aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-10-30 18:37:03 +0100
committerSefa Eyeoglu <contact@scrumplex.net>2022-10-30 18:37:06 +0100
commitb4be28b9bb29609212b398a5f46ee4dbc400cf2d (patch)
tree29c1f85ecae7905c9c400753c00d3644ed809a80
parent87b0d3fe11c1134bf17e1027fda7125f77e09821 (diff)
downloadPrismLauncher-b4be28b9bb29609212b398a5f46ee4dbc400cf2d.tar.gz
PrismLauncher-b4be28b9bb29609212b398a5f46ee4dbc400cf2d.tar.bz2
PrismLauncher-b4be28b9bb29609212b398a5f46ee4dbc400cf2d.zip
fix: fix disabled trash undo action
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
-rw-r--r--launcher/ui/MainWindow.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index 559ebc31..55f3e4f8 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -1134,11 +1134,6 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
connect(actionDeleteGroup, SIGNAL(triggered(bool)), SLOT(deleteGroup()));
actions.append(actionDeleteGroup);
}
-
- QAction *actionUndoTrashInstance = new QAction("Undo last trash instance", this);
- connect(actionUndoTrashInstance, SIGNAL(triggered(bool)), SLOT(undoTrashInstance()));
- actionUndoTrashInstance->setEnabled(APPLICATION->instances()->trashedSomething());
- actions.append(actionUndoTrashInstance);
}
QMenu myMenu;
myMenu.addActions(actions);
@@ -1834,6 +1829,7 @@ void MainWindow::deleteGroup()
void MainWindow::undoTrashInstance()
{
APPLICATION->instances()->undoTrashInstance();
+ ui->actionUndoTrashInstance->setEnabled(APPLICATION->instances()->trashedSomething());
}
void MainWindow::on_actionViewInstanceFolder_triggered()
@@ -1940,6 +1936,7 @@ void MainWindow::on_actionDeleteInstance_triggered()
auto id = m_selectedInstance->id();
if (APPLICATION->instances()->trashInstance(id)) {
+ ui->actionUndoTrashInstance->setEnabled(APPLICATION->instances()->trashedSomething());
return;
}