Author: sveinung Date: Fri Apr 28 12:05:23 2017 New Revision: 35324 URL: http://svn.gna.org/viewcvs/freeciv?rev=35324&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/S2_6/client/gui-qt/dialogs.cpp Modified: branches/S2_6/client/gui-qt/dialogs.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/dialogs.cpp?rev=35324&r1=35323&r2=35324&view=diff ============================================================================== --- branches/S2_6/client/gui-qt/dialogs.cpp (original) +++ branches/S2_6/client/gui-qt/dialogs.cpp Fri Apr 28 12:05:23 2017 @@ -2585,6 +2585,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(); @@ -2602,11 +2603,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); @@ -2614,6 +2615,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) { @@ -2674,7 +2682,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