Complete.Org: Mailing Lists: Archives: freeciv-dev: April 1999:
Re: [Freeciv-Dev] Problem with the disconnect menu in the gtk client
Home

Re: [Freeciv-Dev] Problem with the disconnect menu in the gtk client

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: brunel@xxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Problem with the disconnect menu in the gtk client
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 25 Apr 1999 13:20:24 +1000 (EST)

Content-Transfer-Encoding: 7bit
Content-Type: multipart/mixed; boundary="_----------=_92501035356220"
MIME-Version: 1.0
X-Mailer: MIME::Lite 1.123  (B2.05; Q2.03)
Subject: disconnect

This is a multi-part message in MIME format.

--_----------=_92501035356220
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Content-Type: text/plain

Nicolas Brunel wrote:
> 
>       if the client state is PRE_GAME, 
> /game/disconnect is not highlighted even if connected to a server.
> The patch attached fix this.
> 
> I add a state to the client CLIENT_CONNECTED.
> Now, the client state before SELECT_RACE is CLIENT_CONNECTED.

I don't think its necessary to add a new client state.
(I'm also not sure about what code depends on the client state,
but that just makes me more wary about chaing it.)

Why not do what the Xaw client does, and make "disconnect"
always available whenever the Game menu is available (that is,
whenever there isn't a model dialog happening; the connect
dialog is model, and that is about the only time that disconnect
should _not_ be available).

The attached patch does that.  I also noticed there was a bug
that the set_sensitive() for the server options items did not
match the new menu item names; I fixed that, but then noticed
that actually the server options items may be very useful
before the game starts, and seem to work ok, so changed them
to true.  Exporting and clearing the output window also seem
reasonable and ok to do.  (Changes also made the the Xaw client.)

Regards,
-- David

--_----------=_92501035356220
Content-Disposition: inline; filename="disconnect.diff"
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; name="disconnect.diff"

diff -u -r --exclude-from exclude freeciv-cvs/client/gui-gtk/menu.c 
freeciv-mod/client/gui-gtk/menu.c
--- freeciv-cvs/client/gui-gtk/menu.c   Tue Apr 13 22:14:40 1999
+++ freeciv-mod/client/gui-gtk/menu.c   Sun Apr 25 13:12:00 1999
@@ -675,11 +675,11 @@
     menus_set_sensitive("<main>/Game/Save Settings", FALSE);
     menus_set_sensitive("<main>/Game/Players", FALSE);
     menus_set_sensitive("<main>/Game/Messages", FALSE);
-    menus_set_sensitive("<main>/Game/Server Options 1", FALSE);
-    menus_set_sensitive("<main>/Game/Server Options 2", FALSE);
-    menus_set_sensitive("<main>/Game/Export Log", FALSE);
-    menus_set_sensitive("<main>/Game/Clear Log", FALSE);
-    menus_set_sensitive("<main>/Game/Disconnect", FALSE);
+    menus_set_sensitive("<main>/Game/Server opt initial", TRUE);
+    menus_set_sensitive("<main>/Game/Server opt ongoing", TRUE);
+    menus_set_sensitive("<main>/Game/Export Log", TRUE);
+    menus_set_sensitive("<main>/Game/Clear Log", TRUE);
+    menus_set_sensitive("<main>/Game/Disconnect", TRUE);
 
   }
   else {
@@ -694,8 +694,8 @@
     menus_set_sensitive("<main>/Game/Save Settings", TRUE);
     menus_set_sensitive("<main>/Game/Players", TRUE);
     menus_set_sensitive("<main>/Game/Messages", TRUE);
-    menus_set_sensitive("<main>/Game/Server Options 1", TRUE);
-    menus_set_sensitive("<main>/Game/Server Options 2", TRUE);
+    menus_set_sensitive("<main>/Game/Server opt initial", TRUE);
+    menus_set_sensitive("<main>/Game/Server opt ongoing", TRUE);
     menus_set_sensitive("<main>/Game/Export Log", TRUE);
     menus_set_sensitive("<main>/Game/Clear Log", TRUE);
     menus_set_sensitive("<main>/Game/Disconnect", TRUE);
diff -u -r --exclude-from exclude freeciv-cvs/client/gui-xaw/menu.c 
freeciv-mod/client/gui-xaw/menu.c
--- freeciv-cvs/client/gui-xaw/menu.c   Tue Apr 13 20:53:13 1999
+++ freeciv-mod/client/gui-xaw/menu.c   Sun Apr 25 13:10:57 1999
@@ -221,10 +221,10 @@
     menu_entry_sensitive(game_menu, MENU_GAME_REVOLUTION, 0);
     menu_entry_sensitive(game_menu, MENU_GAME_PLAYERS, 0);
     menu_entry_sensitive(game_menu, MENU_GAME_MESSAGES, 0);
-    menu_entry_sensitive(game_menu, MENU_GAME_SERVER_OPTIONS1, 0);
-    menu_entry_sensitive(game_menu, MENU_GAME_SERVER_OPTIONS2, 0);
-    menu_entry_sensitive(game_menu, MENU_GAME_OUTPUT_LOG, 0);
-    menu_entry_sensitive(game_menu, MENU_GAME_CLEAR_OUTPUT, 0);
+    menu_entry_sensitive(game_menu, MENU_GAME_SERVER_OPTIONS1, 1);
+    menu_entry_sensitive(game_menu, MENU_GAME_SERVER_OPTIONS2, 1);
+    menu_entry_sensitive(game_menu, MENU_GAME_OUTPUT_LOG, 1);
+    menu_entry_sensitive(game_menu, MENU_GAME_CLEAR_OUTPUT, 1);
     menu_entry_sensitive(game_menu, MENU_GAME_FIND_CITY, 0);
   
   }

--_----------=_92501035356220--

[Prev in Thread] Current Thread [Next in Thread]