diff -urN -Xfreeciv/diff_ignore freeciv/client/civclient.c freeciv-new/client/civclient.c --- freeciv/client/civclient.c Wed Oct 2 11:45:41 2002 +++ freeciv-new/client/civclient.c Fri Oct 4 23:24:23 2002 @@ -46,6 +46,7 @@ #include "chatline_g.h" #include "citydlg_g.h" #include "cityrepdata.h" +#include "cityrep_g.h" #include "climisc.h" #include "clinet.h" #include "connectdlg_g.h" @@ -650,6 +651,7 @@ } else if(client_state==CLIENT_PRE_GAME_STATE) { popdown_all_city_dialogs(); + popdown_everything(); close_all_diplomacy_dialogs(); set_unit_focus_no_center(NULL); clear_notify_window(); diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk/cityrep.c freeciv-new/client/gui-gtk/cityrep.c --- freeciv/client/gui-gtk/cityrep.c Thu Sep 26 14:22:22 2002 +++ freeciv-new/client/gui-gtk/cityrep.c Fri Oct 4 23:24:23 2002 @@ -163,6 +163,19 @@ } } +/**************************************************************** + Closes the city report dialog +****************************************************************/ +void popdown_city_report_dialog(void) +{ + if (city_dialog_shell) { + if (city_dialog_shell_is_modal) { + gtk_widget_set_sensitive(top_vbox, TRUE); + } + gtk_widget_destroy(city_dialog_shell); + city_dialog_shell = NULL; + } +} /**************************************************************** ... @@ -1157,11 +1170,7 @@ *****************************************************************/ static void city_close_callback(GtkWidget *w, gpointer data) { - - if(city_dialog_shell_is_modal) - gtk_widget_set_sensitive(top_vbox, TRUE); - gtk_widget_destroy(city_dialog_shell); - city_dialog_shell=NULL; + popdown_city_report_dialog(); } /**************************************************************** diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk/dialogs.c freeciv-new/client/gui-gtk/dialogs.c --- freeciv/client/gui-gtk/dialogs.c Wed Oct 2 11:45:51 2002 +++ freeciv-new/client/gui-gtk/dialogs.c Fri Oct 4 23:24:23 2002 @@ -70,6 +70,8 @@ as the races_dialog is poped up. */ /******************************************************************/ +static GtkWidget *notify_dialog_shell; +/******************************************************************/ static GtkWidget *spy_tech_shell; static GtkWidget *spy_advances_list; static GtkWidget *spy_steal_command; @@ -144,10 +146,9 @@ /**************************************************************** ... *****************************************************************/ -static void notify_command_callback(GtkWidget *w, GtkWidget *t) +static void notify_command_callback(GtkWidget * w, GtkWidget * t) { - gtk_widget_destroy( t ); - gtk_widget_set_sensitive( top_vbox, TRUE ); + popdown_notify_dialog(); } /**************************************************************** @@ -165,7 +166,7 @@ *****************************************************************/ void popup_notify_dialog(char *caption, char *headline, char *lines) { - GtkWidget *notify_dialog_shell, *notify_command; + GtkWidget *notify_command; GtkWidget *notify_label, *notify_headline, *notify_scrolled; GtkAccelGroup *accel=gtk_accel_group_new(); @@ -227,6 +228,18 @@ } /**************************************************************** + Closes the notify dialog +*****************************************************************/ +void popdown_notify_dialog(void) +{ + if (notify_dialog_shell) { + gtk_widget_destroy(notify_dialog_shell); + gtk_widget_set_sensitive(top_vbox, TRUE); + notify_dialog_shell = NULL; + } +} + +/**************************************************************** ... *****************************************************************/ diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk/gui_main.c freeciv-new/client/gui-gtk/gui_main.c --- freeciv/client/gui-gtk/gui_main.c Wed Oct 2 11:45:51 2002 +++ freeciv-new/client/gui-gtk/gui_main.c Sat Oct 5 00:35:48 2002 @@ -42,6 +42,8 @@ #include "version.h" #include "chatline.h" +#include "citydlg.h" +#include "cityrep.h" #include "civclient.h" #include "climisc.h" #include "clinet.h" @@ -57,9 +59,12 @@ #include "mapctrl.h" #include "mapview.h" #include "menu.h" +#include "messagewin.h" #include "optiondlg.h" #include "options.h" +#include "plrdlg.h" #include "spaceshipdlg.h" +#include "repodlgs.h" #include "resources.h" #include "tilespec.h" @@ -184,6 +189,20 @@ } /************************************************************************** + This closes every dialog +**************************************************************************/ +void popdown_everything(void) +{ + popdown_city_report_dialog(); + popdown_meswin_dialog(); + popdown_science_dialog(); + popdown_economy_report_dialog(); + popdown_activeunits_report_dialog(); + popdown_players_dialog(); + popdown_notify_dialog(); +} + +/************************************************************************** handles main window keyboard events. **************************************************************************/ static gint keyboard_handler(GtkWidget *w, GdkEventKey *ev) diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk/messagewin.c freeciv-new/client/gui-gtk/messagewin.c --- freeciv/client/gui-gtk/messagewin.c Wed Aug 21 23:32:17 2002 +++ freeciv-new/client/gui-gtk/messagewin.c Sat Oct 5 00:26:34 2002 @@ -85,6 +85,18 @@ { return meswin_dialog_shell != NULL; } +/************************************************************************** + Closes the message window dialog +**************************************************************************/ +void popdown_meswin_dialog(void) +{ + if (meswin_dialog_shell) { + gtk_widget_destroy(meswin_dialog_shell); + meswin_dialog_shell = NULL; + gtk_style_unref(meswin_visited_style); + gtk_style_unref(meswin_not_visited_style); + } +} /**************************************************************** ... @@ -271,10 +283,7 @@ **************************************************************************/ static void meswin_close_callback(GtkWidget *w, gpointer data) { - gtk_widget_destroy(meswin_dialog_shell); - meswin_dialog_shell = NULL; - gtk_style_unref(meswin_visited_style); - gtk_style_unref(meswin_not_visited_style); + popdown_meswin_dialog(); } /************************************************************************** diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk/plrdlg.c freeciv-new/client/gui-gtk/plrdlg.c --- freeciv/client/gui-gtk/plrdlg.c Fri Aug 9 00:10:18 2002 +++ freeciv-new/client/gui-gtk/plrdlg.c Fri Oct 4 23:24:23 2002 @@ -86,6 +86,17 @@ } } +/**************************************************************** + Closes the players dialog +*****************************************************************/ +void popdown_players_dialog(void) +{ + if (players_dialog_shell) { + gtk_widget_destroy(players_dialog_shell); + players_dialog_shell = NULL; + } +} + /* * Sort plrs by column... */ @@ -500,10 +511,9 @@ /************************************************************************** ... **************************************************************************/ -void players_button_callback(GtkWidget *w, gpointer data) +static void players_button_callback(GtkWidget * w, gpointer data) { - gtk_widget_destroy(players_dialog_shell); - players_dialog_shell = NULL; + popdown_players_dialog(); } /************************************************************************** diff -urN -Xfreeciv/diff_ignore freeciv/client/gui-gtk/repodlgs.c freeciv-new/client/gui-gtk/repodlgs.c --- freeciv/client/gui-gtk/repodlgs.c Thu Jun 27 02:59:15 2002 +++ freeciv-new/client/gui-gtk/repodlgs.c Fri Oct 4 23:24:23 2002 @@ -119,6 +119,19 @@ } } +/**************************************************************** + Closes the science dialog +*****************************************************************/ +void popdown_science_dialog(void) +{ + if (science_dialog_shell) { + if (science_dialog_shell_is_modal) { + gtk_widget_set_sensitive(top_vbox, TRUE); + } + gtk_widget_destroy(science_dialog_shell); + science_dialog_shell = NULL; + } +} /**************************************************************** ... @@ -282,13 +295,9 @@ /**************************************************************** ... *****************************************************************/ -void science_close_callback(GtkWidget *widget, gpointer data) +static void science_close_callback(GtkWidget * widget, gpointer data) { - - if(science_dialog_shell_is_modal) - gtk_widget_set_sensitive(top_vbox, TRUE); - gtk_widget_destroy(science_dialog_shell); - science_dialog_shell=NULL; + popdown_science_dialog(); } /**************************************************************** @@ -535,6 +544,19 @@ } } +/**************************************************************** + Close the economy report dialog +****************************************************************/ +void popdown_economy_report_dialog(void) +{ + if (economy_dialog_shell) { + if (economy_dialog_shell_is_modal) { + gtk_widget_set_sensitive(top_vbox, TRUE); + } + gtk_widget_destroy(economy_dialog_shell); + economy_dialog_shell = NULL; + } +} /**************************************************************** ... @@ -642,13 +664,9 @@ /**************************************************************** ... *****************************************************************/ -void economy_close_callback(GtkWidget *w, gpointer data) +static void economy_close_callback(GtkWidget * w, gpointer data) { - - if(economy_dialog_shell_is_modal) - gtk_widget_set_sensitive(top_vbox, TRUE); - gtk_widget_destroy(economy_dialog_shell); - economy_dialog_shell=NULL; + popdown_economy_report_dialog(); } /**************************************************************** @@ -769,6 +787,19 @@ } } +/**************************************************************** + Closes the units report dialog +****************************************************************/ +void popdown_activeunits_report_dialog(void) +{ + if (activeunits_dialog_shell) { + if (activeunits_dialog_shell_is_modal) { + gtk_widget_set_sensitive(top_vbox, TRUE); + } + gtk_widget_destroy(activeunits_dialog_shell); + activeunits_dialog_shell = NULL; + } +} /**************************************************************** ... @@ -914,13 +945,9 @@ /**************************************************************** ... *****************************************************************/ -void activeunits_close_callback(GtkWidget *w, gpointer data) +static void activeunits_close_callback(GtkWidget * w, gpointer data) { - - if(activeunits_dialog_shell_is_modal) - gtk_widget_set_sensitive(top_vbox, TRUE); - gtk_widget_destroy(activeunits_dialog_shell); - activeunits_dialog_shell = NULL; + popdown_activeunits_report_dialog(); } /**************************************************************** diff -urN -Xfreeciv/diff_ignore freeciv/client/include/cityrep_g.h freeciv-new/client/include/cityrep_g.h --- freeciv/client/include/cityrep_g.h Fri Apr 12 15:50:55 2002 +++ freeciv-new/client/include/cityrep_g.h Fri Oct 4 23:24:23 2002 @@ -18,6 +18,7 @@ struct city; void popup_city_report_dialog(bool make_modal); +void popdown_city_report_dialog(void); void city_report_dialog_update(void); void city_report_dialog_update_city(struct city *pcity); diff -urN -Xfreeciv/diff_ignore freeciv/client/include/dialogs_g.h freeciv-new/client/include/dialogs_g.h --- freeciv/client/include/dialogs_g.h Sat May 25 17:05:58 2002 +++ freeciv-new/client/include/dialogs_g.h Fri Oct 4 23:24:23 2002 @@ -23,6 +23,7 @@ void popup_notify_goto_dialog(char *headline, char *lines, int x, int y); void popup_notify_dialog(char *caption, char *headline, char *lines); +void popdown_notify_dialog(void); void popup_races_dialog(void); void popdown_races_dialog(void); diff -urN -Xfreeciv/diff_ignore freeciv/client/include/gui_main_g.h freeciv-new/client/include/gui_main_g.h --- freeciv/client/include/gui_main_g.h Sat Aug 24 16:37:49 2002 +++ freeciv-new/client/include/gui_main_g.h Fri Oct 4 23:24:23 2002 @@ -26,6 +26,8 @@ void set_unit_icon(int idx, struct unit *punit); void set_unit_icons_more_arrow(bool onoff); +void popdown_everything(void); + extern const char *client_string; #endif /* FC__GUI_MAIN_G_H */ diff -urN -Xfreeciv/diff_ignore freeciv/client/include/messagewin_g.h freeciv-new/client/include/messagewin_g.h --- freeciv/client/include/messagewin_g.h Thu Jul 18 11:42:29 2002 +++ freeciv-new/client/include/messagewin_g.h Fri Oct 4 23:24:23 2002 @@ -18,6 +18,7 @@ #include "messagewin_common.h" void popup_meswin_dialog(void); +void popdown_meswin_dialog(void); bool is_meswin_open(void); void real_update_meswin_dialog(void); diff -urN -Xfreeciv/diff_ignore freeciv/client/include/plrdlg_g.h freeciv-new/client/include/plrdlg_g.h --- freeciv/client/include/plrdlg_g.h Thu Jun 27 02:59:21 2002 +++ freeciv-new/client/include/plrdlg_g.h Fri Oct 4 23:24:23 2002 @@ -16,6 +16,7 @@ #include "plrdlg_common.h" void popup_players_dialog(void); +void popdown_players_dialog(void); void update_players_dialog(void); #endif /* FC__PLRDLG_G_H */ diff -urN -Xfreeciv/diff_ignore freeciv/client/include/repodlgs_g.h freeciv-new/client/include/repodlgs_g.h --- freeciv/client/include/repodlgs_g.h Thu Jun 27 02:59:21 2002 +++ freeciv-new/client/include/repodlgs_g.h Fri Oct 4 23:24:23 2002 @@ -22,9 +22,14 @@ void science_dialog_update(void); void popup_science_dialog(bool make_modal); +void popdown_science_dialog(void); + void economy_report_dialog_update(void); void popup_economy_report_dialog(bool make_modal); +void popdown_economy_report_dialog(void); + void activeunits_report_dialog_update(void); void popup_activeunits_report_dialog(bool make_modal); +void popdown_activeunits_report_dialog(void); #endif /* FC__REPODLGS_G_H */