Index: client/agents/agents.c =================================================================== RCS file: /home/freeciv/CVS/freeciv/client/agents/agents.c,v retrieving revision 1.15 diff -u -r1.15 agents.c --- client/agents/agents.c 2002/06/23 16:06:23 1.15 +++ client/agents/agents.c 2002/06/25 17:00:41 @@ -22,6 +22,7 @@ #include "clinet.h" #include "timing.h" #include "mapctrl_g.h" +#include "dialogs_g.h" #include "cma_core.h" #include "cma_fec.h" @@ -133,6 +134,7 @@ } } call_list_iterate_end; + popup_dialogs_set_sensitive(FALSE); set_turn_done_button_state(FALSE); pcall2 = fc_malloc(sizeof(struct call)); @@ -235,8 +237,11 @@ currently_running = FALSE; - if (!agents_busy() && !game.player_ptr->turn_done && !client_is_observer()) { - set_turn_done_button_state(TRUE); + if (!agents_busy() && !client_is_observer()) { + popup_dialogs_set_sensitive(TRUE); + if (!game.player_ptr->turn_done) { + set_turn_done_button_state(TRUE); + } } } 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/06/25 17:00:43 @@ -137,7 +137,34 @@ int dest_x, dest_y; enum unit_activity what; }; - + +#define SPECLIST_TAG dialog2 +#define SPECLIST_TYPE GtkWidget +#include "speclist.h" + +#define SPECLIST_TAG dialog2 +#define SPECLIST_TYPE GtkWidget +#include "speclist_c.h" + +#define dialog2_list_iterate(calllist, pcall) \ + TYPED_LIST_ITERATE(GtkWidget, calllist, pcall) +#define dialog2_list_iterate_end LIST_ITERATE_END + +static struct dialog2_list open_dialogs; +static bool open_dialogs_initialized = FALSE; +static bool popup_dialogs_sensitive = TRUE; + +/**************************************************************** +... +*****************************************************************/ +static void initialize_open_dialogs(void) +{ + if (!open_dialogs_initialized) { + dialog2_list_init(&open_dialogs); + open_dialogs_initialized = TRUE; + } +} + /**************************************************************** ... *****************************************************************/ @@ -1437,6 +1464,9 @@ (*close_callback)(close_callback_data); } + initialize_open_dialogs(); + dialog2_list_unlink(&open_dialogs, dialog_shell); + free(buttons); } @@ -1514,9 +1544,13 @@ GtkAccelGroup *accel = gtk_accel_group_new(); int i; + initialize_open_dialogs(); + gtk_widget_set_sensitive(parent, FALSE); dshell=gtk_window_new(GTK_WINDOW_TOPLEVEL); + dialog2_list_insert(&open_dialogs, dshell); + gtk_widget_set_sensitive(dshell, popup_dialogs_sensitive); gtk_window_set_position (GTK_WINDOW(dshell), GTK_WIN_POS_MOUSE); gtk_accel_group_attach(accel, GTK_OBJECT(dshell)); @@ -2248,3 +2282,18 @@ } void dummy_close_callback(gpointer data){} + +void popup_dialogs_set_sensitive(bool sensitive) +{ + initialize_open_dialogs(); + + if (popup_dialogs_sensitive == sensitive) { + return; + } + popup_dialogs_sensitive = sensitive; + + + dialog2_list_iterate(open_dialogs, dshell) { + gtk_widget_set_sensitive(dshell, popup_dialogs_sensitive); + } dialog2_list_iterate_end; +} 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/06/25 17:00:43 @@ -45,4 +45,6 @@ enum tile_special_type may_pillage); void popup_unit_connect_dialog (struct unit *punit, int dest_x, int dest_y); +void popup_dialogs_set_sensitive(bool sensitive); + #endif /* FC__DIALOGS_G_H */