Author: cazfi
Date: Fri Oct 30 01:07:32 2015
New Revision: 30305

URL: http://svn.gna.org/viewcvs/freeciv?rev=30305&view=rev
Log:
Split gtk_menus.xml to gtk2-client and gtk3-client specific files.

See patch #6495

Added:
    trunk/data/gtk2_menus.xml
      - copied unchanged from r30304, trunk/data/gtk_menus.xml
    trunk/data/gtk3_menus.xml
      - copied, changed from r30304, trunk/data/gtk_menus.xml
Removed:
    trunk/data/gtk_menus.xml
Modified:
    trunk/client/gui-gtk-2.0/menu.c
    trunk/client/gui-gtk-3.0/menu.c
    trunk/data/Makefile.am

Modified: trunk/client/gui-gtk-2.0/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/menu.c?rev=30305&r1=30304&r2=30305&view=diff
==============================================================================
--- trunk/client/gui-gtk-2.0/menu.c     (original)
+++ trunk/client/gui-gtk-2.0/menu.c     Fri Oct 30 01:07:32 2015
@@ -1846,7 +1846,7 @@
   const char *name;
 
   if ((name = getenv("FREECIV_MENUS"))
-      || (name = fileinfoname(get_data_dirs(), "gtk_menus.xml"))) {
+      || (name = fileinfoname(get_data_dirs(), "gtk2_menus.xml"))) {
     sz_strlcpy(filename, name);
   } else {
     log_error("Gtk menus: file definition not found");

Modified: trunk/client/gui-gtk-3.0/menu.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/menu.c?rev=30305&r1=30304&r2=30305&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/menu.c     (original)
+++ trunk/client/gui-gtk-3.0/menu.c     Fri Oct 30 01:07:32 2015
@@ -85,10 +85,12 @@
 static void menus_set_sensitive(GtkActionGroup *group,
                                 const gchar *action_name,
                                 gboolean is_sensitive);
+#ifndef DEBUG
 static void menus_set_visible(GtkActionGroup *group,
                               const gchar *action_name,
                               gboolean is_visible,
                               gboolean is_sensitive);
+#endif /* DEBUG */
 
 static void view_menu_update_sensitivity(void);
 
@@ -1575,8 +1577,6 @@
        NULL, NULL, G_CALLBACK(show_focus_unit_callback), FALSE},
       {"SHOW_FOG_OF_WAR", NULL, _("Fog of _War"),
        NULL, NULL, G_CALLBACK(show_fog_of_war_callback), FALSE},
-      {"SHOW_BETTER_FOG_OF_WAR", NULL, _("Better Fog of War"),
-       NULL, NULL, NULL, FALSE},
 
       {"FULL_SCREEN", NULL, _("_Fullscreen"),
        "<Alt>Return", NULL, G_CALLBACK(full_screen_callback), FALSE}
