Commit Graph

73 Commits (c62819216325e07f10590ba1ae739ac66e216df0)

Author SHA1 Message Date
Adriaan de Groot 99c03f7fbb [libcalamaresui] Behave better as a model
Adriaan de Groot 8f0a6d3065 [calamares] The ViewManager is its own model
- Having a ProgressTreeModel that does nothing but
  proxy to ViewManager methods is kind of useless.
- Move the relevant code from ProgressTreeModel to
  ViewManager.
- Remove now-unused ProgressTreeModel.
Adriaan de Groot 60c1d40b20 [libcalamaresui] Log which ViewStep is broken
- a ViewStep with no widget will crash the application;
   print out its name before doing so.
Adriaan de Groot 16a460adff [libcalamaresui] Move ExecutionViewStep where it belongs
- viewpages/ collects the ViewStep implementations
 - chase header moving and tidy some #includes
Adriaan de Groot c030cc41cd [libcalamaresui] Refactor button-creation
- The "convenience" method was no longer convenient, since
   we now place strings on the buttons by default.
 - While here, **name** the buttons so they can be themed.
Adriaan de Groot b78eacd7a8 [libcalamaresui] Set button texts always
- if the welcome module wasn't loaded (or loading otherwise failed)
   then no text was set, leading to confusing screens with
   buttons with icons but no label.
Andrius Štikonas 490c14d93d QLatin1Literal->QLatin1String.
Adriaan de Groot 1cde8c20df [libcalamaresui] Simplify retranslation
- Use any object method to connect() to
bill-auger e459b82cfe
fix typo in src/libcalamaresui/ViewManager.cpp
Adriaan de Groot ec08a293b2 [libcalamaresui] Reduce compile warnings
- "this" isn't used in the lambda; in future it might be if the
   lambda needs to get the configuration from settings.
Adriaan de Groot 566be48f16 libcalamaresui: rename and document pastebin method
Adriaan de Groot 2aae30f517 libcalamaresui: don't rely on translations to interpret button
- Keep the debug-failure-call in the code, but commented out
 - Check ButtonRole, rather than the button's text, to see
   which one it is.
Adriaan de Groot 675a35bb2e libcalamaresui: when displaying pasted URL, don't be fancy
- Just call the static method and then quit, rather
   than being careful about allocations.
Adriaan de Groot fac9ccde88 libcalamaresui: document magic constants in question()
Adriaan de Groot 630694b242 libcalamaresui: apply coding style to viewmanager
Adriaan de Groot d49ddf6463 libcalamaresui: factor out the pastebin functionality
- While called from the ViewManager (to post the debug log)
   this isn't really part of the ViewManager itself, so factor
   out the pasting code into its own file.
Adriaan de Groot 8f7d183a0c libcalamaresui: don't always fail
- The paste-branch was merged too soon. Now undoing the damage.
bill-auger c90d3b2016 squashme WIP upload log to paste server - more error checks and validations
bill-auger e096631c54 squashme WIP upload log to paste server - refactor error checking
bill-auger e7960474d4 implement post log to paste server
Adriaan de Groot 79dc9e3463 [libcalamares] Update button icons as we go along
- Adapt the button icons (previous, next, do-install, all-done)
   to the state of the buttons and the corresponding text.
Adriaan de Groot b3d9af4cae [libcalamaresui] Apply correct button labels
- updateButtonLabels() knows all the special cases for
   buttons, so use it when the language changes instead
   of setting up some possibly-wrong values.
 - One edge case that this fixes is: have **just** the welcome
   page before the first exec section in sequence. Then the
   *next* button label was *next* instead of *install*.
Adriaan de Groot 780fe125f7 [libcalamaresui] Give the buttons icons
- Next, Back, Cancel/Quit have somewhat-appropriate icons.
Adriaan de Groot c233bbb23d [libcalamaresui] Handle no-finished-page scenarios
- From an exec section, next() is called automatically when
   all the jobs in that section are done.
 - If there **is** no next section (e.g. there's no finished
   page to show after the exec), then m_steps.at() would assert
   on an out-of-range index.
 - Introdcuce a helper predicate isAtVeryEnd() which handles both
   out-of-range and normal at-the-end scenarios.
 - If there's no page following the exec section, stay with the
   slideshow but update buttons to match the normal last-page
   behavior, and don't ask about cancel (since we're done).
