Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2005:
[Freeciv-Dev] (PR#13432)
Home

[Freeciv-Dev] (PR#13432)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13432)
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Sat, 9 Jul 2005 09:45:48 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13432 >

The attached makes the diplomatic window a tab.

The tab is raised if we initiated a meeting, otherwise it's created in
the background.
--
mateusz
Index: civclient.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/civclient.c,v
retrieving revision 1.227
diff -u -r1.227 civclient.c
--- civclient.c 7 Jun 2005 06:20:05 -0000       1.227
+++ civclient.c 9 Jul 2005 15:00:43 -0000
@@ -516,8 +516,8 @@
     }
     else if (client_state == CLIENT_PRE_GAME_STATE) {
       popdown_all_city_dialogs();
-      popdown_all_game_dialogs();
       close_all_diplomacy_dialogs();
+      popdown_all_game_dialogs();
       set_unit_focus(NULL);
       clear_notify_window();
       if (oldstate != CLIENT_BOOT_STATE) {
Index: gui-gtk-2.0/cityrep.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/cityrep.c,v
retrieving revision 1.73
diff -u -r1.73 cityrep.c
--- gui-gtk-2.0/cityrep.c       23 Apr 2005 17:40:23 -0000      1.73
+++ gui-gtk-2.0/cityrep.c       9 Jul 2005 15:00:47 -0000
@@ -66,7 +66,8 @@
 static void city_activated_callback(GtkTreeView *view, GtkTreePath *path,
                                    GtkTreeViewColumn *col, gpointer data);
 
-static void city_command_callback(struct gui_dialog *dlg, int response);
+static void city_command_callback(struct gui_dialog *dlg, int response,
+                                  gpointer data);
 
 static void city_selection_changed_callback(GtkTreeSelection *selection);
 
@@ -782,7 +783,7 @@
   GtkWidget *w, *sw, *menubar;
   int i;
 
-  gui_dialog_new(&city_dialog_shell, GTK_NOTEBOOK(top_notebook));
+  gui_dialog_new(&city_dialog_shell, GTK_NOTEBOOK(top_notebook), NULL);
   gui_dialog_set_title(city_dialog_shell, _("Cities"));
 
   gui_dialog_set_default_size(city_dialog_shell, -1, 420);
@@ -1034,7 +1035,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-static void city_command_callback(struct gui_dialog *dlg, int response)
+static void city_command_callback(struct gui_dialog *dlg, int response,
+                                  gpointer data)
 {
   switch (response) {
   case CITY_CENTER:
Index: gui-gtk-2.0/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/dialogs.c,v
retrieving revision 1.109
diff -u -r1.109 dialogs.c
--- gui-gtk-2.0/dialogs.c       4 Jul 2005 17:48:36 -0000       1.109
+++ gui-gtk-2.0/dialogs.c       9 Jul 2005 15:00:52 -0000
@@ -129,7 +129,7 @@
   static struct gui_dialog *shell;
   GtkWidget *vbox, *label, *headline_label, *sw;
 
-  gui_dialog_new(&shell, GTK_NOTEBOOK(bottom_notebook));
+  gui_dialog_new(&shell, GTK_NOTEBOOK(bottom_notebook), NULL);
   gui_dialog_set_title(shell, caption);
 
   gui_dialog_add_button(shell, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); 
Index: gui-gtk-2.0/diplodlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/diplodlg.c,v
retrieving revision 1.30
diff -u -r1.30 diplodlg.c
--- gui-gtk-2.0/diplodlg.c      5 May 2005 18:32:47 -0000       1.30
+++ gui-gtk-2.0/diplodlg.c      9 Jul 2005 15:00:55 -0000
@@ -45,9 +45,8 @@
 
 struct Diplomacy_dialog {
   struct Treaty treaty;
+  struct gui_dialog* dialog;
   
-  GtkWidget *shell;
-
   GtkWidget *menu0;
   GtkWidget *menu1;
 
@@ -71,7 +70,7 @@
                                                 struct player *plr1);
 
 static struct Diplomacy_dialog *find_diplomacy_dialog(int other_player_id);
-static void popup_diplomacy_dialog(int other_player_id);
+static void popup_diplomacy_dialog(int other_player_id, int initiated_from);
 static void diplomacy_dialog_map_callback(GtkWidget *w, gpointer data);
 static void diplomacy_dialog_seamap_callback(GtkWidget *w, gpointer data);
 static void diplomacy_dialog_tech_callback(GtkWidget *w, gpointer data);
@@ -85,6 +84,8 @@
 static void update_diplomacy_dialog(struct Diplomacy_dialog *pdialog);
 static void diplo_dialog_returnkey(GtkWidget *w, gpointer data);
 
+#define RESPONSE_CANCEL_MEETING 100
+
 /****************************************************************
 ...
 *****************************************************************/
@@ -101,6 +102,7 @@
   pdialog->treaty.accept1 = other_accepted;
 
   update_diplomacy_dialog(pdialog);
+  gui_dialog_alert(pdialog->dialog);
 }
 
 /****************************************************************
@@ -108,7 +110,7 @@
 *****************************************************************/
 void handle_diplomacy_init_meeting(int counterpart, int initiated_from)
 {
-  popup_diplomacy_dialog(counterpart);
+  popup_diplomacy_dialog(counterpart, initiated_from);
 }
 
 
@@ -140,6 +142,7 @@
 
   add_clause(&pdialog->treaty, get_player(giver), type, value);
   update_diplomacy_dialog(pdialog);
+  gui_dialog_alert(pdialog->dialog);  
 }
 
 /****************************************************************
@@ -156,12 +159,13 @@
 
   remove_clause(&pdialog->treaty, get_player(giver), type, value);
   update_diplomacy_dialog(pdialog);
+  gui_dialog_alert(pdialog->dialog);
 }
 
 /****************************************************************
 popup the dialog 10% inside the main-window 
 *****************************************************************/
-static void popup_diplomacy_dialog(int other_player_id)
+static void popup_diplomacy_dialog(int other_player_id, int initiated_from)
 {
   struct Diplomacy_dialog *pdialog = find_diplomacy_dialog(other_player_id);
 
@@ -175,7 +179,11 @@
                                get_player(other_player_id));
   }
 
-  gtk_window_present(GTK_WINDOW(pdialog->shell));
+  gui_dialog_present(pdialog->dialog);
+  /* We initated the meeting - Make the tab active */
+  if (initiated_from == game.player_ptr->player_no) {
+    gui_dialog_raise(pdialog->dialog);
+  }
 }
 
 /****************************************************************
@@ -392,10 +400,9 @@
 /****************************************************************
 ...
 *****************************************************************/
-static void diplomacy_destroy(GtkWidget *w, gpointer data)
+static void diplomacy_destroy(struct Diplomacy_dialog* pdialog)
 {
-  struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *)data;
-
+  gui_dialog_destroy(pdialog->dialog);
   dialog_list_unlink(dialog_list, pdialog);
   free(pdialog);
 }
