Skip to content

Be more consistent about setting state of 'onwards' buttons (#199)

Make update_navigation_buttons's behaviour more consistent and clearer by always explicitly setting both the visibility and sensitivity of all three possible buttons (forward, accept, and skip).

In the current code, the logic is:

  • If the page is complete, set the next widget sensitive and visible; set the other two buttons not visible, but do not change their sensitivity
  • Otherwise, if the page is skippable, set the skip button visible and the other two buttons not visible, do not change any button's sensitivity
  • Otherwise, set the next widget visible but not sensitive; set the other two buttons not visible, but do not change their sensitivity

This seems pretty inconsistent, and causes a clear bug, #199 (closed). @lnicola proposes !246 (closed) to fix #199 (closed). It changes the second behaviour in the list to:

  • Otherwise, if the page is skippable, set the skip button visible and the other two buttons not visible, and set the next widget as not sensitive

which addresses the immediate bug, but overall, I still feel like the logic here is pretty inconsistent. To me it feels clearer and overall safer to always touch both the visibility and sensitivity of all three buttons, in a way that is (hopefully) consistent with their intended state:

  • If the page is complete, set the next widget visible and sensitive; set both other buttons not visible and not sensitive
  • Otherwise, if the page is skippable, set the skip button visible and sensitive; set both other buttons not visible and not sensitive
  • Otherwise, set the next widget visible but not sensitive; set both other buttons not visible and not sensitive

Signed-off-by: Adam Williamson awilliam@redhat.com

Merge request reports