mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-05 13:37:43 +03:00
Add a function to database widget to access enabled state of actions.
This commit is contained in:
parent
267e88001b
commit
4751f40c2b
3 changed files with 51 additions and 13 deletions
|
@ -177,6 +177,33 @@ DatabaseWidget::Mode DatabaseWidget::currentMode()
|
|||
}
|
||||
}
|
||||
|
||||
bool DatabaseWidget::actionEnabled(Action action)
|
||||
{
|
||||
switch (action) {
|
||||
case GroupNew:
|
||||
return m_actionGroupNew->isEnabled();
|
||||
case GroupEdit:
|
||||
return m_actionGroupEdit->isEnabled();
|
||||
case GroupDelete:
|
||||
return m_actionGroupDelete->isEnabled();
|
||||
case EntryNew:
|
||||
return m_actionEntryNew->isEnabled();
|
||||
case EntryClone:
|
||||
return m_actionEntryClone->isEnabled();
|
||||
case EntryEditView:
|
||||
return m_actionEntryEditView->isEnabled();
|
||||
case EntryDelete:
|
||||
return m_actionEntryDelete->isEnabled();
|
||||
case EntryCopyUsername:
|
||||
return m_actionEntryCopyUsername->isEnabled();
|
||||
case EntryCopyPassword:
|
||||
return m_actionEntryCopyPassword->isEnabled();
|
||||
default:
|
||||
Q_ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::emitCurrentModeChanged()
|
||||
{
|
||||
Q_EMIT currentModeChanged(currentMode());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue