refs #661, info in context menu when force reload is unavailable

(KB/RW slack discussion)
This commit is contained in:
Klaus Basan
2016-05-24 18:21:30 +02:00
parent 54b1234f7f
commit 0ff7791532
3 changed files with 32 additions and 0 deletions

View File

@@ -48,6 +48,17 @@ namespace BlackGui
if (this->m_action) { m_action->setChecked(checked); }
}
bool CMenuAction::isActionEnabled() const
{
if (!this->m_action) { return false; }
return this->m_action->isEnabled();
}
void CMenuAction::setActionEnabled(bool enabled)
{
if (this->m_action) { m_action->setEnabled(enabled); }
}
bool CMenuAction::hasNoPathWithSeparator() const
{
return this->m_separator && this->hasNoPath();
@@ -244,6 +255,11 @@ namespace BlackGui
return action;
}
CMenuAction CMenuActions::addAction(const QIcon &actionIcon, const QString &text, const QString &path)
{
return this->addAction(actionIcon, text, path, nullptr);
}
CMenuAction CMenuActions::addAction(const QIcon &actionIcon, const QString &text, const QString &path, const BlackMisc::CSlot<void ()> &slot, const QKeySequence &shortcut)
{
return this->addAction(actionIcon, text, path, slot.object(), slot, shortcut);