VirtualBox

Changeset 58674 in vbox


Ignore:
Timestamp:
Nov 12, 2015 3:15:45 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:7909: Mac OS X: Runtime UI: Extra-Data Manager: Action-pool: Renaming dock icon disable overlay action and some code style rework.

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

Legend:

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

    r58544 r58674  
    136136const char* UIExtraDataDefs::GUI_RealtimeDockIconUpdateEnabled = "GUI/RealtimeDockIconUpdateEnabled";
    137137const char* UIExtraDataDefs::GUI_RealtimeDockIconUpdateMonitor = "GUI/RealtimeDockIconUpdateMonitor";
    138 const char* UIExtraDataDefs::GUI_DockIconOverlayDisabled = "GUI/DockIconOverlayDisabled";
     138const char* UIExtraDataDefs::GUI_DockIconDisableOverlay = "GUI/DockIconDisableOverlay";
    139139#endif /* Q_WS_MAC */
    140140const char* UIExtraDataDefs::GUI_PassCAD = "GUI/PassCAD";
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r58621 r58674  
    235235        /** Mac OS X: Holds guest-screen which Dock icon should reflect at runtime. */
    236236        extern const char* GUI_RealtimeDockIconUpdateMonitor;
    237         /** Mac OS X: Holds whether Dock icon should disable guest-os overlay. */
    238         extern const char* GUI_DockIconOverlayDisabled;
     237        /** Mac OS X: Holds whether Dock icon should have overlay disabled. */
     238        extern const char* GUI_DockIconDisableOverlay;
    239239#endif /* Q_WS_MAC */
    240240        /** Holds whether machine should pass CAD to guest. */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r58544 r58674  
    18741874           << GUI_StatusBar_Enabled << GUI_RestrictedStatusBarIndicators << GUI_StatusBar_IndicatorOrder
    18751875#ifdef Q_WS_MAC
    1876            << GUI_RealtimeDockIconUpdateEnabled << GUI_RealtimeDockIconUpdateMonitor << GUI_DockIconOverlayDisabled
     1876           << GUI_RealtimeDockIconUpdateEnabled << GUI_RealtimeDockIconUpdateMonitor << GUI_DockIconDisableOverlay
    18771877#endif /* Q_WS_MAC */
    18781878           << GUI_PassCAD
     
    34313431}
    34323432
    3433 bool UIExtraDataManager::dockIconOverlayDisabled(const QString &strID)
    3434 {   
     3433bool UIExtraDataManager::dockIconDisableOverlay(const QString &strID)
     3434{
    34353435    /* 'False' unless feature allowed: */
    3436     return isFeatureAllowed(GUI_DockIconOverlayDisabled, strID);
    3437 }
    3438 
    3439 void UIExtraDataManager::setdockIconOverlayDisabled(bool fDisabled, const QString &strID)
     3436    return isFeatureAllowed(GUI_DockIconDisableOverlay, strID);
     3437}
     3438
     3439void UIExtraDataManager::setDockIconDisableOverlay(bool fDisabled, const QString &strID)
    34403440{
    34413441    /* 'True' if feature allowed, null-string otherwise: */
    3442     setExtraDataString(GUI_DockIconOverlayDisabled, toFeatureAllowed(fDisabled), strID);
     3442    setExtraDataString(GUI_DockIconDisableOverlay, toFeatureAllowed(fDisabled), strID);
    34433443}
    34443444#endif /* Q_WS_MAC */
     
    38253825                     strKey == GUI_RealtimeDockIconUpdateMonitor)
    38263826                emit sigDockIconAppearanceChange(!isFeatureRestricted(strKey, strMachineID));
    3827             /* 'Dock icon overlay' appearance changed (allowed if not restricted)? */
    3828             else if (strKey == GUI_DockIconOverlayDisabled)
     3827            /* 'Dock icon overlay' appearance changed (restricted if not allowed)? */
     3828            else if (strKey == GUI_DockIconDisableOverlay)
    38293829                emit sigDockIconOverlayAppearanceChange(isFeatureAllowed(strKey, strMachineID));
    38303830#endif /* Q_WS_MAC */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r58544 r58674  
    464464
    465465        /** Mac OS X: Returns whether Dock icon overlay is disabled. */
    466         bool dockIconOverlayDisabled(const QString &strID);
    467         /** Mac OS X: Defines whether Dock icon overlay @a fDisabled. */
    468         void setdockIconOverlayDisabled(bool fDisabled, const QString &strID);
     466        bool dockIconDisableOverlay(const QString &strID);
     467        /** Mac OS X: Defines whether Dock icon overlay is @a fDisabled. */
     468        void setDockIconDisableOverlay(bool fDisabled, const QString &strID);
    469469#endif /* Q_WS_MAC */
    470470
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UIAbstractDockIconPreview.cpp

    r58544 r58674  
    122122{
    123123    /* Determine whether dock icon overlay is not disabled: */
    124     if (!gEDataManager->dockIconOverlayDisabled(vboxGlobal().managedVMUuid()))
     124    if (!gEDataManager->dockIconDisableOverlay(vboxGlobal().managedVMUuid()))
    125125    {
    126         /* Initialize overlayrect: */
     126        /* Initialize overlay rectangle: */
    127127        CGRect overlayRect = CGRectMake(0, 0, 0, 0);
    128128        /* Make sure overlay image is valid: */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r58550 r58674  
    18401840};
    18411841
    1842 class UIActionToggleDockIconOverlayDisabled : public UIActionToggle
    1843 {
    1844     Q_OBJECT;
    1845 
    1846 public:
    1847 
    1848     UIActionToggleDockIconOverlayDisabled(UIActionPool *pParent)
     1842class UIActionToggleDockIconDisableOverlay : public UIActionToggle
     1843{
     1844    Q_OBJECT;
     1845
     1846public:
     1847
     1848    UIActionToggleDockIconDisableOverlay(UIActionPool *pParent)
    18491849        : UIActionToggle(pParent) {}
    18501850
     
    21492149    m_pool[UIActionIndexRT_M_Dock_M_DockSettings_T_PreviewMonitor] = new UIActionToggleDockPreviewMonitor(this);
    21502150    m_pool[UIActionIndexRT_M_Dock_M_DockSettings_T_DisableMonitor] = new UIActionToggleDockDisableMonitor(this);
    2151     m_pool[UIActionIndexRT_M_Dock_M_DockSettings_T_OverlayDisabled] = new UIActionToggleDockIconOverlayDisabled(this);
     2151    m_pool[UIActionIndexRT_M_Dock_M_DockSettings_T_DisableOverlay] = new UIActionToggleDockIconDisableOverlay(this);
    21522152#endif /* Q_WS_MAC */
    21532153
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r58550 r58674  
    122122    UIActionIndexRT_M_Dock_M_DockSettings_T_PreviewMonitor,
    123123    UIActionIndexRT_M_Dock_M_DockSettings_T_DisableMonitor,
    124     UIActionIndexRT_M_Dock_M_DockSettings_T_OverlayDisabled,
     124    UIActionIndexRT_M_Dock_M_DockSettings_T_DisableOverlay,
    125125#endif /* Q_WS_MAC */
    126126
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r58550 r58674  
    11941194            this, SLOT(sltChangeDockIconUpdate(bool)));
    11951195
    1196     /* Get dock icon overlay disabled action: */
    1197     QAction *pDockIconOverlayDisabled = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_OverlayDisabled);
    1198     /* Prepare dock icon overlay disabled action with initial data: */
    1199     pDockIconOverlayDisabled->setChecked(gEDataManager->dockIconOverlayDisabled(vboxGlobal().managedVMUuid()));
    1200     /* Connect dock icon overlay disabled signals: */
    1201     connect(pDockIconOverlayDisabled, SIGNAL(triggered(bool)),
    1202             this, SLOT(sltDockIconOverlayDisabledChanged(bool)));
     1196    /* Get dock icon disable overlay action: */
     1197    QAction *pDockIconDisableOverlay = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableOverlay);
     1198    /* Prepare dock icon disable overlay action with initial data: */
     1199    pDockIconDisableOverlay->setChecked(gEDataManager->dockIconDisableOverlay(vboxGlobal().managedVMUuid()));
     1200    /* Connect dock icon disable overlay related signals: */
     1201    connect(pDockIconDisableOverlay, SIGNAL(triggered(bool)),
     1202            this, SLOT(sltDockIconDisableOverlayChanged(bool)));
    12031203    connect(gEDataManager, SIGNAL(sigDockIconOverlayAppearanceChange(bool)),
    12041204            this, SLOT(sltChangeDockIconOverlayAppearance(bool)));
    1205     /* Add dock icon overlay disabled action to the dock settings menu: */
    1206     pDockSettingsMenu->addAction(pDockIconOverlayDisabled);
     1205    /* Add dock icon disable overlay action to the dock settings menu: */
     1206    pDockSettingsMenu->addAction(pDockIconDisableOverlay);
    12071207
    12081208    /* Monitor selection if there are more than one monitor */
     
    21432143void UIMachineLogic::sltChangeDockIconOverlayAppearance(bool fDisabled)
    21442144{
    2145     /* Value of flag is directly referenced from extra-data manager later: */
    2146     Q_UNUSED(fDisabled);
    21472145    /* Update dock icon overlay: */
    21482146    if (isMachineWindowsCreated())
    21492147        updateDockOverlay();
    2150     /* Make sure to update dock icon action when dock icon overlay disabled changed from extra-data manager: */
    2151     QAction *pDockIconOverlayDisabled = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_OverlayDisabled);
    2152     if (fDisabled != pDockIconOverlayDisabled->isChecked())
    2153         pDockIconOverlayDisabled->setChecked(fDisabled);
    2154 }
    2155 
    2156 void UIMachineLogic::sltDockIconOverlayDisabledChanged(bool fDisabled)
    2157 {
    2158     /* Write dock icon overlay flag to extra-data: */
    2159     gEDataManager->setdockIconOverlayDisabled(fDisabled, vboxGlobal().managedVMUuid());
     2148    /* Make sure to update dock icon disable overlay action state when 'GUI_DockIconDisableOverlay' changed from extra-data manager: */
     2149    QAction *pDockIconDisableOverlay = actionPool()->action(UIActionIndexRT_M_Dock_M_DockSettings_T_DisableOverlay);
     2150    if (fDisabled != pDockIconDisableOverlay->isChecked())
     2151    {
     2152        /* Block signals initially to avoid recursive loop: */
     2153        pDockIconDisableOverlay->blockSignals(true);
     2154        /* Update state: */
     2155        pDockIconDisableOverlay->setChecked(fDisabled);
     2156        /* Make sure to unblock signals again: */
     2157        pDockIconDisableOverlay->blockSignals(false);
     2158    }
     2159}
     2160
     2161void UIMachineLogic::sltDockIconDisableOverlayChanged(bool fDisabled)
     2162{
     2163    /* Write dock icon disable overlay flag to extra-data: */
     2164    gEDataManager->setDockIconDisableOverlay(fDisabled, vboxGlobal().managedVMUuid());
    21602165}
    21612166#endif /* Q_WS_MAC */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h

    r58550 r58674  
    314314    void sltChangeDockIconOverlayAppearance(bool fDisabled);
    315315    /** Handles dock icon overlay disable action triggering. */
    316     void sltDockIconOverlayDisabledChanged(bool fDisabled);
     316    void sltDockIconDisableOverlayChanged(bool fDisabled);
    317317#endif /* RT_OS_DARWIN */
    318318
     
    400400    QActionGroup *m_pDockPreviewSelectMonitorGroup;
    401401    int m_DockIconPreviewMonitor;
    402     /** Holds whether dock icon overlay disabled. */
    403     bool m_fIsDockIconOverlayDisabled;
    404402#endif /* Q_WS_MAC */
    405403
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