diff options
author | dada513 <dada513@protonmail.com> | 2022-03-27 16:08:11 +0200 |
---|---|---|
committer | dada513 <dada513@protonmail.com> | 2022-03-27 16:08:11 +0200 |
commit | 424f4a72ffd4d5e6748559d2ce76ec2fd3b4cde1 (patch) | |
tree | 7b62e96669d2ddc44cc8125f762b661fce2a5014 /launcher/ui/pages | |
parent | 0a5dfeb3d7767a024f3b9032ea84df82570c7052 (diff) | |
download | PrismLauncher-424f4a72ffd4d5e6748559d2ce76ec2fd3b4cde1.tar.gz PrismLauncher-424f4a72ffd4d5e6748559d2ce76ec2fd3b4cde1.tar.bz2 PrismLauncher-424f4a72ffd4d5e6748559d2ce76ec2fd3b4cde1.zip |
Inform user about possible issues when using a Portal as instance folder
Diffstat (limited to 'launcher/ui/pages')
-rw-r--r-- | launcher/ui/pages/global/LauncherPage.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index 6f7e1cc7..c3dde8e6 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 @@ -48,6 +49,7 @@ #include "Application.h" #include "BuildConfig.h" #include "ui/themes/ITheme.h" +#include "Flatpak.h" #include <QApplication> #include <QProcess> @@ -141,6 +143,25 @@ void LauncherPage::on_instDirBrowseBtn_clicked() ui->instDirTextBox->setText(cooked_dir); } } + else if(Flatpak::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 really want to use this path?\n" + "Selecting \"No\" will close this and not alter your instance path.")); + warning.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + int result = warning.exec(); + if (result == QMessageBox::Yes) + { + ui->instDirTextBox->setText(cooked_dir); + } + } else { ui->instDirTextBox->setText(cooked_dir); |