Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10010) "add global worklist" in the citydlg
Home

[Freeciv-Dev] (PR#10010) "add global worklist" in the citydlg

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10010) "add global worklist" in the citydlg
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Mon, 25 Oct 2004 19:40:44 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10010 >

> [jdorje - Fri Sep 10 06:39:43 2004]:
> 
> In the citydlg, there is an "add global worklist" popup menu.  This menu 
> should have an entry to edit the worklists.

Here's a patch for the gui-gtk-2.0.

Index: client/gui-gtk-2.0/wldlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/wldlg.c,v
retrieving revision 1.36
diff -u -r1.36 wldlg.c
--- client/gui-gtk-2.0/wldlg.c  3 Jun 2004 13:53:42 -0000       1.36
+++ client/gui-gtk-2.0/wldlg.c  26 Oct 2004 02:39:37 -0000
@@ -503,6 +503,7 @@
 {
   struct player *plr;
   int i;
+  GtkWidget *item;
 
   gtk_container_foreach(GTK_CONTAINER(menu),
                        (GtkCallback) gtk_widget_destroy, NULL);
@@ -510,8 +511,6 @@
 
   for (i = 0; i < MAX_NUM_WORKLISTS; i++) {
     if (plr->worklists[i].is_valid) {
-      GtkWidget *item;
-
       item = gtk_menu_item_new_with_label(plr->worklists[i].name);
       g_object_set_data(G_OBJECT(item), "pos", GINT_TO_POINTER(i));
       gtk_widget_show(item);
@@ -521,6 +520,18 @@
                       G_CALLBACK(menu_item_callback), data);
     }
   }
+
+  item = gtk_separator_menu_item_new();
+  gtk_widget_show(item);
+
+  gtk_container_add(GTK_CONTAINER(menu), item);
+
+  item = gtk_menu_item_new_with_mnemonic(_("Edit Global _Worklists"));
+  gtk_widget_show(item);
+
+  gtk_container_add(GTK_CONTAINER(menu), item);
+  g_signal_connect(item, "activate",
+                  G_CALLBACK(popup_worklists_report), NULL);
 }
 
 /****************************************************************

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10010) "add global worklist" in the citydlg, Vasco Alexandre da Silva Costa <=