freedomofpress/securedrop-client

Export Wizard launched after modal has wrong button sizehint (buttons too tall)

Opened this issue · 1 comments

Description

Known issue from #1777:
If the Export Wizard is launched with the main appwindow as its parent (i.e. user clicks "Export", "Export Transcript", or "Export All" and all files have already been downloaded), the wizard buttons appear at the correct height. However, if the export wizard is launched after a modal ("Some files will not be exported"), the button box takes up too much height, cutting off part of the last line of text in the Preflight message. The buttons remain too tall for the rest of the export flow.

Steps to Reproduce

  • actions -> Export All for a source where some files have not yet been downloaded. Accept the modal confirmation

Expected Behavior

export_transcript

Actual Behavior

button_too_big

Comments

  • The parent widget is affecting the sizeHint of the buttons
  • Part of the problem is that we don't draw the buttonbox and buttonalyout (it's handled by Qt), so we don't have direct access to the layout elements
  • Very brief look: Overriding sizeHint would solve this issue, but that's not possible without extending or reimplementing the button class. Trying to create and use a child class of QWizardButton led to a segfault; that needs more investigation. Trying to implement a QAbstractButton means a lot of implementation. There's probably a better way that involves creating and using a new button layout with setButtonLayout. This needs testing to make sure that we don't lose all the useful features of the existing buttons (advance/return page logic, enabled/disabled state, etc).
  • A quick workaround (looking for the mainwindow and setting it explicitly as the wizard's parent, instead of the modal being the parent) did not work

I think we should address this at a later date. The possible solutions have more downsides than upsides, especially if we get into creating custom buttons, which would create a larger test/QA burden right before the release.