@@ -403,7 +410,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-static void diplomacy_response(GtkWidget *w, gint response, gpointer data)
+static void diplomacy_response(struct gui_dialog *dlg, int response,
+                               gpointer data)
 {
   struct Diplomacy_dialog *pdialog = (struct Diplomacy_dialog *)data;
 
@@ -415,12 +423,11 @@
                                             pdialog->treaty.plr1->
                                             player_no);
     break;
-
   default:
     dsend_packet_diplomacy_cancel_meeting_req(&aconnection,
                                              pdialog->treaty.plr1->
                                              player_no);
-    gtk_widget_destroy(w);
+    diplomacy_destroy(pdialog);
     break; 
   }
 }
@@ -431,7 +438,7 @@
 static struct Diplomacy_dialog *create_diplomacy_dialog(struct player *plr0, 
                                                        struct player *plr1)
 {
-  GtkWidget *shell, *vbox, *bottom, *hbox, *table;
+  GtkWidget *vbox, *bottom, *hbox, *table;
   GtkWidget *label, *sw, *view, *image, *spin;
   GtkWidget *menubar, *menuitem, *menu;
   GtkListStore *store;
@@ -445,23 +452,21 @@
   dialog_list_prepend(dialog_list, pdialog);
   init_treaty(&pdialog->treaty, plr0, plr1);
 
-  shell = gtk_dialog_new_with_buttons(_("Diplomacy meeting"),
-                                     NULL,
-                                     0,
-                                     NULL);
-  pdialog->shell = shell;
-  setup_dialog(shell, toplevel);
-  g_signal_connect(shell, "destroy",
-                  G_CALLBACK(diplomacy_destroy), pdialog);
-  g_signal_connect(shell, "response",
-                  G_CALLBACK(diplomacy_response), pdialog);
-
-  gtk_dialog_add_button(GTK_DIALOG(shell), _("_Cancel meeting"),
-                       GTK_RESPONSE_CANCEL);
-  gtk_dialog_add_button(GTK_DIALOG(shell), _("Accept _treaty"),
+  gui_dialog_new(&(pdialog->dialog), GTK_NOTEBOOK(top_notebook), pdialog);
+  
+  my_snprintf(buf, sizeof(buf),
+              _("Diplomacy: %s"),
+             get_nation_name_plural(plr1->nation));
+
+  gui_dialog_set_title(pdialog->dialog, buf);
+  gui_dialog_response_set_callback(pdialog->dialog, diplomacy_response);
+
+  gui_dialog_add_button(pdialog->dialog, _("_Cancel meeting"),
+                       RESPONSE_CANCEL_MEETING);
+  gui_dialog_add_button(pdialog->dialog, _("Accept _treaty"),
                        GTK_RESPONSE_ACCEPT);
 
-  vbox = GTK_DIALOG(shell)->vbox;
+  vbox = pdialog->dialog->vbox;
 
 
   /* clauses. */
@@ -609,6 +614,7 @@
   gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu);
   gtk_menu_shell_append(GTK_MENU_SHELL(menubar), menuitem);
   g_object_set_data(G_OBJECT(menu), "plr", plr1);
+  
   g_signal_connect(menu, "show", G_CALLBACK(popup_add_menu), pdialog);
   
   gtk_widget_show_all(bottom);
@@ -616,6 +622,7 @@
   g_signal_connect(view, "row_activated", G_CALLBACK(row_callback), pdialog);
 
   update_diplomacy_dialog(pdialog);
+  gui_dialog_show_all(pdialog->dialog);
 
   return pdialog;
 }
