Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] Re: (PR#977) Extended connect dialog
Home

[Freeciv-Dev] Re: (PR#977) Extended connect dialog

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: i-freeciv-lists@xxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#977) Extended connect dialog
From: "Daniel L Speyer" <dspeyer@xxxxxxxxxxx>
Date: Fri, 9 Apr 2004 19:02:15 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=977 >

Mike Kaufman wrote:
> I did not revert these changes because I think that they were originally
> inferior and practically a bug. The new way make a lot more sense I think
> in terms of initial and ongoing settings.

How about this, then.  The attached patch keeps your organization but fixes the 
real HCI bugs in it.  Specifically, it:

* greys out invalid menu options
* renames the dialogs in accordance with their new meaning
* ensures that the user will never see an inappropriate control
* removes coding cruft that should never have been called anyway 
* splits the options into more categories, so that the user can find things and 
the dialog doesn't grow taller than the screen
* rewrites some help texts so that they appear decent in a proportional spacing 
font

--Daniel Speyer



diff -ur freeciv-kaufman-Apr-07/client/gui-gtk-2.0/connectdlg.c 
freeciv-speyer-Apr-07/client/gui-gtk-2.0/connectdlg.c
--- freeciv-kaufman-Apr-07/client/gui-gtk-2.0/connectdlg.c      2004-04-09 
21:44:09.000000000 -0400
+++ freeciv-speyer-Apr-07/client/gui-gtk-2.0/connectdlg.c       2004-04-08 
22:44:15.000000000 -0400
@@ -862,7 +862,7 @@
   hbox = gtk_hbox_new(FALSE, 2);
   gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 20);
 
-  button = gtk_button_new_with_label(_("Initial Server Options"));
+  button = gtk_button_new_with_label(_("Change Server Options"));
   g_signal_connect_swapped(G_OBJECT(button), "clicked",
                           G_CALLBACK(send_report_request), 
                           (gpointer)REPORT_SERVER_OPTIONS2);
diff -ur freeciv-kaufman-Apr-07/client/gui-gtk-2.0/menu.c 
freeciv-speyer-Apr-07/client/gui-gtk-2.0/menu.c
--- freeciv-kaufman-Apr-07/client/gui-gtk-2.0/menu.c    2004-04-09 
21:44:09.000000000 -0400
+++ freeciv-speyer-Apr-07/client/gui-gtk-2.0/menu.c     2004-04-08 
22:31:05.000000000 -0400
@@ -607,9 +607,9 @@
        game_menu_callback,     MENU_GAME_SAVE_SETTINGS                         
        },
   { "/" N_("Game") "/sep2",                            NULL,
        NULL,                   0,                                      
"<Separator>"   },
-  { "/" N_("Game") "/" N_("Server Opt _initial"),      NULL,
+  { "/" N_("Game") "/" N_("View _Fixed Server Options"),NULL,
        game_menu_callback,     MENU_GAME_SERVER_OPTIONS1                       
        },
-  { "/" N_("Game") "/" N_("Server Opt _ongoing"),      NULL,
+  { "/" N_("Game") "/" N_("_Change Server Options"),   NULL,
        game_menu_callback,     MENU_GAME_SERVER_OPTIONS2                       
        },
   { "/" N_("Game") "/" N_("Save Game As..."),          NULL,
        game_menu_callback,     MENU_GAME_SAVE_GAME                             
        },
@@ -1061,6 +1061,21 @@
 *****************************************************************/
 void update_menus(void)
 {
+
+  menus_set_sensitive("<main>/_Game/Save Game As...", client_has_hack &&
+                     get_client_state()>=CLIENT_GAME_RUNNING_STATE);
+  menus_set_sensitive("<main>/_Game/Quick Save Game", client_has_hack &&
+                     get_client_state()>=CLIENT_GAME_RUNNING_STATE);
+  menus_set_sensitive("<main>/_Game/End Game", client_has_hack &&
+                     get_client_state()>=CLIENT_GAME_RUNNING_STATE);
+  menus_set_sensitive("<main>/_Game/_Change Server Options", 
+                     aconnection.established);
+  menus_set_sensitive("<main>/_Game/View _Fixed Server Options", 
+                     get_client_state()>=CLIENT_GAME_RUNNING_STATE);
+  menus_set_sensitive("<main>/_Game/_Disconnect", 
+                     aconnection.established);
+
+
   if (!can_client_change_view()) {
     menus_set_sensitive("<main>/_Reports", FALSE);
     menus_set_sensitive("<main>/_Kingdom", FALSE);
@@ -1114,10 +1129,6 @@
       }
     }
 
-    menus_set_sensitive("<main>/_Game/Save Game As...", client_has_hack);
-    menus_set_sensitive("<main>/_Game/Quick Save Game", client_has_hack);
-    menus_set_sensitive("<main>/_Game/End Game", client_has_hack);
-
     menus_set_sensitive("<main>/_Reports", TRUE);
     menus_set_sensitive("<main>/_Kingdom", TRUE);
     menus_set_sensitive("<main>/_View", TRUE);
diff -ur freeciv-kaufman-Apr-07/server/stdinhand.c 
freeciv-speyer-Apr-07/server/stdinhand.c
--- freeciv-kaufman-Apr-07/server/stdinhand.c   2004-04-09 21:44:09.000000000 
-0400
+++ freeciv-speyer-Apr-07/server/stdinhand.c    2004-04-08 22:11:41.000000000 
-0400
@@ -132,18 +132,24 @@
  */
 enum sset_category {
   SSET_GEOLOGY,
+  SSET_ECOLOGY,
   SSET_SOCIOLOGY,
+  SSET_ECONOMICS,
   SSET_MILITARY,
   SSET_SCIENCE,
   SSET_INTERNAL,
+  SSET_NETWORK,
   SSET_NUM_CATEGORIES
 };
 
 char *sset_category_names[]= { N_("Geological"),
+                              N_("Ecological"),
                               N_("Sociological"),
+                              N_("Economic"),
                               N_("Military"),
                               N_("Scientific"),
-                              N_("Internal") };
+                              N_("Internal"),
+                              N_("Networking") };
 
 /*
  * The type of the setting.
@@ -268,10 +274,14 @@
          N_("Two-dimensional maps can wrap at the north-south or \n"
             "east-west edges, and use a cartesian or isometric \n"
             "rectangular grid.  See the manual for further explanation.\n"
-             "  0 Flat Earth (unwrapped)          4 Flat Earth (isometric)\n"
-             "  1 Earth (wraps E-W)               5 Earth (isometric)\n"
-             "  2 Uranus (wraps N-S)              6 Uranus (isometric)\n"
-             "  3 Donut World (wraps N-S, E-W)    7 Donut World (isometric)"
+             "  0 Flat Earth (unwrapped)\n"
+             "  1 Earth (wraps E-W)\n"
+             "  2 Uranus (wraps N-S)\n"
+             "  3 Donut World (wraps N-S, E-W)\n"
+            "  4 Flat Earth (isometric)\n"
+            "  5 Earth (isometric)\n"
+            "  6 Uranus (isometric)\n"
+            "  7 Donut World (isometric)"
           ), NULL, 
          MAP_MIN_TOPO, MAP_MAX_TOPO, MAP_DEFAULT_TOPO)
 
@@ -281,19 +291,15 @@
   GEN_INT("generator", map.generator, SSET_MAP_GEN, SSET_GEOLOGY,
            SSET_TO_CLIENT,
          N_("Method used to generate map"),
-    N_("1 = standard, with random continents;\n"
+    N_("1 = standard, with random continents;\n\n"
        "2 = equally sized large islands with one player each, and "
-       "twice that many\n"
-       "    smaller islands;\n"
+       "twice that many smaller islands;\n\n"
        "3 = equally sized large islands with one player each, and "
-       "a number of other\n"
-       "    islands of similar size;\n"
+       "a number of other islands of similar size;\n\n"
        "4 = equally sized large islands with two players on every "
-       "island (or one\n"
-       "    with three players for an odd number of players), and "
-       "additional\n"
-       "    smaller islands;\n"
-       "5 = one or more large earthlike continents with some scatter.\n"
+       "island (or one with three players for an odd number of players), and "
+       "additional smaller islands;\n\n"
+       "5 = one or more large earthlike continents with some scatter.\n\n"
        "Note: values 2,3 and 4 generate \"fairer\" (but more boring) "
        "maps.\n"
        "(Zero indicates a scenario map.)"), NULL,
@@ -301,7 +307,7 @@
 
   GEN_BOOL("tinyisles", map.tinyisles, SSET_MAP_GEN, SSET_GEOLOGY,
            SSET_TO_CLIENT,
-          N_("Presence or absence of 1x1 islands"),
+          N_("Presence of 1x1 islands"),
           N_("0 = no 1x1 islands; 1 = some 1x1 islands"), NULL,
           MAP_DEFAULT_TINYISLES)
 
@@ -328,19 +334,19 @@
          N_("Amount of river squares"), "", NULL,
          MAP_MIN_RIVERS, MAP_MAX_RIVERS, MAP_DEFAULT_RIVERS)
 
-  GEN_INT("grass", map.grasssize, SSET_MAP_GEN, SSET_GEOLOGY, SSET_TO_CLIENT,
+  GEN_INT("grass", map.grasssize, SSET_MAP_GEN, SSET_ECOLOGY, SSET_TO_CLIENT,
          N_("Amount of grass squares"), "", NULL,
          MAP_MIN_GRASS, MAP_MAX_GRASS, MAP_DEFAULT_GRASS)
 
-  GEN_INT("forests", map.forestsize, SSET_MAP_GEN, SSET_GEOLOGY, 
SSET_TO_CLIENT,
+  GEN_INT("forests", map.forestsize, SSET_MAP_GEN, SSET_ECOLOGY, 
SSET_TO_CLIENT,
          N_("Amount of forest squares"), "", NULL, 
          MAP_MIN_FORESTS, MAP_MAX_FORESTS, MAP_DEFAULT_FORESTS)
 
-  GEN_INT("swamps", map.swampsize, SSET_MAP_GEN, SSET_GEOLOGY, SSET_TO_CLIENT,
+  GEN_INT("swamps", map.swampsize, SSET_MAP_GEN, SSET_ECOLOGY, SSET_TO_CLIENT,
          N_("Amount of swamp squares"), "", NULL, 
          MAP_MIN_SWAMPS, MAP_MAX_SWAMPS, MAP_DEFAULT_SWAMPS)
     
-  GEN_INT("deserts", map.deserts, SSET_MAP_GEN, SSET_GEOLOGY, SSET_TO_CLIENT,
+  GEN_INT("deserts", map.deserts, SSET_MAP_GEN, SSET_ECOLOGY, SSET_TO_CLIENT,
          N_("Amount of desert squares"), "", NULL, 
          MAP_MIN_DESERTS, MAP_MAX_DESERTS, MAP_DEFAULT_DESERTS)
 
@@ -363,7 +369,7 @@
             "on the time."), NULL, 
          GAME_MIN_RANDSEED, GAME_MAX_RANDSEED, GAME_DEFAULT_RANDSEED)
 
-  GEN_INT("specials", map.riches, SSET_MAP_ADD, SSET_GEOLOGY, SSET_TO_CLIENT,
+  GEN_INT("specials", map.riches, SSET_MAP_ADD, SSET_ECOLOGY, SSET_TO_CLIENT,
          N_("Amount of \"special\" resource squares"), 
          N_("Special resources improve the basic terrain type they "
             "are on.  The server variable's scale is parts per "
@@ -423,11 +429,11 @@
             "which the initial units are dispersed."), NULL,
          GAME_MIN_DISPERSION, GAME_MAX_DISPERSION, GAME_DEFAULT_DISPERSION)
 
-  GEN_INT("gold", game.gold, SSET_GAME_INIT, SSET_SOCIOLOGY, SSET_TO_CLIENT,
+  GEN_INT("gold", game.gold, SSET_GAME_INIT, SSET_ECONOMICS, SSET_TO_CLIENT,
          N_("Starting gold per player"), "", NULL,
          GAME_MIN_GOLD, GAME_MAX_GOLD, GAME_DEFAULT_GOLD)
 
-  GEN_INT("techlevel", game.tech, SSET_GAME_INIT, SSET_SOCIOLOGY,
+  GEN_INT("techlevel", game.tech, SSET_GAME_INIT, SSET_SCIENCE,
           SSET_TO_CLIENT,
          N_("Number of initial advances per player"), "", NULL,
          GAME_MIN_TECHLEVEL, GAME_MAX_TECHLEVEL, GAME_DEFAULT_TECHLEVEL)
@@ -478,11 +484,11 @@
          NULL, 
          GAME_MIN_FREECOST, GAME_MAX_FREECOST, GAME_DEFAULT_FREECOST)
 
-  GEN_INT("foodbox", game.foodbox, SSET_RULES, SSET_SOCIOLOGY, SSET_TO_CLIENT,
+  GEN_INT("foodbox", game.foodbox, SSET_RULES, SSET_ECONOMICS, SSET_TO_CLIENT,
          N_("Food required for a city to grow"), "", NULL,
          GAME_MIN_FOODBOX, GAME_MAX_FOODBOX, GAME_DEFAULT_FOODBOX)
 
-  GEN_INT("aqueductloss", game.aqueductloss, SSET_RULES, SSET_SOCIOLOGY,
+  GEN_INT("aqueductloss", game.aqueductloss, SSET_RULES, SSET_ECONOMICS,
           SSET_TO_CLIENT,
          N_("Percentage food lost when need aqueduct"),
          N_("If a city would expand, but it can't because it needs "
@@ -492,7 +498,7 @@
          GAME_MIN_AQUEDUCTLOSS, GAME_MAX_AQUEDUCTLOSS, 
          GAME_DEFAULT_AQUEDUCTLOSS)
 
-  GEN_INT("fulltradesize", game.fulltradesize, SSET_RULES, SSET_SOCIOLOGY,
+  GEN_INT("fulltradesize", game.fulltradesize, SSET_RULES, SSET_ECONOMICS,
           SSET_TO_CLIENT,
          N_("Minimum city size to get full trade"),
          N_("There is a trade penalty in all cities smaller than this. "
@@ -503,7 +509,7 @@
          GAME_MIN_FULLTRADESIZE, GAME_MAX_FULLTRADESIZE, 
          GAME_DEFAULT_FULLTRADESIZE)
 
-  GEN_INT("notradesize", game.notradesize, SSET_RULES, SSET_SOCIOLOGY,
+  GEN_INT("notradesize", game.notradesize, SSET_RULES, SSET_ECONOMICS,
           SSET_TO_CLIENT,
          N_("Maximum size of a city without trade"),
          N_("All the cities of smaller or equal size to this do not "
@@ -771,7 +777,7 @@
  * affect what happens in the game, it just determines when the
  * players stop playing and look at the score.)
  */
-  GEN_STRING("allowtake", game.allow_take, SSET_META, SSET_INTERNAL,
+  GEN_STRING("allowtake", game.allow_take, SSET_META, SSET_NETWORK,
              SSET_TO_CLIENT,
              N_("Players that users are allowed to take"),
              N_("This should be a string of characters, each of which "
@@ -792,20 +798,20 @@
                 "Each character above may be followed by one of the "
                 "following numbers to allow or restrict the manner "
                 "of connection:\n"
-                "  (none) = Controller allowed, observers allowed,\n"
-                "           can displace connections.\n"
-                "  1 = Controller allowed, observers allowed,\n"
-                "      can't displace connections;\n"
-                "  2 = Controller allowed, no observers allowed,\n"
-                "      can displace connections;\n"
-                "  3 = Controller allowed, no observers allowed,\n"
-                "      can't displace connections;\n"
-                "  4 = No controller allowed, observers allowed;\n"
-                "\"Displacing a connection\" means that you may take over "
+                "     (none) = Controller allowed, observers allowed, "
+                "can displace connections.*\n"
+                "     1 = Controller allowed, observers allowed, "
+                "can't displace connections;\n"
+                "     2 = Controller allowed, no observers allowed, "
+                "can displace connections;\n"
+                "     3 = Controller allowed, no observers allowed, "
+                "can't displace connections;\n"
+                "     4 = No controller allowed, observers allowed;\n\n"
+                "* \"Displacing a connection\" means that you may take over "
                 "a player that another user already has control of."),
                 is_valid_allowtake, GAME_DEFAULT_ALLOW_TAKE)
 
-  GEN_BOOL("autotoggle", game.auto_ai_toggle, SSET_META, SSET_INTERNAL,
+  GEN_BOOL("autotoggle", game.auto_ai_toggle, SSET_META, SSET_NETWORK,
            SSET_TO_CLIENT,
           N_("Whether AI-status toggles with connection"),
           N_("If this is set to 1, AI status is turned off when a player "
@@ -835,7 +841,7 @@
           GAME_MIN_TIMEOUT, GAME_MAX_TIMEOUT, GAME_DEFAULT_TIMEOUT)
 #endif
 
-  GEN_INT("tcptimeout", game.tcptimeout, SSET_META, SSET_INTERNAL,
+  GEN_INT("tcptimeout", game.tcptimeout, SSET_META, SSET_NETWORK,
           SSET_TO_CLIENT,
          N_("Seconds to let a client connection block"),
          N_("If a TCP connection is blocking for a time greater than "
@@ -844,7 +850,7 @@
             "TCP protocol implementation itself."), NULL, 
          GAME_MIN_TCPTIMEOUT, GAME_MAX_TCPTIMEOUT, GAME_DEFAULT_TCPTIMEOUT)
 
-  GEN_INT("netwait", game.netwait, SSET_META, SSET_INTERNAL, SSET_TO_CLIENT,
+  GEN_INT("netwait", game.netwait, SSET_META, SSET_NETWORK, SSET_TO_CLIENT,
          N_("Max seconds for TCP buffers to drain"),
          N_("The civserver will wait for up to the value of this "
             "parameter in seconds, for all client connection TCP "
@@ -852,13 +858,13 @@
             "wait at all."), NULL, 
          GAME_MIN_NETWAIT, GAME_MAX_NETWAIT, GAME_DEFAULT_NETWAIT)
 
-  GEN_INT("pingtime", game.pingtime, SSET_META, SSET_INTERNAL, SSET_TO_CLIENT,
+  GEN_INT("pingtime", game.pingtime, SSET_META, SSET_NETWORK, SSET_TO_CLIENT,
          N_("Seconds between PINGs"),
          N_("The civserver will poll the clients with a PING request "
             "each time this period elapses."), NULL, 
          GAME_MIN_PINGTIME, GAME_MAX_PINGTIME, GAME_DEFAULT_PINGTIME)
 
-  GEN_INT("pingtimeout", game.pingtimeout, SSET_META, SSET_INTERNAL,
+  GEN_INT("pingtimeout", game.pingtimeout, SSET_META, SSET_NETWORK,
           SSET_TO_CLIENT,
          N_("Time to cut a client"),
          N_("If a client doesn't reply to a PONG in this time the "
@@ -888,14 +894,19 @@
                "specifies the the inclusion of a line of information "
                "in the Demographics report.\n"
                "The characters and their meanings are:\n"
-               "    N = include Population           P = include Production\n"
-               "    A = include Land Area            E = include Economics\n"
-               "    S = include Settled Area         M = include Military 
Service\n"
-               "    R = include Research Speed       O = include Pollution\n"
+               "    N = include Population\n"
+               "    P = include Production\n"
+               "    A = include Land Area\n"
                "    L = include Literacy\n"
+               "    R = include Research Speed\n"
+               "    S = include Settled Area\n"
+               "    E = include Economics\n"
+               "    M = include Military Service\n"
+               "    O = include Pollution\n"
                "Additionally, the following characters control whether "
                "or not certain columns are displayed in the report:\n"
-               "    q = display \"quantity\" column    r = display \"rank\" 
column\n"
+               "    q = display \"quantity\" column\n"
+               "    r = display \"rank\" column\n"
                "    b = display \"best nation\" column\n"
                "(The order of these characters is not significant, but their 
case is.)"),
             is_valid_demography,
@@ -2816,10 +2827,7 @@
 
   /* count the number of settings */
   for (i = 0; settings[i].name; i++) {
-    if (which == 1 && sset_is_changeable(i)) {
-      continue;
-    }
-    if (which == 2 && !sset_is_changeable(i)) {
+    if (!sset_is_changeable(i)) {
       continue;
     }
     s++;
@@ -2837,10 +2845,7 @@
   send_packet_options_settable_control(dest, &control);
 
   for (s = 0, i = 0; settings[i].name; i++) {
-    if (which == 1 && sset_is_changeable(i)) {
-      continue;
-    }
-    if (which == 2 && !sset_is_changeable(i)) {
+    if (!sset_is_changeable(i)) {
       continue;
     }
 

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