Skip to content

rework page navigation/control flow

This MR is a work in progress to properly decouple various QML pages in Keysmith and push more logic towards C++.

The ultimate objective is to make various bits of code suitable for re-use in handling otpauth:// URIs received via D-Bus. See also: !77 (merged) A major blocker there is that while QML pages are in theory re-usable views, in practice the control flow/state machine implemented in main.qml requires a dedicated instance of the page for each 'occurrence' that might be needed. For example: there are two instances of the 'add' account page/view necessary, each one for a slightly different situation, to satisfy the need for different wiring of signals to ensure the right page transitions occur.

The plan is as follows:

  • Make navigation properly declarative
  • Introduce a proxy class to signal navigation/routing changes from C++ to QML. This should be accessible as a property of the global/singleton Keysmith object in QML.
  • Introduce hidden (encapsulated) state object(s) in C++ code
  • Introduce "view model" classes which provide data inputs (properties), and actions (signals) to QML pages. C++ code will then use the proxy to puppeteer the QML UI, and the QML UI will forward user input using the actions to C++. As a result QML code should be mostly "plain" reusable components.
  • Bind QML UI to the new view models and page navigation from C++.
  • Clean up unnecessary QML bindings (e.g. CommandLine, other API)
Edited by Johan Ouwerkerk

Merge request reports