VirtualBox

Changeset 56058 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
May 25, 2015 1:42:13 PM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Runtime UI: Action-pool: Small code reordering to sync with actual action positions.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
2 edited

Legend:

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

    r56037 r56058  
    498498};
    499499
     500class UIActionSimplePerformWindowAdjust : public UIActionSimple
     501{
     502    Q_OBJECT;
     503
     504public:
     505
     506    UIActionSimplePerformWindowAdjust(UIActionPool *pParent)
     507        : UIActionSimple(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png") {}
     508
     509protected:
     510
     511    /** Returns action extra-data ID. */
     512    virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow; }
     513    /** Returns action extra-data key. */
     514    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); }
     515    /** Returns whether action is allowed. */
     516    virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); }
     517
     518    QString shortcutExtraDataID() const
     519    {
     520        return QString("WindowAdjust");
     521    }
     522
     523    QKeySequence defaultShortcut(UIActionPoolType) const
     524    {
     525        return QKeySequence("A");
     526    }
     527
     528    void retranslateUi()
     529    {
     530        setName(QApplication::translate("UIActionPool", "&Adjust Window Size"));
     531        setStatusTip(QApplication::translate("UIActionPool", "Adjust window size and position to best fit the guest display"));
     532    }
     533};
     534
    500535class UIActionToggleGuestAutoresize : public UIActionToggle
    501536{
     
    532567        setName(QApplication::translate("UIActionPool", "Auto-resize &Guest Display"));
    533568        setStatusTip(QApplication::translate("UIActionPool", "Automatically resize the guest display when the window is resized (requires Guest Additions)"));
    534     }
    535 };
    536 
    537 class UIActionSimplePerformWindowAdjust : public UIActionSimple
    538 {
    539     Q_OBJECT;
    540 
    541 public:
    542 
    543     UIActionSimplePerformWindowAdjust(UIActionPool *pParent)
    544         : UIActionSimple(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png") {}
    545 
    546 protected:
    547 
    548     /** Returns action extra-data ID. */
    549     virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow; }
    550     /** Returns action extra-data key. */
    551     virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); }
    552     /** Returns whether action is allowed. */
    553     virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow); }
    554 
    555     QString shortcutExtraDataID() const
    556     {
    557         return QString("WindowAdjust");
    558     }
    559 
    560     QKeySequence defaultShortcut(UIActionPoolType) const
    561     {
    562         return QKeySequence("A");
    563     }
    564 
    565     void retranslateUi()
    566     {
    567         setName(QApplication::translate("UIActionPool", "&Adjust Window Size"));
    568         setStatusTip(QApplication::translate("UIActionPool", "Adjust window size and position to best fit the guest display"));
    569569    }
    570570};
     
    20312031    m_pool[UIActionIndexRT_M_View_T_Seamless] = new UIActionToggleSeamlessMode(this);
    20322032    m_pool[UIActionIndexRT_M_View_T_Scale] = new UIActionToggleScaleMode(this);
     2033    m_pool[UIActionIndexRT_M_View_S_AdjustWindow] = new UIActionSimplePerformWindowAdjust(this);
    20332034    m_pool[UIActionIndexRT_M_View_T_GuestAutoresize] = new UIActionToggleGuestAutoresize(this);
    2034     m_pool[UIActionIndexRT_M_View_S_AdjustWindow] = new UIActionSimplePerformWindowAdjust(this);
    20352035    m_pool[UIActionIndexRT_M_View_S_TakeScreenshot] = new UIActionSimplePerformTakeScreenshot(this);
    20362036    m_pool[UIActionIndexRT_M_View_M_VideoCapture] = new UIActionMenuVideoCapture(this);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r55977 r56058  
    957957    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_Seamless));
    958958    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_Scale));
     959    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow));
    959960    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize));
    960     m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow));
    961961    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCAD));
    962962#ifdef Q_WS_X11
     
    10401040
    10411041    /* 'View' actions connections: */
     1042    connect(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow), SIGNAL(triggered()),
     1043            this, SLOT(sltAdjustWindow()));
    10421044    connect(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize), SIGNAL(toggled(bool)),
    10431045            this, SLOT(sltToggleGuestAutoresize(bool)));
    1044     connect(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow), SIGNAL(triggered()),
    1045             this, SLOT(sltAdjustWindow()));
    10461046    connect(actionPool()->action(UIActionIndexRT_M_View_S_TakeScreenshot), SIGNAL(triggered()),
    10471047            this, SLOT(sltTakeScreenshot()));
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