diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/editexecutablesdialog.cpp | 5 | ||||
| -rw-r--r-- | src/instancemanager.cpp | 21 | ||||
| -rw-r--r-- | src/instancemanager.h | 3 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 4 | ||||
| -rw-r--r-- | src/problemsdialog.ui | 2 | ||||
| -rw-r--r-- | src/shared/appconfig.inc | 1 | ||||
| -rw-r--r-- | src/version.rc | 4 |
7 files changed, 35 insertions, 5 deletions
diff --git a/src/editexecutablesdialog.cpp b/src/editexecutablesdialog.cpp index 7823fadc..0d6367b8 100644 --- a/src/editexecutablesdialog.cpp +++ b/src/editexecutablesdialog.cpp @@ -619,8 +619,9 @@ void EditExecutablesDialog::on_browseBinary_clicked() ui->binary->setText(QDir::toNativeSeparators(binaryName)); } - // setting title if currently empty - if (ui->title->text().isEmpty()) { + // setting title if currently empty or some variation of "New Executable" + if (ui->title->text().isEmpty() || + ui->title->text().startsWith(tr("New Executable"), Qt::CaseInsensitive)) { const auto prefix = QFileInfo(binaryName).baseName(); const auto newTitle = m_executablesList.makeNonConflictingTitle(prefix); diff --git a/src/instancemanager.cpp b/src/instancemanager.cpp index fdc30e22..c0d343de 100644 --- a/src/instancemanager.cpp +++ b/src/instancemanager.cpp @@ -186,6 +186,10 @@ QString InstanceManager::queryInstanceName(const QStringList &instanceList) cons QString InstanceManager::chooseInstance(const QStringList &instanceList) const { + if (portableInstallIsLocked()) { + return QString(); + } + enum class Special : uint8_t { NewInstance, Portable, @@ -266,6 +270,19 @@ bool InstanceManager::portableInstall() const } +bool InstanceManager::portableInstallIsLocked() const +{ + return QFile::exists(qApp->applicationDirPath() + "/" + + QString::fromStdWString(AppConfig::portableLockFileName())); +} + + +bool InstanceManager::allowedToChangeInstance() const +{ + return !portableInstallIsLocked(); +} + + void InstanceManager::createDataPath(const QString &dataPath) const { if (!QDir(dataPath).exists()) { @@ -286,6 +303,10 @@ void InstanceManager::createDataPath(const QString &dataPath) const QString InstanceManager::determineDataPath() { QString instanceId = currentInstance(); + if (portableInstallIsLocked()) + { + instanceId.clear(); + } if (instanceId.isEmpty() && !m_Reset && (m_overrideInstance || portableInstall())) { // startup, apparently using portable mode before diff --git a/src/instancemanager.h b/src/instancemanager.h index 4efa6f03..0e31fb08 100644 --- a/src/instancemanager.h +++ b/src/instancemanager.h @@ -38,6 +38,8 @@ public: QString currentInstance() const; + bool allowedToChangeInstance() const; + private: InstanceManager(); @@ -58,6 +60,7 @@ private: void createDataPath(const QString &dataPath) const; bool portableInstall() const; + bool portableInstallIsLocked() const; private: diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 7774d87d..42cbe919 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -727,6 +727,10 @@ void MainWindow::setupToolbar() } else { log::warn("no separator found on the toolbar, icons won't be right-aligned"); } + + if (!InstanceManager::instance().allowedToChangeInstance()) { + ui->actionChange_Game->setVisible(false); + } } void MainWindow::setupActionMenu(QAction* a) diff --git a/src/problemsdialog.ui b/src/problemsdialog.ui index a1712d4a..a474f73b 100644 --- a/src/problemsdialog.ui +++ b/src/problemsdialog.ui @@ -50,7 +50,7 @@ <html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:7.8pt;"><br /></p></body></html></string>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Click a notification above to get more details...</p></body></html></string>
</property>
</widget>
</item>
diff --git a/src/shared/appconfig.inc b/src/shared/appconfig.inc index e572a32b..709c845d 100644 --- a/src/shared/appconfig.inc +++ b/src/shared/appconfig.inc @@ -17,6 +17,7 @@ APPPARAM(std::wstring, proxyDLLOrig, L"steam_api_orig.dll") // needs to be ident APPPARAM(std::wstring, proxyDLLSource, L"proxy.dll")
APPPARAM(std::wstring, vfs32DLLName, L"usvfs_x86.dll")
APPPARAM(std::wstring, vfs64DLLName, L"usvfs_x64.dll")
+APPPARAM(std::wstring, portableLockFileName, L"portable.txt")
APPPARAM(const wchar_t*, localSavePlaceholder, L"__MOProfileSave__\\")
APPPARAM(std::wstring, firstStepsTutorial, L"tutorial_firststeps_main.js")
diff --git a/src/version.rc b/src/version.rc index 92370853..9bf6cc83 100644 --- a/src/version.rc +++ b/src/version.rc @@ -3,8 +3,8 @@ // If VS_FF_PRERELEASE is not set, MO labels the build as a release and uses VER_FILEVERSION to determine version number. // Otherwise, if letters are used in VER_FILEVERSION_STR, uses the full MOBase::VersionInfo parser // Otherwise, uses the numbers from VER_FILEVERSION and sets the release type as pre-alpha -#define VER_FILEVERSION 2,2,1 -#define VER_FILEVERSION_STR "2.2.1rc1\0" +#define VER_FILEVERSION 2,2,2 +#define VER_FILEVERSION_STR "2.2.2alpha1\0" VS_VERSION_INFO VERSIONINFO FILEVERSION VER_FILEVERSION |
