diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-20 22:46:44 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-20 22:46:44 +0300 |
commit | 19316e22b40b47cf88856592b9ff528e860aa4a5 (patch) | |
tree | 055eaa303f9f18f02ab8f50e56d62200ec15b70d /launcher | |
parent | 0aaea9bf5dbc49a20ad56d7856807d1bb7325411 (diff) | |
download | PrismLauncher-19316e22b40b47cf88856592b9ff528e860aa4a5.tar.gz PrismLauncher-19316e22b40b47cf88856592b9ff528e860aa4a5.tar.bz2 PrismLauncher-19316e22b40b47cf88856592b9ff528e860aa4a5.zip |
fixed status label after instance remove
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher')
-rw-r--r-- | launcher/ui/MainWindow.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 73b8dbe5..9228928f 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); } @@ -1351,10 +1352,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() @@ -1652,10 +1654,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; @@ -1680,6 +1678,7 @@ void MainWindow::selectionBad() { // start by reseting everything... m_selectedInstance = nullptr; + m_statusLeft->setText(tr("No instance selected")); statusBar()->clearMessage(); ui->instanceToolBar->setEnabled(false); |