diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-07-08 12:59:55 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2023-07-08 12:59:55 -0700 |
commit | a54bbae62282e8adce76df9626c58b6bb3e12967 (patch) | |
tree | d3f38bf45c1d9011110d21f650a40a59494cf3ea /launcher | |
parent | 67d473aab773e7f94c394ebdde05581dc8f805de (diff) | |
download | PrismLauncher-a54bbae62282e8adce76df9626c58b6bb3e12967.tar.gz PrismLauncher-a54bbae62282e8adce76df9626c58b6bb3e12967.tar.bz2 PrismLauncher-a54bbae62282e8adce76df9626c58b6bb3e12967.zip |
fix(instance edit): don't allow editing if no selected instance or instance doesn't support editing
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher')
-rw-r--r-- | launcher/ui/MainWindow.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 515abf07..254f229d 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -1279,7 +1279,17 @@ void MainWindow::globalSettingsClosed() void MainWindow::on_actionEditInstance_triggered() { - APPLICATION->showInstanceWindow(m_selectedInstance); + + if (!m_selectedInstance) + return; + + if (m_selectedInstance->canEdit()) { + APPLICATION->showInstanceWindow(m_selectedInstance); + } else { + CustomMessageBox::selectable(this, tr("Instance not editable"), + tr("This instance is not editable. it may be broken, invalid, or too old. Check logs for details,"), + QMessageBox::Critical)->show(); + } } void MainWindow::on_actionManageAccounts_triggered() |