Changeset 55170 in vbox for trunk/src/VBox
- Timestamp:
- Apr 9, 2015 7:54:44 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r55140 r55170 72 72 template<> bool canConvert<StorageSlot>(); 73 73 template<> bool canConvert<UIExtraDataMetaDefs::MenuType>(); 74 #ifdef Q_WS_MAC75 74 template<> bool canConvert<UIExtraDataMetaDefs::MenuApplicationActionType>(); 76 #endif /* Q_WS_MAC */77 75 template<> bool canConvert<UIExtraDataMetaDefs::MenuHelpActionType>(); 78 76 template<> bool canConvert<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(); … … 133 131 template<> QString toInternalString(const UIExtraDataMetaDefs::MenuType &menuType); 134 132 template<> UIExtraDataMetaDefs::MenuType fromInternalString<UIExtraDataMetaDefs::MenuType>(const QString &strMenuType); 135 #ifdef Q_WS_MAC136 133 template<> QString toInternalString(const UIExtraDataMetaDefs::MenuApplicationActionType &menuApplicationActionType); 137 134 template<> UIExtraDataMetaDefs::MenuApplicationActionType fromInternalString<UIExtraDataMetaDefs::MenuApplicationActionType>(const QString &strMenuApplicationActionType); 138 #endif /* Q_WS_MAC */139 135 template<> QString toInternalString(const UIExtraDataMetaDefs::MenuHelpActionType &menuHelpActionType); 140 136 template<> UIExtraDataMetaDefs::MenuHelpActionType fromInternalString<UIExtraDataMetaDefs::MenuHelpActionType>(const QString &strMenuHelpActionType); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r54463 r55170 40 40 template<> bool canConvert<StorageSlot>() { return true; } 41 41 template<> bool canConvert<UIExtraDataMetaDefs::MenuType>() { return true; } 42 #ifdef Q_WS_MAC43 42 template<> bool canConvert<UIExtraDataMetaDefs::MenuApplicationActionType>() { return true; } 44 #endif /* Q_WS_MAC */45 43 template<> bool canConvert<UIExtraDataMetaDefs::MenuHelpActionType>() { return true; } 46 44 template<> bool canConvert<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>() { return true; } … … 374 372 switch (menuType) 375 373 { 376 #ifdef RT_OS_DARWIN377 374 case UIExtraDataMetaDefs::MenuType_Application: strResult = "Application"; break; 378 #endif /* RT_OS_DARWIN */379 375 case UIExtraDataMetaDefs::MenuType_Machine: strResult = "Machine"; break; 380 376 case UIExtraDataMetaDefs::MenuType_View: strResult = "View"; break; … … 404 400 * to search through the keys using 'case-insensitive' rule: */ 405 401 QStringList keys; QList<UIExtraDataMetaDefs::MenuType> values; 406 #ifdef RT_OS_DARWIN407 402 keys << "Application"; values << UIExtraDataMetaDefs::MenuType_Application; 408 #endif /* RT_OS_DARWIN */409 403 keys << "Machine"; values << UIExtraDataMetaDefs::MenuType_Machine; 410 404 keys << "View"; values << UIExtraDataMetaDefs::MenuType_View; … … 426 420 } 427 421 428 #ifdef Q_WS_MAC429 422 /* QString <= UIExtraDataMetaDefs::MenuApplicationActionType: */ 430 423 template<> QString toInternalString(const UIExtraDataMetaDefs::MenuApplicationActionType &menuApplicationActionType) … … 433 426 switch (menuApplicationActionType) 434 427 { 435 case UIExtraDataMetaDefs::MenuApplicationActionType_About: strResult = "About"; break; 436 case UIExtraDataMetaDefs::MenuApplicationActionType_Preferences: strResult = "Preferences"; break; 437 case UIExtraDataMetaDefs::MenuApplicationActionType_Close: strResult = "Close"; break; 438 case UIExtraDataMetaDefs::MenuApplicationActionType_All: strResult = "All"; break; 428 #ifdef Q_WS_MAC 429 case UIExtraDataMetaDefs::MenuApplicationActionType_About: strResult = "About"; break; 430 #endif /* Q_WS_MAC */ 431 case UIExtraDataMetaDefs::MenuApplicationActionType_Preferences: strResult = "Preferences"; break; 432 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 433 case UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager: strResult = "NetworkAccessManager"; break; 434 case UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates: strResult = "CheckForUpdates"; break; 435 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 436 case UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings: strResult = "ResetWarnings"; break; 437 case UIExtraDataMetaDefs::MenuApplicationActionType_Close: strResult = "Close"; break; 438 case UIExtraDataMetaDefs::MenuApplicationActionType_All: strResult = "All"; break; 439 439 default: 440 440 { … … 451 451 /* Here we have some fancy stuff allowing us 452 452 * to search through the keys using 'case-insensitive' rule: */ 453 QStringList keys; QList<UIExtraDataMetaDefs::MenuApplicationActionType> values; 454 keys << "About"; values << UIExtraDataMetaDefs::MenuApplicationActionType_About; 455 keys << "Preferences"; values << UIExtraDataMetaDefs::MenuApplicationActionType_Preferences; 456 keys << "Close"; values << UIExtraDataMetaDefs::MenuApplicationActionType_Close; 457 keys << "All"; values << UIExtraDataMetaDefs::MenuApplicationActionType_All; 453 QStringList keys; QList<UIExtraDataMetaDefs::MenuApplicationActionType> values; 454 #ifdef Q_WS_MAC 455 keys << "About"; values << UIExtraDataMetaDefs::MenuApplicationActionType_About; 456 #endif /* Q_WS_MAC */ 457 keys << "Preferences"; values << UIExtraDataMetaDefs::MenuApplicationActionType_Preferences; 458 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 459 keys << "NetworkAccessManager"; values << UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager; 460 keys << "CheckForUpdates"; values << UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates; 461 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 462 keys << "ResetWarnings"; values << UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings; 463 keys << "Close"; values << UIExtraDataMetaDefs::MenuApplicationActionType_Close; 464 keys << "All"; values << UIExtraDataMetaDefs::MenuApplicationActionType_All; 458 465 /* Invalid type for unknown words: */ 459 466 if (!keys.contains(strMenuApplicationActionType, Qt::CaseInsensitive)) … … 462 469 return values.at(keys.indexOf(QRegExp(strMenuApplicationActionType, Qt::CaseInsensitive))); 463 470 } 464 #endif /* Q_WS_MAC */465 471 466 472 /* QString <= UIExtraDataMetaDefs::MenuHelpActionType: */ … … 472 478 case UIExtraDataMetaDefs::MenuHelpActionType_Contents: strResult = "Contents"; break; 473 479 case UIExtraDataMetaDefs::MenuHelpActionType_WebSite: strResult = "WebSite"; break; 474 case UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings: strResult = "ResetWarnings"; break;475 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER476 case UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager: strResult = "NetworkAccessManager"; break;477 case UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates: strResult = "CheckForUpdates"; break;478 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */479 480 #ifndef Q_WS_MAC 480 481 case UIExtraDataMetaDefs::MenuHelpActionType_About: strResult = "About"; break; 481 case UIExtraDataMetaDefs::MenuHelpActionType_Preferences: strResult = "Preferences"; break;482 482 #endif /* !Q_WS_MAC */ 483 483 case UIExtraDataMetaDefs::MenuHelpActionType_All: strResult = "All"; break; … … 499 499 keys << "Contents"; values << UIExtraDataMetaDefs::MenuHelpActionType_Contents; 500 500 keys << "WebSite"; values << UIExtraDataMetaDefs::MenuHelpActionType_WebSite; 501 keys << "ResetWarnings"; values << UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings;502 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER503 keys << "NetworkAccessManager"; values << UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager;504 keys << "CheckForUpdates"; values << UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates;505 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */506 501 #ifndef Q_WS_MAC 507 502 keys << "About"; values << UIExtraDataMetaDefs::MenuHelpActionType_About; 508 keys << "Preferences"; values << UIExtraDataMetaDefs::MenuHelpActionType_Preferences;509 503 #endif /* !Q_WS_MAC */ 510 504 keys << "All"; values << UIExtraDataMetaDefs::MenuHelpActionType_All; … … 530 524 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown: strResult = "Shutdown"; break; 531 525 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff: strResult = "PowerOff"; break; 532 #ifndef Q_WS_MAC533 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close: strResult = "Close"; break;534 #endif /* !Q_WS_MAC */535 526 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing: strResult = "Nothing"; break; 536 527 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All: strResult = "All"; break; … … 558 549 keys << "Shutdown"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown; 559 550 keys << "PowerOff"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff; 560 #ifndef Q_WS_MAC561 keys << "Close"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close;562 #endif /* !Q_WS_MAC */563 551 keys << "Nothing"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing; 564 552 keys << "All"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r54463 r55170 92 92 #endif /* !Q_WS_MAC */ 93 93 const char* UIExtraDataDefs::GUI_RestrictedRuntimeMenus = "GUI/RestrictedRuntimeMenus"; 94 #ifdef Q_WS_MAC95 94 const char* UIExtraDataDefs::GUI_RestrictedRuntimeApplicationMenuActions = "GUI/RestrictedRuntimeApplicationMenuActions"; 96 #endif /* Q_WS_MAC */97 95 const char* UIExtraDataDefs::GUI_RestrictedRuntimeMachineMenuActions = "GUI/RestrictedRuntimeMachineMenuActions"; 98 96 const char* UIExtraDataDefs::GUI_RestrictedRuntimeViewMenuActions = "GUI/RestrictedRuntimeViewMenuActions"; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r54463 r55170 154 154 /** Holds restricted Runtime UI menu types. */ 155 155 extern const char* GUI_RestrictedRuntimeMenus; 156 #ifdef Q_WS_MAC 157 /** Mac OS X: Holds restricted Runtime UI action types for 'Application' menu. */ 156 /** Holds restricted Runtime UI action types for 'Application' menu. */ 158 157 extern const char* GUI_RestrictedRuntimeApplicationMenuActions; 159 #endif /* Q_WS_MAC */160 158 /** Holds restricted Runtime UI action types for Machine menu. */ 161 159 extern const char* GUI_RestrictedRuntimeMachineMenuActions; … … 295 293 Q_OBJECT; 296 294 Q_ENUMS(MenuType); 297 #ifdef RT_OS_DARWIN298 295 Q_ENUMS(MenuApplicationActionType); 299 #endif /* RT_OS_DARWIN */300 296 Q_ENUMS(MenuHelpActionType); 301 297 Q_ENUMS(RuntimeMenuMachineActionType); … … 316 312 { 317 313 MenuType_Invalid = 0, 318 #ifdef RT_OS_DARWIN319 314 MenuType_Application = RT_BIT(0), 320 #endif /* RT_OS_DARWIN */321 315 MenuType_Machine = RT_BIT(1), 322 316 MenuType_View = RT_BIT(2), … … 333 327 }; 334 328 335 #ifdef RT_OS_DARWIN336 329 /** Menu "Application": Action types. */ 337 330 enum MenuApplicationActionType 338 331 { 339 MenuApplicationActionType_Invalid = 0, 340 MenuApplicationActionType_About = RT_BIT(0), 341 MenuApplicationActionType_Preferences = RT_BIT(1), 342 MenuApplicationActionType_Close = RT_BIT(2), 343 MenuApplicationActionType_All = 0xFFFF 344 }; 332 MenuApplicationActionType_Invalid = 0, 333 #ifdef RT_OS_DARWIN 334 MenuApplicationActionType_About = RT_BIT(0), 345 335 #endif /* RT_OS_DARWIN */ 336 MenuApplicationActionType_Preferences = RT_BIT(1), 337 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 338 MenuApplicationActionType_NetworkAccessManager = RT_BIT(2), 339 MenuApplicationActionType_CheckForUpdates = RT_BIT(3), 340 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 341 MenuApplicationActionType_ResetWarnings = RT_BIT(4), 342 MenuApplicationActionType_Close = RT_BIT(5), 343 MenuApplicationActionType_All = 0xFFFF 344 }; 346 345 347 346 /** Menu "Help": Action types. */ … … 351 350 MenuHelpActionType_Contents = RT_BIT(0), 352 351 MenuHelpActionType_WebSite = RT_BIT(1), 353 MenuHelpActionType_ResetWarnings = RT_BIT(2),354 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER355 MenuHelpActionType_NetworkAccessManager = RT_BIT(3),356 MenuHelpActionType_CheckForUpdates = RT_BIT(4),357 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */358 352 #ifndef RT_OS_DARWIN 359 MenuHelpActionType_About = RT_BIT(5), 360 MenuHelpActionType_Preferences = RT_BIT(6), 353 MenuHelpActionType_About = RT_BIT(2), 361 354 #endif /* !RT_OS_DARWIN */ 362 355 MenuHelpActionType_All = 0xFFFF … … 375 368 RuntimeMenuMachineActionType_Shutdown = RT_BIT(6), 376 369 RuntimeMenuMachineActionType_PowerOff = RT_BIT(7), 377 #ifndef RT_OS_DARWIN 378 RuntimeMenuMachineActionType_Close = RT_BIT(8), 379 #endif /* !RT_OS_DARWIN */ 380 RuntimeMenuMachineActionType_Nothing = RT_BIT(9), 370 RuntimeMenuMachineActionType_Nothing = RT_BIT(8), 381 371 RuntimeMenuMachineActionType_All = 0xFFFF 382 372 }; -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r54794 r55170 1758 1758 << GUI_LastNormalWindowPosition << GUI_LastScaleWindowPosition 1759 1759 << GUI_RestrictedRuntimeMenus 1760 #ifdef Q_WS_MAC1761 1760 << GUI_RestrictedRuntimeApplicationMenuActions 1762 #endif /* Q_WS_MAC */1763 1761 << GUI_RestrictedRuntimeMachineMenuActions 1764 1762 << GUI_RestrictedRuntimeViewMenuActions … … 2612 2610 } 2613 2611 2614 #ifdef Q_WS_MAC2615 2612 UIExtraDataMetaDefs::MenuApplicationActionType UIExtraDataManager::restrictedRuntimeMenuApplicationActionTypes(const QString &strID) 2616 2613 { … … 2659 2656 setExtraDataStringList(GUI_RestrictedRuntimeApplicationMenuActions, result, strID); 2660 2657 } 2661 #endif /* Q_WS_MAC */2662 2658 2663 2659 UIExtraDataMetaDefs::RuntimeMenuMachineActionType UIExtraDataManager::restrictedRuntimeMenuMachineActionTypes(const QString &strID) … … 3675 3671 #endif /* !Q_WS_MAC */ 3676 3672 strKey == GUI_RestrictedRuntimeMenus || 3677 #ifdef Q_WS_MAC3678 3673 strKey == GUI_RestrictedRuntimeApplicationMenuActions || 3679 #endif /* Q_WS_MAC */3680 3674 strKey == GUI_RestrictedRuntimeMachineMenuActions || 3681 3675 strKey == GUI_RestrictedRuntimeViewMenuActions || -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r54794 r55170 312 312 void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QString &strID); 313 313 314 #ifdef Q_WS_MAC 315 /** Mac OS X: Returns restricted Runtime UI action types for Application menu. */ 314 /** Returns restricted Runtime UI action types for Application menu. */ 316 315 UIExtraDataMetaDefs::MenuApplicationActionType restrictedRuntimeMenuApplicationActionTypes(const QString &strID); 317 /** Mac OS X:Defines restricted Runtime UI action types for Application menu. */316 /** Defines restricted Runtime UI action types for Application menu. */ 318 317 void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QString &strID); 319 #endif /* Q_WS_MAC */320 318 321 319 /** Returns restricted Runtime UI action types for Machine menu. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r54272 r55170 316 316 317 317 318 #ifdef RT_OS_DARWIN319 318 class UIActionMenuApplication : public UIActionMenu 320 319 { … … 326 325 : UIActionMenu(pParent) 327 326 { 327 #ifdef RT_OS_DARWIN 328 328 menu()->setConsumable(true); 329 #endif /* RT_OS_DARWIN */ 329 330 retranslateUi(); 330 331 } … … 341 342 void retranslateUi() 342 343 { 344 #ifdef RT_OS_DARWIN 343 345 setName(QApplication::translate("UIActionPool", "&VirtualBox")); 346 #else /* !RT_OS_DARWIN */ 347 setName(QApplication::translate("UIActionPool", "&File")); 348 #endif /* !RT_OS_DARWIN */ 344 349 } 345 350 }; … … 383 388 }; 384 389 390 #ifdef RT_OS_DARWIN 385 391 class UIActionMenuWindow : public UIActionMenu 386 392 { … … 550 556 : UIActionSimple(pParent, ":/reset_warnings_16px.png") 551 557 { 558 setMenuRole(QAction::ApplicationSpecificRole); 552 559 retranslateUi(); 553 560 } … … 556 563 557 564 /** Returns action extra-data ID. */ 558 virtual int extraDataID() const { return UIExtraDataMetaDefs::Menu HelpActionType_ResetWarnings; }565 virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings; } 559 566 /** Returns action extra-data key. */ 560 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::Menu HelpActionType_ResetWarnings); }567 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings); } 561 568 /** Returns whether action is allowed. */ 562 virtual bool isAllowed() const { return actionPool()->isAllowedInMenu Help(UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings); }569 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings); } 563 570 564 571 QString shortcutExtraDataID() const … … 584 591 : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png") 585 592 { 593 setMenuRole(QAction::ApplicationSpecificRole); 586 594 retranslateUi(); 587 595 } … … 590 598 591 599 /** Returns action extra-data ID. */ 592 virtual int extraDataID() const { return UIExtraDataMetaDefs::Menu HelpActionType_NetworkAccessManager; }600 virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager; } 593 601 /** Returns action extra-data key. */ 594 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::Menu HelpActionType_NetworkAccessManager); }602 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager); } 595 603 /** Returns whether action is allowed. */ 596 virtual bool isAllowed() const { return actionPool()->isAllowedInMenu Help(UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager); }604 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager); } 597 605 598 606 QString shortcutExtraDataID() const … … 624 632 625 633 /** Returns action extra-data ID. */ 626 virtual int extraDataID() const { return UIExtraDataMetaDefs::Menu HelpActionType_CheckForUpdates; }634 virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates; } 627 635 /** Returns action extra-data key. */ 628 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::Menu HelpActionType_CheckForUpdates); }636 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates); } 629 637 /** Returns whether action is allowed. */ 630 virtual bool isAllowed() const { return actionPool()->isAllowedInMenu Help(UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates); }638 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates); } 631 639 632 640 QString shortcutExtraDataID() const … … 661 669 virtual int extraDataID() const 662 670 { 663 #ifdef Q_WS_MAC671 #ifdef RT_OS_DARWIN 664 672 return UIExtraDataMetaDefs::MenuApplicationActionType_About; 665 #else /* ! Q_WS_MAC*/673 #else /* !RT_OS_DARWIN */ 666 674 return UIExtraDataMetaDefs::MenuHelpActionType_About; 667 #endif /* ! Q_WS_MAC*/675 #endif /* !RT_OS_DARWIN */ 668 676 } 669 677 /** Returns action extra-data key. */ 670 678 virtual QString extraDataKey() const 671 679 { 672 #ifdef Q_WS_MAC680 #ifdef RT_OS_DARWIN 673 681 return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_About); 674 #else /* ! Q_WS_MAC*/682 #else /* !RT_OS_DARWIN */ 675 683 return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_About); 676 #endif /* ! Q_WS_MAC*/684 #endif /* !RT_OS_DARWIN */ 677 685 } 678 686 /** Returns whether action is allowed. */ 679 687 virtual bool isAllowed() const 680 688 { 681 #ifdef Q_WS_MAC689 #ifdef RT_OS_DARWIN 682 690 return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_About); 683 #else /* ! Q_WS_MAC*/691 #else /* !RT_OS_DARWIN */ 684 692 return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_About); 685 #endif /* ! Q_WS_MAC*/693 #endif /* !RT_OS_DARWIN */ 686 694 } 687 695 … … 714 722 715 723 /** Returns action extra-data ID. */ 716 virtual int extraDataID() const 717 { 718 #ifdef Q_WS_MAC 719 return UIExtraDataMetaDefs::MenuApplicationActionType_Preferences; 720 #else /* !Q_WS_MAC */ 721 return UIExtraDataMetaDefs::MenuHelpActionType_Preferences; 722 #endif /* !Q_WS_MAC */ 723 } 724 virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuApplicationActionType_Preferences; } 724 725 /** Returns action extra-data key. */ 725 virtual QString extraDataKey() const 726 { 727 #ifdef Q_WS_MAC 728 return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_Preferences); 729 #else /* !Q_WS_MAC */ 730 return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_Preferences); 731 #endif /* !Q_WS_MAC */ 732 } 726 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_Preferences); } 733 727 /** Returns whether action is allowed. */ 734 virtual bool isAllowed() const 735 { 736 #ifdef Q_WS_MAC 737 return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_Preferences); 738 #else /* !Q_WS_MAC */ 739 return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_Preferences); 740 #endif /* !Q_WS_MAC */ 741 } 728 virtual bool isAllowed() const { return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_Preferences); } 742 729 743 730 QString shortcutExtraDataID() const … … 833 820 } 834 821 835 #ifdef Q_WS_MAC836 822 bool UIActionPool::isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType type) const 837 823 { … … 848 834 } 849 835 836 #ifdef Q_WS_MAC 850 837 bool UIActionPool::isAllowedInMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType type) const 851 838 { … … 910 897 void UIActionPool::preparePool() 911 898 { 912 #ifdef RT_OS_DARWIN913 899 /* Create 'Application' actions: */ 914 900 m_pool[UIActionIndex_M_Application] = new UIActionMenuApplication(this); 901 #ifdef RT_OS_DARWIN 915 902 m_pool[UIActionIndex_M_Application_S_About] = new UIActionSimpleAbout(this); 903 #endif /* RT_OS_DARWIN */ 916 904 m_pool[UIActionIndex_M_Application_S_Preferences] = new UIActionSimplePreferences(this); 905 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 906 m_pool[UIActionIndex_M_Application_S_NetworkAccessManager] = new UIActionSimpleNetworkAccessManager(this); 907 m_pool[UIActionIndex_M_Application_S_CheckForUpdates] = new UIActionSimpleCheckForUpdates(this); 908 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 909 m_pool[UIActionIndex_M_Application_S_ResetWarnings] = new UIActionSimpleResetWarnings(this); 917 910 m_pool[UIActionIndex_M_Application_S_Close] = new UIActionSimplePerformClose(this); 918 911 912 #ifdef RT_OS_DARWIN 919 913 /* Create 'Window' actions: */ 920 914 m_pool[UIActionIndex_M_Window] = new UIActionMenuWindow(this); … … 926 920 m_pool[UIActionIndex_Simple_Contents] = new UIActionSimpleContents(this); 927 921 m_pool[UIActionIndex_Simple_WebSite] = new UIActionSimpleWebSite(this); 928 m_pool[UIActionIndex_Simple_ResetWarnings] = new UIActionSimpleResetWarnings(this);929 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER930 m_pool[UIActionIndex_Simple_NetworkAccessManager] = new UIActionSimpleNetworkAccessManager(this);931 m_pool[UIActionIndex_Simple_CheckForUpdates] = new UIActionSimpleCheckForUpdates(this);932 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */933 922 #ifndef RT_OS_DARWIN 934 923 m_pool[UIActionIndex_Simple_About] = new UIActionSimpleAbout(this); 935 m_pool[UIActionIndex_Simple_Preferences] = new UIActionSimplePreferences(this);936 924 #endif /* !RT_OS_DARWIN */ 937 925 … … 952 940 void UIActionPool::prepareConnections() 953 941 { 942 /* 'Application' menu connections: */ 943 #ifdef RT_OS_DARWIN 944 connect(action(UIActionIndex_M_Application_S_About), SIGNAL(triggered()), 945 &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection); 946 #endif /* RT_OS_DARWIN */ 947 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 948 connect(action(UIActionIndex_M_Application_S_NetworkAccessManager), SIGNAL(triggered()), 949 gNetworkManager, SLOT(show()), Qt::UniqueConnection); 950 connect(action(UIActionIndex_M_Application_S_CheckForUpdates), SIGNAL(triggered()), 951 gUpdateManager, SLOT(sltForceCheck()), Qt::UniqueConnection); 952 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 953 connect(action(UIActionIndex_M_Application_S_ResetWarnings), SIGNAL(triggered()), 954 &msgCenter(), SLOT(sltResetSuppressedMessages()), Qt::UniqueConnection); 955 954 956 /* 'Help' menu connections: */ 955 957 connect(action(UIActionIndex_Simple_Contents), SIGNAL(triggered()), … … 957 959 connect(action(UIActionIndex_Simple_WebSite), SIGNAL(triggered()), 958 960 &msgCenter(), SLOT(sltShowHelpWebDialog()), Qt::UniqueConnection); 959 connect(action(UIActionIndex_Simple_ResetWarnings), SIGNAL(triggered()), 960 &msgCenter(), SLOT(sltResetSuppressedMessages()), Qt::UniqueConnection); 961 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 962 connect(action(UIActionIndex_Simple_NetworkAccessManager), SIGNAL(triggered()), 963 gNetworkManager, SLOT(show()), Qt::UniqueConnection); 964 connect(action(UIActionIndex_Simple_CheckForUpdates), SIGNAL(triggered()), 965 gUpdateManager, SLOT(sltForceCheck()), Qt::UniqueConnection); 966 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 967 #ifdef RT_OS_DARWIN 968 connect(action(UIActionIndex_M_Application_S_About), SIGNAL(triggered()), 969 &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection); 970 #else /* !RT_OS_DARWIN */ 961 #ifndef RT_OS_DARWIN 971 962 connect(action(UIActionIndex_Simple_About), SIGNAL(triggered()), 972 963 &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection); … … 1032 1023 if (!fUpdateAllowed) 1033 1024 { 1034 m_restrictedActionsMenu Help[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::MenuHelpActionType)1035 (m_restrictedActionsMenu Help[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates);1025 m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::MenuApplicationActionType) 1026 (m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates); 1036 1027 } 1037 1028 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ … … 1048 1039 } 1049 1040 1050 #ifdef RT_OS_DARWIN1051 1041 void UIActionPool::updateMenuApplication() 1052 1042 { 1053 1043 /* Get corresponding menu: */ 1054 1044 UIMenu *pMenu = action(UIActionIndex_M_Application)->menu(); 1055 AssertReturnVoid(pMenu && pMenu->isConsumable()); 1045 AssertPtrReturnVoid(pMenu); 1046 #ifdef RT_OS_DARWIN 1047 AssertReturnVoid(pMenu->isConsumable()); 1048 #endif /* RT_OS_DARWIN */ 1056 1049 /* Clear contents: */ 1050 #ifdef RT_OS_DARWIN 1057 1051 if (!pMenu->isConsumed()) 1052 #endif /* RT_OS_DARWIN */ 1058 1053 pMenu->clear(); 1059 1054 1055 /* Separator: */ 1056 bool fSeparator = false; 1057 1058 #ifdef RT_OS_DARWIN 1060 1059 /* 'About' action: */ 1061 addAction(pMenu, action(UIActionIndex_M_Application_S_About)); 1060 fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_About)) || fSeparator; 1061 #endif /* RT_OS_DARWIN */ 1062 1062 1063 /* 'Preferences' action: */ 1063 addAction(pMenu, action(UIActionIndex_M_Application_S_Preferences)); 1064 fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_Preferences)) || fSeparator; 1065 1066 #ifndef RT_OS_DARWIN 1067 /* Separator: */ 1068 if (fSeparator) 1069 { 1070 pMenu->addSeparator(); 1071 fSeparator = false; 1072 } 1073 #endif /* !RT_OS_DARWIN */ 1074 1075 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 1076 /* 'Network Manager' action: */ 1077 fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_NetworkAccessManager)) || fSeparator; 1078 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 1079 /* 'Reset Warnings' action: */ 1080 fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_ResetWarnings)) || fSeparator; 1081 1082 #ifndef RT_OS_DARWIN 1083 /* Separator: */ 1084 if (fSeparator) 1085 { 1086 pMenu->addSeparator(); 1087 fSeparator = false; 1088 } 1089 #endif /* !RT_OS_DARWIN */ 1090 1064 1091 /* 'Close' action: */ 1065 addAction(pMenu, action(UIActionIndex_M_Application_S_Close));1092 fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_Close)) || fSeparator; 1066 1093 1067 1094 /* Mark menu as valid: */ … … 1069 1096 } 1070 1097 1098 #ifdef RT_OS_DARWIN 1071 1099 void UIActionPool::updateMenuWindow() 1072 1100 { … … 1106 1134 1107 1135 /* 'Contents' action: */ 1108 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Contents)) ;1136 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Contents)) || fSeparator;; 1109 1137 /* 'Web Site' action: */ 1110 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_WebSite)) ;1138 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_WebSite)) || fSeparator;; 1111 1139 1112 1140 /* Separator? */ … … 1117 1145 } 1118 1146 1119 /* 'Reset Warnings' action: */1120 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_ResetWarnings));1121 1122 /* Separator? */1123 if (fSeparator)1124 {1125 pMenu->addSeparator();1126 fSeparator = false;1127 }1128 1129 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER1130 /* 'Network Manager' action: */1131 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_NetworkAccessManager));1132 /* 'Check for Updates' action (only for Selector pool): */1133 if (type() == UIActionPoolType_Selector)1134 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_CheckForUpdates));1135 1136 /* Separator? */1137 if (fSeparator)1138 {1139 pMenu->addSeparator();1140 fSeparator = false;1141 }1142 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */1143 1144 1147 #ifndef RT_OS_DARWIN 1145 1148 /* 'About' action: */ 1146 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_About)); 1147 /* 'Preferences' action (only for Runtime pool): */ 1148 if (type() == UIActionPoolType_Runtime) 1149 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Preferences)); 1149 fSeparator = addAction(pMenu, action(UIActionIndex_Simple_About)) || fSeparator;; 1150 1150 #endif /* !RT_OS_DARWIN */ 1151 1151 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r54272 r55170 52 52 enum UIActionIndex 53 53 { 54 #ifdef RT_OS_DARWIN55 54 /* 'Application' menu actions: */ 56 55 UIActionIndex_M_Application, 56 #ifdef RT_OS_DARWIN 57 57 UIActionIndex_M_Application_S_About, 58 #endif /* RT_OS_DARWIN */ 58 59 UIActionIndex_M_Application_S_Preferences, 60 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 61 UIActionIndex_M_Application_S_NetworkAccessManager, 62 UIActionIndex_M_Application_S_CheckForUpdates, 63 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 64 UIActionIndex_M_Application_S_ResetWarnings, 59 65 UIActionIndex_M_Application_S_Close, 60 66 67 #ifdef RT_OS_DARWIN 61 68 /* 'Window' menu actions: */ 62 69 UIActionIndex_M_Window, … … 68 75 UIActionIndex_Simple_Contents, 69 76 UIActionIndex_Simple_WebSite, 70 UIActionIndex_Simple_ResetWarnings,71 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER72 UIActionIndex_Simple_NetworkAccessManager,73 UIActionIndex_Simple_CheckForUpdates,74 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */75 77 #ifndef RT_OS_DARWIN 76 78 UIActionIndex_Simple_About, 77 UIActionIndex_Simple_Preferences,78 79 #endif /* !RT_OS_DARWIN */ 79 80 … … 366 367 void setRestrictionForMenuBar(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuType restriction); 367 368 368 #ifdef Q_WS_MAC369 369 /** Returns whether the action with passed @a type is allowed in the 'Application' menu. */ 370 370 bool isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType type) const; … … 372 372 void setRestrictionForMenuApplication(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuApplicationActionType restriction); 373 373 374 /** Returns whether the action with passed @a type is allowed in the 'Window' menu. */ 374 #ifdef Q_WS_MAC 375 /** Mac OS X: Returns whether the action with passed @a type is allowed in the 'Window' menu. */ 375 376 bool isAllowedInMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType type) const; 376 /** Defines 'Window' menu @a restriction for passed @a level. */377 /** Mac OS X: Defines 'Window' menu @a restriction for passed @a level. */ 377 378 void setRestrictionForMenuWindow(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuWindowActionType restriction); 378 379 #endif /* Q_WS_MAC */ … … 425 426 /** Update menus routine. */ 426 427 virtual void updateMenus() = 0; 427 #ifdef RT_OS_DARWIN428 428 /** Update 'Application' menu routine. */ 429 429 virtual void updateMenuApplication(); 430 /** Update 'Window' menu routine. */ 430 #ifdef RT_OS_DARWIN 431 /** Mac OS X: Update 'Window' menu routine. */ 431 432 virtual void updateMenuWindow(); 432 433 #endif /* RT_OS_DARWIN */ … … 462 463 /** Holds restricted menu types. */ 463 464 QMap<UIActionRestrictionLevel, UIExtraDataMetaDefs::MenuType> m_restrictedMenus; 464 #ifdef Q_WS_MAC465 465 /** Holds restricted action types of the 'Application' menu. */ 466 466 QMap<UIActionRestrictionLevel, UIExtraDataMetaDefs::MenuApplicationActionType> m_restrictedActionsMenuApplication; 467 /** Holds restricted action types of the 'Window' menu. */ 467 #ifdef Q_WS_MAC 468 /** Mac OS X: Holds restricted action types of the 'Window' menu. */ 468 469 QMap<UIActionRestrictionLevel, UIExtraDataMetaDefs::MenuWindowActionType> m_restrictedActionsMenuWindow; 469 470 #endif /* Q_WS_MAC */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r54990 r55170 342 342 }; 343 343 344 #ifndef RT_OS_DARWIN345 class UIActionSimplePerformClose : public UIActionSimple346 {347 Q_OBJECT;348 349 public:350 351 UIActionSimplePerformClose(UIActionPool *pParent)352 : UIActionSimple(pParent, ":/exit_16px.png")353 {354 setMenuRole(QAction::QuitRole);355 }356 357 protected:358 359 /** Returns action extra-data ID. */360 virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close;}361 /** Returns action extra-data key. */362 virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close);}363 /** Returns whether action is allowed. */364 virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close); }365 366 QString shortcutExtraDataID() const367 {368 return QString("Close");369 }370 371 QKeySequence defaultShortcut(UIActionPoolType) const372 {373 return QKeySequence("Q");374 }375 376 void retranslateUi()377 {378 setName(QApplication::translate("UIActionPool", "&Close..."));379 setStatusTip(QApplication::translate("UIActionPool", "Close the virtual machine"));380 }381 };382 #endif /* !RT_OS_DARWIN */383 384 344 class UIActionMenuView : public UIActionMenu 385 345 { … … 2064 2024 m_pool[UIActionIndexRT_M_Machine_S_Shutdown] = new UIActionSimplePerformShutdown(this); 2065 2025 m_pool[UIActionIndexRT_M_Machine_S_PowerOff] = new UIActionSimplePerformPowerOff(this); 2066 #ifndef RT_OS_DARWIN2067 m_pool[UIActionIndexRT_M_Machine_S_Close] = new UIActionSimplePerformClose(this);2068 #endif /* !RT_OS_DARWIN */2069 2026 2070 2027 /* 'View' actions: */ … … 2182 2139 /* Recache common action restrictions: */ 2183 2140 m_restrictedMenus[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuTypes(strMachineID); 2184 #ifdef Q_WS_MAC2185 2141 m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuApplicationActionTypes(strMachineID); 2186 #endif /* Q_WS_MAC */2187 2142 m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuMachineActionTypes(strMachineID); 2188 2143 m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuViewActionTypes(strMachineID); … … 2258 2213 if (fAllCloseActionsRestricted) 2259 2214 { 2260 #ifdef Q_WS_MAC2261 2215 m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::MenuApplicationActionType) 2262 2216 (m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::MenuApplicationActionType_Close); 2263 #else /* !Q_WS_MAC */2264 m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuMachineActionType)2265 (m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close);2266 #endif /* !Q_WS_MAC */2267 2217 } 2268 2218 … … 2287 2237 m_mainMenus.clear(); 2288 2238 2289 #ifdef RT_OS_DARWIN2290 2239 /* 'Application' menu: */ 2291 2240 addMenu(m_mainMenus, action(UIActionIndex_M_Application)); 2292 2241 updateMenuApplication(); 2293 #endif /* RT_OS_DARWIN */2294 2242 2295 2243 /* 'Machine' menu: */ … … 2364 2312 /* 'PowerOff' action: */ 2365 2313 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_PowerOff)) || fSeparator; 2366 2367 #ifndef Q_WS_MAC2368 /* Separator: */2369 if (fSeparator)2370 {2371 pMenu->addSeparator();2372 fSeparator = false;2373 }2374 2375 /* 'Close' action: */2376 fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Close)) || fSeparator;2377 #endif /* !Q_WS_MAC */2378 2314 2379 2315 /* Mark menu as valid: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r54990 r55170 49 49 UIActionIndexRT_M_Machine_S_Shutdown, 50 50 UIActionIndexRT_M_Machine_S_PowerOff, 51 #ifndef RT_OS_DARWIN52 UIActionIndexRT_M_Machine_S_Close,53 #endif /* !RT_OS_DARWIN */54 51 55 52 /* 'View' menu actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r55146 r55170 1013 1013 void UIMachineLogic::prepareActionConnections() 1014 1014 { 1015 /* 'Application' actions connection: */ 1016 connect(actionPool()->action(UIActionIndex_M_Application_S_Preferences), SIGNAL(triggered()), 1017 this, SLOT(sltShowGlobalPreferences()), Qt::UniqueConnection); 1018 connect(actionPool()->action(UIActionIndex_M_Application_S_Close), SIGNAL(triggered()), 1019 this, SLOT(sltClose()), Qt::QueuedConnection); 1020 1015 1021 /* 'Machine' actions connections: */ 1016 1022 connect(actionPool()->action(UIActionIndexRT_M_Machine_S_Settings), SIGNAL(triggered()), … … 1030 1036 connect(actionPool()->action(UIActionIndexRT_M_Machine_S_PowerOff), SIGNAL(triggered()), 1031 1037 this, SLOT(sltPowerOff()), Qt::QueuedConnection); 1032 #ifdef RT_OS_DARWIN1033 connect(actionPool()->action(UIActionIndex_M_Application_S_Close), SIGNAL(triggered()),1034 this, SLOT(sltClose()), Qt::QueuedConnection);1035 #else /* !RT_OS_DARWIN */1036 connect(actionPool()->action(UIActionIndexRT_M_Machine_S_Close), SIGNAL(triggered()),1037 this, SLOT(sltClose()), Qt::QueuedConnection);1038 #endif /* !RT_OS_DARWIN */1039 1038 1040 1039 /* 'View' actions connections: */ … … 1098 1097 this, SLOT(sltMinimizeActiveMachineWindow())); 1099 1098 #endif /* Q_WS_MAC */ 1100 1101 /* 'Help' actions connections: */1102 #ifdef RT_OS_DARWIN1103 connect(actionPool()->action(UIActionIndex_M_Application_S_Preferences), SIGNAL(triggered()),1104 this, SLOT(sltShowGlobalPreferences()), Qt::UniqueConnection);1105 #else /* !RT_OS_DARWIN */1106 connect(actionPool()->action(UIActionIndex_Simple_Preferences), SIGNAL(triggered()),1107 this, SLOT(sltShowGlobalPreferences()), Qt::UniqueConnection);1108 #endif /* !RT_OS_DARWIN */1109 1099 } 1110 1100 … … 2407 2397 return; 2408 2398 2409 #ifdef RT_OS_DARWIN2410 2399 /* Check that we do NOT handling that already: */ 2411 2400 if (actionPool()->action(UIActionIndex_M_Application_S_Preferences)->data().toBool()) … … 2413 2402 /* Remember that we handling that already: */ 2414 2403 actionPool()->action(UIActionIndex_M_Application_S_Preferences)->setData(true); 2415 #else /* !RT_OS_DARWIN */2416 /* Check that we do NOT handling that already: */2417 if (actionPool()->action(UIActionIndex_Simple_Preferences)->data().toBool())2418 return;2419 /* Remember that we handling that already: */2420 actionPool()->action(UIActionIndex_Simple_Preferences)->setData(true);2421 #endif /* !RT_OS_DARWIN */2422 2404 2423 2405 /* Create and execute global settings window: */ … … 2428 2410 delete pDialog; 2429 2411 2430 #ifdef RT_OS_DARWIN2431 2412 /* Remember that we do NOT handling that already: */ 2432 2413 actionPool()->action(UIActionIndex_M_Application_S_Preferences)->setData(false); 2433 #else /* !RT_OS_DARWIN */2434 /* Remember that we do NOT handling that already: */2435 actionPool()->action(UIActionIndex_Simple_Preferences)->setData(false);2436 #endif /* !RT_OS_DARWIN */2437 2414 } 2438 2415 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.cpp
r54990 r55170 135 135 break; 136 136 } 137 #ifdef Q_WS_MAC138 137 case UIExtraDataMetaDefs::MenuType_Application: 139 138 { … … 149 148 break; 150 149 } 151 #endif /* Q_WS_MAC */152 150 case UIExtraDataMetaDefs::MenuType_Machine: 153 151 { … … 337 335 { 338 336 /* Create menus: */ 339 #ifdef Q_WS_MAC340 337 prepareMenuApplication(); 341 #endif /* Q_WS_MAC */342 338 prepareMenuMachine(); 343 339 prepareMenuView(); … … 503 499 } 504 500 501 void UIMenuBarEditorWidget::prepareMenuApplication() 502 { 503 /* Copy menu: */ 505 504 #ifdef Q_WS_MAC 506 void UIMenuBarEditorWidget::prepareMenuApplication() 507 { 508 /* Copy menu: */509 QMenu *pMenu = prepareNamedMenu("VirtualBox"); 505 QMenu *pMenu = prepareNamedMenu("Application"); 506 #else /* !Q_WS_MAC */ 507 QMenu *pMenu = prepareCopiedMenu(actionPool()->action(UIActionIndex_M_Application)); 508 #endif /* !Q_WS_MAC */ 510 509 AssertPtrReturnVoid(pMenu); 511 510 { 511 #ifdef Q_WS_MAC 512 512 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_M_Application_S_About)); 513 #endif /* Q_WS_MAC */ 513 514 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_M_Application_S_Preferences)); 514 } 515 } 516 #endif /* Q_WS_MAC */ 515 #ifndef Q_WS_MAC 516 pMenu->addSeparator(); 517 #endif /* !Q_WS_MAC */ 518 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 519 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_M_Application_S_NetworkAccessManager)); 520 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 521 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_M_Application_S_ResetWarnings)); 522 } 523 } 517 524 518 525 void UIMenuBarEditorWidget::prepareMenuMachine() … … 637 644 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_WebSite)); 638 645 pMenu->addSeparator(); 639 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_ResetWarnings));640 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER641 pMenu->addSeparator();642 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_NetworkAccessManager));643 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */644 646 #ifndef Q_WS_MAC 645 pMenu->addSeparator();646 647 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_About)); 647 prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_Preferences));648 648 #endif /* !Q_WS_MAC */ 649 649 } … … 692 692 693 693 /* Update known menu-bar menus: */ 694 #ifdef Q_WS_MAC695 694 updateMenuApplication(); 696 #endif /* Q_WS_MAC */697 695 updateMenuMachine(); 698 696 updateMenuView(); … … 708 706 } 709 707 710 #ifdef Q_WS_MAC711 708 void UIMenuBarEditorWidget::updateMenuApplication() 712 709 { … … 737 734 } 738 735 } 739 #endif /* Q_WS_MAC */740 736 741 737 void UIMenuBarEditorWidget::updateMenuMachine() -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.h
r54528 r55170 119 119 /** Prepare menus routine. */ 120 120 void prepareMenus(); 121 #ifdef Q_WS_MAC 122 /** Mac OS X: Prepare 'Application' menu routine. */ 121 /** Prepare 'Application' menu routine. */ 123 122 void prepareMenuApplication(); 124 #endif /* Q_WS_MAC */125 123 /** Prepare 'Machine' menu routine. */ 126 124 void prepareMenuMachine(); … … 148 146 /** Update menus routine. */ 149 147 void updateMenus(); 150 #ifdef Q_WS_MAC 151 /** Mac OS X: Update 'Application' menu routine. */ 148 /** Update 'Application' menu routine. */ 152 149 void updateMenuApplication(); 153 #endif /* Q_WS_MAC */154 150 /** Update 'Machine' menu routine. */ 155 151 void updateMenuMachine(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
r54472 r55170 251 251 actionPool()->action(UIActionIndexRT_M_View_T_Fullscreen), SLOT(trigger())); 252 252 connect(m_pMiniToolBar, SIGNAL(sigCloseAction()), 253 actionPool()->action(UIActionIndex RT_M_Machine_S_Close), SLOT(trigger()));253 actionPool()->action(UIActionIndex_M_Application_S_Close), SLOT(trigger())); 254 254 connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()), 255 255 this, SLOT(sltRevokeFocus()), Qt::QueuedConnection); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp
r54463 r55170 135 135 actionPool()->action(UIActionIndexRT_M_View_T_Seamless), SLOT(trigger())); 136 136 connect(m_pMiniToolBar, SIGNAL(sigCloseAction()), 137 actionPool()->action(UIActionIndex RT_M_Machine_S_Close), SLOT(trigger()));137 actionPool()->action(UIActionIndex_M_Application_S_Close), SLOT(trigger())); 138 138 connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()), 139 139 this, SLOT(sltRevokeFocus()), Qt::QueuedConnection); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r53305 r55170 320 320 void UISelectorWindow::sltShowPreferencesDialog() 321 321 { 322 #ifdef RT_OS_DARWIN323 322 /* Check that we do NOT handling that already: */ 324 323 if (actionPool()->action(UIActionIndex_M_Application_S_Preferences)->data().toBool()) … … 326 325 /* Remember that we handling that already: */ 327 326 actionPool()->action(UIActionIndex_M_Application_S_Preferences)->setData(true); 328 #else /* !RT_OS_DARWIN */329 /* Check that we do NOT handling that already: */330 if (actionPool()->action(UIActionIndex_Simple_Preferences)->data().toBool())331 return;332 /* Remember that we handling that already: */333 actionPool()->action(UIActionIndex_Simple_Preferences)->setData(true);334 #endif /* !RT_OS_DARWIN */335 327 336 328 /* Don't show the inaccessible warning … … 342 334 dialog.execute(); 343 335 344 #ifdef RT_OS_DARWIN345 336 /* Remember that we do NOT handling that already: */ 346 337 actionPool()->action(UIActionIndex_M_Application_S_Preferences)->setData(false); 347 #else /* !RT_OS_DARWIN */348 /* Remember that we do NOT handling that already: */349 actionPool()->action(UIActionIndex_Simple_Preferences)->setData(false);350 #endif /* !RT_OS_DARWIN */351 338 } 352 339 … … 1151 1138 1152 1139 /* Populate File-menu: */ 1153 pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowMediumManager)); 1140 #ifdef Q_WS_MAC 1141 pMenu->addAction(actionPool()->action(UIActionIndex_M_Application_S_About)); 1142 pMenu->addAction(actionPool()->action(UIActionIndex_M_Application_S_Preferences)); 1143 #endif /* Q_WS_MAC */ 1154 1144 pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance)); 1155 1145 pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)); 1156 #ifndef Q_WS_MAC1157 1146 pMenu->addSeparator(); 1158 #endif /* Q_WS_MAC */ 1147 pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowMediumManager)); 1159 1148 #ifdef DEBUG 1160 1149 pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager)); 1161 1150 #endif /* DEBUG */ 1162 #ifdef Q_WS_MAC 1163 pMenu->addAction(actionPool()->action(UIActionIndex_M_Application_S_About)); 1151 #ifndef Q_WS_MAC 1164 1152 pMenu->addAction(actionPool()->action(UIActionIndex_M_Application_S_Preferences)); 1165 #else /* !Q_WS_MAC */ 1166 pMenu->addAction(actionPool()->action(UIActionIndex_Simple_Preferences)); 1153 #endif /* Q_WS_MAC */ 1167 1154 pMenu->addSeparator(); 1168 #endif /* Q_WS_MAC */ 1155 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER 1156 pMenu->addAction(actionPool()->action(UIActionIndex_M_Application_S_NetworkAccessManager)); 1157 pMenu->addAction(actionPool()->action(UIActionIndex_M_Application_S_CheckForUpdates)); 1158 # ifndef Q_WS_MAC 1159 pMenu->addSeparator(); 1160 # endif /* Q_WS_MAC */ 1161 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 1169 1162 pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_Close)); 1170 1163 } … … 1386 1379 connect(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager), SIGNAL(triggered()), this, SLOT(sltOpenExtraDataManagerWindow())); 1387 1380 #endif /* DEBUG */ 1388 #ifdef RT_OS_DARWIN1389 1381 connect(actionPool()->action(UIActionIndex_M_Application_S_Preferences), SIGNAL(triggered()), this, SLOT(sltShowPreferencesDialog())); 1390 #else /* !RT_OS_DARWIN */1391 connect(actionPool()->action(UIActionIndex_Simple_Preferences), SIGNAL(triggered()), this, SLOT(sltShowPreferencesDialog()));1392 #endif /* !RT_OS_DARWIN */1393 1382 connect(actionPool()->action(UIActionIndexST_M_File_S_Close), SIGNAL(triggered()), this, SLOT(sltPerformExit())); 1394 1383
Note:
See TracChangeset
for help on using the changeset viewer.