Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2005:
[Freeciv-Dev] (PR#12114) Reorganize and trim client options.
Home

[Freeciv-Dev] (PR#12114) Reorganize and trim client options.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#12114) Reorganize and trim client options.
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Fri, 4 Feb 2005 14:59:02 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12114 >

This patch:
* Removes "Use Alt/Meta for accelerators" from GTK+ 2.x,
  since it isn't used.
* Removes "Popup dialogs in AI Mode". Was anyone masochist enough to
  enable this?

Adds help tooltips for the local options.

Index: client/climisc.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/climisc.c,v
retrieving revision 1.150
diff -u -r1.150 climisc.c
--- client/climisc.c    22 Jan 2005 20:31:11 -0000      1.150
+++ client/climisc.c    4 Feb 2005 22:52:27 -0000
@@ -864,7 +864,7 @@
     add_notify_window(message, ptile, event);
   }
   if (BOOL_VAL(where & MW_POPUP) &&
-      (!game.player_ptr->ai.control || ai_popup_windows)) {
+      (!game.player_ptr->ai.control)) {
     popup_notify_goto_dialog(_("Popup Request"), message, ptile);
   }
 
Index: client/control.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/control.c,v
retrieving revision 1.151
diff -u -r1.151 control.c
--- client/control.c    22 Jan 2005 19:45:39 -0000      1.151
+++ client/control.c    4 Feb 2005 22:52:27 -0000
@@ -528,7 +528,7 @@
 
     if (punit && (unit_can_help_build_wonder_here(punit)
                  || unit_can_est_traderoute_here(punit))
-       && (!game.player_ptr->ai.control || ai_popup_windows)) {
+       && (!game.player_ptr->ai.control)) {
       struct city *pcity_dest = map_get_city(punit->tile);
       struct city *pcity_homecity = find_city_by_id(punit->homecity);
       if (pcity_dest && pcity_homecity) {
Index: client/messagewin_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/messagewin_common.c,v
retrieving revision 1.17
diff -u -r1.17 messagewin_common.c
--- client/messagewin_common.c  25 Nov 2004 06:57:16 -0000      1.17
+++ client/messagewin_common.c  4 Feb 2005 22:52:27 -0000
@@ -74,7 +74,7 @@
   }
 
   if (!is_meswin_open() && messages_total > 0 &&
-      (!game.player_ptr->ai.control || ai_popup_windows)) {
+      (!game.player_ptr->ai.control)) {
     popup_meswin_dialog(FALSE);
     change = FALSE;
     return;
Index: client/options.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/options.c,v
retrieving revision 1.114
diff -u -r1.114 options.c
--- client/options.c    4 Feb 2005 21:46:57 -0000       1.114
+++ client/options.c    4 Feb 2005 22:52:28 -0000
@@ -58,7 +58,6 @@
 int  smooth_move_unit_msec = 30;
 int smooth_center_slide_msec = 0;
 bool do_combat_animation = TRUE;
-bool ai_popup_windows = FALSE;
 bool ai_manual_turn_done = FALSE;
 bool auto_center_on_unit = TRUE;
 bool auto_center_on_combat = FALSE;
@@ -164,11 +163,6 @@
                  N_("If this option is disabled them combat animation "
                     "between units on the mapview will be turned off."),
                  COC_GRAPHICS),
-  GEN_BOOL_OPTION(ai_popup_windows, N_("Popup dialogs in AI Mode"),
-                 N_("If this option is disabled then when watching an AI "
-                    "player, dialog windows will not be popped up like "
-                    "normal."),
-                 COC_INTERFACE),
   GEN_BOOL_OPTION(ai_manual_turn_done, N_("Manual Turn Done in AI Mode"),
                  N_("If this option is disabled, then you will not have "
                     "to press the turn done button manually when watching "
Index: client/options.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/options.h,v
retrieving revision 1.45
diff -u -r1.45 options.h
--- client/options.h    4 Feb 2005 21:46:57 -0000       1.45
+++ client/options.h    4 Feb 2005 22:52:28 -0000
@@ -32,7 +32,6 @@
 extern int smooth_move_unit_msec;
 extern int smooth_center_slide_msec;
 extern bool do_combat_animation;
-extern bool ai_popup_windows;
 extern bool ai_manual_turn_done;
 extern bool auto_center_on_unit;
 extern bool auto_center_on_combat;
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.462
diff -u -r1.462 packhand.c
--- client/packhand.c   2 Feb 2005 02:44:31 -0000       1.462
+++ client/packhand.c   4 Feb 2005 22:52:29 -0000
@@ -610,7 +610,7 @@
   }
 
   if (popup &&
-      (!game.player_ptr->ai.control || ai_popup_windows)) {
+      (!game.player_ptr->ai.control)) {
     update_menus();
     if (!city_dialog_is_open(pcity)) {
       popup_city_dialog(pcity, FALSE);
@@ -887,7 +887,7 @@
     lines = "";
   }
 
-  if (!game.player_ptr->ai.control || ai_popup_windows ||
+  if (!game.player_ptr->ai.control||
       event != E_BROADCAST_REPORT) {
     popup_notify_dialog(caption, headline, lines);
     play_sound_for_event(event);
@@ -1135,7 +1135,7 @@
          refresh_city_dialog(pcity);
        
         if((unit_flag(punit, F_TRADE_ROUTE) || unit_flag(punit, F_HELP_WONDER))
-          && (!game.player_ptr->ai.control || ai_popup_windows)
+          && (!game.player_ptr->ai.control)
           && punit->owner==game.player_idx
           && !unit_has_orders(punit)
           && (unit_can_help_build_wonder_here(punit)
@@ -1515,7 +1515,7 @@
       science_dialog_update();
     }
     if (poptechup) {
-      if (!game.player_ptr->ai.control || ai_popup_windows) {
+      if (!game.player_ptr->ai.control) {
        popup_science_dialog(FALSE);
       }
     }
@@ -2606,7 +2606,7 @@
 
   if (punit) {
     punit->bribe_cost = cost;
-    if (!game.player_ptr->ai.control || ai_popup_windows) {
+    if (!game.player_ptr->ai.control) {
       popup_bribe_dialog(punit);
     }
   }
@@ -2621,7 +2621,7 @@
 
   if (pcity) {
     pcity->incite_revolt_cost = cost;
-    if (!game.player_ptr->ai.control || ai_popup_windows) {
+    if (!game.player_ptr->ai.control) {
       popup_incite_dialog(pcity);
     }
   }
Index: client/gui-gtk-2.0/gamedlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gamedlgs.c,v
retrieving revision 1.25
diff -u -r1.25 gamedlgs.c
--- client/gui-gtk-2.0/gamedlgs.c       4 Feb 2005 20:56:45 -0000       1.25
+++ client/gui-gtk-2.0/gamedlgs.c       4 Feb 2005 22:52:29 -0000
@@ -423,9 +423,10 @@
 *****************************************************************/
 static void create_option_dialog(void)
 {
-  GtkWidget *label, *notebook, *align, *table[COC_MAX];
+  GtkWidget *ebox, *label, *notebook, *align, *table[COC_MAX];
   int i, len[COC_MAX];
   GtkSizeGroup *group[COC_MAX];
+  GtkTooltips *tips;
 
   option_dialog_shell = gtk_dialog_new_with_buttons(_("Set local options"),
        NULL,
@@ -461,51 +462,45 @@
     len[i] = 0;
   }
 
+  tips = gtk_tooltips_new();
+
   client_options_iterate(o) {
     i = len[o->category];
+
+    ebox = gtk_event_box_new();
+    gtk_table_attach(GTK_TABLE(table[o->category]), ebox,
+                    0, 1, i, i+1,
+                    GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
+    gtk_size_group_add_widget(group[o->category], ebox);
+
+    label = gtk_label_new(_(o->description));
+    gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+    gtk_container_add(GTK_CONTAINER(ebox), label);
+
+    gtk_tooltips_set_tip(tips, ebox, o->helptext, NULL);
+
     switch (o->type) {
     case COT_BOOL:
-      label = gtk_label_new(_(o->description));
-      gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-      gtk_table_attach(GTK_TABLE(table[o->category]), label,
-                      0, 1, i, i+1,
-                      GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
       o->p_gui_data = gtk_check_button_new();
-      gtk_table_attach(GTK_TABLE(table[o->category]), o->p_gui_data,
-                      1, 2, i, i+1,
-                      GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0);
       break;
     case COT_INT:
-      label = gtk_label_new(_(o->description));
-      gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-      gtk_table_attach(GTK_TABLE(table[o->category]), label,
-                      0, 1, i, i+1,
-                      GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
       o->p_gui_data = gtk_entry_new();
       gtk_entry_set_max_length(GTK_ENTRY(o->p_gui_data), 5);
       gtk_widget_set_size_request(GTK_WIDGET(o->p_gui_data), 45, -1);
-      gtk_table_attach(GTK_TABLE(table[o->category]), o->p_gui_data,
-                      1, 2, i, i+1,
-                      GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0);
       break;
     case COT_STR:
-      label = gtk_label_new(_(o->description));
-      gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
-      gtk_table_attach(GTK_TABLE(table[o->category]), label,
-                      0, 1, i, i+1,
-                      GTK_FILL, GTK_FILL | GTK_EXPAND, 0, 0);
       if (o->p_string_vals) {
         o->p_gui_data = gtk_combo_new();
       } else {
         o->p_gui_data = gtk_entry_new();
       }
       gtk_widget_set_size_request(GTK_WIDGET(o->p_gui_data), 150, -1);
-      gtk_table_attach(GTK_TABLE(table[o->category]), o->p_gui_data,
-                      1, 2, i, i+1,
-                      GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0);
       break;
     }
-    gtk_size_group_add_widget(group[o->category], label);
+    gtk_table_attach(GTK_TABLE(table[o->category]), o->p_gui_data,
+                    1, 2, i, i+1,
+                    GTK_FILL | GTK_EXPAND, GTK_FILL | GTK_EXPAND, 0, 0);
+
     len[o->category]++;
   } client_options_iterate_end;
 
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.104
diff -u -r1.104 gui_main.c
--- client/gui-gtk-2.0/gui_main.c       1 Feb 2005 01:08:45 -0000       1.104
+++ client/gui-gtk-2.0/gui_main.c       4 Feb 2005 22:52:29 -0000
@@ -142,10 +142,6 @@
 
 client_option gui_options[] = {
   /* This option is the same as the one in gui-gtk */
-  GEN_BOOL_OPTION(meta_accelerators, N_("Use Alt/Meta for accelerators"),
-                 N_("Uses the Alt or Meta keys for keyboard accelerators."),
-                 COC_INTERFACE),
-  /* This option is the same as the one in gui-gtk */
   GEN_BOOL_OPTION(map_scrollbars, N_("Show Map Scrollbars"),
                  N_("Disable this option to hide the scrollbars on the "
                     "map view."),

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