summaryrefslogtreecommitdiff
path: root/src/createinstancedialog.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-11-03 10:57:26 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2020-11-03 11:41:54 -0500
commit1d97d914f1de0404b5b4db1bfdeff35ed94ea422 (patch)
treec1f7514c450a3957613830ef26d618dd5c6f863e /src/createinstancedialog.h
parentb10436d60f7db3eedd838cbfad93cb41ddf1fd86 (diff)
InstanceManager now returns new Instance struct instead of instance name
moved most of the figuring out of instance parameters from InstanceManager to Instance, separated all the ui from it and put it in main.cpp added ways to show single pages in the create instance dialog so they can be used when info is missing
Diffstat (limited to 'src/createinstancedialog.h')
-rw-r--r--src/createinstancedialog.h37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/createinstancedialog.h b/src/createinstancedialog.h
index 0841ef29..6947f2e2 100644
--- a/src/createinstancedialog.h
+++ b/src/createinstancedialog.h
@@ -39,7 +39,7 @@ public:
Types type;
MOBase::IPluginGame* game;
QString gameLocation;
- QString gameEdition;
+ QString gameVariant;
QString instanceName;
QString dataPath;
QString iniPath;
@@ -57,6 +57,32 @@ public:
const PluginContainer& pluginContainer();
Settings* settings();
+ template <class Page>
+ void setSinglePage()
+ {
+ for (auto&& p : m_pages) {
+ if (auto* tp=dynamic_cast<Page*>(p.get())) {
+ tp->setSkip(false);
+ } else {
+ p->setSkip(true);
+ }
+ }
+
+ setSinglePageImpl();
+ }
+
+ template <class Page>
+ Page* getPage()
+ {
+ for (auto&& p : m_pages) {
+ if (auto* tp=dynamic_cast<Page*>(p.get())) {
+ return tp;
+ }
+ }
+
+ return nullptr;
+ }
+
void next();
void back();
void selectPage(std::size_t i);
@@ -69,7 +95,7 @@ public:
Types instanceType() const;
MOBase::IPluginGame* game() const;
QString gameLocation() const;
- QString gameEdition() const;
+ QString gameVariant() const;
QString instanceName() const;
QString dataPath() const;
Paths paths() const;
@@ -84,6 +110,10 @@ private:
std::vector<std::unique_ptr<cid::Page>> m_pages;
QString m_originalNext;
bool m_switching;
+ bool m_singlePage;
+
+
+ void setSinglePageImpl();
template <class T>
T getSelected(T (cid::Page::*mf)() const) const
@@ -100,6 +130,9 @@ private:
void logCreation(const QString& s);
void logCreation(const std::wstring& s);
+
+ bool canNext() const;
+ bool canBack() const;
};
#endif // MODORGANIZER_CREATEINSTANCEDIALOG_INCLUDED