@@ -1836,7 +1836,7 @@
   const char *name;
 
   if ((name = getenv("FREECIV_MENUS"))
-      || (name = fileinfoname(get_data_dirs(), "gtk_menus.xml"))) {
+      || (name = fileinfoname(get_data_dirs(), "gtk3_menus.xml"))) {
     sz_strlcpy(filename, name);
   } else {
     log_error("Gtk menus: file definition not found");
@@ -1945,6 +1945,7 @@
 /****************************************************************
   Sets an action visible.
 *****************************************************************/
+#ifndef DEBUG
 static void menus_set_visible(GtkActionGroup *group,
                               const gchar *action_name,
                               gboolean is_visible,
@@ -1962,6 +1963,7 @@
   gtk_action_set_visible(action, is_visible);
   gtk_action_set_sensitive(action, is_sensitive);
 }
+#endif /* DEBUG */
 
 /****************************************************************
   Renames an action.
@@ -2688,11 +2690,6 @@
   menus_set_active(safe_group, "SHOW_FOG_OF_WAR",
                    gui_options.draw_fog_of_war);
 
-  /* To avoid run-time errors from gtk3, we have to have this action,
-   * really used by gtk2-client only, defined also in gtk3-client code.
-   * We just don't show it to the user. */
-  menus_set_visible(safe_group, "SHOW_BETTER_FOG_OF_WAR", FALSE, FALSE);
-
   view_menu_update_sensitivity();
 
   menus_set_active(safe_group, "FULL_SCREEN", gui_options.gui_gtk3_fullscreen);

Modified: trunk/data/Makefile.am
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/Makefile.am?rev=30305&r1=30304&r2=30305&view=diff
==============================================================================
--- trunk/data/Makefile.am      (original)
+++ trunk/data/Makefile.am      Fri Oct 30 01:07:32 2015
@@ -19,11 +19,11 @@
 if CLIENT_GUI_GTK_2_0
 CLIENT_FILES += \
        freeciv.rc-2.0  \
-       gtk_menus.xml
+       gtk2_menus.xml
 else
 if CLIENT_GUI_GTK_3_0
 CLIENT_FILES += \
-       gtk_menus.xml
+       gtk3_menus.xml
 endif
 endif
 else
@@ -60,7 +60,8 @@
        Freeciv \
        freeciv-client.png \
        freeciv.rc-2.0  \
-       gtk_menus.xml   \
+       gtk2_menus.xml  \
+       gtk3_menus.xml  \
        database.lua    \
        amplio2.tilespec \
        cimpletoon.tilespec \

Copied: trunk/data/gtk3_menus.xml (from r30304, trunk/data/gtk_menus.xml)
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/gtk3_menus.xml?p2=trunk/data/gtk3_menus.xml&p1=trunk/data/gtk_menus.xml&r1=30304&r2=30305&rev=30305&view=diff
==============================================================================
--- trunk/data/gtk_menus.xml    (original)
+++ trunk/data/gtk3_menus.xml   Fri Oct 30 01:07:32 2015
@@ -64,7 +64,6 @@
       <menuitem action="SHOW_UNIT_SHIELDS" />
       <menuitem action="SHOW_FOCUS_UNIT" />
       <menuitem action="SHOW_FOG_OF_WAR" />
-      <menuitem action="SHOW_BETTER_FOG_OF_WAR" />
       <separator />
       <menuitem action="FULL_SCREEN" />
       <separator />

Removed: trunk/data/gtk_menus.xml
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/data/gtk_menus.xml?rev=30304&view=auto
==============================================================================
--- trunk/data/gtk_menus.xml    (original)
+++ trunk/data/gtk_menus.xml    (removed)
@@ -1,200 +0,0 @@
-<ui>
-  <menubar>
-    <menu action="MENU_GAME">
-      <menuitem action="CLEAR_CHAT_LOGS" />
-      <menuitem action="SAVE_CHAT_LOGS" />
-      <menu action="MENU_OPTIONS">
-        <menuitem action="LOCAL_OPTIONS" />
-        <menuitem action="MESSAGE_OPTIONS" />
-        <menuitem action="SERVER_OPTIONS" />
-        <menuitem action="SAVE_OPTIONS" />
-        <menuitem action="SAVE_OPTIONS_ON_EXIT" />
-      </menu>
-      <separator />
-      <menuitem action="RELOAD_TILESET" />
-      <menuitem action="GAME_SAVE" />
-      <menuitem action="GAME_SAVE_AS" />
-      <menuitem action="MAPIMG_SAVE" />
-      <menuitem action="MAPIMG_SAVE_AS" />
-      <separator />
-      <menuitem action="LEAVE" />
-      <menuitem action="QUIT" />
-    </menu>
-
-    <menu action="MENU_EDIT">
-      <menuitem action="FIND_CITY" />
-      <menuitem action="WORKLISTS" />
-      <separator />
-      <menuitem action="EDIT_MODE" />
-      <menuitem action="RECALC_BORDERS" />
-      <menuitem action="TOGGLE_FOG" />
-      <menuitem action="SCENARIO_PROPERTIES" />
-      <menuitem action="SAVE_SCENARIO" />
-      <separator />
-      <menuitem action="CLIENT_LUA_SCRIPT" />
-    </menu>
-
-    <menu action="MENU_VIEW">
-      <menuitem action="SHOW_CITY_OUTLINES" />
-      <menuitem action="SHOW_CITY_OUTPUT" />
-      <menuitem action="SHOW_MAP_GRID" />
-      <menuitem action="SHOW_NATIONAL_BORDERS" />
-      <menuitem action="SHOW_NATIVE_TILES" />
-      <menuitem action="SHOW_CITY_FULL_BAR" />
-      <menuitem action="SHOW_CITY_NAMES" />
-      <menuitem action="SHOW_CITY_GROWTH" />
-      <menuitem action="SHOW_CITY_PRODUCTIONS" />
-      <menuitem action="SHOW_CITY_BUY_COST" />
-      <menuitem action="SHOW_CITY_TRADE_ROUTES" />
-      <separator />
-      <menuitem action="SHOW_TERRAIN" />
-      <menuitem action="SHOW_COASTLINE" />
-      <menu action="MENU_IMPROVEMENTS">
-        <menuitem action="SHOW_PATHS" />
-        <menuitem action="SHOW_IRRIGATION" />
-        <menuitem action="SHOW_MINES" />
-        <menuitem action="SHOW_BASES" />
-      </menu>
-      <menuitem action="SHOW_RESOURCES" />
-      <menuitem action="SHOW_HUTS" />
-      <menuitem action="SHOW_POLLUTION" />
-      <menuitem action="SHOW_CITIES" />
-      <menuitem action="SHOW_UNITS" />
-      <menuitem action="SHOW_UNIT_SOLID_BG" />
-      <menuitem action="SHOW_UNIT_SHIELDS" />
-      <menuitem action="SHOW_FOCUS_UNIT" />
-      <menuitem action="SHOW_FOG_OF_WAR" />
-      <menuitem action="SHOW_BETTER_FOG_OF_WAR" />
-      <separator />
-      <menuitem action="FULL_SCREEN" />
-      <separator />
-      <menuitem action="CENTER_VIEW" />
-    </menu>
-
-    <menu action="MENU_SELECT">
-      <menuitem action="SELECT_SINGLE" />
-      <menuitem action="SELECT_ALL_ON_TILE" />
-      <separator />
-      <menuitem action="SELECT_SAME_TYPE_TILE" />
-      <menuitem action="SELECT_SAME_TYPE_CONT" />
-      <menuitem action="SELECT_SAME_TYPE" />
-      <separator />
-      <menuitem action="SELECT_DLG" />
-      <separator />
-      <menuitem action="UNIT_WAIT" />
-      <menuitem action="UNIT_DONE" />
-    </menu>
-
-    <menu action="MENU_UNIT">
-      <menuitem action="UNIT_GOTO" />
-      <menuitem action="UNIT_GOTO_CITY" />
-      <menuitem action="UNIT_RETURN" />
-      <separator />
-      <menuitem action="UNIT_EXPLORE" />
-      <menuitem action="UNIT_PATROL" />
-      <separator />
-      <menuitem action="UNIT_SENTRY" />
-      <menuitem action="UNIT_UNSENTRY" />
-      <separator />
-      <menuitem action="UNIT_LOAD" />
-      <menuitem action="UNIT_UNLOAD" />
-      <menuitem action="UNIT_UNLOAD_TRANSPORTER" />
-      <separator />
-      <menuitem action="UNIT_HOMECITY" />
-      <menuitem action="UNIT_UPGRADE" />
-      <menuitem action="UNIT_CONVERT" />
-      <menuitem action="UNIT_DISBAND" />
-    </menu>
-
-    <menu action="MENU_WORK">
-      <menuitem action="BUILD_CITY" />
-      <menuitem action="GO_BUILD_CITY" />
-      <menuitem action="GO_JOIN_CITY" />
-      <menuitem action="AUTO_SETTLER" />
-      <separator />
-      <menuitem action="BUILD_ROAD" />
-      <menu action="MENU_BUILD_PATH">
-        <!-- The buildable road list is ruleset dependent -->
-        <menuitem action="NULL" />
-      </menu>
-      <menuitem action="BUILD_IRRIGATION" />
-      <menuitem action="BUILD_MINE" />
-      <separator />
-      <menuitem action="CONNECT_ROAD" />
-      <menuitem action="CONNECT_RAIL" />
-      <menuitem action="CONNECT_IRRIGATION" />
-      <separator />
-      <menuitem action="TRANSFORM_TERRAIN" />
-      <menuitem action="CLEAN_POLLUTION" />
-      <menuitem action="CLEAN_FALLOUT" />
-    </menu>
-
-    <menu action="MENU_COMBAT">
-      <menuitem action="FORTIFY" />
-      <menuitem action="BUILD_FORTRESS" />
-      <menuitem action="BUILD_AIRBASE" />
-      <menu action="MENU_BUILD_BASE">
-        <!-- The buildable base list is ruleset dependent -->
-        <menuitem action="NULL" />
-      </menu>
-      <separator />
-      <menuitem action="DO_PILLAGE" />
-      <menuitem action="DIPLOMAT_ACTION" />
-      <menuitem action="EXPLODE_NUKE" />
-    </menu>
-
-    <menu action="MENU_CIVILIZATION">
-      <menuitem action="MAP_VIEW" />
-      <menuitem action="REPORT_UNITS" />
-      <menuitem action="REPORT_NATIONS" />
-      <menuitem action="REPORT_CITIES" />
-      <menuitem action="REPORT_ECONOMY" />
-      <menuitem action="REPORT_RESEARCH" />
-      <separator />
-      <menuitem action="TAX_RATE" />
-      <menuitem action="POLICIES" />
-      <menu action="MENU_GOVERNMENT">
-        <menuitem action="START_REVOLUTION" />
-        <!-- The government types are ruleset dependent -->
-      </menu>
-      <separator />
-      <menuitem action="REPORT_WOW" />
-      <menuitem action="REPORT_TOP_CITIES" />
-      <menuitem action="REPORT_MESSAGES" />
-      <menuitem action="REPORT_DEMOGRAPHIC" />
-      <menuitem action="REPORT_SPACESHIP" />
-      <menuitem action="REPORT_ACHIEVEMENTS" />
-    </menu>
-
-    <menu action="MENU_HELP">
-      <menuitem action="HELP_OVERVIEW" />
-      <menuitem action="HELP_PLAYING" />
-      <menuitem action="HELP_TERRAIN" />
-      <menuitem action="HELP_ECONOMY" />
-      <menuitem action="HELP_CITIES" />
-      <menuitem action="HELP_IMPROVEMENTS" />
-      <menuitem action="HELP_WONDERS" />
-      <menuitem action="HELP_UNITS" />
-      <menuitem action="HELP_COMBAT" />
-      <menuitem action="HELP_ZOC" />
-      <menuitem action="HELP_GOVERNMENT" />
-      <menuitem action="HELP_POLICIES" />
-      <menuitem action="HELP_DIPLOMACY" />
-      <menuitem action="HELP_TECH" />
-      <menuitem action="HELP_SPACE_RACE" />
-      <menuitem action="HELP_RULESET" />
-      <menuitem action="HELP_TILESET" />
-      <menuitem action="HELP_NATIONS" />
-      <separator />
-      <menuitem action="HELP_CONNECTING" />
-      <menuitem action="HELP_CONTROLS" />
-      <menuitem action="HELP_CMA" />
-      <menuitem action="HELP_CHATLINE" />
-      <menuitem action="HELP_WORKLIST_EDITOR" />
-      <separator />
-      <menuitem action="HELP_LANGUAGES" />
-      <menuitem action="HELP_COPYING" />
-      <menuitem action="HELP_ABOUT" />
-    </menu>
-  </menubar>
-</ui>


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

Reply via email to