VirtualBox

Ignore:
Timestamp:
Oct 24, 2018 8:15:35 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6699. Some prep. work for moving the guest control widgets into a separate dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolRuntime.cpp

    r74942 r75018  
    230230};
    231231
     232/** Simple action extension, used as 'Show Guest Control Dialog' action class. */
     233class UIActionSimpleRuntimeShowGuestControlDialog : public UIActionSimple
     234{
     235    Q_OBJECT;
     236
     237public:
     238
     239    /** Constructs action passing @a pParent to the base-class. */
     240    UIActionSimpleRuntimeShowGuestControlDialog(UIActionPool *pParent)
     241        : UIActionSimple(pParent, ":/session_info_16px.png", ":/session_info_disabled_16px.png", true)
     242    {}
     243
     244protected:
     245
     246    /** Returns action extra-data ID. */
     247    virtual int extraDataID() const /* override */
     248    {
     249        return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestControlDialog;
     250    }
     251    /** Returns action extra-data key. */
     252    virtual QString extraDataKey() const /* override */
     253    {
     254        return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestControlDialog);
     255    }
     256    /** Returns whether action is allowed. */
     257    virtual bool isAllowed() const /* override */
     258    {
     259        return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestControlDialog);
     260    }
     261
     262    /** Returns shortcut extra-data ID. */
     263    virtual QString shortcutExtraDataID() const /* override */
     264    {
     265        return QString("GuestControlDialog");
     266    }
     267
     268    /** Returns default shortcut. */
     269    virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */
     270    {
     271        return QKeySequence();
     272    }
     273
     274    /** Handles translation event. */
     275    virtual void retranslateUi() /* override */
     276    {
     277        setName(QApplication::translate("UIActionPool", "Guest Control..."));
     278        setStatusTip(QApplication::translate("UIActionPool", "Display the virtual machine guest control window"));
     279    }
     280};
     281
    232282/** Toggle action extension, used as 'Pause' action class. */
    233283class UIActionToggleRuntimePause : public UIActionToggle
     
    31843234    m_pool[UIActionIndexRT_M_Machine_S_TakeSnapshot] = new UIActionSimpleRuntimePerformTakeSnapshot(this);
    31853235    m_pool[UIActionIndexRT_M_Machine_S_ShowInformation] = new UIActionSimpleRuntimeShowInformationDialog(this);
     3236    m_pool[UIActionIndexRT_M_Machine_S_ShowGuestControl] = new UIActionSimpleRuntimeShowGuestControlDialog(this);
    31863237    m_pool[UIActionIndexRT_M_Machine_T_Pause] = new UIActionToggleRuntimePause(this);
    31873238    m_pool[UIActionIndexRT_M_Machine_S_Reset] = new UIActionSimpleRuntimePerformReset(this);
     
    34853536    /* 'Information Dialog' action: */
    34863537    fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowInformation)) || fSeparator;
     3538    fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowGuestControl)) || fSeparator;
    34873539
    34883540    /* Separator: */
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