[Freeciv-Dev] (PR#533) client dialogs need to close at end of game
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
[pagnin - Fri Oct 4 22:47:19 2002]:
> Andreas has made the win32 part of this patch, as stated in this
> message:
> http://lists.complete.org/freeciv-
> dev@xxxxxxxxxxx/2002/07/msg00421.html.gz
>
> I've updated the patch, and fixed some little problems with it
> (added header file in client/gui-gtk/gui_main.c, perhaps win32 version
> need also this fix but I haven't a working win32 development setup)
>
> I submit the updated patch for a review from other.
This patch has some problems.
It introduces a whole slew of popdown_xxx_dialog functions into
client/include, but none of these are included in gui-stub. Moreover,
they are never called from the common client code - they are all called
by popdown_everything, which is itself a gui function (and also needs to
go into gui-stub).
IMO this can be easily rectified:
- Pull popdown_xxx_dialog out of client/include. Leave
popdown_everything there.
- Put popdown_everything into gui-stub.
- Call popdown_everything when the client disconnects (as the patch
currently does).
- All gui's then need to define popdown_everything. For GTK most of the
work is already done. For other GUIs we can provide stub functions and
let the GUI authors fill in the rest.
Also, I really do not like the name popdown_everything. What is being
closed are the game dialog windows. What about
popdown_all_game_dialogs? This mirrors popdown_all_city_dialogs().
Later, we may unify this code so that
popdown_all_game_dialogs/popdown_everything goes directly in client/.
But I don't know that all clients will use exactly the same form for
this, so doing it prematurely may be a waste.
Attached is a stub patch as described above. I will also try to make
the XAW part.
jason
? client/gui-gtk/diff
? client/gui-stub/stub-update.diff
? client/gui-xaw/diff
Index: client//civclient.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/civclient.c,v
retrieving revision 1.150
diff -u -r1.150 civclient.c
--- client//civclient.c 2002/11/11 10:00:46 1.150
+++ client//civclient.c 2002/11/12 08:45:59
@@ -664,6 +664,7 @@
}
else if(client_state==CLIENT_PRE_GAME_STATE) {
popdown_all_city_dialogs();
+ popdown_all_game_dialogs();
close_all_diplomacy_dialogs();
set_unit_focus_no_center(NULL);
clear_notify_window();
Index: client//gui-gtk/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/dialogs.c,v
retrieving revision 1.111
diff -u -r1.111 dialogs.c
--- client//gui-gtk/dialogs.c 2002/11/07 16:04:53 1.111
+++ client//gui-gtk/dialogs.c 2002/11/12 08:46:00
@@ -2364,3 +2364,12 @@
}
void dummy_close_callback(gpointer data){}
+
+/**********************************************************************
+ This function is called when the client disconnects or the game is
+ over. It should close all dialogs windows for that game.
+***********************************************************************/
+void popdown_all_game_dialogs(void)
+{
+ /* TODO */
+}
Index: client//gui-gtk-2.0/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/dialogs.c,v
retrieving revision 1.21
diff -u -r1.21 dialogs.c
--- client//gui-gtk-2.0/dialogs.c 2002/10/27 21:05:16 1.21
+++ client//gui-gtk-2.0/dialogs.c 2002/11/12 08:46:01
@@ -2305,3 +2305,12 @@
send_packet_player_request(&aconnection, &packet, PACKET_PLAYER_RATES);
return TRUE;
}
+
+/**********************************************************************
+ This function is called when the client disconnects or the game is
+ over. It should close all dialogs windows for that game.
+***********************************************************************/
+void popdown_all_game_dialogs(void)
+{
+ /* TODO */
+}
Index: client//gui-mui/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-mui/dialogs.c,v
retrieving revision 1.43
diff -u -r1.43 dialogs.c
--- client//gui-mui/dialogs.c 2002/06/12 07:24:39 1.43
+++ client//gui-mui/dialogs.c 2002/11/12 08:46:02
@@ -1892,3 +1892,12 @@
}
}
}
+
+/**********************************************************************
+ This function is called when the client disconnects or the game is
+ over. It should close all dialogs windows for that game.
+***********************************************************************/
+void popdown_all_game_dialogs(void)
+{
+ /* TODO */
+}
Index: client//gui-stub/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-stub/dialogs.c,v
retrieving revision 1.6
diff -u -r1.6 dialogs.c
--- client//gui-stub/dialogs.c 2002/05/25 15:05:56 1.6
+++ client//gui-stub/dialogs.c 2002/11/12 08:46:02
@@ -105,3 +105,12 @@
{
/* PORTME */
}
+
+/**********************************************************************
+ This function is called when the client disconnects or the game is
+ over. It should close all dialogs windows for that game.
+***********************************************************************/
+void popdown_all_game_dialogs(void)
+{
+ /* PORTME */
+}
Index: client//gui-win32/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/dialogs.c,v
retrieving revision 1.22
diff -u -r1.22 dialogs.c
--- client//gui-win32/dialogs.c 2002/07/13 13:33:05 1.22
+++ client//gui-win32/dialogs.c 2002/11/12 08:46:03
@@ -1982,3 +1982,12 @@
fcwin_set_box(hdlg,vbox);
ShowWindow(hdlg,SW_SHOWNORMAL);
}
+
+/**********************************************************************
+ This function is called when the client disconnects or the game is
+ over. It should close all dialogs windows for that game.
+***********************************************************************/
+void popdown_all_game_dialogs(void)
+{
+ /* TODO */
+}
Index: client//gui-xaw/dialogs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-xaw/dialogs.c,v
retrieving revision 1.69
diff -u -r1.69 dialogs.c
--- client//gui-xaw/dialogs.c 2002/08/07 11:21:42 1.69
+++ client//gui-xaw/dialogs.c 2002/11/12 08:46:04
@@ -2447,3 +2447,12 @@
send_packet_player_request(&aconnection, &packet, PACKET_PLAYER_RATES);
}
+
+/**********************************************************************
+ This function is called when the client disconnects or the game is
+ over. It should close all dialogs windows for that game.
+***********************************************************************/
+void popdown_all_game_dialogs(void)
+{
+ /* TODO */
+}
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/11/12 08:46:04
@@ -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 popdown_all_game_dialogs(void);
+
#endif /* FC__DIALOGS_G_H */
- [Freeciv-Dev] (PR#533) client dialogs need to close at end of game,
Jason Short via RT <=
|
|