Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2004:
[Freeciv-Dev] (PR#8501) RFC: extended options dialog
Home

[Freeciv-Dev] (PR#8501) RFC: extended options dialog

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8501) RFC: extended options dialog
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Apr 2004 18:46:09 -0700
Reply-to: rt@xxxxxxxxxxx

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

The current options dialog is very limited.  It only includes a few of 
the options.

Most other options are generally accessed through menus.  They *should* 
be available through the options dialog as well.  However adding more 
options to the options dialog is ugly, since it's so big already.

My suggestion is that each option is given a type.  The options dialog 
can then have multiple tabs, one for each type.  This is basically what 
the SDL client's options dialog does (the SDL client doesn't have menus 
so these options must be integrated some other way; this will also apply 
to the FS client I think).

If others approve of this idea, we can work toward the goal in a couple 
of different steps.

1.  Attached is a preliminary patch showing the core changes needed for 
options.[ch].

2.  However a large part of the work will be in writing the GUI code for 
the options dialog.  The GUI developers will have to do this.

3.  Then we have to integrate all of the scattered options into the list 
in options.c.

4.  Finally we have to decide on the classes for all of the options.  My 
current list of classes is pretty mediocre.  This is probably a problem 
for a design person.

These steps are all independent but must be done in order.

jason

Index: client/options.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/options.c,v
retrieving revision 1.96
diff -u -r1.96 options.c
--- client/options.c    3 Apr 2004 01:57:22 -0000       1.96
+++ client/options.c    13 Apr 2004 01:37:59 -0000
@@ -77,37 +77,59 @@
 /* This option is currently set by the client - not by the user. */
 bool update_city_text_in_refresh_tile = TRUE;
 
+const char *client_option_class_names[] = {
+  N_("Graphics"),
+  N_("Interface"),
+  N_("Miscellaneous")
+};
+
 static client_option common_options[] = {
   GEN_STR_OPTION(default_user_name,        N_("Default player's login name"),
-                NULL, NULL), 
+                COC_MISCELLANEOUS, NULL, NULL), 
   GEN_STR_OPTION(default_server_host,       N_("Default server"),
-                NULL, NULL),
-  GEN_INT_OPTION(default_server_port,       N_("Default server's port")),
+                COC_MISCELLANEOUS, NULL, NULL),
+  GEN_INT_OPTION(default_server_port,       N_("Default server's port"),
+                COC_MISCELLANEOUS),
   GEN_STR_OPTION(default_metaserver,        N_("Default metaserver"),
-                NULL, NULL),
+                COC_MISCELLANEOUS, NULL, NULL),
   GEN_STR_OPTION(default_sound_set_name,    N_("Default name of sound set"),
-                get_soundset_list, NULL),
+                COC_MISCELLANEOUS, get_soundset_list, NULL),
   GEN_STR_OPTION(default_sound_plugin_name, N_("Default sound plugin"),
-                get_soundplugin_list, NULL),
+                COC_MISCELLANEOUS, get_soundplugin_list, NULL),
   GEN_STR_OPTION(default_tileset_name,     N_("Tileset"),
-                get_tileset_list, tilespec_reread_callback),
+                COC_GRAPHICS, get_tileset_list, tilespec_reread_callback),
 