@@ -790,7 +797,7 @@
 *****************************************************************/
 void close_diplomacy_dialog(struct Diplomacy_dialog *pdialog)
 {
-  gtk_widget_destroy(pdialog->shell);
+  diplomacy_destroy(pdialog);
 }
 
 /*****************************************************************
Index: gui-gtk-2.0/finddlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/finddlg.c,v
retrieving revision 1.20
diff -u -r1.20 finddlg.c
--- gui-gtk-2.0/finddlg.c       5 May 2005 18:32:47 -0000       1.20
+++ gui-gtk-2.0/finddlg.c       9 Jul 2005 15:00:55 -0000
@@ -38,7 +38,7 @@
 
 static void update_find_dialog(GtkListStore *store);
 
-static void find_response(struct gui_dialog *dlg, int response);
+static void find_response(struct gui_dialog *dlg, int response, gpointer data);
 static void find_destroy_callback(GtkWidget *w, gpointer data);
 static void find_selection_callback(GtkTreeSelection *selection,
                                    GtkTreeModel *model);
@@ -60,7 +60,7 @@
 
     pos = get_center_tile_mapcanvas();
 
-    gui_dialog_new(&find_dialog_shell, GTK_NOTEBOOK(bottom_notebook));
+    gui_dialog_new(&find_dialog_shell, GTK_NOTEBOOK(bottom_notebook), NULL);
     gui_dialog_set_title(find_dialog_shell, _("Find City"));
     gui_dialog_set_default_size(find_dialog_shell, -1, 240);
 
@@ -152,7 +152,7 @@
 /**************************************************************************
 ...
 **************************************************************************/
