aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2023-08-22 15:14:02 +0100
committerGitHub <noreply@github.com>2023-08-22 15:14:02 +0100
commitf7951f6082ac21ac19bc0089d01d6c7f5b322422 (patch)
tree9eae33a9692b8854b8752776c8cf3f751e26a223 /launcher
parent0e9611111638bfbb15e55270d2d9d0460fe32d58 (diff)
parent19316e22b40b47cf88856592b9ff528e860aa4a5 (diff)
downloadPrismLauncher-f7951f6082ac21ac19bc0089d01d6c7f5b322422.tar.gz
PrismLauncher-f7951f6082ac21ac19bc0089d01d6c7f5b322422.tar.bz2
PrismLauncher-f7951f6082ac21ac19bc0089d01d6c7f5b322422.zip
Merge pull request #1548 from Trial97/version_label
Reset status label when deleting instance
Diffstat (limited to 'launcher')
-rw-r--r--launcher/ui/MainWindow.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index cbfd4b9a..b3b60714 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -560,7 +560,8 @@ void MainWindow::updateLaunchButton()
launchMenu->clear();
else
launchMenu = new QMenu(this);
- m_selectedInstance->populateLaunchMenu(launchMenu);
+ if (m_selectedInstance)
+ m_selectedInstance->populateLaunchMenu(launchMenu);
ui->actionLaunchInstance->setMenu(launchMenu);
}
@@ -1356,10 +1357,11 @@ void MainWindow::on_actionDeleteInstance_triggered()
if (APPLICATION->instances()->trashInstance(id)) {
ui->actionUndoTrashInstance->setEnabled(APPLICATION->instances()->trashedSomething());
- return;
+ } else {
+ APPLICATION->instances()->deleteInstance(id);
}
-
- APPLICATION->instances()->deleteInstance(id);
+ APPLICATION->settings()->set("SelectedInstance", QString());
+ selectionBad();
}
void MainWindow::on_actionExportInstanceZip_triggered()
@@ -1657,10 +1659,6 @@ void MainWindow::instanceChanged(const QModelIndex& current, [[maybe_unused]] co
connect(m_selectedInstance.get(), &BaseInstance::runningStatusChanged, this, &MainWindow::refreshCurrentInstance);
connect(m_selectedInstance.get(), &BaseInstance::profilerChanged, this, &MainWindow::refreshCurrentInstance);
} else {
- ui->instanceToolBar->setEnabled(false);
- setInstanceActionsEnabled(false);
- ui->actionLaunchInstance->setEnabled(false);
- ui->actionKillInstance->setEnabled(false);
APPLICATION->settings()->set("SelectedInstance", QString());
selectionBad();
return;
@@ -1685,6 +1683,7 @@ void MainWindow::selectionBad()
{
// start by reseting everything...
m_selectedInstance = nullptr;
+ m_statusLeft->setText(tr("No instance selected"));
statusBar()->clearMessage();
ui->instanceToolBar->setEnabled(false);