-  GEN_BOOL_OPTION(solid_color_behind_units, N_("Solid unit background color")),
-  GEN_BOOL_OPTION(sound_bell_at_new_turn,   N_("Sound bell at new turn")),
+  GEN_BOOL_OPTION(solid_color_behind_units,
+                 N_("Solid unit background color"), COC_GRAPHICS),
+  GEN_BOOL_OPTION(sound_bell_at_new_turn,   N_("Sound bell at new turn"),
+                 COC_INTERFACE),
   GEN_INT_OPTION(smooth_move_unit_msec,
-                N_("Unit movement animation time (milliseconds)")),
-  GEN_BOOL_OPTION(do_combat_animation,      N_("Show combat animation")),
-  GEN_BOOL_OPTION(ai_popup_windows,         N_("Popup dialogs in AI Mode")),
-  GEN_BOOL_OPTION(ai_manual_turn_done,      N_("Manual Turn Done in AI Mode")),
-  GEN_BOOL_OPTION(auto_center_on_unit,      N_("Auto Center on Units")),
-  GEN_BOOL_OPTION(auto_center_on_combat,    N_("Auto Center on Combat")),
-  GEN_BOOL_OPTION(wakeup_focus,             N_("Focus on Awakened Units")),
-  GEN_BOOL_OPTION(draw_diagonal_roads,      N_("Draw Diagonal Roads/Rails")),
-  GEN_BOOL_OPTION(center_when_popup_city,   N_("Center map when Popup city")),
-  GEN_BOOL_OPTION(concise_city_production,  N_("Concise City Production")),
-  GEN_BOOL_OPTION(auto_turn_done,           N_("End Turn when done moving")),
-  GEN_BOOL_OPTION(ask_city_name,            N_("Prompt for city names")),
-  GEN_BOOL_OPTION(popup_new_cities,         N_("Pop up city dialog for new 
cities")),
+                N_("Unit movement animation time (milliseconds)"),
+                COC_GRAPHICS),
+  GEN_BOOL_OPTION(do_combat_animation,      N_("Show combat animation"),
+                 COC_GRAPHICS),
+  GEN_BOOL_OPTION(ai_popup_windows,         N_("Popup dialogs in AI Mode"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(ai_manual_turn_done, N_("Manual Turn Done in AI Mode"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(auto_center_on_unit,      N_("Auto Center on Units"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(auto_center_on_combat, N_("Auto Center on Combat"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(wakeup_focus,             N_("Focus on Awakened Units"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(draw_diagonal_roads,      N_("Draw Diagonal Roads/Rails"),
+                 COC_GRAPHICS),
+  GEN_BOOL_OPTION(center_when_popup_city,   N_("Center map when Popup city"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(concise_city_production,  N_("Concise City Production"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(auto_turn_done,           N_("End Turn when done moving"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(ask_city_name,            N_("Prompt for city names"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(popup_new_cities, N_("Pop up city dialog for new cities"),
+                 COC_INTERFACE),
 };
 #undef GEN_INT_OPTION
 #undef GEN_BOOL_OPTION
Index: client/options.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/options.h,v
retrieving revision 1.37
diff -u -r1.37 options.h
--- client/options.h    3 Apr 2004 01:57:22 -0000       1.37
+++ client/options.h    13 Apr 2004 01:37:59 -0000
@@ -54,9 +54,18 @@
   COT_STR
 };
 
+enum client_option_class {
+  COC_GRAPHICS,
+  COC_INTERFACE,
+  COC_MISCELLANEOUS
+};
+
+extern const char *client_option_class_names[];
+
 typedef struct client_option {
   const char *name;
   const char *description;
+  enum client_option_class class;
   enum client_option_type type;
   int *p_int_value;
   bool *p_bool_value;
@@ -75,16 +84,14 @@
 } client_option;
 extern client_option *options;
 
-#define GEN_INT_OPTION(oname, desc) { #oname, desc, COT_INT, \
-                                      &oname, NULL, NULL, 0, NULL, \
-                                       NULL, NULL }
-#define GEN_BOOL_OPTION(oname, desc) { #oname, desc, COT_BOOL, \
-                                       NULL, &oname, NULL, 0, NULL, \
-                                       NULL, NULL }
-#define GEN_STR_OPTION(oname, desc, str_defaults, callback) \
-                                    { #oname, desc, COT_STR, \
-                                      NULL, NULL, oname, sizeof(oname), \
-                                      callback, str_defaults, NULL }
+#define GEN_INT_OPTION(oname, desc, class) { #oname, desc, class, COT_INT, \
+                                             &oname, NULL, NULL, 0, NULL, \
+                                             NULL, NULL }
+#define GEN_BOOL_OPTION(oname, desc, class) \
+  { #oname, desc, class, COT_BOOL, NULL, &oname, NULL, 0, NULL, NULL, NULL }
+#define GEN_STR_OPTION(oname, desc, class, str_defaults, callback) \
+  { #oname, desc, class, COT_STR, NULL, NULL, oname, sizeof(oname), \
+    callback, str_defaults, NULL }
 
 extern int num_options;
 
Index: client/gui-gtk/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/gui_main.c,v
retrieving revision 1.147
diff -u -r1.147 gui_main.c
--- client/gui-gtk/gui_main.c   8 Mar 2004 02:24:35 -0000       1.147
+++ client/gui-gtk/gui_main.c   13 Apr 2004 01:37:59 -0000
@@ -124,9 +124,10 @@
 static gint gdk_input_id;
 
 client_option gui_options[] = {
-  GEN_BOOL_OPTION(meta_accelerators, N_("Use Alt/Meta for accelerators")),
-  GEN_BOOL_OPTION(map_scrollbars, N_("Show Map Scrollbars")),
-  GEN_BOOL_OPTION(keyboardless_goto, N_("Keyboardless goto")),
+  GEN_BOOL_OPTION(meta_accelerators, N_("Use Alt/Meta for accelerators"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(map_scrollbars, N_("Show Map Scrollbars"), COC_INTERFACE),
+  GEN_BOOL_OPTION(keyboardless_goto, N_("Keyboardless goto"), COC_INTERFACE),
 };
 const int num_gui_options = ARRAY_SIZE(gui_options);
 
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.c,v
retrieving revision 1.70
diff -u -r1.70 gui_main.c
--- client/gui-gtk-2.0/gui_main.c       3 Apr 2004 01:57:22 -0000       1.70
+++ client/gui-gtk-2.0/gui_main.c       13 Apr 2004 01:37:59 -0000
@@ -124,11 +124,13 @@
 GtkWidget *government_ebox;
 
 client_option gui_options[] = {
-  GEN_BOOL_OPTION(meta_accelerators,   N_("Use Alt/Meta for accelerators")),
-  GEN_BOOL_OPTION(map_scrollbars,      N_("Show Map Scrollbars")),
-  GEN_BOOL_OPTION(keyboardless_goto,   N_("Keyboardless goto")),
-  GEN_BOOL_OPTION(dialogs_on_top,      N_("Keep dialogs on top")),
-  GEN_BOOL_OPTION(show_task_icons,     N_("Show worklist task icons")),
+  GEN_BOOL_OPTION(meta_accelerators, N_("Use Alt/Meta for accelerators"),
+                 COC_INTERFACE),
+  GEN_BOOL_OPTION(map_scrollbars, N_("Show Map Scrollbars"), COC_INTERFACE),
+  GEN_BOOL_OPTION(keyboardless_goto, N_("Keyboardless goto"), COC_INTERFACE),
+  GEN_BOOL_OPTION(dialogs_on_top, N_("Keep dialogs on top"), COC_INTERFACE),
+  GEN_BOOL_OPTION(show_task_icons, N_("Show worklist task icons"),
+                 COC_INTERFACE),
 };
 const int num_gui_options = ARRAY_SIZE(gui_options);
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8501) RFC: extended options dialog, Jason Short <=