- Timestamp:
- Sep 3, 2014 4:04:29 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95861
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r52583 r52589 329 329 /** Returns action extra-data key. */ 330 330 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Application); } 331 /** Returns whether action is allowed. */ 332 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Application); } 331 333 332 334 void retranslateUi() … … 354 356 /** Returns action extra-data key. */ 355 357 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_Close); } 358 /** Returns whether action is allowed. */ 359 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_Close); } 356 360 357 361 QString shortcutExtraDataID() const … … 391 395 /** Returns action extra-data key. */ 392 396 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Help); } 397 /** Returns whether action is allowed. */ 398 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Help); } 393 399 394 400 void retranslateUi() … … 416 422 /** Returns action extra-data key. */ 417 423 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_Contents); } 424 /** Returns whether action is allowed. */ 425 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_Contents); } 418 426 419 427 QString shortcutExtraDataID() const … … 457 465 /** Returns action extra-data key. */ 458 466 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_WebSite); } 467 /** Returns whether action is allowed. */ 468 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_WebSite); } 459 469 460 470 QString shortcutExtraDataID() const … … 488 498 /** Returns action extra-data key. */ 489 499 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings); } 500 /** Returns whether action is allowed. */ 501 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings); } 490 502 491 503 QString shortcutExtraDataID() const … … 520 532 /** Returns action extra-data key. */ 521 533 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager); } 534 /** Returns whether action is allowed. */ 535 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager); } 522 536 523 537 QString shortcutExtraDataID() const … … 552 566 /** Returns action extra-data key. */ 553 567 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates); } 568 /** Returns whether action is allowed. */ 569 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates); } 554 570 555 571 QString shortcutExtraDataID() const … … 599 615 #endif /* !Q_WS_MAC */ 600 616 } 617 /** Returns whether action is allowed. */ 618 virtual bool isAllowed() const 619 { 620 #ifdef Q_WS_MAC 621 return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_About); 622 #else /* !Q_WS_MAC */ 623 return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_About); 624 #endif /* !Q_WS_MAC */ 625 } 601 626 602 627 QString shortcutExtraDataID() const … … 643 668 #else /* !Q_WS_MAC */ 644 669 return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_Preferences); 670 #endif /* !Q_WS_MAC */ 671 } 672 /** Returns whether action is allowed. */ 673 virtual bool isAllowed() const 674 { 675 #ifdef Q_WS_MAC 676 return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_Preferences); 677 #else /* !Q_WS_MAC */ 678 return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_Preferences); 645 679 #endif /* !Q_WS_MAC */ 646 680 } … … 945 979 946 980 /* 'About' action: */ 947 const bool fAllowToShowActionAbout = isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_About); 948 action(UIActionIndex_M_Application_S_About)->setEnabled(fAllowToShowActionAbout); 949 action(UIActionIndex_M_Application_S_About)->setVisible(fAllowToShowActionAbout); 950 if (!pMenu->isConsumed()) 951 pMenu->addAction(action(UIActionIndex_M_Application_S_About)); 952 953 /* Only for Runtime pool: */ 981 addAction(pMenu, action(UIActionIndex_M_Application_S_About)); 982 /* 'Preferences' action (only for Runtime pool): */ 954 983 if (type() == UIActionPoolType_Runtime) 955 { 956 /* 'Preferences' action: */ 957 const bool fAllowToShowActionPreferences = isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_Preferences); 958 action(UIActionIndex_M_Application_S_Preferences)->setEnabled(fAllowToShowActionPreferences); 959 action(UIActionIndex_M_Application_S_Preferences)->setVisible(fAllowToShowActionPreferences); 960 if (!pMenu->isConsumed()) 961 pMenu->addAction(action(UIActionIndex_M_Application_S_Preferences)); 962 } 963 964 /* Close action: */ 965 const bool fAllowToShowActionClose = isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_Close); 966 action(UIActionIndex_M_Application_S_Close)->setEnabled(fAllowToShowActionClose); 967 if (!pMenu->isConsumed()) 968 pMenu->addAction(action(UIActionIndex_M_Application_S_Close)); 984 addAction(pMenu, action(UIActionIndex_M_Application_S_Preferences)); 985 /* 'Close' action: */ 986 addAction(pMenu, action(UIActionIndex_M_Application_S_Close)); 969 987 970 988 /* Mark menu as valid: */ … … 976 994 { 977 995 /* Get corresponding menu: */ 978 QMenu *pMenu = action(UIActionIndex_Menu_Help)->menu();996 UIMenu *pMenu = action(UIActionIndex_Menu_Help)->menu(); 979 997 AssertPtrReturnVoid(pMenu); 980 998 /* Clear contents: */ 981 999 pMenu->clear(); 982 1000 983 984 1001 /* Separator? */ 985 1002 bool fSeparator = false; 986 1003 987 988 1004 /* 'Contents' action: */ 989 const bool fAllowToShowActionContents = isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_Contents); 990 action(UIActionIndex_Simple_Contents)->setEnabled(fAllowToShowActionContents); 991 if (fAllowToShowActionContents) 992 { 993 pMenu->addAction(action(UIActionIndex_Simple_Contents)); 994 fSeparator = true; 995 } 996 1005 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Contents)); 997 1006 /* 'Web Site' action: */ 998 const bool fAllowToShowActionWebSite = isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_WebSite); 999 action(UIActionIndex_Simple_WebSite)->setEnabled(fAllowToShowActionWebSite); 1000 if (fAllowToShowActionWebSite) 1001 { 1002 pMenu->addAction(action(UIActionIndex_Simple_WebSite)); 1003 fSeparator = true; 1004 } 1005 1007 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_WebSite)); 1006 1008 1007 1009 /* Separator? */ … … 1012 1014 } 1013 1015 1014 1015 1016 /* 'Reset Warnings' action: */ 1016 const bool fAllowToShowActionResetWarnings = isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings); 1017 action(UIActionIndex_Simple_ResetWarnings)->setEnabled(fAllowToShowActionResetWarnings); 1018 if (fAllowToShowActionResetWarnings) 1019 { 1020 pMenu->addAction(action(UIActionIndex_Simple_ResetWarnings)); 1021 fSeparator = true; 1022 } 1023 1017 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_ResetWarnings)); 1024 1018 1025 1019 /* Separator? */ … … 1030 1024 } 1031 1025 1032 1033 1026 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 1034 1027 /* 'Network Manager' action: */ 1035 const bool fAllowToShowActionNetworkManager = isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager); 1036 action(UIActionIndex_Simple_NetworkAccessManager)->setEnabled(fAllowToShowActionNetworkManager); 1037 if (fAllowToShowActionNetworkManager) 1038 { 1039 pMenu->addAction(action(UIActionIndex_Simple_NetworkAccessManager)); 1040 fSeparator = true; 1041 } 1042 1043 /* Only for Selector pool: */ 1028 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_NetworkAccessManager)); 1029 /* 'Check for Updates' action (only for Selector pool): */ 1044 1030 if (type() == UIActionPoolType_Selector) 1045 { 1046 /* 'Check for Updates' action: */ 1047 const bool fAllowToShowActionCheckForUpdates = isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates); 1048 action(UIActionIndex_Simple_NetworkAccessManager)->setEnabled(fAllowToShowActionCheckForUpdates); 1049 if (fAllowToShowActionCheckForUpdates) 1050 { 1051 pMenu->addAction(action(UIActionIndex_Simple_CheckForUpdates)); 1052 fSeparator = true; 1053 } 1054 } 1055 1031 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_CheckForUpdates)); 1056 1032 1057 1033 /* Separator? */ … … 1063 1039 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 1064 1040 1065 1066 1041 #ifndef RT_OS_DARWIN 1067 1042 /* 'About' action: */ 1068 const bool fAllowToShowActionAbout = isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_About); 1069 action(UIActionIndex_Simple_About)->setEnabled(fAllowToShowActionAbout); 1070 if (fAllowToShowActionAbout) 1071 pMenu->addAction(action(UIActionIndex_Simple_About)); 1072 1073 /* Only for Runtime pool: */ 1043 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_About)); 1044 /* 'Preferences' action (only for Runtime pool): */ 1074 1045 if (type() == UIActionPoolType_Runtime) 1075 { 1076 /* 'Preferences' action: */ 1077 const bool fAllowToShowActionPreferences = isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_Preferences); 1078 action(UIActionIndex_Simple_Preferences)->setEnabled(fAllowToShowActionPreferences); 1079 if (fAllowToShowActionPreferences) 1080 pMenu->addAction(action(UIActionIndex_Simple_Preferences)); 1081 } 1046 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Preferences)); 1082 1047 #endif /* !RT_OS_DARWIN */ 1083 1084 1048 1085 1049 /* Mark menu as valid: */ … … 1116 1080 } 1117 1081 1082 bool UIActionPool::addAction(UIMenu *pMenu, UIAction *pAction, bool fReallyAdd /* = true */) 1083 { 1084 /* Check if action is allowed: */ 1085 const bool fIsActionAllowed = pAction->isAllowed(); 1086 1087 #ifdef RT_OS_DARWIN 1088 /* Check if menu is consumable: */ 1089 const bool fIsMenuConsumable = pMenu->isConsumable(); 1090 /* Check if menu is NOT yet consumed: */ 1091 const bool fIsMenuConsumed = pMenu->isConsumed(); 1092 #endif /* RT_OS_DARWIN */ 1093 1094 /* Make this action enabled/visible 1095 * depending on clearance state. */ 1096 pAction->setEnabled(fIsActionAllowed); 1097 pAction->setVisible(fIsActionAllowed); 1098 1099 #ifdef RT_OS_DARWIN 1100 /* If menu is consumable: */ 1101 if (fIsMenuConsumable) 1102 { 1103 /* Add action only if menu was not yet consumed: */ 1104 if (!fIsMenuConsumed) 1105 pMenu->addAction(pAction); 1106 } 1107 /* If menu is NOT consumable: */ 1108 else 1109 #endif /* RT_OS_DARWIN */ 1110 { 1111 /* Add action only if is allowed: */ 1112 if (fIsActionAllowed && fReallyAdd) 1113 pMenu->addAction(pAction); 1114 } 1115 1116 /* Return if action is allowed: */ 1117 return fIsActionAllowed; 1118 } 1119 1120 bool UIActionPool::addMenu(QList<QMenu*> &menuList, UIAction *pAction, bool fReallyAdd /* = true */) 1121 { 1122 /* Check if action is allowed: */ 1123 const bool fIsActionAllowed = pAction->isAllowed(); 1124 1125 /* Get action's menu: */ 1126 UIMenu *pMenu = pAction->menu(); 1127 1128 #ifdef RT_OS_DARWIN 1129 /* Check if menu is consumable: */ 1130 const bool fIsMenuConsumable = pMenu->isConsumable(); 1131 /* Check if menu is NOT yet consumed: */ 1132 const bool fIsMenuConsumed = pMenu->isConsumed(); 1133 #endif /* RT_OS_DARWIN */ 1134 1135 /* Make this action enabled/visible 1136 * depending on clearance state. */ 1137 pAction->setEnabled( fIsActionAllowed 1138 #ifdef RT_OS_DARWIN 1139 && !fIsMenuConsumable 1140 #endif /* RT_OS_DARWIN */ 1141 ); 1142 pAction->setVisible( fIsActionAllowed 1143 #ifdef RT_OS_DARWIN 1144 && !fIsMenuConsumable 1145 #endif /* RT_OS_DARWIN */ 1146 ); 1147 1148 #ifdef RT_OS_DARWIN 1149 /* If menu is consumable: */ 1150 if (fIsMenuConsumable) 1151 { 1152 /* Add action's menu only if menu was not yet consumed: */ 1153 if (!fIsMenuConsumed) 1154 menuList << pMenu; 1155 } 1156 /* If menu is NOT consumable: */ 1157 else 1158 #endif /* RT_OS_DARWIN */ 1159 { 1160 /* Add action only if is allowed: */ 1161 if (fIsActionAllowed && fReallyAdd) 1162 menuList << pMenu; 1163 } 1164 1165 /* Return if action is allowed: */ 1166 return fIsActionAllowed; 1167 } 1168 1118 1169 #include "UIActionPool.moc" 1119 1170 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r52583 r52589 159 159 /** Returns action extra-data key. */ 160 160 virtual QString extraDataKey() const { return QString(); } 161 /** Returns whether action is allowed. */ 162 virtual bool isAllowed() const { return true; } 161 163 162 164 /** Returns extra-data ID to save keyboard shortcut under. */ … … 430 432 virtual bool event(QEvent *pEvent); 431 433 434 /** Adds action into corresponding menu. */ 435 bool addAction(UIMenu *pMenu, UIAction *pAction, bool fReallyAdd = true); 436 /** Adds action's menu into corresponding menu list. */ 437 bool addMenu(QList<QMenu*> &menuList, UIAction *pAction, bool fReallyAdd = true); 438 432 439 /** Holds the action-pool type. */ 433 440 const UIActionPoolType m_type; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r52583 r52589 49 49 /** Returns action extra-data key. */ 50 50 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Machine); } 51 /** Returns whether action is allowed. */ 52 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Machine); } 51 53 52 54 void retranslateUi() … … 71 73 /** Returns action extra-data key. */ 72 74 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog); } 75 /** Returns whether action is allowed. */ 76 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog); } 73 77 74 78 QString shortcutExtraDataID() const … … 104 108 /** Returns action extra-data key. */ 105 109 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot); } 110 /** Returns whether action is allowed. */ 111 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot); } 106 112 107 113 QString shortcutExtraDataID() const … … 137 143 /** Returns action extra-data key. */ 138 144 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeScreenshot); } 145 /** Returns whether action is allowed. */ 146 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeScreenshot); } 139 147 140 148 QString shortcutExtraDataID() const … … 170 178 /** Returns action extra-data key. */ 171 179 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog); } 180 /** Returns whether action is allowed. */ 181 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog); } 172 182 173 183 QString shortcutExtraDataID() const … … 203 213 /** Returns action extra-data key. */ 204 214 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Keyboard); } 215 /** Returns whether action is allowed. */ 216 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Keyboard); } 205 217 206 218 void retranslateUi() … … 225 237 /** Returns action extra-data key. */ 226 238 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_KeyboardSettings); } 239 /** Returns whether action is allowed. */ 240 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_KeyboardSettings); } 227 241 228 242 QString shortcutExtraDataID() const … … 253 267 /** Returns action extra-data key. */ 254 268 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Mouse); } 269 /** Returns whether action is allowed. */ 270 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Mouse); } 255 271 256 272 void retranslateUi() … … 277 293 /** Returns action extra-data key. */ 278 294 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_MouseIntegration); } 295 /** Returns whether action is allowed. */ 296 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_MouseIntegration); } 279 297 280 298 QString shortcutExtraDataID() const … … 310 328 /** Returns action extra-data key. */ 311 329 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TypeCAD); } 330 /** Returns whether action is allowed. */ 331 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TypeCAD); } 312 332 313 333 QString shortcutExtraDataID() const … … 344 364 /** Returns action extra-data key. */ 345 365 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TypeCABS); } 366 /** Returns whether action is allowed. */ 367 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TypeCABS); } 346 368 347 369 QString shortcutExtraDataID() const … … 380 402 /** Returns action extra-data key. */ 381 403 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause); } 404 /** Returns whether action is allowed. */ 405 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause); } 382 406 383 407 QString shortcutExtraDataID() const … … 413 437 /** Returns action extra-data key. */ 414 438 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset); } 439 /** Returns whether action is allowed. */ 440 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset); } 415 441 416 442 QString shortcutExtraDataID() const … … 446 472 /** Returns action extra-data key. */ 447 473 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState); } 474 /** Returns whether action is allowed. */ 475 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState); } 448 476 449 477 QString shortcutExtraDataID() const … … 474 502 /** Returns action extra-data key. */ 475 503 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown); } 504 /** Returns whether action is allowed. */ 505 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown); } 476 506 477 507 QString shortcutExtraDataID() const … … 511 541 /** Returns action extra-data key. */ 512 542 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff); } 543 /** Returns whether action is allowed. */ 544 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff); } 513 545 514 546 QString shortcutExtraDataID() const … … 543 575 /** Returns action extra-data key. */ 544 576 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close);} 577 /** Returns whether action is allowed. */ 578 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close); } 545 579 546 580 QString shortcutExtraDataID() const … … 577 611 /** Returns action extra-data key. */ 578 612 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_View); } 613 /** Returns whether action is allowed. */ 614 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_View); } 579 615 580 616 void retranslateUi() … … 599 635 /** Returns action extra-data key. */ 600 636 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_View); } 637 /** Returns whether action is allowed. */ 638 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_View); } 601 639 602 640 void retranslateUi() {} … … 620 658 /** Returns action extra-data key. */ 621 659 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen); } 660 /** Returns whether action is allowed. */ 661 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen); } 622 662 623 663 QString shortcutExtraDataID() const … … 655 695 /** Returns action extra-data key. */ 656 696 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless); } 697 /** Returns whether action is allowed. */ 698 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless); } 657 699 658 700 QString shortcutExtraDataID() const … … 690 732 /** Returns action extra-data key. */ 691 733 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale); } 734 /** Returns whether action is allowed. */ 735 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale); } 692 736 693 737 QString shortcutExtraDataID() const … … 725 769 /** Returns action extra-data key. */ 726 770 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize); } 771 /** Returns whether action is allowed. */ 772 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize); } 727 773 728 774 QString shortcutExtraDataID() const … … 758 804 /** Returns action extra-data key. */ 759 805 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); } 806 /** Returns whether action is allowed. */ 807 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); } 760 808 761 809 QString shortcutExtraDataID() const … … 791 839 /** Returns action extra-data key. */ 792 840 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar); } 841 /** Returns whether action is allowed. */ 842 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar); } 793 843 794 844 void retranslateUi() … … 813 863 /** Returns action extra-data key. */ 814 864 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings); } 865 /** Returns whether action is allowed. */ 866 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings); } 815 867 816 868 QString shortcutExtraDataID() const … … 841 893 /** Returns action extra-data key. */ 842 894 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar); } 895 /** Returns whether action is allowed. */ 896 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar); } 843 897 844 898 void retranslateUi() … … 863 917 /** Returns action extra-data key. */ 864 918 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings); } 919 /** Returns whether action is allowed. */ 920 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings); } 865 921 866 922 QString shortcutExtraDataID() const … … 892 948 /** Returns action extra-data key. */ 893 949 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar); } 950 /** Returns whether action is allowed. */ 951 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar); } 894 952 895 953 QString shortcutExtraDataID() const … … 920 978 /** Returns action extra-data key. */ 921 979 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Devices); } 980 /** Returns whether action is allowed. */ 981 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Devices); } 922 982 923 983 void retranslateUi() … … 945 1005 /** Returns action extra-data key. */ 946 1006 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives); } 1007 /** Returns whether action is allowed. */ 1008 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives); } 947 1009 948 1010 void retranslateUi() … … 967 1029 /** Returns action extra-data key. */ 968 1030 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings); } 1031 /** Returns whether action is allowed. */ 1032 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings); } 969 1033 970 1034 QString shortcutExtraDataID() const … … 998 1062 /** Returns action extra-data key. */ 999 1063 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices); } 1064 /** Returns whether action is allowed. */ 1065 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices); } 1000 1066 1001 1067 void retranslateUi() … … 1023 1089 /** Returns action extra-data key. */ 1024 1090 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices); } 1091 /** Returns whether action is allowed. */ 1092 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices); } 1025 1093 1026 1094 void retranslateUi() … … 1045 1113 /** Returns action extra-data key. */ 1046 1114 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network); } 1115 /** Returns whether action is allowed. */ 1116 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network); } 1047 1117 1048 1118 void retranslateUi() … … 1067 1137 /** Returns action extra-data key. */ 1068 1138 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings); } 1139 /** Returns whether action is allowed. */ 1140 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings); } 1069 1141 1070 1142 QString shortcutExtraDataID() const … … 1098 1170 /** Returns action extra-data key. */ 1099 1171 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices); } 1172 /** Returns whether action is allowed. */ 1173 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices); } 1100 1174 1101 1175 void retranslateUi() … … 1120 1194 /** Returns action extra-data key. */ 1121 1195 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings); } 1196 /** Returns whether action is allowed. */ 1197 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings); } 1122 1198 1123 1199 QString shortcutExtraDataID() const … … 1151 1227 /** Returns action extra-data key. */ 1152 1228 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams); } 1229 /** Returns whether action is allowed. */ 1230 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams); } 1153 1231 1154 1232 void retranslateUi() … … 1173 1251 /** Returns action extra-data key. */ 1174 1252 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard); } 1253 /** Returns whether action is allowed. */ 1254 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard); } 1175 1255 1176 1256 void retranslateUi() … … 1195 1275 /** Returns action extra-data key. */ 1196 1276 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop); } 1277 /** Returns whether action is allowed. */ 1278 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop); } 1197 1279 1198 1280 void retranslateUi() … … 1217 1299 /** Returns action extra-data key. */ 1218 1300 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders); } 1301 /** Returns whether action is allowed. */ 1302 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders); } 1219 1303 1220 1304 void retranslateUi() … … 1239 1323 /** Returns action extra-data key. */ 1240 1324 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings); } 1325 /** Returns whether action is allowed. */ 1326 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings); } 1241 1327 1242 1328 QString shortcutExtraDataID() const … … 1269 1355 /** Returns action extra-data key. */ 1270 1356 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VRDEServer); } 1357 /** Returns whether action is allowed. */ 1358 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VRDEServer); } 1271 1359 1272 1360 QString shortcutExtraDataID() const … … 1297 1385 /** Returns action extra-data key. */ 1298 1386 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VideoCapture); } 1387 /** Returns whether action is allowed. */ 1388 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VideoCapture); } 1299 1389 1300 1390 void retranslateUi() … … 1321 1411 /** Returns action extra-data key. */ 1322 1412 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_StartVideoCapture); } 1413 /** Returns whether action is allowed. */ 1414 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_StartVideoCapture); } 1323 1415 1324 1416 QString shortcutExtraDataID() const … … 1349 1441 /** Returns action extra-data key. */ 1350 1442 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VideoCaptureSettings); } 1443 /** Returns whether action is allowed. */ 1444 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VideoCaptureSettings); } 1351 1445 1352 1446 QString shortcutExtraDataID() const … … 1377 1471 /** Returns action extra-data key. */ 1378 1472 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InstallGuestTools); } 1473 /** Returns whether action is allowed. */ 1474 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InstallGuestTools); } 1379 1475 1380 1476 QString shortcutExtraDataID() const … … 1411 1507 /** Returns action extra-data key. */ 1412 1508 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Debug); } 1509 /** Returns whether action is allowed. */ 1510 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Debug); } 1413 1511 1414 1512 void retranslateUi() … … 1433 1531 /** Returns action extra-data key. */ 1434 1532 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics); } 1533 /** Returns whether action is allowed. */ 1534 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics); } 1435 1535 1436 1536 QString shortcutExtraDataID() const … … 1460 1560 /** Returns action extra-data key. */ 1461 1561 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine); } 1562 /** Returns whether action is allowed. */ 1563 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine); } 1462 1564 1463 1565 QString shortcutExtraDataID() const … … 1487 1589 /** Returns action extra-data key. */ 1488 1590 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging); } 1591 /** Returns whether action is allowed. */ 1592 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging); } 1489 1593 1490 1594 QString shortcutExtraDataID() const … … 1514 1618 /** Returns action extra-data key. */ 1515 1619 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog); } 1620 /** Returns whether action is allowed. */ 1621 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog); } 1516 1622 1517 1623 QString shortcutExtraDataID() const … … 1989 2095 #ifdef RT_OS_DARWIN 1990 2096 /* 'Application' menu: */ 1991 action(UIActionIndex_M_Application)->setVisible(false); 1992 m_mainMenus << action(UIActionIndex_M_Application)->menu(); 2097 addMenu(m_mainMenus, action(UIActionIndex_M_Application)); 1993 2098 updateMenuApplication(); 1994 2099 #endif /* RT_OS_DARWIN */ 1995 2100 1996 2101 /* 'Machine' menu: */ 1997 const bool fAllowToShowMenuMachine = isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Machine); 1998 action(UIActionIndexRT_M_Machine)->setVisible(fAllowToShowMenuMachine); 1999 if (fAllowToShowMenuMachine) 2000 m_mainMenus << action(UIActionIndexRT_M_Machine)->menu(); 2102 addMenu(m_mainMenus, action(UIActionIndexRT_M_Machine)); 2001 2103 updateMenuMachine(); 2002 2104 2003 2105 /* 'View' menu: */ 2004 const bool fAllowToShowMenuView = isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_View); 2005 action(UIActionIndexRT_M_View)->setVisible(fAllowToShowMenuView); 2006 action(UIActionIndexRT_M_ViewPopup)->setVisible(fAllowToShowMenuView); 2007 if (fAllowToShowMenuView) 2008 m_mainMenus << action(UIActionIndexRT_M_View)->menu(); 2106 addMenu(m_mainMenus, action(UIActionIndexRT_M_View)); 2009 2107 updateMenuView(); 2108 /* 'View' popup menu: */ 2109 addMenu(m_mainMenus, action(UIActionIndexRT_M_ViewPopup), false); 2010 2110 updateMenuViewPopup(); 2011 2111 2012 2112 /* 'Devices' menu: */ 2013 const bool fAllowToShowMenuDevices = isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Devices); 2014 action(UIActionIndexRT_M_Devices)->setVisible(fAllowToShowMenuDevices); 2015 if (fAllowToShowMenuDevices) 2016 m_mainMenus << action(UIActionIndexRT_M_Devices)->menu(); 2113 addMenu(m_mainMenus, action(UIActionIndexRT_M_Devices)); 2017 2114 updateMenuDevices(); 2018 2115 2019 2116 #ifdef VBOX_WITH_DEBUGGER_GUI 2020 2117 /* 'Debug' menu: */ 2021 const bool fAllowToShowMenuDebug = isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Debug); 2022 action(UIActionIndexRT_M_Debug)->setVisible(fAllowToShowMenuDebug); 2023 if (fAllowToShowMenuDebug) 2024 m_mainMenus << action(UIActionIndexRT_M_Debug)->menu(); 2118 addMenu(m_mainMenus, action(UIActionIndexRT_M_Debug)); 2025 2119 updateMenuDebug(); 2026 2120 #endif /* VBOX_WITH_DEBUGGER_GUI */ 2027 2121 2028 2122 /* 'Help' menu: */ 2029 const bool fAllowToShowMenuHelp = isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Help); 2030 action(UIActionIndex_Menu_Help)->setVisible(fAllowToShowMenuHelp); 2031 if (fAllowToShowMenuHelp) 2032 m_mainMenus << action(UIActionIndex_Menu_Help)->menu(); 2123 addMenu(m_mainMenus, action(UIActionIndex_Menu_Help)); 2033 2124 updateMenuHelp(); 2034 2125 } … … 2037 2128 { 2038 2129 /* Get corresponding menu: */ 2039 QMenu *pMenu = action(UIActionIndexRT_M_Machine)->menu();2130 UIMenu *pMenu = action(UIActionIndexRT_M_Machine)->menu(); 2040 2131 AssertPtrReturnVoid(pMenu); 2041 2132 /* Clear contents: */ 2042 2133 pMenu->clear(); 2043 2134 2044 2045 2135 /* Separator: */ 2046 2136 bool fSeparator = false; 2047 2137 2048 2049 2138 /* 'Settings Dialog' action: */ 2050 const bool fAllowToShowActionSettingsDialog = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog); 2051 action(UIActionIndexRT_M_Machine_S_Settings)->setEnabled(fAllowToShowActionSettingsDialog); 2052 if (fAllowToShowActionSettingsDialog) 2053 { 2054 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_Settings)); 2055 fSeparator = true; 2056 } 2057 2139 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Settings)) || fSeparator; 2058 2140 /* 'Take Snapshot' action: */ 2059 const bool fAllowToShowActionTakeSnapshot = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot); 2060 action(UIActionIndexRT_M_Machine_S_TakeSnapshot)->setEnabled(fAllowToShowActionTakeSnapshot); 2061 if (fAllowToShowActionTakeSnapshot) 2062 { 2063 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_TakeSnapshot)); 2064 fSeparator = true; 2065 } 2066 2141 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_TakeSnapshot)) || fSeparator; 2067 2142 /* 'Take Screenshot' action: */ 2068 const bool fAllowToShowActionTakeScreenshot = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeScreenshot); 2069 action(UIActionIndexRT_M_Machine_S_TakeScreenshot)->setEnabled(fAllowToShowActionTakeScreenshot); 2070 if (fAllowToShowActionTakeScreenshot) 2071 { 2072 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_TakeScreenshot)); 2073 fSeparator = true; 2074 } 2075 2143 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_TakeScreenshot)) || fSeparator; 2076 2144 /* 'Information Dialog' action: */ 2077 const bool fAllowToShowActionInformationDialog = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog); 2078 action(UIActionIndexRT_M_Machine_S_ShowInformation)->setEnabled(fAllowToShowActionInformationDialog); 2079 if (fAllowToShowActionInformationDialog) 2080 { 2081 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_ShowInformation)); 2082 fSeparator = true; 2083 } 2084 2145 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowInformation)) || fSeparator; 2085 2146 2086 2147 /* Separator: */ … … 2091 2152 } 2092 2153 2093 2094 2154 /* 'Keyboard' submenu: */ 2095 const bool fAllowToShowActionKeyboard = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Keyboard); 2096 action(UIActionIndexRT_M_Machine_M_Keyboard)->setEnabled(fAllowToShowActionKeyboard); 2097 if (fAllowToShowActionKeyboard) 2098 { 2099 // pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Keyboard)); 2100 // fSeparator = true; 2101 } 2155 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_M_Keyboard), false) || fSeparator; 2102 2156 updateMenuMachineKeyboard(); 2103 2104 2157 /* 'Keyboard Settings' action: */ 2105 const bool fAllowToShowActionKeyboardSettings = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_KeyboardSettings); 2106 action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings)->setEnabled(fAllowToShowActionKeyboardSettings); 2107 if (fAllowToShowActionKeyboardSettings) 2108 { 2109 pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings)); 2110 fSeparator = true; 2111 } 2112 2158 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings)) || fSeparator; 2113 2159 /* 'Mouse' submenu: */ 2114 const bool fAllowToShowActionMouse = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Mouse); 2115 action(UIActionIndexRT_M_Machine_M_Mouse)->setEnabled(fAllowToShowActionMouse); 2116 if (fAllowToShowActionMouse) 2117 { 2118 // pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Mouse)); 2119 // fSeparator = true; 2120 } 2160 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_M_Mouse), false) || fSeparator; 2121 2161 updateMenuMachineMouse(); 2122 2123 2162 /* 'Mouse Integration' action: */ 2124 const bool fAllowToShowActionMouseIntegration = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_MouseIntegration); 2125 action(UIActionIndexRT_M_Machine_M_Mouse_T_Integration)->setEnabled(fAllowToShowActionMouseIntegration); 2126 if (fAllowToShowActionMouseIntegration) 2127 { 2128 pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Mouse_T_Integration)); 2129 fSeparator = true; 2130 } 2131 2163 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_M_Mouse_T_Integration)) || fSeparator; 2132 2164 2133 2165 /* Separator: */ … … 2138 2170 } 2139 2171 2140 2141 2172 /* 'Type CAD' action: */ 2142 const bool fAllowToShowActionTypeCAD = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TypeCAD); 2143 action(UIActionIndexRT_M_Machine_S_TypeCAD)->setEnabled(fAllowToShowActionTypeCAD); 2144 if (fAllowToShowActionTypeCAD) 2145 { 2146 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_TypeCAD)); 2147 fSeparator = true; 2148 } 2149 2173 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_TypeCAD)) || fSeparator; 2150 2174 #ifdef Q_WS_X11 2151 2175 /* 'Type CABS' action: */ 2152 const bool fAllowToShowActionTypeCABS = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TypeCABS); 2153 action(UIActionIndexRT_M_Machine_S_TypeCABS)->setEnabled(fAllowToShowActionTypeCABS); 2154 if (fAllowToShowActionTypeCABS) 2155 { 2156 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_TypeCABS)); 2157 fSeparator = true; 2158 } 2176 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_TypeCABS)) || fSeparator; 2159 2177 #endif /* Q_WS_X11 */ 2160 2161 2178 2162 2179 /* Separator: */ … … 2167 2184 } 2168 2185 2169 2170 2186 /* 'Pause' action: */ 2171 const bool fAllowToShowActionPause = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause); 2172 action(UIActionIndexRT_M_Machine_T_Pause)->setEnabled(fAllowToShowActionPause); 2173 if (fAllowToShowActionPause) 2174 { 2175 pMenu->addAction(action(UIActionIndexRT_M_Machine_T_Pause)); 2176 fSeparator = true; 2177 } 2178 2187 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_T_Pause)) || fSeparator; 2179 2188 /* 'Reset' action: */ 2180 const bool fAllowToShowActionReset = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset); 2181 action(UIActionIndexRT_M_Machine_S_Reset)->setEnabled(fAllowToShowActionReset); 2182 if (fAllowToShowActionReset) 2183 { 2184 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_Reset)); 2185 fSeparator = true; 2186 } 2187 2189 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Reset)) || fSeparator; 2188 2190 /* 'Save' action: */ 2189 const bool fAllowToShowActionSaveState = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState); 2190 action(UIActionIndexRT_M_Machine_S_Save)->setEnabled(fAllowToShowActionSaveState); 2191 if (fAllowToShowActionSaveState) 2192 { 2193 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_Save)); 2194 fSeparator = true; 2195 } 2196 2191 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Save)) || fSeparator; 2197 2192 /* 'Shutdown' action: */ 2198 const bool fAllowToShowActionShutdown = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown); 2199 action(UIActionIndexRT_M_Machine_S_Shutdown)->setEnabled(fAllowToShowActionShutdown); 2200 if (fAllowToShowActionShutdown) 2201 { 2202 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_Shutdown)); 2203 fSeparator = true; 2204 } 2205 2193 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Shutdown)) || fSeparator; 2206 2194 /* 'PowerOff' action: */ 2207 const bool fAllowToShowActionPowerOff = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff); 2208 action(UIActionIndexRT_M_Machine_S_PowerOff)->setEnabled(fAllowToShowActionPowerOff); 2209 if (fAllowToShowActionPowerOff) 2210 { 2211 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_PowerOff)); 2212 fSeparator = true; 2213 } 2214 2195 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_PowerOff)) || fSeparator; 2215 2196 2216 2197 #ifndef Q_WS_MAC … … 2222 2203 } 2223 2204 2224 2225 /* Close action: */ 2226 const bool fAllowToShowActionClose = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close); 2227 pMenu->addAction(action(UIActionIndexRT_M_Machine_S_Close)); 2228 action(UIActionIndexRT_M_Machine_S_Close)->setEnabled(fAllowToShowActionClose); 2205 /* 'Close' action: */ 2206 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Close)) || fSeparator; 2229 2207 #endif /* !Q_WS_MAC */ 2230 2231 2208 2232 2209 /* Mark menu as valid: */ … … 2237 2214 { 2238 2215 /* Get corresponding menu: */ 2239 QMenu *pMenu = action(UIActionIndexRT_M_Machine_M_Keyboard)->menu();2216 UIMenu *pMenu = action(UIActionIndexRT_M_Machine_M_Keyboard)->menu(); 2240 2217 AssertPtrReturnVoid(pMenu); 2241 2218 /* Clear contents: */ … … 2243 2220 2244 2221 /* 'Keyboard Settings' action: */ 2245 const bool fAllowToShowActionKeyboardSettings = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_KeyboardSettings); 2246 action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings)->setEnabled(fAllowToShowActionKeyboardSettings); 2247 if (fAllowToShowActionKeyboardSettings) 2248 pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings)); 2222 addAction(pMenu, action(UIActionIndexRT_M_Machine_M_Keyboard_S_Settings)); 2249 2223 2250 2224 /* Mark menu as valid: */ … … 2255 2229 { 2256 2230 /* Get corresponding menu: */ 2257 QMenu *pMenu = action(UIActionIndexRT_M_Machine_M_Mouse)->menu();2231 UIMenu *pMenu = action(UIActionIndexRT_M_Machine_M_Mouse)->menu(); 2258 2232 AssertPtrReturnVoid(pMenu); 2259 2233 /* Clear contents: */ … … 2261 2235 2262 2236 /* 'Machine Integration' action: */ 2263 const bool fAllowToShowActionMouseIntegration = isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_MouseIntegration); 2264 action(UIActionIndexRT_M_Machine_M_Mouse_T_Integration)->setEnabled(fAllowToShowActionMouseIntegration); 2265 if (fAllowToShowActionMouseIntegration) 2266 pMenu->addAction(action(UIActionIndexRT_M_Machine_M_Mouse_T_Integration)); 2237 addAction(pMenu, action(UIActionIndexRT_M_Machine_M_Mouse_T_Integration)); 2267 2238 2268 2239 /* Mark menu as valid: */ … … 2273 2244 { 2274 2245 /* Get corresponding menu: */ 2275 QMenu *pMenu = action(UIActionIndexRT_M_View)->menu();2246 UIMenu *pMenu = action(UIActionIndexRT_M_View)->menu(); 2276 2247 AssertPtrReturnVoid(pMenu); 2277 2248 /* Clear contents: */ 2278 2249 pMenu->clear(); 2279 2250 2280 2281 2251 /* Separator: */ 2282 2252 bool fSeparator = false; 2283 2253 2284 2285 2254 /* 'Fullscreen' action: */ 2286 const bool fIsAllowToShowActionFullscreen = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen); 2287 action(UIActionIndexRT_M_View_T_Fullscreen)->setEnabled(fIsAllowToShowActionFullscreen); 2288 if (fIsAllowToShowActionFullscreen) 2289 { 2290 pMenu->addAction(action(UIActionIndexRT_M_View_T_Fullscreen)); 2291 fSeparator = true; 2292 } 2293 2255 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_Fullscreen)) || fSeparator; 2294 2256 /* 'Seamless' action: */ 2295 const bool fIsAllowToShowActionSeamless = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless); 2296 action(UIActionIndexRT_M_View_T_Seamless)->setEnabled(fIsAllowToShowActionSeamless); 2297 if (fIsAllowToShowActionSeamless) 2298 { 2299 pMenu->addAction(action(UIActionIndexRT_M_View_T_Seamless)); 2300 fSeparator = true; 2301 } 2302 2257 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_Seamless)) || fSeparator; 2303 2258 /* 'Scale' action: */ 2304 const bool fIsAllowToShowActionScale = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale); 2305 action(UIActionIndexRT_M_View_T_Scale)->setEnabled(fIsAllowToShowActionScale); 2306 if (fIsAllowToShowActionScale) 2307 { 2308 pMenu->addAction(action(UIActionIndexRT_M_View_T_Scale)); 2309 fSeparator = true; 2310 } 2311 2259 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_Scale)) || fSeparator; 2312 2260 2313 2261 /* Separator: */ … … 2318 2266 } 2319 2267 2320 2321 2268 /* 'Adjust Window' action: */ 2322 const bool fAllowToShowActionAdjustWindow = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); 2323 action(UIActionIndexRT_M_View_S_AdjustWindow)->setEnabled(fAllowToShowActionAdjustWindow); 2324 if (fAllowToShowActionAdjustWindow) 2325 { 2326 pMenu->addAction(action(UIActionIndexRT_M_View_S_AdjustWindow)); 2327 fSeparator = true; 2328 } 2329 2269 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_S_AdjustWindow)) || fSeparator; 2330 2270 /* 'Guest Autoresize' action: */ 2331 const bool fAllowToShowActionGuestAutoresize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize); 2332 action(UIActionIndexRT_M_View_T_GuestAutoresize)->setEnabled(fAllowToShowActionGuestAutoresize); 2333 if (fAllowToShowActionGuestAutoresize) 2334 { 2335 pMenu->addAction(action(UIActionIndexRT_M_View_T_GuestAutoresize)); 2336 fSeparator = true; 2337 } 2338 2271 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_GuestAutoresize)) || fSeparator; 2339 2272 2340 2273 /* Separator: */ … … 2345 2278 } 2346 2279 2347 2348 2280 /* 'Menu Bar' submenu: */ 2349 const bool fAllowToShowActionMenuBar = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar); 2350 action(UIActionIndexRT_M_View_M_MenuBar)->setEnabled(fAllowToShowActionMenuBar); 2351 if (fAllowToShowActionMenuBar) 2352 { 2353 pMenu->addAction(action(UIActionIndexRT_M_View_M_MenuBar)); 2354 fSeparator = true; 2355 } 2281 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_M_MenuBar)) || fSeparator; 2356 2282 updateMenuViewMenuBar(); 2357 2358 2283 /* 'Status Bar' submenu: */ 2359 const bool fAllowToShowActionStatusBar = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar); 2360 action(UIActionIndexRT_M_View_M_StatusBar)->setEnabled(fAllowToShowActionStatusBar); 2361 if (fAllowToShowActionStatusBar) 2362 { 2363 pMenu->addAction(action(UIActionIndexRT_M_View_M_StatusBar)); 2364 fSeparator = true; 2365 } 2284 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_M_StatusBar)) || fSeparator; 2366 2285 updateMenuViewStatusBar(); 2367 2368 2286 2369 2287 /* Separator: */ … … 2373 2291 fSeparator = false; 2374 2292 } 2375 2376 2293 2377 2294 /* Do we have to show resize or multiscreen menu? */ … … 2405 2322 } 2406 2323 2407 2408 2324 /* Mark menu as valid: */ 2409 2325 m_invalidations.remove(UIActionIndexRT_M_View); … … 2413 2329 { 2414 2330 /* Get corresponding menu: */ 2415 QMenu *pMenu = action(UIActionIndexRT_M_ViewPopup)->menu();2331 UIMenu *pMenu = action(UIActionIndexRT_M_ViewPopup)->menu(); 2416 2332 AssertPtrReturnVoid(pMenu); 2417 2333 /* Clear contents: */ 2418 2334 pMenu->clear(); 2419 2335 2420 2421 2336 /* Separator: */ 2422 2337 bool fSeparator = false; 2423 2338 2424 2425 2339 /* 'Adjust Window' action: */ 2426 const bool fAllowToShowActionAdjustWindow = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); 2427 action(UIActionIndexRT_M_View_S_AdjustWindow)->setEnabled(fAllowToShowActionAdjustWindow); 2428 if (fAllowToShowActionAdjustWindow) 2429 { 2430 pMenu->addAction(action(UIActionIndexRT_M_View_S_AdjustWindow)); 2431 fSeparator = true; 2432 } 2433 2340 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_S_AdjustWindow)) || fSeparator; 2434 2341 /* 'Guest Autoresize' action: */ 2435 const bool fAllowToShowActionGuestAutoresize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize); 2436 action(UIActionIndexRT_M_View_T_GuestAutoresize)->setEnabled(fAllowToShowActionGuestAutoresize); 2437 if (fAllowToShowActionGuestAutoresize) 2438 { 2439 pMenu->addAction(action(UIActionIndexRT_M_View_T_GuestAutoresize)); 2440 fSeparator = true; 2441 } 2442 2342 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_GuestAutoresize)) || fSeparator; 2443 2343 2444 2344 /* Separator: */ … … 2448 2348 fSeparator = false; 2449 2349 } 2450 2451 2350 2452 2351 /* Do we have to show resize menu? */ … … 2464 2363 } 2465 2364 2466 2467 2365 /* Mark menu as valid: */ 2468 2366 m_invalidations.remove(UIActionIndexRT_M_ViewPopup); … … 2472 2370 { 2473 2371 /* Get corresponding menu: */ 2474 QMenu *pMenu = action(UIActionIndexRT_M_View_M_MenuBar)->menu();2372 UIMenu *pMenu = action(UIActionIndexRT_M_View_M_MenuBar)->menu(); 2475 2373 AssertPtrReturnVoid(pMenu); 2476 2374 /* Clear contents: */ … … 2478 2376 2479 2377 /* 'Menu Bar Settings' action: */ 2480 const bool fAllowToShowActionMenuBarSettings = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings); 2481 action(UIActionIndexRT_M_View_M_MenuBar_S_Settings)->setEnabled(fAllowToShowActionMenuBarSettings); 2482 if (fAllowToShowActionMenuBarSettings) 2483 pMenu->addAction(action(UIActionIndexRT_M_View_M_MenuBar_S_Settings)); 2378 addAction(pMenu, action(UIActionIndexRT_M_View_M_MenuBar_S_Settings)); 2484 2379 2485 2380 /* Mark menu as valid: */ … … 2490 2385 { 2491 2386 /* Get corresponding menu: */ 2492 QMenu *pMenu = action(UIActionIndexRT_M_View_M_StatusBar)->menu();2387 UIMenu *pMenu = action(UIActionIndexRT_M_View_M_StatusBar)->menu(); 2493 2388 AssertPtrReturnVoid(pMenu); 2494 2389 /* Clear contents: */ … … 2496 2391 2497 2392 /* 'Status Bar Settings' action: */ 2498 const bool fAllowToShowActionStatusBarSettings = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings); 2499 action(UIActionIndexRT_M_View_M_StatusBar_S_Settings)->setEnabled(fAllowToShowActionStatusBarSettings); 2500 if (fAllowToShowActionStatusBarSettings) 2501 pMenu->addAction(action(UIActionIndexRT_M_View_M_StatusBar_S_Settings)); 2502 2393 addAction(pMenu, action(UIActionIndexRT_M_View_M_StatusBar_S_Settings)); 2503 2394 /* 'Toggle Status Bar' action: */ 2504 const bool fAllowToShowActionToggleStatusBar = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar); 2505 action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility)->setEnabled(fAllowToShowActionToggleStatusBar); 2506 if (fAllowToShowActionToggleStatusBar) 2507 pMenu->addAction(action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility)); 2395 addAction(pMenu, action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility)); 2508 2396 2509 2397 /* Mark menu as valid: */ … … 2578 2466 if (screenSize.width() == size.width() && 2579 2467 screenSize.height() == size.height()) 2580 {2581 2468 pAction->setChecked(true); 2582 }2583 2469 } 2584 2470 } … … 2633 2519 { 2634 2520 /* Get corresponding menu: */ 2635 QMenu *pMenu = action(UIActionIndexRT_M_Devices)->menu();2521 UIMenu *pMenu = action(UIActionIndexRT_M_Devices)->menu(); 2636 2522 AssertPtrReturnVoid(pMenu); 2637 2523 /* Clear contents: */ 2638 2524 pMenu->clear(); 2639 2525 2640 2641 2526 /* Separator: */ 2642 2527 bool fSeparator = false; 2643 2528 2644 2645 2529 /* 'Hard Drives' submenu: */ 2646 const bool fAllowToShowActionHardDrives = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives); 2647 action(UIActionIndexRT_M_Devices_M_HardDrives)->setEnabled(fAllowToShowActionHardDrives); 2648 if (fAllowToShowActionHardDrives) 2649 { 2650 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_HardDrives)); 2651 fSeparator = true; 2652 } 2530 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_HardDrives)) || fSeparator; 2653 2531 updateMenuDevicesHardDrives(); 2654 2655 2532 /* 'Optical Devices' submenu: */ 2656 const bool fAllowToShowActionOpticalDevices = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices); 2657 action(UIActionIndexRT_M_Devices_M_OpticalDevices)->setEnabled(fAllowToShowActionOpticalDevices); 2658 if (fAllowToShowActionOpticalDevices) 2659 { 2660 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_OpticalDevices)); 2661 fSeparator = true; 2662 } 2663 2533 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_OpticalDevices)) || fSeparator; 2664 2534 /* 'Floppy Devices' submenu: */ 2665 const bool fAllowToShowActionFloppyDevices = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices); 2666 action(UIActionIndexRT_M_Devices_M_FloppyDevices)->setEnabled(fAllowToShowActionFloppyDevices); 2667 if (fAllowToShowActionFloppyDevices) 2668 { 2669 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_FloppyDevices)); 2670 fSeparator = true; 2671 } 2672 2535 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_FloppyDevices)) || fSeparator; 2673 2536 /* 'Network' submenu: */ 2674 const bool fAllowToShowActionNetwork = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network); 2675 action(UIActionIndexRT_M_Devices_M_Network)->setEnabled(fAllowToShowActionNetwork); 2676 if (fAllowToShowActionNetwork) 2677 { 2678 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_Network)); 2679 fSeparator = true; 2680 } 2537 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Network)) || fSeparator; 2681 2538 updateMenuDevicesNetwork(); 2682 2683 2539 /* 'USB Devices' submenu: */ 2684 const bool fAllowToShowActionUSBDevices = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices); 2685 action(UIActionIndexRT_M_Devices_M_USBDevices)->setEnabled(fAllowToShowActionUSBDevices); 2686 if (fAllowToShowActionUSBDevices) 2687 { 2688 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_USBDevices)); 2689 fSeparator = true; 2690 } 2540 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_USBDevices)) || fSeparator; 2691 2541 updateMenuDevicesUSBDevices(); 2692 2693 2542 /* 'Web Cams' submenu: */ 2694 const bool fAllowToShowActionWebCams = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams); 2695 action(UIActionIndexRT_M_Devices_M_WebCams)->setEnabled(fAllowToShowActionWebCams); 2696 if (fAllowToShowActionWebCams) 2697 { 2698 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_WebCams)); 2699 fSeparator = true; 2700 } 2701 2543 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_WebCams)) || fSeparator; 2702 2544 /* 'Shared Clipboard' submenu: */ 2703 const bool fAllowToShowActionSharedClipboard = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard); 2704 action(UIActionIndexRT_M_Devices_M_SharedClipboard)->setEnabled(fAllowToShowActionSharedClipboard); 2705 if (fAllowToShowActionSharedClipboard) 2706 { 2707 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_SharedClipboard)); 2708 fSeparator = true; 2709 } 2710 2545 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_SharedClipboard)) || fSeparator; 2711 2546 /* 'Drag&Drop' submenu: */ 2712 const bool fAllowToShowActionDragAndDrop = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop); 2713 action(UIActionIndexRT_M_Devices_M_DragAndDrop)->setEnabled(fAllowToShowActionDragAndDrop); 2714 if (fAllowToShowActionDragAndDrop) 2715 { 2716 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_DragAndDrop)); 2717 fSeparator = true; 2718 } 2719 2547 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_DragAndDrop)) || fSeparator; 2720 2548 /* 'Shared Folders' submenu: */ 2721 const bool fAllowToShowActionSharedFolders = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders); 2722 action(UIActionIndexRT_M_Devices_M_SharedFolders)->setEnabled(fAllowToShowActionSharedFolders); 2723 if (fAllowToShowActionSharedFolders) 2724 { 2725 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_SharedFolders)); 2726 fSeparator = true; 2727 } 2549 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_SharedFolders)) || fSeparator; 2728 2550 updateMenuDevicesSharedFolders(); 2729 2730 2551 2731 2552 /* Separator: */ … … 2736 2557 } 2737 2558 2738 2739 2559 /* 'VRDE Server' action: */ 2740 const bool fAllowToShowActionVRDEServer = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VRDEServer); 2741 action(UIActionIndexRT_M_Devices_T_VRDEServer)->setEnabled(fAllowToShowActionVRDEServer); 2742 if (fAllowToShowActionVRDEServer) 2743 { 2744 pMenu->addAction(action(UIActionIndexRT_M_Devices_T_VRDEServer)); 2745 fSeparator = true; 2746 } 2747 2748 /* 'Video Capture' action: */ 2749 const bool fAllowToShowActionVideoCapture = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_StartVideoCapture); 2750 action(UIActionIndexRT_M_Devices_M_VideoCapture_T_Start)->setEnabled(fAllowToShowActionVideoCapture); 2751 if (fAllowToShowActionVideoCapture) 2752 { 2753 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_VideoCapture_T_Start)); 2754 fSeparator = true; 2755 } 2560 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_T_VRDEServer)) || fSeparator; 2561 /* 'Video Capture' submenu: */ 2562 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_VideoCapture), false) || fSeparator; 2756 2563 updateMenuDevicesVideoCapture(); 2757 2564 /* 'Video Capture Start' action: */ 2565 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_VideoCapture_T_Start)) || fSeparator; 2758 2566 2759 2567 /* Separator: */ … … 2764 2572 } 2765 2573 2766 2767 2574 /* Install Guest Tools action: */ 2768 const bool fAllowToShowActionInstallGuestTools = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InstallGuestTools); 2769 action(UIActionIndexRT_M_Devices_S_InstallGuestTools)->setEnabled(fAllowToShowActionInstallGuestTools); 2770 if (fAllowToShowActionInstallGuestTools) 2771 pMenu->addAction(action(UIActionIndexRT_M_Devices_S_InstallGuestTools)); 2772 2575 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_S_InstallGuestTools)) || fSeparator; 2773 2576 2774 2577 /* Mark menu as valid: */ … … 2779 2582 { 2780 2583 /* Get corresponding menu: */ 2781 QMenu *pMenu = action(UIActionIndexRT_M_Devices_M_HardDrives)->menu();2584 UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_HardDrives)->menu(); 2782 2585 AssertPtrReturnVoid(pMenu); 2783 2586 /* Clear contents: */ … … 2785 2588 2786 2589 /* 'Hard Drives Settings' action: */ 2787 const bool fAllowToShowActionHardDrivesSettings = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings); 2788 action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings)->setEnabled(fAllowToShowActionHardDrivesSettings); 2789 if (fAllowToShowActionHardDrivesSettings) 2790 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings)); 2590 addAction(pMenu, action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings)); 2791 2591 2792 2592 /* Mark menu as valid: */ … … 2797 2597 { 2798 2598 /* Get corresponding menu: */ 2799 QMenu *pMenu = action(UIActionIndexRT_M_Devices_M_Network)->menu();2599 UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_Network)->menu(); 2800 2600 AssertPtrReturnVoid(pMenu); 2801 2601 /* Clear contents: */ … … 2803 2603 2804 2604 /* 'Network Settings' action: */ 2805 const bool fAllowToShowActionNetworkSettings = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings); 2806 action(UIActionIndexRT_M_Devices_M_Network_S_Settings)->setEnabled(fAllowToShowActionNetworkSettings); 2807 if (fAllowToShowActionNetworkSettings) 2808 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_Network_S_Settings)); 2605 addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Network_S_Settings)); 2606 2607 /* This menu always remains invalid.. */ 2809 2608 } 2810 2609 … … 2812 2611 { 2813 2612 /* Get corresponding menu: */ 2814 QMenu *pMenu = action(UIActionIndexRT_M_Devices_M_USBDevices)->menu();2613 UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_USBDevices)->menu(); 2815 2614 AssertPtrReturnVoid(pMenu); 2816 2615 /* Clear contents: */ … … 2818 2617 2819 2618 /* 'USB Devices Settings' action: */ 2820 const bool fAllowToShowActionUSBDevicesSettings = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings); 2821 action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings)->setEnabled(fAllowToShowActionUSBDevicesSettings); 2822 if (fAllowToShowActionUSBDevicesSettings) 2823 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings)); 2619 addAction(pMenu, action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings)); 2620 2621 /* This menu always remains invalid.. */ 2824 2622 } 2825 2623 … … 2827 2625 { 2828 2626 /* Get corresponding menu: */ 2829 QMenu *pMenu = action(UIActionIndexRT_M_Devices_M_SharedFolders)->menu();2627 UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_SharedFolders)->menu(); 2830 2628 AssertPtrReturnVoid(pMenu); 2831 2629 /* Clear contents: */ … … 2833 2631 2834 2632 /* 'Shared Folders Settings' action: */ 2835 const bool fAllowToShowActionSharedFoldersSettings = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings); 2836 action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings)->setEnabled(fAllowToShowActionSharedFoldersSettings); 2837 if (fAllowToShowActionSharedFoldersSettings) 2838 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings)); 2633 addAction(pMenu, action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings)); 2839 2634 2840 2635 /* Mark menu as valid: */ … … 2845 2640 { 2846 2641 /* Get corresponding menu: */ 2847 QMenu *pMenu = action(UIActionIndexRT_M_Devices_M_VideoCapture)->menu();2642 UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_VideoCapture)->menu(); 2848 2643 AssertPtrReturnVoid(pMenu); 2849 2644 /* Clear contents: */ … … 2851 2646 2852 2647 /* 'Video Capture Settings' action: */ 2853 const bool fAllowToShowActionVideoCaptureSettings = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VideoCaptureSettings); 2854 action(UIActionIndexRT_M_Devices_M_VideoCapture_S_Settings)->setEnabled(fAllowToShowActionVideoCaptureSettings); 2855 if (fAllowToShowActionVideoCaptureSettings) 2856 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_VideoCapture_S_Settings)); 2857 2648 addAction(pMenu, action(UIActionIndexRT_M_Devices_M_VideoCapture_S_Settings)); 2858 2649 /* 'Start Video Capture' action: */ 2859 const bool fAllowToShowActionStartVideoCapture = isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_StartVideoCapture); 2860 action(UIActionIndexRT_M_Devices_M_VideoCapture_S_Settings)->setEnabled(fAllowToShowActionStartVideoCapture); 2861 if (fAllowToShowActionStartVideoCapture) 2862 pMenu->addAction(action(UIActionIndexRT_M_Devices_M_VideoCapture_T_Start)); 2650 addAction(pMenu, action(UIActionIndexRT_M_Devices_M_VideoCapture_S_Settings)); 2863 2651 2864 2652 /* Mark menu as valid: */ … … 2870 2658 { 2871 2659 /* Get corresponding menu: */ 2872 QMenu *pMenu = action(UIActionIndexRT_M_Debug)->menu();2660 UIMenu *pMenu = action(UIActionIndexRT_M_Debug)->menu(); 2873 2661 AssertPtrReturnVoid(pMenu); 2874 2662 /* Clear contents: */ … … 2876 2664 2877 2665 /* 'Statistics' action: */ 2878 const bool fAllowToShowActionStatistics = isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics); 2879 action(UIActionIndexRT_M_Debug_S_ShowStatistics)->setEnabled(fAllowToShowActionStatistics); 2880 if (fAllowToShowActionStatistics) 2881 pMenu->addAction(action(UIActionIndexRT_M_Debug_S_ShowStatistics)); 2882 2666 addAction(pMenu, action(UIActionIndexRT_M_Debug_S_ShowStatistics)); 2883 2667 /* 'Command Line' action: */ 2884 const bool fAllowToShowActionCommandLine = isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine); 2885 action(UIActionIndexRT_M_Debug_S_ShowCommandLine)->setEnabled(fAllowToShowActionCommandLine); 2886 if (fAllowToShowActionCommandLine) 2887 pMenu->addAction(action(UIActionIndexRT_M_Debug_S_ShowCommandLine)); 2888 2668 addAction(pMenu, action(UIActionIndexRT_M_Debug_S_ShowCommandLine)); 2889 2669 /* 'Logging' action: */ 2890 const bool fAllowToShowActionLogging = isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging); 2891 action(UIActionIndexRT_M_Debug_T_Logging)->setEnabled(fAllowToShowActionLogging); 2892 if (fAllowToShowActionLogging) 2893 pMenu->addAction(action(UIActionIndexRT_M_Debug_T_Logging)); 2894 2670 addAction(pMenu, action(UIActionIndexRT_M_Debug_T_Logging)); 2895 2671 /* 'Log Dialog' action: */ 2896 const bool fAllowToShowActionLogDialog = isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_LogDialog); 2897 action(UIActionIndexRT_M_Debug_S_ShowLogDialog)->setEnabled(fAllowToShowActionLogDialog); 2898 if (fAllowToShowActionLogDialog) 2899 pMenu->addAction(action(UIActionIndexRT_M_Debug_S_ShowLogDialog)); 2672 addAction(pMenu, action(UIActionIndexRT_M_Debug_S_ShowLogDialog)); 2900 2673 2901 2674 /* Mark menu as valid: */
Note:
See TracChangeset
for help on using the changeset viewer.