aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui
diff options
context:
space:
mode:
authorEzekiel Smith <ezekielsmith@protonmail.com>2022-04-01 21:03:14 +1000
committerGitHub <noreply@github.com>2022-04-01 21:03:14 +1000
commit382548e0a7106ce6b97accb320c7901499b00435 (patch)
tree067bbe65e289f72923dd90d31695e27bc3b7aaa4 /launcher/ui
parenta90fc3d7fe42bf68eff7ee865ae88b0ff5d5ad98 (diff)
parent59b3e30821bd20a3dc9e9fe4617ffa461f3a89b8 (diff)
downloadPrismLauncher-382548e0a7106ce6b97accb320c7901499b00435.tar.gz
PrismLauncher-382548e0a7106ce6b97accb320c7901499b00435.tar.bz2
PrismLauncher-382548e0a7106ce6b97accb320c7901499b00435.zip
Merge pull request #355 from dada513/flatpak_properly
Fix flatpak properly
Diffstat (limited to 'launcher/ui')
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index 6f7e1cc7..42ad5ae3 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -2,6 +2,7 @@
/*
* PolyMC - Minecraft Launcher
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
+ * Copyright (c) 2022 dada513 <dada513@protonmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -134,13 +135,31 @@ void LauncherPage::on_instDirBrowseBtn_clicked()
warning.setInformativeText(
tr("Do you really want to use this path? "
"Selecting \"No\" will close this and not alter your instance path."));
- warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+ warning.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
int result = warning.exec();
- if (result == QMessageBox::Yes)
+ if (result == QMessageBox::Ok)
{
ui->instDirTextBox->setText(cooked_dir);
}
}
+ else if(APPLICATION->isFlatpak() && raw_dir.startsWith("/run/user"))
+ {
+ QMessageBox warning;
+ warning.setText(tr("You're trying to specify an instance folder "
+ "which was granted temporaily via Flatpak.\n"
+ "This is known to cause problems. "
+ "After a restart the launcher might break, "
+ "because it will no longer have access to that directory.\n\n"
+ "Granting PolyMC access to it via Flatseal is recommended."));
+ warning.setInformativeText(
+ tr("Do you want to proceed anyway?"));
+ warning.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
+ int result = warning.exec();
+ if (result == QMessageBox::Ok)
+ {
+ ui->instDirTextBox->setText(cooked_dir);
+ }
+ }
else
{
ui->instDirTextBox->setText(cooked_dir);