Index: client/civclient.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/civclient.c,v retrieving revision 1.138 diff -u -r1.138 civclient.c --- client/civclient.c 2002/06/27 01:11:37 1.138 +++ client/civclient.c 2002/07/16 15:31:41 @@ -45,6 +45,7 @@ #include "chatline_g.h" #include "citydlg_g.h" +#include "cityrep_g.h" #include "climisc.h" #include "clinet.h" #include "connectdlg_g.h" @@ -580,6 +581,13 @@ } else if(client_state==CLIENT_PRE_GAME_STATE) { popdown_all_city_dialogs(); + popdown_city_report_dialog(); + popdown_meswin_dialog(); + popdown_science_dialog(); + popdown_economy_report_dialog(); + popdown_activeunits_report_dialog(); + popdown_players_dialog(); + popdown_notify_dialog(); close_all_diplomacy_dialogs(); client_remove_all_cli_conn(); set_unit_focus_no_center(NULL); Index: client/gui-gtk/cityrep.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/cityrep.c,v retrieving revision 1.60 diff -u -r1.60 cityrep.c --- client/gui-gtk/cityrep.c 2002/06/27 00:59:14 1.60 +++ client/gui-gtk/cityrep.c 2002/07/16 15:31:42 @@ -163,6 +163,19 @@ } } +/**************************************************************** +... +****************************************************************/ +void popdown_city_report_dialog() +{ + 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; + } +} /**************************************************************** ... @@ -1149,11 +1162,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(); } /**************************************************************** Index: client/gui-gtk/dialogs.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/dialogs.c,v retrieving revision 1.103 diff -u -r1.103 dialogs.c --- client/gui-gtk/dialogs.c 2002/06/24 15:56:39 1.103 +++ client/gui-gtk/dialogs.c 2002/07/16 15:31:43 @@ -69,6 +69,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; @@ -141,10 +143,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(); } /**************************************************************** @@ -162,7 +163,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(); @@ -221,6 +222,18 @@ gtk_widget_show( notify_dialog_shell ); gtk_widget_set_sensitive( top_vbox, FALSE ); +} + +/**************************************************************** +... +*****************************************************************/ +void popdown_notify_dialog() +{ + if (notify_dialog_shell) { + gtk_widget_destroy(notify_dialog_shell); + gtk_widget_set_sensitive(top_vbox, TRUE); + notify_dialog_shell = NULL; + } } /**************************************************************** Index: client/gui-gtk/messagewin.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/messagewin.c,v retrieving revision 1.32 diff -u -r1.32 messagewin.c --- client/gui-gtk/messagewin.c 2002/06/30 14:37:41 1.32 +++ client/gui-gtk/messagewin.c 2002/07/16 15:31:43 @@ -194,6 +194,19 @@ /************************************************************************** ... **************************************************************************/ +void popdown_meswin_dialog() +{ + 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); + } +} + +/************************************************************************** +... +**************************************************************************/ static int messages_total = 0; /* current total number of message lines */ static int messages_alloc = 0; /* number allocated for */ @@ -366,10 +379,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(); } /************************************************************************** Index: client/gui-gtk/plrdlg.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/plrdlg.c,v retrieving revision 1.35 diff -u -r1.35 plrdlg.c --- client/gui-gtk/plrdlg.c 2002/06/27 00:59:14 1.35 +++ client/gui-gtk/plrdlg.c 2002/07/16 15:31:44 @@ -86,6 +86,17 @@ } } +/**************************************************************** + ... +*****************************************************************/ +void popdown_players_dialog(void) +{ + if (players_dialog_shell) { + gtk_widget_destroy(players_dialog_shell); + players_dialog_shell = NULL; + } +} + /* * Sort plrs by column... */ @@ -498,10 +509,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(); } /************************************************************************** Index: client/gui-gtk/repodlgs.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/repodlgs.c,v retrieving revision 1.61 diff -u -r1.61 repodlgs.c --- client/gui-gtk/repodlgs.c 2002/06/27 00:59:15 1.61 +++ client/gui-gtk/repodlgs.c 2002/07/16 15:31:44 @@ -119,6 +119,19 @@ } } +/**************************************************************** +... +*****************************************************************/ +void popdown_science_dialog() +{ + 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 @@ } } +/**************************************************************** +... +****************************************************************/ +void popdown_economy_report_dialog() +{ + 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 @@ } } +/**************************************************************** +... +****************************************************************/ +void popdown_activeunits_report_dialog() +{ + 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(); } /**************************************************************** Index: client/include/cityrep_g.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/include/cityrep_g.h,v retrieving revision 1.4 diff -u -r1.4 cityrep_g.h --- client/include/cityrep_g.h 2002/04/12 13:50:55 1.4 +++ client/include/cityrep_g.h 2002/07/16 15:31:45 @@ -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); Index: client/include/dialogs_g.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/include/dialogs_g.h,v retrieving revision 1.11 diff -u -r1.11 dialogs_g.h --- client/include/dialogs_g.h 2002/05/25 15:05:58 1.11 +++ client/include/dialogs_g.h 2002/07/16 15:31:45 @@ -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); Index: client/include/messagewin_g.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/include/messagewin_g.h,v retrieving revision 1.2 diff -u -r1.2 messagewin_g.h --- client/include/messagewin_g.h 2002/06/27 00:59:21 1.2 +++ client/include/messagewin_g.h 2002/07/16 15:31:45 @@ -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); void real_clear_notify_window(void); Index: client/include/plrdlg_g.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/include/plrdlg_g.h,v retrieving revision 1.3 diff -u -r1.3 plrdlg_g.h --- client/include/plrdlg_g.h 2002/06/27 00:59:21 1.3 +++ client/include/plrdlg_g.h 2002/07/16 15:31:45 @@ -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 */ Index: client/include/repodlgs_g.h =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/include/repodlgs_g.h,v retrieving revision 1.5 diff -u -r1.5 repodlgs_g.h --- client/include/repodlgs_g.h 2002/06/27 00:59:21 1.5 +++ client/include/repodlgs_g.h 2002/07/16 15:31:45 @@ -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 */