-static void find_response(struct gui_dialog *dlg, int response)
+static void find_response(struct gui_dialog *dlg, int response, gpointer data)
 {
   if (response == GTK_RESPONSE_ACCEPT) {
     GtkTreeSelection *selection;
Index: gui-gtk-2.0/gui_stuff.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_stuff.c,v
retrieving revision 1.24
diff -u -r1.24 gui_stuff.c
--- gui-gtk-2.0/gui_stuff.c     1 Jun 2005 01:02:33 -0000       1.24
+++ gui-gtk-2.0/gui_stuff.c     9 Jul 2005 15:00:55 -0000
@@ -291,14 +291,15 @@
 static void gui_dialog_response(struct gui_dialog *dlg, int response)
 {
   if (dlg->response_callback) {
-    (*dlg->response_callback)(dlg, response);
+    (*dlg->response_callback)(dlg, response, dlg->user_data);
   }
 }
 
 /**************************************************************************
   Default dialog response handler. Destroys the dialog.
 **************************************************************************/
-static void gui_dialog_destroyed(struct gui_dialog *dlg, int response)
+static void gui_dialog_destroyed(struct gui_dialog *dlg, int response,
+                                 gpointer data)
 {
   gui_dialog_destroy(dlg);
 }
@@ -328,6 +329,7 @@
 /**************************************************************************
   Emit a delete event response on dialog deletion in case the end-user
   needs to know when a deletion took place.
+  Popup dialog version
 **************************************************************************/
 static gint gui_dialog_delete_handler(GtkWidget *widget,
                                      GdkEventAny *ev, gpointer data)
@@ -342,6 +344,21 @@
 }
 
 /**************************************************************************
+  Emit a delete event response on dialog deletion in case the end-user
+  needs to know when a deletion took place.
+  TAB version
+**************************************************************************/
+static gint gui_dialog_delete_tab_handler(struct gui_dialog* dlg)
+{
+  /* emit response signal. */
+  gui_dialog_response(dlg, GTK_RESPONSE_DELETE_EVENT);
+                                                                               
+  /* do the destroy by default. */
+  return FALSE;
+}
+
+
+/**************************************************************************
   Allow the user to close a dialog using Escape or CTRL+W.
 **************************************************************************/
 static gboolean gui_dialog_key_press_handler(GtkWidget *w, GdkEventKey *ev,
@@ -384,8 +401,10 @@
   current user setting of 'enable_tabs'.
   Sets pdlg to point to the dialog once it is create, Zeroes pdlg on
   dialog destruction.
+  user_data will be passed through response function
 **************************************************************************/
-void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook)
+void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook,
+                    gpointer user_data)
 {
   struct gui_dialog *dlg;
   GtkWidget *vbox, *action_area;
@@ -395,6 +414,7 @@
 
   dlg->source = pdlg;
   *pdlg = dlg;
+  dlg->user_data = user_data;
 
   if (enable_tabs) {
     dlg->type = GUI_DIALOG_TAB;
@@ -435,6 +455,9 @@
 
       gtk_container_add(GTK_CONTAINER(window), vbox);
       dlg->v.window = window;
+      g_signal_connect(window, "delete_event",
+        G_CALLBACK(gui_dialog_delete_handler), dlg);
+      
     }
     break;
   case GUI_DIALOG_TAB:
@@ -455,7 +478,7 @@
       button = gtk_button_new();
       gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
       g_signal_connect_swapped(button, "clicked",
-         G_CALLBACK(gui_dialog_destroy), dlg);
+         G_CALLBACK(gui_dialog_delete_tab_handler), dlg);
 
       my_snprintf(buf, sizeof(buf), _("Close Tab:\n%s"), _("Ctrl+W"));
       gtk_tooltips_set_tip(main_tips, button, buf, "");
@@ -486,8 +509,6 @@
 
   g_signal_connect(vbox, "destroy",
       G_CALLBACK(gui_dialog_destroy_handler), dlg);
-  g_signal_connect(vbox, "delete_event",
-      G_CALLBACK(gui_dialog_delete_handler), dlg);
   g_signal_connect(vbox, "key_press_event",
       G_CALLBACK(gui_dialog_key_press_handler), dlg);
 
Index: gui-gtk-2.0/gui_stuff.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_stuff.h,v
retrieving revision 1.14
diff -u -r1.14 gui_stuff.h
--- gui-gtk-2.0/gui_stuff.h     1 Jun 2005 01:02:33 -0000       1.14
+++ gui-gtk-2.0/gui_stuff.h     9 Jul 2005 15:00:55 -0000
@@ -60,7 +60,7 @@
 
 struct gui_dialog;
 
-typedef void (*GUI_DIALOG_RESPONSE_FUN)(struct gui_dialog *, int);
+typedef void (*GUI_DIALOG_RESPONSE_FUN)(struct gui_dialog *, int, gpointer);
 
 struct gui_dialog
 {
@@ -83,11 +83,12 @@
   struct gui_dialog **source;
 
   GUI_DIALOG_RESPONSE_FUN response_callback;
+  gpointer user_data;
 
   GtkSizeGroup *gui_button;
 };
 
-void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook);
+void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, gpointer 
user_data);
 void gui_dialog_set_default_response(struct gui_dialog *dlg, int response);
 GtkWidget *gui_dialog_add_button(struct gui_dialog *dlg,
     const char *text, int response);
