mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +00:00
Applications+Demos+LibGUI: Migrate to fallible WizardDialogs and Pages
And port page text to String. Also removes WizardDialog::show() helper as all current implementations prefer to derive their own Dialog.
This commit is contained in:
parent
96e60c98cf
commit
caa8f43dbe
12 changed files with 178 additions and 115 deletions
|
@ -13,16 +13,11 @@
|
|||
namespace GUI {
|
||||
|
||||
class WizardDialog : public Dialog {
|
||||
C_OBJECT(WizardDialog)
|
||||
C_OBJECT_ABSTRACT(WizardDialog)
|
||||
public:
|
||||
virtual ~WizardDialog() override = default;
|
||||
|
||||
static void show(AbstractWizardPage& first_page, Window* parent_window = nullptr)
|
||||
{
|
||||
auto dialog = WizardDialog::construct(parent_window);
|
||||
dialog->push_page(first_page);
|
||||
dialog->exec();
|
||||
}
|
||||
static ErrorOr<NonnullRefPtr<WizardDialog>> create(Window* parent_window);
|
||||
|
||||
Function<void()> on_cancel;
|
||||
|
||||
|
@ -36,8 +31,9 @@ public:
|
|||
inline bool has_pages() const { return !m_page_stack.is_empty(); }
|
||||
|
||||
protected:
|
||||
WizardDialog(Window* parent_window);
|
||||
explicit WizardDialog(Window* parent_window);
|
||||
|
||||
virtual ErrorOr<void> build();
|
||||
virtual void handle_cancel();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue