From 0389688f3b30b9888bb94a08991bc1de00b89c59 Mon Sep 17 00:00:00 2001
From: isanae <14251494+isanae@users.noreply.github.com>
Date: Sat, 25 Jul 2020 21:52:30 -0400
Subject: move to next page when clicking a game add game name in the label in
the paths page can't use canonicalPath(), path might not exist
---
src/createinstancedialog.ui | 13 ++++++++-----
src/createinstancedialogpages.cpp | 13 ++++++++++---
src/createinstancedialogpages.h | 1 +
3 files changed, 19 insertions(+), 8 deletions(-)
(limited to 'src')
diff --git a/src/createinstancedialog.ui b/src/createinstancedialog.ui
index 4d9d8b06..41703f5e 100644
--- a/src/createinstancedialog.ui
+++ b/src/createinstancedialog.ui
@@ -7,7 +7,7 @@
0
0
493
- 423
+ 444
@@ -58,7 +58,7 @@
-
- 0
+ 5
@@ -506,12 +506,15 @@
<h3>Select a folder where the data should be stored.</h3>
+
+ true
+
-
-
+
- This includes downloads, mods, profiles and overwrite. If there is enough space on this drive, you should use the default folder.
+ This includes downloads, mods, profiles and overwrite for your <b>%1</b> instance. If there is enough space on this drive, you should use the default folder.
true
@@ -744,7 +747,7 @@
-
- Use <code>%BASE_DIR%</code> to refer to the Base Directory.
+ Use %BASE_DIR% to refer to the Base Directory.
diff --git a/src/createinstancedialogpages.cpp b/src/createinstancedialogpages.cpp
index 4d2c5b8b..e5213d33 100644
--- a/src/createinstancedialogpages.cpp
+++ b/src/createinstancedialogpages.cpp
@@ -269,6 +269,10 @@ void GamePage::select(IPluginGame* game)
m_selection = checked;
selectButton(checked);
updateNavigation();
+
+ if (checked) {
+ next();
+ }
}
void GamePage::selectCustom()
@@ -277,6 +281,7 @@ void GamePage::selectCustom()
&m_dlg, QObject::tr("Find game installation"));
if (path.isEmpty()) {
+ // reselect the previous button
selectButton(m_selection);
return;
}
@@ -408,7 +413,7 @@ QCommandLinkButton* GamePage::createCustomButton()
QObject::connect(b, &QAbstractButton::clicked, [&] {
selectCustom();
- });
+ });
return b;
}
@@ -422,7 +427,7 @@ void GamePage::createGameButton(Game* g)
QObject::connect(g->button, &QAbstractButton::clicked, [g, this] {
select(g->game);
- });
+ });
}
void GamePage::fillList()
@@ -759,6 +764,7 @@ bool NamePage::checkName(QString parentDir, QString name)
PathsPage::PathsPage(CreateInstanceDialog& dlg) :
Page(dlg), m_lastType(CreateInstanceDialog::NoType),
+ m_label(ui->pathsLabel),
m_simpleExists(ui->locationExists), m_simpleInvalid(ui->locationInvalid),
m_advancedExists(ui->advancedDirExists),
m_advancedInvalid(ui->advancedDirInvalid)
@@ -793,6 +799,7 @@ void PathsPage::activated()
checkPaths();
updateNavigation();
+ m_label.setText(m_dlg.game()->gameName());
m_lastInstanceName = name;
m_lastType = type;
}
@@ -868,7 +875,7 @@ void PathsPage::setPaths(const QString& name, bool force)
path = root + "/" + name;
}
- path = QDir::toNativeSeparators(QDir(path).canonicalPath());
+ path = QDir::toNativeSeparators(QDir::cleanPath(path));
setIfEmpty(ui->location, path, force);
setIfEmpty(ui->base, path, force);
diff --git a/src/createinstancedialogpages.h b/src/createinstancedialogpages.h
index 0d210493..15e63a8f 100644
--- a/src/createinstancedialogpages.h
+++ b/src/createinstancedialogpages.h
@@ -179,6 +179,7 @@ public:
private:
QString m_lastInstanceName;
CreateInstanceDialog::Types m_lastType;
+ PlaceholderLabel m_label;
mutable PlaceholderLabel m_simpleExists, m_simpleInvalid;
mutable PlaceholderLabel m_advancedExists, m_advancedInvalid;
--
cgit v1.3.1