VirtualBox

Changeset 55170 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 9, 2015 7:54:44 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: 7782: Big and quite dangerous menu-bar rework implementing separate File menu for Runtime UI.

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  
    7272template<> bool canConvert<StorageSlot>();
    7373template<> bool canConvert<UIExtraDataMetaDefs::MenuType>();
    74 #ifdef Q_WS_MAC
    7574template<> bool canConvert<UIExtraDataMetaDefs::MenuApplicationActionType>();
    76 #endif /* Q_WS_MAC */
    7775template<> bool canConvert<UIExtraDataMetaDefs::MenuHelpActionType>();
    7876template<> bool canConvert<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>();
     
    133131template<> QString toInternalString(const UIExtraDataMetaDefs::MenuType &menuType);
    134132template<> UIExtraDataMetaDefs::MenuType fromInternalString<UIExtraDataMetaDefs::MenuType>(const QString &strMenuType);
    135 #ifdef Q_WS_MAC
    136133template<> QString toInternalString(const UIExtraDataMetaDefs::MenuApplicationActionType &menuApplicationActionType);
    137134template<> UIExtraDataMetaDefs::MenuApplicationActionType fromInternalString<UIExtraDataMetaDefs::MenuApplicationActionType>(const QString &strMenuApplicationActionType);
    138 #endif /* Q_WS_MAC */
    139135template<> QString toInternalString(const UIExtraDataMetaDefs::MenuHelpActionType &menuHelpActionType);
    140136template<> UIExtraDataMetaDefs::MenuHelpActionType fromInternalString<UIExtraDataMetaDefs::MenuHelpActionType>(const QString &strMenuHelpActionType);
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r54463 r55170  
    4040template<> bool canConvert<StorageSlot>() { return true; }
    4141template<> bool canConvert<UIExtraDataMetaDefs::MenuType>() { return true; }
    42 #ifdef Q_WS_MAC
    4342template<> bool canConvert<UIExtraDataMetaDefs::MenuApplicationActionType>() { return true; }
    44 #endif /* Q_WS_MAC */
    4543template<> bool canConvert<UIExtraDataMetaDefs::MenuHelpActionType>() { return true; }
    4644template<> bool canConvert<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>() { return true; }
     
    374372    switch (menuType)
    375373    {
    376 #ifdef RT_OS_DARWIN
    377374        case UIExtraDataMetaDefs::MenuType_Application: strResult = "Application"; break;
    378 #endif /* RT_OS_DARWIN */
    379375        case UIExtraDataMetaDefs::MenuType_Machine:     strResult = "Machine"; break;
    380376        case UIExtraDataMetaDefs::MenuType_View:        strResult = "View"; break;
     
    404400     * to search through the keys using 'case-insensitive' rule: */
    405401    QStringList keys;      QList<UIExtraDataMetaDefs::MenuType> values;
    406 #ifdef RT_OS_DARWIN
    407402    keys << "Application"; values << UIExtraDataMetaDefs::MenuType_Application;
    408 #endif /* RT_OS_DARWIN */
    409403    keys << "Machine";     values << UIExtraDataMetaDefs::MenuType_Machine;
    410404    keys << "View";        values << UIExtraDataMetaDefs::MenuType_View;
     
    426420}
    427421
    428 #ifdef Q_WS_MAC
    429422/* QString <= UIExtraDataMetaDefs::MenuApplicationActionType: */
    430423template<> QString toInternalString(const UIExtraDataMetaDefs::MenuApplicationActionType &menuApplicationActionType)
     
    433426    switch (menuApplicationActionType)
    434427    {
    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;
    439439        default:
    440440        {
     
    451451    /* Here we have some fancy stuff allowing us
    452452     * 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;
    458465    /* Invalid type for unknown words: */
    459466    if (!keys.contains(strMenuApplicationActionType, Qt::CaseInsensitive))
     
    462469    return values.at(keys.indexOf(QRegExp(strMenuApplicationActionType, Qt::CaseInsensitive)));
    463470}
    464 #endif /* Q_WS_MAC */
    465471
    466472/* QString <= UIExtraDataMetaDefs::MenuHelpActionType: */
     
    472478        case UIExtraDataMetaDefs::MenuHelpActionType_Contents:             strResult = "Contents"; break;
    473479        case UIExtraDataMetaDefs::MenuHelpActionType_WebSite:              strResult = "WebSite"; break;
    474         case UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings:        strResult = "ResetWarnings"; break;
    475 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    476         case UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager: strResult = "NetworkAccessManager"; break;
    477         case UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates:      strResult = "CheckForUpdates"; break;
    478 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    479480#ifndef Q_WS_MAC
    480481        case UIExtraDataMetaDefs::MenuHelpActionType_About:                strResult = "About"; break;
    481         case UIExtraDataMetaDefs::MenuHelpActionType_Preferences:          strResult = "Preferences"; break;
    482482#endif /* !Q_WS_MAC */
    483483        case UIExtraDataMetaDefs::MenuHelpActionType_All:                  strResult = "All"; break;
     
    499499    keys << "Contents";             values << UIExtraDataMetaDefs::MenuHelpActionType_Contents;
    500500    keys << "WebSite";              values << UIExtraDataMetaDefs::MenuHelpActionType_WebSite;
    501     keys << "ResetWarnings";        values << UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings;
    502 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    503     keys << "NetworkAccessManager"; values << UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager;
    504     keys << "CheckForUpdates";      values << UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates;
    505 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    506501#ifndef Q_WS_MAC
    507502    keys << "About";                values << UIExtraDataMetaDefs::MenuHelpActionType_About;
    508     keys << "Preferences";          values << UIExtraDataMetaDefs::MenuHelpActionType_Preferences;
    509503#endif /* !Q_WS_MAC */
    510504    keys << "All";                  values << UIExtraDataMetaDefs::MenuHelpActionType_All;
     
    530524        case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown:          strResult = "Shutdown"; break;
    531525        case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff:          strResult = "PowerOff"; break;
    532 #ifndef Q_WS_MAC
    533         case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close:             strResult = "Close"; break;
    534 #endif /* !Q_WS_MAC */
    535526        case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing:           strResult = "Nothing"; break;
    536527        case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All:               strResult = "All"; break;
     
    558549    keys << "Shutdown";          values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown;
    559550    keys << "PowerOff";          values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff;
    560 #ifndef Q_WS_MAC
    561     keys << "Close";             values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Close;
    562 #endif /* !Q_WS_MAC */
    563551    keys << "Nothing";           values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing;
    564552    keys << "All";               values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All;
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp

    r54463 r55170  
    9292#endif /* !Q_WS_MAC */
    9393const char* UIExtraDataDefs::GUI_RestrictedRuntimeMenus = "GUI/RestrictedRuntimeMenus";
    94 #ifdef Q_WS_MAC
    9594const char* UIExtraDataDefs::GUI_RestrictedRuntimeApplicationMenuActions = "GUI/RestrictedRuntimeApplicationMenuActions";
    96 #endif /* Q_WS_MAC */
    9795const char* UIExtraDataDefs::GUI_RestrictedRuntimeMachineMenuActions = "GUI/RestrictedRuntimeMachineMenuActions";
    9896const char* UIExtraDataDefs::GUI_RestrictedRuntimeViewMenuActions = "GUI/RestrictedRuntimeViewMenuActions";
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r54463 r55170  
    154154        /** Holds restricted Runtime UI menu types. */
    155155        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. */
    158157        extern const char* GUI_RestrictedRuntimeApplicationMenuActions;
    159 #endif /* Q_WS_MAC */
    160158        /** Holds restricted Runtime UI action types for Machine menu. */
    161159        extern const char* GUI_RestrictedRuntimeMachineMenuActions;
     
    295293    Q_OBJECT;
    296294    Q_ENUMS(MenuType);
    297 #ifdef RT_OS_DARWIN
    298295    Q_ENUMS(MenuApplicationActionType);
    299 #endif /* RT_OS_DARWIN */
    300296    Q_ENUMS(MenuHelpActionType);
    301297    Q_ENUMS(RuntimeMenuMachineActionType);
     
    316312    {
    317313        MenuType_Invalid     = 0,
    318 #ifdef RT_OS_DARWIN
    319314        MenuType_Application = RT_BIT(0),
    320 #endif /* RT_OS_DARWIN */
    321315        MenuType_Machine     = RT_BIT(1),
    322316        MenuType_View        = RT_BIT(2),
     
    333327    };
    334328
    335 #ifdef RT_OS_DARWIN
    336329    /** Menu "Application": Action types. */
    337330    enum MenuApplicationActionType
    338331    {
    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),
    345335#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    };
    346345
    347346    /** Menu "Help": Action types. */
     
    351350        MenuHelpActionType_Contents             = RT_BIT(0),
    352351        MenuHelpActionType_WebSite              = RT_BIT(1),
    353         MenuHelpActionType_ResetWarnings        = RT_BIT(2),
    354 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    355         MenuHelpActionType_NetworkAccessManager = RT_BIT(3),
    356         MenuHelpActionType_CheckForUpdates      = RT_BIT(4),
    357 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    358352#ifndef RT_OS_DARWIN
    359         MenuHelpActionType_About                = RT_BIT(5),
    360         MenuHelpActionType_Preferences          = RT_BIT(6),
     353        MenuHelpActionType_About                = RT_BIT(2),
    361354#endif /* !RT_OS_DARWIN */
    362355        MenuHelpActionType_All                  = 0xFFFF
     
    375368        RuntimeMenuMachineActionType_Shutdown          = RT_BIT(6),
    376369        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),
    381371        RuntimeMenuMachineActionType_All               = 0xFFFF
    382372    };
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r54794 r55170  
    17581758           << GUI_LastNormalWindowPosition << GUI_LastScaleWindowPosition
    17591759           << GUI_RestrictedRuntimeMenus
    1760 #ifdef Q_WS_MAC
    17611760           << GUI_RestrictedRuntimeApplicationMenuActions
    1762 #endif /* Q_WS_MAC */
    17631761           << GUI_RestrictedRuntimeMachineMenuActions
    17641762           << GUI_RestrictedRuntimeViewMenuActions
     
    26122610}
    26132611
    2614 #ifdef Q_WS_MAC
    26152612UIExtraDataMetaDefs::MenuApplicationActionType UIExtraDataManager::restrictedRuntimeMenuApplicationActionTypes(const QString &strID)
    26162613{
     
    26592656    setExtraDataStringList(GUI_RestrictedRuntimeApplicationMenuActions, result, strID);
    26602657}
    2661 #endif /* Q_WS_MAC */
    26622658
    26632659UIExtraDataMetaDefs::RuntimeMenuMachineActionType UIExtraDataManager::restrictedRuntimeMenuMachineActionTypes(const QString &strID)
     
    36753671#endif /* !Q_WS_MAC */
    36763672            strKey == GUI_RestrictedRuntimeMenus ||
    3677 #ifdef Q_WS_MAC
    36783673            strKey == GUI_RestrictedRuntimeApplicationMenuActions ||
    3679 #endif /* Q_WS_MAC */
    36803674            strKey == GUI_RestrictedRuntimeMachineMenuActions ||
    36813675            strKey == GUI_RestrictedRuntimeViewMenuActions ||
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r54794 r55170  
    312312        void setRestrictedRuntimeMenuTypes(UIExtraDataMetaDefs::MenuType types, const QString &strID);
    313313
    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. */
    316315        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. */
    318317        void setRestrictedRuntimeMenuApplicationActionTypes(UIExtraDataMetaDefs::MenuApplicationActionType types, const QString &strID);
    319 #endif /* Q_WS_MAC */
    320318
    321319        /** Returns restricted Runtime UI action types for Machine menu. */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r54272 r55170  
    316316
    317317
    318 #ifdef RT_OS_DARWIN
    319318class UIActionMenuApplication : public UIActionMenu
    320319{
     
    326325        : UIActionMenu(pParent)
    327326    {
     327#ifdef RT_OS_DARWIN
    328328        menu()->setConsumable(true);
     329#endif /* RT_OS_DARWIN */
    329330        retranslateUi();
    330331    }
     
    341342    void retranslateUi()
    342343    {
     344#ifdef RT_OS_DARWIN
    343345        setName(QApplication::translate("UIActionPool", "&VirtualBox"));
     346#else /* !RT_OS_DARWIN */
     347        setName(QApplication::translate("UIActionPool", "&File"));
     348#endif /* !RT_OS_DARWIN */
    344349    }
    345350};
     
    383388};
    384389
     390#ifdef RT_OS_DARWIN
    385391class UIActionMenuWindow : public UIActionMenu
    386392{
     
    550556        : UIActionSimple(pParent, ":/reset_warnings_16px.png")
    551557    {
     558        setMenuRole(QAction::ApplicationSpecificRole);
    552559        retranslateUi();
    553560    }
     
    556563
    557564    /** Returns action extra-data ID. */
    558     virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings; }
     565    virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings; }
    559566    /** Returns action extra-data key. */
    560     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings); }
     567    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings); }
    561568    /** Returns whether action is allowed. */
    562     virtual bool isAllowed() const { return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_ResetWarnings); }
     569    virtual bool isAllowed() const { return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings); }
    563570
    564571    QString shortcutExtraDataID() const
     
    584591        : UIActionSimple(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
    585592    {
     593        setMenuRole(QAction::ApplicationSpecificRole);
    586594        retranslateUi();
    587595    }
     
    590598
    591599    /** Returns action extra-data ID. */
    592     virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager; }
     600    virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager; }
    593601    /** Returns action extra-data key. */
    594     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager); }
     602    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager); }
    595603    /** Returns whether action is allowed. */
    596     virtual bool isAllowed() const { return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager); }
     604    virtual bool isAllowed() const { return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager); }
    597605
    598606    QString shortcutExtraDataID() const
     
    624632
    625633    /** Returns action extra-data ID. */
    626     virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates; }
     634    virtual int extraDataID() const { return UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates; }
    627635    /** Returns action extra-data key. */
    628     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates); }
     636    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates); }
    629637    /** Returns whether action is allowed. */
    630     virtual bool isAllowed() const { return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates); }
     638    virtual bool isAllowed() const { return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates); }
    631639
    632640    QString shortcutExtraDataID() const
     
    661669    virtual int extraDataID() const
    662670    {
    663 #ifdef Q_WS_MAC
     671#ifdef RT_OS_DARWIN
    664672        return UIExtraDataMetaDefs::MenuApplicationActionType_About;
    665 #else /* !Q_WS_MAC */
     673#else /* !RT_OS_DARWIN */
    666674        return UIExtraDataMetaDefs::MenuHelpActionType_About;
    667 #endif /* !Q_WS_MAC */
     675#endif /* !RT_OS_DARWIN */
    668676    }
    669677    /** Returns action extra-data key. */
    670678    virtual QString extraDataKey() const
    671679    {
    672 #ifdef Q_WS_MAC
     680#ifdef RT_OS_DARWIN
    673681        return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_About);
    674 #else /* !Q_WS_MAC */
     682#else /* !RT_OS_DARWIN */
    675683        return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_About);
    676 #endif /* !Q_WS_MAC */
     684#endif /* !RT_OS_DARWIN */
    677685    }
    678686    /** Returns whether action is allowed. */
    679687    virtual bool isAllowed() const
    680688    {
    681 #ifdef Q_WS_MAC
     689#ifdef RT_OS_DARWIN
    682690        return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_About);
    683 #else /* !Q_WS_MAC */
     691#else /* !RT_OS_DARWIN */
    684692        return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_About);
    685 #endif /* !Q_WS_MAC */
     693#endif /* !RT_OS_DARWIN */
    686694    }
    687695
     
    714722
    715723    /** 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; }
    724725    /** 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); }
    733727    /** 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); }
    742729
    743730    QString shortcutExtraDataID() const
     
    833820}
    834821
    835 #ifdef Q_WS_MAC
    836822bool UIActionPool::isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType type) const
    837823{
     
    848834}
    849835
     836#ifdef Q_WS_MAC
    850837bool UIActionPool::isAllowedInMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType type) const
    851838{
     
    910897void UIActionPool::preparePool()
    911898{
    912 #ifdef RT_OS_DARWIN
    913899    /* Create 'Application' actions: */
    914900    m_pool[UIActionIndex_M_Application] = new UIActionMenuApplication(this);
     901#ifdef RT_OS_DARWIN
    915902    m_pool[UIActionIndex_M_Application_S_About] = new UIActionSimpleAbout(this);
     903#endif /* RT_OS_DARWIN */
    916904    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);
    917910    m_pool[UIActionIndex_M_Application_S_Close] = new UIActionSimplePerformClose(this);
    918911
     912#ifdef RT_OS_DARWIN
    919913    /* Create 'Window' actions: */
    920914    m_pool[UIActionIndex_M_Window] = new UIActionMenuWindow(this);
     
    926920    m_pool[UIActionIndex_Simple_Contents] = new UIActionSimpleContents(this);
    927921    m_pool[UIActionIndex_Simple_WebSite] = new UIActionSimpleWebSite(this);
    928     m_pool[UIActionIndex_Simple_ResetWarnings] = new UIActionSimpleResetWarnings(this);
    929 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    930     m_pool[UIActionIndex_Simple_NetworkAccessManager] = new UIActionSimpleNetworkAccessManager(this);
    931     m_pool[UIActionIndex_Simple_CheckForUpdates] = new UIActionSimpleCheckForUpdates(this);
    932 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    933922#ifndef RT_OS_DARWIN
    934923    m_pool[UIActionIndex_Simple_About] = new UIActionSimpleAbout(this);
    935     m_pool[UIActionIndex_Simple_Preferences] = new UIActionSimplePreferences(this);
    936924#endif /* !RT_OS_DARWIN */
    937925
     
    952940void UIActionPool::prepareConnections()
    953941{
     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
    954956    /* 'Help' menu connections: */
    955957    connect(action(UIActionIndex_Simple_Contents), SIGNAL(triggered()),
     
    957959    connect(action(UIActionIndex_Simple_WebSite), SIGNAL(triggered()),
    958960            &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
    971962    connect(action(UIActionIndex_Simple_About), SIGNAL(triggered()),
    972963            &msgCenter(), SLOT(sltShowHelpAboutDialog()), Qt::UniqueConnection);
     
    10321023    if (!fUpdateAllowed)
    10331024    {
    1034         m_restrictedActionsMenuHelp[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::MenuHelpActionType)
    1035             (m_restrictedActionsMenuHelp[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::MenuHelpActionType_CheckForUpdates);
     1025        m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::MenuApplicationActionType)
     1026            (m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates);
    10361027    }
    10371028#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
     
    10481039}
    10491040
    1050 #ifdef RT_OS_DARWIN
    10511041void UIActionPool::updateMenuApplication()
    10521042{
    10531043    /* Get corresponding menu: */
    10541044    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 */
    10561049    /* Clear contents: */
     1050#ifdef RT_OS_DARWIN
    10571051    if (!pMenu->isConsumed())
     1052#endif /* RT_OS_DARWIN */
    10581053        pMenu->clear();
    10591054
     1055    /* Separator: */
     1056    bool fSeparator = false;
     1057
     1058#ifdef RT_OS_DARWIN
    10601059    /* '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
    10621063    /* '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
    10641091    /* 'Close' action: */
    1065     addAction(pMenu, action(UIActionIndex_M_Application_S_Close));
     1092    fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_Close)) || fSeparator;
    10661093
    10671094    /* Mark menu as valid: */
     
    10691096}
    10701097
     1098#ifdef RT_OS_DARWIN
    10711099void UIActionPool::updateMenuWindow()
    10721100{
     
    11061134
    11071135    /* 'Contents' action: */
    1108     fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Contents));
     1136    fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Contents)) || fSeparator;;
    11091137    /* 'Web Site' action: */
    1110     fSeparator = addAction(pMenu, action(UIActionIndex_Simple_WebSite));
     1138    fSeparator = addAction(pMenu, action(UIActionIndex_Simple_WebSite)) || fSeparator;;
    11111139
    11121140    /* Separator? */
     
    11171145    }
    11181146
    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_MANAGER
    1130     /* '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 
    11441147#ifndef RT_OS_DARWIN
    11451148    /* '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;;
    11501150#endif /* !RT_OS_DARWIN */
    11511151
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r54272 r55170  
    5252enum UIActionIndex
    5353{
    54 #ifdef RT_OS_DARWIN
    5554    /* 'Application' menu actions: */
    5655    UIActionIndex_M_Application,
     56#ifdef RT_OS_DARWIN
    5757    UIActionIndex_M_Application_S_About,
     58#endif /* RT_OS_DARWIN */
    5859    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,
    5965    UIActionIndex_M_Application_S_Close,
    6066
     67#ifdef RT_OS_DARWIN
    6168    /* 'Window' menu actions: */
    6269    UIActionIndex_M_Window,
     
    6875    UIActionIndex_Simple_Contents,
    6976    UIActionIndex_Simple_WebSite,
    70     UIActionIndex_Simple_ResetWarnings,
    71 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    72     UIActionIndex_Simple_NetworkAccessManager,
    73     UIActionIndex_Simple_CheckForUpdates,
    74 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    7577#ifndef RT_OS_DARWIN
    7678    UIActionIndex_Simple_About,
    77     UIActionIndex_Simple_Preferences,
    7879#endif /* !RT_OS_DARWIN */
    7980
     
    366367    void setRestrictionForMenuBar(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuType restriction);
    367368
    368 #ifdef Q_WS_MAC
    369369    /** Returns whether the action with passed @a type is allowed in the 'Application' menu. */
    370370    bool isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType type) const;
     
    372372    void setRestrictionForMenuApplication(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuApplicationActionType restriction);
    373373
    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. */
    375376    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. */
    377378    void setRestrictionForMenuWindow(UIActionRestrictionLevel level, UIExtraDataMetaDefs::MenuWindowActionType restriction);
    378379#endif /* Q_WS_MAC */
     
    425426    /** Update menus routine. */
    426427    virtual void updateMenus() = 0;
    427 #ifdef RT_OS_DARWIN
    428428    /** Update 'Application' menu routine. */
    429429    virtual void updateMenuApplication();
    430     /** Update 'Window' menu routine. */
     430#ifdef RT_OS_DARWIN
     431    /** Mac OS X: Update 'Window' menu routine. */
    431432    virtual void updateMenuWindow();
    432433#endif /* RT_OS_DARWIN */
     
    462463    /** Holds restricted menu types. */
    463464    QMap<UIActionRestrictionLevel, UIExtraDataMetaDefs::MenuType> m_restrictedMenus;
    464 #ifdef Q_WS_MAC
    465465    /** Holds restricted action types of the 'Application' menu. */
    466466    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. */
    468469    QMap<UIActionRestrictionLevel, UIExtraDataMetaDefs::MenuWindowActionType> m_restrictedActionsMenuWindow;
    469470#endif /* Q_WS_MAC */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r54990 r55170  
    342342};
    343343
    344 #ifndef RT_OS_DARWIN
    345 class UIActionSimplePerformClose : public UIActionSimple
    346 {
    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() const
    367     {
    368         return QString("Close");
    369     }
    370 
    371     QKeySequence defaultShortcut(UIActionPoolType) const
    372     {
    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 
    384344class UIActionMenuView : public UIActionMenu
    385345{
     
    20642024    m_pool[UIActionIndexRT_M_Machine_S_Shutdown] = new UIActionSimplePerformShutdown(this);
    20652025    m_pool[UIActionIndexRT_M_Machine_S_PowerOff] = new UIActionSimplePerformPowerOff(this);
    2066 #ifndef RT_OS_DARWIN
    2067     m_pool[UIActionIndexRT_M_Machine_S_Close] = new UIActionSimplePerformClose(this);
    2068 #endif /* !RT_OS_DARWIN */
    20692026
    20702027    /* 'View' actions: */
     
    21822139    /* Recache common action restrictions: */
    21832140    m_restrictedMenus[UIActionRestrictionLevel_Base] =                  gEDataManager->restrictedRuntimeMenuTypes(strMachineID);
    2184 #ifdef Q_WS_MAC
    21852141    m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuApplicationActionTypes(strMachineID);
    2186 #endif /* Q_WS_MAC */
    21872142    m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] =     gEDataManager->restrictedRuntimeMenuMachineActionTypes(strMachineID);
    21882143    m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] =        gEDataManager->restrictedRuntimeMenuViewActionTypes(strMachineID);
     
    22582213    if (fAllCloseActionsRestricted)
    22592214    {
    2260 #ifdef Q_WS_MAC
    22612215        m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::MenuApplicationActionType)
    22622216            (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 */
    22672217    }
    22682218
     
    22872237    m_mainMenus.clear();
    22882238
    2289 #ifdef RT_OS_DARWIN
    22902239    /* 'Application' menu: */
    22912240    addMenu(m_mainMenus, action(UIActionIndex_M_Application));
    22922241    updateMenuApplication();
    2293 #endif /* RT_OS_DARWIN */
    22942242
    22952243    /* 'Machine' menu: */
     
    23642312    /* 'PowerOff' action: */
    23652313    fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_PowerOff)) || fSeparator;
    2366 
    2367 #ifndef Q_WS_MAC
    2368     /* 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 */
    23782314
    23792315    /* Mark menu as valid: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r54990 r55170  
    4949    UIActionIndexRT_M_Machine_S_Shutdown,
    5050    UIActionIndexRT_M_Machine_S_PowerOff,
    51 #ifndef RT_OS_DARWIN
    52     UIActionIndexRT_M_Machine_S_Close,
    53 #endif /* !RT_OS_DARWIN */
    5451
    5552    /* 'View' menu actions: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r55146 r55170  
    10131013void UIMachineLogic::prepareActionConnections()
    10141014{
     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
    10151021    /* 'Machine' actions connections: */
    10161022    connect(actionPool()->action(UIActionIndexRT_M_Machine_S_Settings), SIGNAL(triggered()),
     
    10301036    connect(actionPool()->action(UIActionIndexRT_M_Machine_S_PowerOff), SIGNAL(triggered()),
    10311037            this, SLOT(sltPowerOff()), Qt::QueuedConnection);
    1032 #ifdef RT_OS_DARWIN
    1033     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 */
    10391038
    10401039    /* 'View' actions connections: */
     
    10981097            this, SLOT(sltMinimizeActiveMachineWindow()));
    10991098#endif /* Q_WS_MAC */
    1100 
    1101     /* 'Help' actions connections: */
    1102 #ifdef RT_OS_DARWIN
    1103     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 */
    11091099}
    11101100
     
    24072397        return;
    24082398
    2409 #ifdef RT_OS_DARWIN
    24102399    /* Check that we do NOT handling that already: */
    24112400    if (actionPool()->action(UIActionIndex_M_Application_S_Preferences)->data().toBool())
     
    24132402    /* Remember that we handling that already: */
    24142403    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 */
    24222404
    24232405    /* Create and execute global settings window: */
     
    24282410        delete pDialog;
    24292411
    2430 #ifdef RT_OS_DARWIN
    24312412    /* Remember that we do NOT handling that already: */
    24322413    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 */
    24372414}
    24382415
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.cpp

    r54990 r55170  
    135135            break;
    136136        }
    137 #ifdef Q_WS_MAC
    138137        case UIExtraDataMetaDefs::MenuType_Application:
    139138        {
     
    149148            break;
    150149        }
    151 #endif /* Q_WS_MAC */
    152150        case UIExtraDataMetaDefs::MenuType_Machine:
    153151        {
     
    337335{
    338336    /* Create menus: */
    339 #ifdef Q_WS_MAC
    340337    prepareMenuApplication();
    341 #endif /* Q_WS_MAC */
    342338    prepareMenuMachine();
    343339    prepareMenuView();
     
    503499}
    504500
     501void UIMenuBarEditorWidget::prepareMenuApplication()
     502{
     503    /* Copy menu: */
    505504#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 */
    510509    AssertPtrReturnVoid(pMenu);
    511510    {
     511#ifdef Q_WS_MAC
    512512        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_M_Application_S_About));
     513#endif /* Q_WS_MAC */
    513514        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}
    517524
    518525void UIMenuBarEditorWidget::prepareMenuMachine()
     
    637644        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_WebSite));
    638645        pMenu->addSeparator();
    639         prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_ResetWarnings));
    640 #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    641         pMenu->addSeparator();
    642         prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_NetworkAccessManager));
    643 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
    644646#ifndef Q_WS_MAC
    645         pMenu->addSeparator();
    646647        prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_About));
    647         prepareCopiedAction(pMenu, actionPool()->action(UIActionIndex_Simple_Preferences));
    648648#endif /* !Q_WS_MAC */
    649649    }
     
    692692
    693693    /* Update known menu-bar menus: */
    694 #ifdef Q_WS_MAC
    695694    updateMenuApplication();
    696 #endif /* Q_WS_MAC */
    697695    updateMenuMachine();
    698696    updateMenuView();
     
    708706}
    709707
    710 #ifdef Q_WS_MAC
    711708void UIMenuBarEditorWidget::updateMenuApplication()
    712709{
     
    737734    }
    738735}
    739 #endif /* Q_WS_MAC */
    740736
    741737void UIMenuBarEditorWidget::updateMenuMachine()
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMenuBarEditorWindow.h

    r54528 r55170  
    119119    /** Prepare menus routine. */
    120120    void prepareMenus();
    121 #ifdef Q_WS_MAC
    122     /** Mac OS X: Prepare 'Application' menu routine. */
     121    /** Prepare 'Application' menu routine. */
    123122    void prepareMenuApplication();
    124 #endif /* Q_WS_MAC */
    125123    /** Prepare 'Machine' menu routine. */
    126124    void prepareMenuMachine();
     
    148146    /** Update menus routine. */
    149147    void updateMenus();
    150 #ifdef Q_WS_MAC
    151     /** Mac OS X: Update 'Application' menu routine. */
     148    /** Update 'Application' menu routine. */
    152149    void updateMenuApplication();
    153 #endif /* Q_WS_MAC */
    154150    /** Update 'Machine' menu routine. */
    155151    void updateMenuMachine();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp

    r54472 r55170  
    251251            actionPool()->action(UIActionIndexRT_M_View_T_Fullscreen), SLOT(trigger()));
    252252    connect(m_pMiniToolBar, SIGNAL(sigCloseAction()),
    253             actionPool()->action(UIActionIndexRT_M_Machine_S_Close), SLOT(trigger()));
     253            actionPool()->action(UIActionIndex_M_Application_S_Close), SLOT(trigger()));
    254254    connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()),
    255255            this, SLOT(sltRevokeFocus()), Qt::QueuedConnection);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineWindowSeamless.cpp

    r54463 r55170  
    135135            actionPool()->action(UIActionIndexRT_M_View_T_Seamless), SLOT(trigger()));
    136136    connect(m_pMiniToolBar, SIGNAL(sigCloseAction()),
    137             actionPool()->action(UIActionIndexRT_M_Machine_S_Close), SLOT(trigger()));
     137            actionPool()->action(UIActionIndex_M_Application_S_Close), SLOT(trigger()));
    138138    connect(m_pMiniToolBar, SIGNAL(sigNotifyAboutFocusStolen()),
    139139            this, SLOT(sltRevokeFocus()), Qt::QueuedConnection);
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r53305 r55170  
    320320void UISelectorWindow::sltShowPreferencesDialog()
    321321{
    322 #ifdef RT_OS_DARWIN
    323322    /* Check that we do NOT handling that already: */
    324323    if (actionPool()->action(UIActionIndex_M_Application_S_Preferences)->data().toBool())
     
    326325    /* Remember that we handling that already: */
    327326    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 */
    335327
    336328    /* Don't show the inaccessible warning
     
    342334    dialog.execute();
    343335
    344 #ifdef RT_OS_DARWIN
    345336    /* Remember that we do NOT handling that already: */
    346337    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 */
    351338}
    352339
     
    11511138
    11521139    /* 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 */
    11541144    pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ImportAppliance));
    11551145    pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance));
    1156 #ifndef Q_WS_MAC
    11571146    pMenu->addSeparator();
    1158 #endif /* Q_WS_MAC */
     1147    pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowMediumManager));
    11591148#ifdef DEBUG
    11601149    pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager));
    11611150#endif /* DEBUG */
    1162 #ifdef Q_WS_MAC
    1163     pMenu->addAction(actionPool()->action(UIActionIndex_M_Application_S_About));
     1151#ifndef Q_WS_MAC
    11641152    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 */
    11671154    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 */
    11691162    pMenu->addAction(actionPool()->action(UIActionIndexST_M_File_S_Close));
    11701163}
     
    13861379    connect(actionPool()->action(UIActionIndexST_M_File_S_ShowExtraDataManager), SIGNAL(triggered()), this, SLOT(sltOpenExtraDataManagerWindow()));
    13871380#endif /* DEBUG */
    1388 #ifdef RT_OS_DARWIN
    13891381    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 */
    13931382    connect(actionPool()->action(UIActionIndexST_M_File_S_Close), SIGNAL(triggered()), this, SLOT(sltPerformExit()));
    13941383
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette