Author: mir3x
Date: Wed Feb  3 19:42:50 2016
New Revision: 31738

URL: http://svn.gna.org/viewcvs/freeciv?rev=31738&view=rev
Log:
Fixed menu item "Save game" being disabled when there are no active units.

Reported by Gunter Heine and Markus Koschany <apo>.

See bug #24371


Modified:
    branches/S2_6/client/gui-qt/menu.cpp

Modified: branches/S2_6/client/gui-qt/menu.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/menu.cpp?rev=31738&r1=31737&r2=31738&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/menu.cpp        (original)
+++ branches/S2_6/client/gui-qt/menu.cpp        Wed Feb  3 19:42:50 2016
@@ -1074,6 +1074,24 @@
     a->setEnabled(false);
   }
 
+  /* Non unit menus */
+  keys = menu_list.keys();
+  foreach (munit key, keys) {
+    i = menu_list.find(key);
+    while (i != menu_list.end() && i.key() == key) {
+      switch (key) {
+      case SAVE:
+        if (can_client_access_hack() && C_S_RUNNING <= client_state()) {
+          i.value()->setEnabled(true);
+        }
+        break;
+      default:
+        break;
+      }
+      i++;
+    }
+  }
+
   if (can_client_issue_orders() == false || get_num_units_in_focus() == 0) {
     return;
   }
@@ -1413,11 +1431,6 @@
 
       case UPGRADE:
         if (units_can_upgrade(punits)) {
-          i.value()->setEnabled(true);
-        }
-        break;
-      case SAVE:
-        if (can_client_access_hack() && C_S_RUNNING <= client_state()) {
           i.value()->setEnabled(true);
         }
         break;


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

Reply via email to