Author: sveinung
Date: Fri Apr 28 12:04:32 2017
New Revision: 35323

URL: http://svn.gna.org/viewcvs/freeciv?rev=35323&view=rev
Log:
Qt client: complete act sel dlg update code.

The code responsible for updating the action selection dialog when actions
change legality (added in gna patch #5365) was unfinished. This resulted in
the "Keep moving" button staying above new actions that becomes legal.

Complete the Qt client's act sel dlg update code.

See hrm Bug #655656

Modified:
    branches/S3_0/client/gui-qt/dialogs.cpp

Modified: branches/S3_0/client/gui-qt/dialogs.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S3_0/client/gui-qt/dialogs.cpp?rev=35323&r1=35322&r2=35323&view=diff
==============================================================================
--- branches/S3_0/client/gui-qt/dialogs.cpp     (original)
+++ branches/S3_0/client/gui-qt/dialogs.cpp     Fri Apr 28 12:04:32 2017
@@ -2952,6 +2952,7 @@
   choice_dialog *asd;
   Choice_dialog_button *keep_moving_button;
   Choice_dialog_button *wait_button;
+  Choice_dialog_button *cancel_button;
   QVariant qv1, qv2;
 
   asd = gui()->get_diplo_dialog();
@@ -2969,11 +2970,11 @@
   /* Put the actor id in qv1. */
   qv1 = actor_unit->id;
 
-  keep_moving_button = asd->get_identified_button(BUTTON_CANCEL);
-  if (keep_moving_button != NULL) {
-    /* Temporary remove the Keep moving button so it won't end up above
+  cancel_button = asd->get_identified_button(BUTTON_CANCEL);
+  if (cancel_button != NULL) {
+    /* Temporary remove the Cancel button so it won't end up above
      * any added buttons. */
-    asd->stack_button(keep_moving_button);
+    asd->stack_button(cancel_button);
   }
 
   wait_button = asd->get_identified_button(BUTTON_WAIT);
@@ -2981,6 +2982,13 @@
     /* Temporary remove the Wait button so it won't end up above
      * any added buttons. */
     asd->stack_button(wait_button);
+  }
+
+  keep_moving_button = asd->get_identified_button(BUTTON_MOVE);
+  if (keep_moving_button != NULL) {
+    /* Temporary remove the Keep moving button so it won't end up above
+     * any added buttons. */
+    asd->stack_button(keep_moving_button);
   }
 
   action_iterate(act) {
@@ -3057,7 +3065,8 @@
     }
   } action_iterate_end;
 
-  if (keep_moving_button != NULL || wait_button != NULL) {
+  if (keep_moving_button != NULL
+      || wait_button != NULL || cancel_button != NULL) {
     /* Reinsert the "Keep moving" button below any potential
      * buttons recently added. */
     asd->unstack_all_buttons();


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

Reply via email to