Adriaan de Groot 95009a5222 [libcalamaresui] Fix disable-cancel behavior
- d78bc0c5 added an early `return false` when cancel is disabled,
   before checking if we were at the last step; so last-step
   didn't get any special handling.
 - refactor so that last-step now gets special handling first,
   **then** disable-cancel handling, and then the usual case.
Adriaan de Groot f3bfc81e52 [libcalamares] Rename dontCancel to disableCancelDuringExec
- This way the name actually refers to what it does, rather
   than being a somewhat ambiguous overload of disableCancel.
Adriaan de Groot d4f4a40fa5 [libcalamaresui] Refactor quit-enabling
- Add signal for change-of-quit-enabledness
 - Minor tidying
Adriaan de Groot 088fa5004c [libcalamaresui] Disallow closing the window during execution
- If the disable-cancel-during-exec setting is on, and the user clicks
   the window-close button, then disregard the close message.
Adriaan de Groot ad4352b65c [libcalamaresui] Make stepIsExecute() more general
- Checking if the **next** step is an execute-step is a little
   weird, so make the API more general (and add the +1 to indexes
   where it was using NextWillExecute before).
Adriaan de Groot 25099ae854 [libcalamaresui] Remove duplicate setEnabled
- If executing is set to true, then later setEnabled( !executing && ... )
   fill be false, so we don't need to call setEnabled( false ) here as well.
Adriaan de Groot d78bc0c5c5 [libcalamaresui] When disable-cancel is on, never confirm
- This function is also reached by clicking the window-close decoration.
Adriaan de Groot a216b5ca76 [libcalamaresui] Misplaced const
Adriaan de Groot b7ddb39105 [libcalamaresui] Massage disable-cancel code
- Even when Cancel is hidden, also disable it (prevents DBUS
   triggers, for instance),
 - Re-enable it when exec is over, if it's disabled then.
 - simplify code a little.
The feren OS Dev a7ac046b3d
Update copyright headers
The feren OS Dev 825c92582a
Update ViewManager.cpp
Adriaan de Groot 3a0bd254c0 [libcalamaresui] Adjust quit-messages to setup-mode
Arnaud Ferraris db3d3a7d03 Add a settings.conf option to disable "Cancel" button
In some cases, e.g. when calamares is used as an "initial setup" tool,
we may want to user to go through all the configuration steps in order
to end up with a usable system.
Therefore, disabling the "Cancel" button can be useful in this case.

This commit adds an option to settings.conf which disables this button
when set to "true". If the option is not present in the settings file,
the default behavior ("Cancel" button enabled & visible) is enforced.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Adriaan de Groot d752223d0b [libcalamaresui] When reporting failure, use full product name.
Adriaan de Groot a8426730ca [libcalamaresui] Improve wording of modules failure warning
Adriaan de Groot 9918dfb95f [libcalamaresui] Reporting on failures
- Provide information on failed modules
 - Disallow further progress when configuration is borked
Adriaan de Groot 6bb72d173d [libcalamares] Drop generic cLog()
- Use cWarning or cError() for errors
 - Use cDebug(level) for other uses (but there aren't any)
Adriaan de Groot 958aee1d41 [libcalamaresui] Switch text on 'next' button
- If the next step will be an install-step (e.g. hit the optional
   confirmation step) then change the text on the 'next' button to
   'install'.
 - Do a little refactoring to make that more pleasant.

FIXES 
Adriaan de Groot 9c9486bb78 [libcalamares] When ViewManager is destroyed, reset instance pointer
Adriaan de Groot 308441ee3a Merge branch '3.1.x-stable'
Adriaan de Groot 41e6f0e06c [calamares] Allow WM close button
- remove hide-close-button hack
 - refactor code in viewmanager for confirming quit
 - hook up confirm-and-quit to WM close button
 - also works for alt-F4 and other quit methods
 - while here, update copyright year

FIXES 
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https
Adriaan de Groot 73a75e837b Auto-resize the main window.
If the summary widget is large, it gets a scrollbar. This looks really
weird, so prefer to grow the installer window instead. Discussed with
@sitter and settled on this solution.

ViewSteps can signal the ViewManager that they need more space (in pixels),
which may or may not be honored.

FIXES 
Adriaan de Groot d3f624f818 FinishedPage: no modal pop-ups in a slot
Switch the failure popup to non-modal, and quit the application when
the pop-up is closed. This allows signals to be delivered to other
slots connected to JobQueue::failed.
Adriaan de Groot ee4e4dfccc C++ trickery to make the code shorter to read.
Adriaan de Groot 9b3af4aac3 i18n: translate yes/no buttons, don't rely on Qt translations