summaryrefslogtreecommitdiff
path: root/ldmicro/lib/linuxUI/linuxUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro/lib/linuxUI/linuxUI.cpp')
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp
index a8c4eb3..015cbb8 100644
--- a/ldmicro/lib/linuxUI/linuxUI.cpp
+++ b/ldmicro/lib/linuxUI/linuxUI.cpp
@@ -152,16 +152,13 @@ void EnableMenuItem(HMENU MenuName, QAction* MenuItem, UINT CheckEnabledItem)
}
}
+// Special function designed for qt, since disabling top-level menu
+// Does not disable its child menus. They can still be accessed via
+// keyboard shortcuts
void EnableMenuItem(HMENU MenuName, HMENU MenuItem, UINT CheckEnabledItem)
{
- /*Blocks only the top menu signals. Does not block submenu signals.
- Signals still executed through keyboard shortcuts
- Reqd:
- QList<QAction *> actions()
- action->blockSignals(bool)*/
QList<QAction *> MenuList = MenuItem->actions();
QList<QAction *>::iterator item = MenuList.begin();
- // printf("MenuListCount%d\n", MenuList.count());
switch (CheckEnabledItem){
case MF_ENABLED :
while((item != MenuList.end()))/* || !(MenuList->isEmpty))*/
@@ -169,7 +166,6 @@ void EnableMenuItem(HMENU MenuName, HMENU MenuItem, UINT CheckEnabledItem)
(*item)->setEnabled(true);
(*item)->blockSignals(false);
item++;
- // printf("Indexof%d\n", MenuList.indexOf(*item, 0));
}
MenuItem->setEnabled(true);
MenuItem->blockSignals(false);
@@ -179,10 +175,7 @@ void EnableMenuItem(HMENU MenuName, HMENU MenuItem, UINT CheckEnabledItem)
{
(*item)->setEnabled(false);
(*item)->blockSignals(true);
- /*if(*item == InsertContactsMenu)
- printf("InsertContactsMenu\n");*/
item++;
- // printf("Indexof%d\n", MenuList.indexOf(*item, 0));
}
MenuItem->setEnabled(false);
MenuItem->blockSignals(true);