Author: cazfi
Date: Wed Nov 11 17:30:46 2015
New Revision: 30539

URL: http://svn.gna.org/viewcvs/freeciv?rev=30539&view=rev
Log:
Added option for setting governor range min and max to be used in gtk3-client.

See patch #6352

Modified:
    branches/S2_6/client/gui-gtk-3.0/cma_fe.c
    branches/S2_6/client/options.c
    branches/S2_6/client/options.h

Modified: branches/S2_6/client/gui-gtk-3.0/cma_fe.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.0/cma_fe.c?rev=30539&r1=30538&r2=30539&view=diff
==============================================================================
--- branches/S2_6/client/gui-gtk-3.0/cma_fe.c   (original)
+++ branches/S2_6/client/gui-gtk-3.0/cma_fe.c   Wed Nov 11 17:30:46 2015
@@ -33,6 +33,7 @@
 #include "client_main.h"
 #include "cma_fec.h"
 #include "messagewin_g.h"
+#include "options.h"
 
 /* client/gtk-3.0 */
 #include "cityrep.h"
@@ -207,7 +208,7 @@
 }
 
 /**************************************************************************
- instantiates a new struct for each city_dialog window that is open.
+  Instantiates a new struct for each city_dialog window that is open.
 **************************************************************************/
 struct cma_dialog *create_cma_dialog(struct city *pcity, bool tiny)
 {
@@ -351,7 +352,9 @@
 
     pdialog->minimal_surplus[i] = hscale =
         gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, NULL);
-    gtk_range_set_range(GTK_RANGE(hscale), -20, 20);
+    gtk_range_set_range(GTK_RANGE(hscale),
+                        gui_options.gui_gtk3_governor_range_min,
+                        gui_options.gui_gtk3_governor_range_max);
     gtk_range_set_increments(GTK_RANGE(hscale), 1, 1);
     pango_layout_get_pixel_size(gtk_scale_get_layout(GTK_SCALE(hscale)),
                                 &layout_width, NULL);

Modified: branches/S2_6/client/options.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.c?rev=30539&r1=30538&r2=30539&view=diff
==============================================================================
--- branches/S2_6/client/options.c      (original)
+++ branches/S2_6/client/options.c      Wed Nov 11 17:30:46 2015
@@ -231,6 +231,8 @@
   .gui_gtk3_citydlg_xsize = GUI_GTK3_CITYDLG_DEFAULT_XSIZE,
   .gui_gtk3_citydlg_ysize = GUI_GTK3_CITYDLG_DEFAULT_YSIZE,
   .gui_gtk3_popup_tech_help = GUI_POPUP_TECH_HELP_RULESET,
+  .gui_gtk3_governor_range_min = -20,
+  .gui_gtk3_governor_range_max = 20,
   .gui_gtk3_font_city_label = "Monospace 8",
   .gui_gtk3_font_notify_label = "Monospace Bold 9",
   .gui_gtk3_font_spaceship_label = "Monospace 8",
@@ -2590,6 +2592,20 @@
                      "current ruleset is used."), COC_INTERFACE, GUI_GTK3,
                   GUI_POPUP_TECH_HELP_RULESET,
                   gui_popup_tech_help_name, NULL),
+  GEN_INT_OPTION(gui_gtk3_governor_range_min,
+                 N_("Minimum surplus for a governor"),
+                 N_("The lower limit of the range for requesting surpluses "
+                    "from the governor."),
+                 COC_INTERFACE, GUI_GTK3, GUI_GTK3_GOV_RANGE_MIN_DEFAULT,
+                 GUI_GTK3_GOV_RANGE_MIN_MIN, GUI_GTK3_GOV_RANGE_MIN_MAX,
+                 NULL),
+  GEN_INT_OPTION(gui_gtk3_governor_range_max,
+                 N_("Maximum surplus for a governor"),
+                 N_("The higher limit of the range for requesting surpluses "
+                    "from the governor."),
+                 COC_INTERFACE, GUI_GTK3, GUI_GTK3_GOV_RANGE_MAX_DEFAULT,
+                 GUI_GTK3_GOV_RANGE_MAX_MIN, GUI_GTK3_GOV_RANGE_MAX_MAX,
+                 NULL),
   GEN_FONT_OPTION(gui_gtk3_font_city_label, "city_label",
                   N_("City Label"),
                   N_("This font is used to display the city labels on city "

Modified: branches/S2_6/client/options.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.h?rev=30539&r1=30538&r2=30539&view=diff
==============================================================================
--- branches/S2_6/client/options.h      (original)
+++ branches/S2_6/client/options.h      Wed Nov 11 17:30:46 2015
@@ -244,7 +244,9 @@
   bool gui_gtk3_chatline_autocompletion;
   int gui_gtk3_citydlg_xsize;
   int gui_gtk3_citydlg_ysize;
-  int  gui_gtk3_popup_tech_help;
+  int gui_gtk3_popup_tech_help;
+  int gui_gtk3_governor_range_min;
+  int gui_gtk3_governor_range_max;
   char gui_gtk3_font_city_label[512];
   char gui_gtk3_font_notify_label[512];
   char gui_gtk3_font_spaceship_label[512];
@@ -474,6 +476,14 @@
 #define GUI_GTK3_CITYDLG_MIN_YSIZE      128
 #define GUI_GTK3_CITYDLG_MAX_YSIZE      4096
 
+#define GUI_GTK3_GOV_RANGE_MIN_DEFAULT  -20
+#define GUI_GTK3_GOV_RANGE_MIN_MIN      -100
+#define GUI_GTK3_GOV_RANGE_MIN_MAX      0
+
+#define GUI_GTK3_GOV_RANGE_MAX_DEFAULT  20
+#define GUI_GTK3_GOV_RANGE_MAX_MIN      0
+#define GUI_GTK3_GOV_RANGE_MAX_MAX      100
+
 #define GUI_DEFAULT_MAPIMG_FILENAME     "freeciv"
 
 #ifdef __cplusplus


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to