Index: gui-gtk-2.0/messagedlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/messagedlg.c,v
retrieving revision 1.21
diff -u -r1.21 messagedlg.c
--- gui-gtk-2.0/messagedlg.c    11 May 2005 19:31:38 -0000      1.21
+++ gui-gtk-2.0/messagedlg.c    9 Jul 2005 15:00:56 -0000
@@ -34,7 +34,8 @@
 static GtkListStore *model[NUM_LISTS];
 
 static void create_messageopt_dialog(void);
-static void messageopt_response(struct gui_dialog *dlg, int response);
+static void messageopt_response(struct gui_dialog *dlg, int response,
+                                gpointer data);
 static void item_toggled(GtkCellRendererToggle *cell,
                         gchar *spath, gpointer data);
 
@@ -57,7 +58,7 @@
   GtkWidget *form, *explanation;
   int n, i, j;
   
-  gui_dialog_new(&shell, GTK_NOTEBOOK(top_notebook));
+  gui_dialog_new(&shell, GTK_NOTEBOOK(top_notebook), NULL);
   gui_dialog_set_title(shell, _("Message Options"));
 
   gui_dialog_set_default_size(shell, -1, 450);
@@ -158,7 +159,8 @@
 /**************************************************************************
 ...
 **************************************************************************/
