summaryrefslogtreecommitdiff
path: root/src/createinstancedialogpages.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/createinstancedialogpages.h')
-rw-r--r--src/createinstancedialogpages.h66
1 files changed, 49 insertions, 17 deletions
diff --git a/src/createinstancedialogpages.h b/src/createinstancedialogpages.h
index 4fde089b..08953a74 100644
--- a/src/createinstancedialogpages.h
+++ b/src/createinstancedialogpages.h
@@ -60,7 +60,7 @@ public:
// called every time a page is shown in the screen
//
- virtual void activated();
+ void activated();
// overrides whether this page should be skipped; this is used by
// CreateInstanceDialog::setSinglePage() to disable all other pages
@@ -82,6 +82,12 @@ public:
void next();
+ // called from the dialog when an action is requested on the current page;
+ // returns true when handled
+ //
+ virtual bool action(CreateInstanceDialog::Actions a);
+
+
// returns the instance type
//
virtual CreateInstanceDialog::Types selectedInstanceType() const;
@@ -111,8 +117,14 @@ protected:
CreateInstanceDialog& m_dlg;
const PluginContainer& m_pc;
bool m_skip;
+ bool m_firstActivation;
+ // called every time a page is shown in the screen; `firstTime` is true for
+ // first activation
+ //
+ virtual void doActivated(bool firstTime);
+
// implemented by derived classes, overridden by setSkip(true)
//
virtual bool doSkip() const;
@@ -128,6 +140,12 @@ public:
protected:
bool doSkip() const override;
+
+private:
+ // the setting is only checked once when opening the dialog, or going forwards
+ // then back after checking the box wouldn't show the intro page any more,
+ // which would be unexpected
+ bool m_skip;
};
@@ -154,6 +172,11 @@ public:
//
void portable();
+protected:
+ // focuses global instance button on first activation
+ //
+ void doActivated(bool firstTime) override;
+
private:
CreateInstanceDialog::Types m_type;
};
@@ -187,6 +210,10 @@ public:
//
bool ready() const override;
+ // handles find
+ //
+ bool action(CreateInstanceDialog::Actions a) override;
+
// returns the selected game
//
MOBase::IPluginGame* selectedGame() const override;
@@ -262,7 +289,6 @@ private:
//
Game* findGame(MOBase::IPluginGame* game);
-
// creates the ui for the given game button
//
void createGameButton(Game* g);
@@ -275,8 +301,13 @@ private:
//
void updateButton(Game* g);
- // called when a button has been clicked; selects the game or asks the user
- // for directory, depending
+ // game buttons are toggles, this creates the button for the given game if
+ // it doesn't exist and toggles it on
+ //
+ // the button might not exist if, for example:
+ // 1) this game is currently filtered out (not installed, doesn't match
+ // filter text, etc) and,
+ // 2) the user browses to a directory that a hidden plugin can use
//
void selectButton(Game* g);
@@ -343,7 +374,7 @@ public:
// uses the game selected in the previous page to fill the list, this must be
// called every time because the user may go back in forth in the wizard
//
- void activated() override;
+ void doActivated(bool firstTime) override;
// returns the selected variant, if any
//
@@ -388,18 +419,18 @@ public:
//
bool ready() const override;
+ // returns the instance name
+ //
+ QString selectedInstanceName() const override;
+
+protected:
// uses the selected game to generate an instance name
//
// as long as the user hasn't modified the textbox, this will regenerate a new
// instance name every time the selected game changes
//
- void activated() override;
+ void doActivated(bool firstTime) override;
- // returns the instance name
- //
- QString selectedInstanceName() const override;
-
-protected:
// returns true for portable instances
//
bool doSkip() const override;
@@ -451,15 +482,16 @@ public:
//
bool ready() const override;
+ // returns the selected paths
+ //
+ CreateInstanceDialog::Paths selectedPaths() const override;
+
+protected:
// resets all the paths if the instance type or instance name have changed,
// the current values are kept as long as these don't change; also updates the
// game name in the ui
//
- void activated() override;
-
- // returns the selected paths
- //
- CreateInstanceDialog::Paths selectedPaths() const override;
+ void doActivated(bool firstTime) override;
private:
// instance name the last time this page was active
@@ -572,7 +604,7 @@ public:
// recreates the log with the latest settings
//
- void activated() override;
+ void doActivated(bool firstTime) override;
// returns the text for the log
//