fix: fix disabled trash undo action
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
87b0d3fe11
commit
b4be28b9bb
@ -1134,11 +1134,6 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
|
|||||||
connect(actionDeleteGroup, SIGNAL(triggered(bool)), SLOT(deleteGroup()));
|
connect(actionDeleteGroup, SIGNAL(triggered(bool)), SLOT(deleteGroup()));
|
||||||
actions.append(actionDeleteGroup);
|
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;
|
QMenu myMenu;
|
||||||
myMenu.addActions(actions);
|
myMenu.addActions(actions);
|
||||||
@ -1834,6 +1829,7 @@ void MainWindow::deleteGroup()
|
|||||||
void MainWindow::undoTrashInstance()
|
void MainWindow::undoTrashInstance()
|
||||||
{
|
{
|
||||||
APPLICATION->instances()->undoTrashInstance();
|
APPLICATION->instances()->undoTrashInstance();
|
||||||
|
ui->actionUndoTrashInstance->setEnabled(APPLICATION->instances()->trashedSomething());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionViewInstanceFolder_triggered()
|
void MainWindow::on_actionViewInstanceFolder_triggered()
|
||||||
@ -1940,6 +1936,7 @@ void MainWindow::on_actionDeleteInstance_triggered()
|
|||||||
|
|
||||||
auto id = m_selectedInstance->id();
|
auto id = m_selectedInstance->id();
|
||||||
if (APPLICATION->instances()->trashInstance(id)) {
|
if (APPLICATION->instances()->trashInstance(id)) {
|
||||||
|
ui->actionUndoTrashInstance->setEnabled(APPLICATION->instances()->trashedSomething());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user