-static void messageopt_response(struct gui_dialog *dlg, int response)
+static void messageopt_response(struct gui_dialog *dlg, int response,
+                                gpointer data)
 {
   if (response == GTK_RESPONSE_OK) {
     ITree it;
Index: gui-gtk-2.0/messagewin.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/messagewin.c,v
retrieving revision 1.29
diff -u -r1.29 messagewin.c
--- gui-gtk-2.0/messagewin.c    25 Nov 2004 06:57:17 -0000      1.29
+++ gui-gtk-2.0/messagewin.c    9 Jul 2005 15:00:57 -0000
@@ -50,7 +50,8 @@
                                          GtkTreePath *path,
                                          GtkTreeViewColumn *col,
                                          gpointer data);
-static void meswin_response_callback(struct gui_dialog *dlg, int response);
+static void meswin_response_callback(struct gui_dialog *dlg, int response,
+                                     gpointer data);
 
 enum {
   CMD_GOTO = 1, CMD_POPCITY
@@ -150,7 +151,7 @@
   GtkTreeViewColumn *col;
   GtkWidget *view, *sw, *cmd;
 
-  gui_dialog_new(&meswin_shell, GTK_NOTEBOOK(bottom_notebook));
+  gui_dialog_new(&meswin_shell, GTK_NOTEBOOK(bottom_notebook), NULL);
   gui_dialog_set_title(meswin_shell, _("Messages"));
 
   meswin_store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_BOOLEAN);
@@ -276,7 +277,8 @@
 /**************************************************************************
 ...
 **************************************************************************/
-static void meswin_response_callback(struct gui_dialog *dlg, int response)
+static void meswin_response_callback(struct gui_dialog *dlg, int response,
+                                     gpointer data)
 {
   switch (response) {
   case CMD_GOTO:
Index: gui-gtk-2.0/plrdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/plrdlg.c,v
retrieving revision 1.65
diff -u -r1.65 plrdlg.c
--- gui-gtk-2.0/plrdlg.c        11 Jun 2005 19:07:30 -0000      1.65
+++ gui-gtk-2.0/plrdlg.c        9 Jul 2005 15:00:59 -0000
@@ -339,7 +339,7 @@
   GtkWidget *sep, *sw;
   GtkWidget *menubar, *menu, *item, *vbox;
 
-  gui_dialog_new(&players_dialog_shell, GTK_NOTEBOOK(top_notebook));
+  gui_dialog_new(&players_dialog_shell, GTK_NOTEBOOK(top_notebook), NULL);
   gui_dialog_set_title(players_dialog_shell, _("Players"));
 
   gui_dialog_add_button(players_dialog_shell,
Index: gui-gtk-2.0/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/repodlgs.c,v
retrieving revision 1.91
diff -u -r1.91 repodlgs.c
--- gui-gtk-2.0/repodlgs.c      30 Jun 2005 20:18:37 -0000      1.91
+++ gui-gtk-2.0/repodlgs.c      9 Jul 2005 15:01:03 -0000
@@ -73,7 +73,8 @@
 };
 
 static void create_economy_report_dialog(bool make_modal);
-static void economy_command_callback(struct gui_dialog *dlg, int response);
+static void economy_command_callback(struct gui_dialog *dlg, int response,
+                                     gpointer data);
 static void economy_selection_callback(GtkTreeSelection *selection,
                                       gpointer data);
 struct economy_row {
@@ -91,7 +92,8 @@
 
 /******************************************************************/
 static void create_activeunits_report_dialog(bool make_modal);
-static void activeunits_command_callback(struct gui_dialog *dlg, int response);
+static void activeunits_command_callback(struct gui_dialog *dlg, int response,
+                                         gpointer data);
 static void activeunits_selection_callback(GtkTreeSelection *selection,
                                           gpointer data);
 static struct gui_dialog *activeunits_dialog_shell = NULL;
@@ -268,7 +270,7 @@
   GtkWidget *frame, *hbox, *w;
   GtkWidget *science_diagram;
 
-  gui_dialog_new(&science_dialog_shell, GTK_NOTEBOOK(top_notebook));
+  gui_dialog_new(&science_dialog_shell, GTK_NOTEBOOK(top_notebook), NULL);
   gui_dialog_set_title(science_dialog_shell, _("Science"));
 
   gui_dialog_add_button(science_dialog_shell,
@@ -667,7 +669,7 @@
 
   model_types[0] = GDK_TYPE_PIXBUF;
 
-  gui_dialog_new(&economy_dialog_shell, GTK_NOTEBOOK(top_notebook));
+  gui_dialog_new(&economy_dialog_shell, GTK_NOTEBOOK(top_notebook), NULL);
   gui_dialog_set_title(economy_dialog_shell, _("Economy"));
 
   align = gtk_alignment_new(0.5, 0.0, 0.0, 1.0);
@@ -787,7 +789,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-static void economy_command_callback(struct gui_dialog *dlg, int response)
+static void economy_command_callback(struct gui_dialog *dlg, int response,
+                                     gpointer callback)
 {
   int i, is_impr;
   gint row;
@@ -972,7 +975,7 @@
 
   intl_slist(ARRAY_SIZE(titles), titles, &titles_done);
 
-  gui_dialog_new(&activeunits_dialog_shell, GTK_NOTEBOOK(top_notebook));
+  gui_dialog_new(&activeunits_dialog_shell, GTK_NOTEBOOK(top_notebook), NULL);
   gui_dialog_set_title(activeunits_dialog_shell, _("Units"));
 
   align = gtk_alignment_new(0.5, 0.0, 0.0, 1.0);
@@ -1117,7 +1120,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-static void activeunits_command_callback(struct gui_dialog *dlg, int response)
+static void activeunits_command_callback(struct gui_dialog *dlg, int response,
+                                         gpointer data)
 {
   int           ut1, ut2;
   GtkTreeModel *model;
@@ -1321,7 +1325,7 @@
 
   intl_slist(ARRAY_SIZE(titles), titles, &titles_done);
 
-  gui_dialog_new(&endgame_report_shell, GTK_NOTEBOOK(top_notebook));
+  gui_dialog_new(&endgame_report_shell, GTK_NOTEBOOK(top_notebook), NULL);
   gui_dialog_set_title(endgame_report_shell, _("Score"));
   gui_dialog_add_button(endgame_report_shell, GTK_STOCK_CLOSE,
       GTK_RESPONSE_CLOSE);
Index: gui-gtk-2.0/spaceshipdlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/spaceshipdlg.c,v
retrieving revision 1.18
diff -u -r1.18 spaceshipdlg.c
--- gui-gtk-2.0/spaceshipdlg.c  5 May 2005 18:32:47 -0000       1.18
+++ gui-gtk-2.0/spaceshipdlg.c  9 Jul 2005 15:01:03 -0000
@@ -186,7 +186,8 @@
 /****************************************************************
 ...
 *****************************************************************/
-static void spaceship_response(struct gui_dialog *dlg, int response)
+static void spaceship_response(struct gui_dialog *dlg, int response,
+                               gpointer data)
 {
   switch (response) {
   case GTK_RESPONSE_ACCEPT:
@@ -213,7 +214,7 @@
   pdialog=fc_malloc(sizeof(struct spaceship_dialog));
   pdialog->pplayer=pplayer;
 
-  gui_dialog_new(&pdialog->shell, GTK_NOTEBOOK(top_notebook));
+  gui_dialog_new(&pdialog->shell, GTK_NOTEBOOK(top_notebook), NULL);
   gui_dialog_set_title(pdialog->shell, pplayer->name);
 
   gui_dialog_add_button(pdialog->shell,

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13432), Mateusz Stefek <=