refs #720, remove highlight DB data menu (we use the DB icon instead)

* removed menu item
* fixed menu action, so parents submenus are searched upwards
This commit is contained in:
Klaus Basan
2016-08-10 15:30:13 +02:00
committed by Mathew Sutcliffe
parent 009bfc3ed1
commit a8834d0511
7 changed files with 42 additions and 45 deletions

View File

@@ -92,28 +92,9 @@ namespace BlackGui
template <class ModelClass, class ContainerType, class ObjectType, class KeyType>
void CViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType>::customMenu(Menus::CMenuActions &menuActions)
{
if (this->m_menus.testFlag(CViewBaseNonTemplate::MenuHighlightDbData))
{
if (!this->m_menuFlagActions.contains(CViewBaseNonTemplate::MenuHighlightDbData))
{
CMenuActions ma;
QAction *added = ma.addAction(CIcons::database16(), "Highlight DB data", CMenuAction::pathViewDatabase(), { this, &CViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType>::ps_toggleHighlightDbData });
added->setCheckable(true);
this->m_menuFlagActions.insert(CViewBaseNonTemplate::MenuHighlightDbData, ma);
}
QAction *a = menuActions.addActions(this->initMenuActions(CViewBaseNonTemplate::MenuHighlightDbData)).first();
a->setChecked(this->derivedModel()->highlightDbData());
}
CViewBase<ModelClass, ContainerType, ObjectType>::customMenu(menuActions);
}
template <class ModelClass, class ContainerType, class ObjectType, class KeyType>
void CViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType>::ps_toggleHighlightDbData()
{
bool h = this->derivedModel()->highlightDbData();
this->derivedModel()->setHighlightDbData(!h);
}
template <class ModelClass, class ContainerType, class ObjectType, class KeyType>
COrderableViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType>::COrderableViewWithDbObjects(QWidget *parent) :
CViewWithDbObjects<ModelClass, ContainerType, ObjectType, KeyType>::CViewWithDbObjects(parent)