VirtualBox

Changeset 56059 in vbox


Ignore:
Timestamp:
May 25, 2015 2:16:35 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
100581
Message:

FE/Qt: Runtime UI: Action-pool: Implementation for the Window Minimize action.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp

    r55187 r56059  
    569569        case UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale:                strResult = "Scale"; break;
    570570        case UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize:      strResult = "GuestAutoresize"; break;
     571        case UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow:       strResult = "MinimizeWindow"; break;
    571572        case UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow:         strResult = "AdjustWindow"; break;
    572573        case UIExtraDataMetaDefs::RuntimeMenuViewActionType_TakeScreenshot:       strResult = "TakeScreenshot"; break;
     
    606607    keys << "Scale";                values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale;
    607608    keys << "GuestAutoresize";      values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize;
     609    keys << "MinimizeWindow";       values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow;
    608610    keys << "AdjustWindow";         values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow;
    609611    keys << "TakeScreenshot";       values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_TakeScreenshot;
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r55939 r56059  
    378378        RuntimeMenuViewActionType_Scale                = RT_BIT(2),
    379379        RuntimeMenuViewActionType_GuestAutoresize      = RT_BIT(3),
    380         RuntimeMenuViewActionType_AdjustWindow         = RT_BIT(4),
    381         RuntimeMenuViewActionType_TakeScreenshot       = RT_BIT(5),
    382         RuntimeMenuViewActionType_VideoCapture         = RT_BIT(6),
    383         RuntimeMenuViewActionType_VideoCaptureSettings = RT_BIT(7),
    384         RuntimeMenuViewActionType_StartVideoCapture    = RT_BIT(8),
    385         RuntimeMenuViewActionType_VRDEServer           = RT_BIT(9),
    386         RuntimeMenuViewActionType_MenuBar              = RT_BIT(10),
    387         RuntimeMenuViewActionType_MenuBarSettings      = RT_BIT(11),
     380        RuntimeMenuViewActionType_MinimizeWindow       = RT_BIT(4),
     381        RuntimeMenuViewActionType_AdjustWindow         = RT_BIT(5),
     382        RuntimeMenuViewActionType_TakeScreenshot       = RT_BIT(6),
     383        RuntimeMenuViewActionType_VideoCapture         = RT_BIT(7),
     384        RuntimeMenuViewActionType_VideoCaptureSettings = RT_BIT(8),
     385        RuntimeMenuViewActionType_StartVideoCapture    = RT_BIT(9),
     386        RuntimeMenuViewActionType_VRDEServer           = RT_BIT(10),
     387        RuntimeMenuViewActionType_MenuBar              = RT_BIT(11),
     388        RuntimeMenuViewActionType_MenuBarSettings      = RT_BIT(12),
    388389#ifndef RT_OS_DARWIN
    389         RuntimeMenuViewActionType_ToggleMenuBar        = RT_BIT(12),
     390        RuntimeMenuViewActionType_ToggleMenuBar        = RT_BIT(13),
    390391#endif /* !RT_OS_DARWIN */
    391         RuntimeMenuViewActionType_StatusBar            = RT_BIT(13),
    392         RuntimeMenuViewActionType_StatusBarSettings    = RT_BIT(14),
    393         RuntimeMenuViewActionType_ToggleStatusBar      = RT_BIT(15),
    394         RuntimeMenuViewActionType_ScaleFactor          = RT_BIT(16),
    395         RuntimeMenuViewActionType_Resize               = RT_BIT(17),
    396         RuntimeMenuViewActionType_Multiscreen          = RT_BIT(18),
     392        RuntimeMenuViewActionType_StatusBar            = RT_BIT(14),
     393        RuntimeMenuViewActionType_StatusBarSettings    = RT_BIT(15),
     394        RuntimeMenuViewActionType_ToggleStatusBar      = RT_BIT(16),
     395        RuntimeMenuViewActionType_ScaleFactor          = RT_BIT(17),
     396        RuntimeMenuViewActionType_Resize               = RT_BIT(18),
     397        RuntimeMenuViewActionType_Multiscreen          = RT_BIT(19),
    397398        RuntimeMenuViewActionType_All                  = 0xFFFF
    398399    };
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r56058 r56059  
    498498};
    499499
     500class UIActionSimplePerformMinimizeWindow : public UIActionSimple
     501{
     502    Q_OBJECT;
     503
     504public:
     505
     506    UIActionSimplePerformMinimizeWindow(UIActionPool *pParent)
     507        : UIActionSimple(pParent, ":/minimize_16px.png") {}
     508
     509protected:
     510
     511    /** Returns action extra-data ID. */
     512    virtual int extraDataID() const { return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow; }
     513    /** Returns action extra-data key. */
     514    virtual QString extraDataKey() const { return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow); }
     515    /** Returns whether action is allowed. */
     516    virtual bool isAllowed() const { return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow); }
     517
     518    QString shortcutExtraDataID() const
     519    {
     520        return QString("WindowMinimize");
     521    }
     522
     523    QKeySequence defaultShortcut(UIActionPoolType) const
     524    {
     525        return QKeySequence("M");
     526    }
     527
     528    void retranslateUi()
     529    {
     530        setName(QApplication::translate("UIActionPool", "&Minimize Window"));
     531        setStatusTip(QApplication::translate("UIActionPool", "Minimize currently active window"));
     532    }
     533};
     534
    500535class UIActionSimplePerformWindowAdjust : public UIActionSimple
    501536{
     
    20312066    m_pool[UIActionIndexRT_M_View_T_Seamless] = new UIActionToggleSeamlessMode(this);
    20322067    m_pool[UIActionIndexRT_M_View_T_Scale] = new UIActionToggleScaleMode(this);
     2068    m_pool[UIActionIndexRT_M_View_S_MinimizeWindow] = new UIActionSimplePerformMinimizeWindow(this);
    20332069    m_pool[UIActionIndexRT_M_View_S_AdjustWindow] = new UIActionSimplePerformWindowAdjust(this);
    20342070    m_pool[UIActionIndexRT_M_View_T_GuestAutoresize] = new UIActionToggleGuestAutoresize(this);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r55401 r56059  
    5757    UIActionIndexRT_M_View_T_Seamless,
    5858    UIActionIndexRT_M_View_T_Scale,
     59    UIActionIndexRT_M_View_S_MinimizeWindow,
    5960    UIActionIndexRT_M_View_S_AdjustWindow,
    6061    UIActionIndexRT_M_View_T_GuestAutoresize,
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r56058 r56059  
    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));
    960959    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_View_T_GuestAutoresize));
    961960    m_pRunningActions->addAction(actionPool()->action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCAD));
     
    972971    m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_S_ShowInformation));
    973972    m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_Machine_T_Pause));
     973    m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_MinimizeWindow));
     974    m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow));
    974975    m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_S_TakeScreenshot));
    975976    m_pRunningOrPausedActions->addAction(actionPool()->action(UIActionIndexRT_M_View_M_VideoCapture));
     
    10401041
    10411042    /* 'View' actions connections: */
     1043    connect(actionPool()->action(UIActionIndexRT_M_View_S_MinimizeWindow), SIGNAL(triggered()),
     1044            this, SLOT(sltMinimizeWindow()));
    10421045    connect(actionPool()->action(UIActionIndexRT_M_View_S_AdjustWindow), SIGNAL(triggered()),
    10431046            this, SLOT(sltAdjustWindow()));
     
    15461549}
    15471550
     1551void UIMachineLogic::sltMinimizeWindow()
     1552{
     1553    /* Do not process if window(s) missed! */
     1554    if (!isMachineWindowsCreated())
     1555        return;
     1556
     1557    /* Minimize currently active machine-window: */
     1558    activeMachineWindow()->showMinimized();
     1559}
     1560
    15481561void UIMachineLogic::sltAdjustWindow()
    15491562{
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r55697 r56059  
    267267    /* "View" menu functionality: */
    268268    void sltToggleGuestAutoresize(bool fEnabled);
     269    void sltMinimizeWindow();
    269270    void sltAdjustWindow();
    270271    void sltTakeScreenshot();
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineLogicFullscreen.cpp

    r55697 r56059  
    466466                                                         (UIExtraDataMetaDefs::RuntimeMenuViewActionType)
    467467                                                         (UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow |
     468#ifdef Q_WS_MAC
     469                                                          UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow |
     470#endif /* Q_WS_MAC */
    468471                                                          UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar |
    469472                                                          UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar |
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