VirtualBox

Changeset 51392 in vbox


Ignore:
Timestamp:
May 26, 2014 12:32:56 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
93913
Message:

FE/Qt: Implement 'Global Preferences' action for Runtime UI.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r51215 r51392  
    249249enum RuntimeMenuApplicationActionType
    250250{
    251     RuntimeMenuApplicationActionType_Invalid = 0,
    252     RuntimeMenuApplicationActionType_About   = RT_BIT(0),
    253     RuntimeMenuApplicationActionType_All     = 0xFFFF
     251    RuntimeMenuApplicationActionType_Invalid     = 0,
     252    RuntimeMenuApplicationActionType_About       = RT_BIT(0),
     253    RuntimeMenuApplicationActionType_Preferences = RT_BIT(1),
     254    RuntimeMenuApplicationActionType_All         = 0xFFFF
    254255};
    255256#endif /* Q_WS_MAC */
     
    335336#ifndef Q_WS_MAC
    336337    RuntimeMenuHelpActionType_About                = RT_BIT(4),
     338    RuntimeMenuHelpActionType_Preferences          = RT_BIT(5),
    337339#endif /* !Q_WS_MAC */
    338340    RuntimeMenuHelpActionType_All                  = 0xFFFF
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp

    r50165 r51392  
    629629    else
    630630        gActionPool->action(UIActionIndex_Simple_About)->setEnabled(false);
     631
     632    /* Preferences action: */
     633#ifdef Q_WS_MAC
     634    if (m_pSession->allowedActionsMenuApplication() & RuntimeMenuApplicationActionType_Preferences)
     635#else /* !Q_WS_MAC */
     636    if (m_pSession->allowedActionsMenuHelp() & RuntimeMenuHelpActionType_Preferences)
     637#endif /* Q_WS_MAC */
     638    {
     639        pMenu->addAction(gActionPool->action(UIActionIndex_Simple_Preferences));
     640        VBoxGlobal::connect(gActionPool->action(UIActionIndex_Simple_Preferences), SIGNAL(triggered()),
     641                            m_pSession, SLOT(sltOpenGlobalPreferences()));
     642    }
     643    else
     644        gActionPool->action(UIActionIndex_Simple_Preferences)->setEnabled(false);
    631645}
    632646
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r51322 r51392  
    4040#include "UIConsoleEventHandler.h"
    4141#include "UIFrameBuffer.h"
     42#include "UISettingsDialogSpecific.h"
    4243#ifdef VBOX_WITH_VIDEOHWACCEL
    4344# include "VBoxFBOverlay.h"
     
    698699}
    699700
     701void UISession::sltOpenGlobalPreferences()
     702{
     703    /* Check that we do NOT handling that already: */
     704    if (gActionPool->action(UIActionIndex_Simple_Preferences)->data().toBool())
     705        return;
     706    /* Remember that we handling that already: */
     707    gActionPool->action(UIActionIndex_Simple_Preferences)->setData(true);
     708
     709    /* Create and execute global settings window: */
     710    QPointer<UISettingsDialogGlobal> pDialog = new UISettingsDialogGlobal(machineLogic()->activeMachineWindow());
     711    pDialog->execute();
     712    if (pDialog)
     713        delete pDialog;
     714
     715    /* Remember that we do NOT handling that already: */
     716    gActionPool->action(UIActionIndex_Simple_Preferences)->setData(false);
     717}
     718
    700719void UISession::sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape)
    701720{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r51252 r51392  
    284284    void sltCloseRuntimeUI();
    285285
     286    /** Open global preferences. */
     287    void sltOpenGlobalPreferences();
     288
    286289    /* Console events slots */
    287290    void sltMousePointerShapeChange(bool fVisible, bool fAlpha, QPoint hotCorner, QSize size, QVector<uint8_t> shape);
Note: See TracChangeset for help on using the changeset viewer.

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