VirtualBox

Changeset 80773 in vbox


Ignore:
Timestamp:
Sep 13, 2019 11:10:21 AM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9510: Extra data related cleanup

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

Legend:

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

    r79921 r80773  
    194194const char *UIExtraDataDefs::GUI_Scaling_Optimization = "GUI/Scaling/Optimization";
    195195
    196 /* Virtual Machine: Information dialog: */
    197 const char *UIExtraDataDefs::GUI_InformationWindowGeometry = "GUI/InformationWindowGeometry";
    198 const char *UIExtraDataDefs::GUI_InformationWindowElements = "GUI/InformationWindowElements";
     196/* Virtual Machine: Session Information Dialog: */
     197const char *UIExtraDataDefs::GUI_SessionInformationDialogGeometry = "GUI/SessionInformationDialogGeometry";
    199198
    200199/* Guest control UI: */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r80129 r80773  
    369369      * @{ */
    370370        /** Holds information-window geometry. */
    371         SHARED_LIBRARY_STUFF extern const char *GUI_InformationWindowGeometry;
    372         /** Holds information-window elements. */
    373         SHARED_LIBRARY_STUFF extern const char *GUI_InformationWindowElements;
     371        SHARED_LIBRARY_STUFF extern const char *GUI_SessionInformationDialogGeometry;
    374372    /** @} */
    375373
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r79921 r80773  
    20232023           << GUI_HidLedsSync
    20242024           << GUI_ScaleFactor << GUI_Scaling_Optimization
    2025            << GUI_InformationWindowGeometry
    2026            << GUI_InformationWindowElements
     2025           << GUI_SessionInformationDialogGeometry
    20272026           << GUI_GuestControl_ProcessControlSplitterHints
    20282027           << GUI_GuestControl_FileManagerDialogGeometry
     
    41614160}
    41624161
    4163 QRect UIExtraDataManager::informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QUuid &uID)
     4162QRect UIExtraDataManager::sessionInformationDialogGeometry(QWidget *pWidget, QWidget *pParentWidget)
    41644163{
    41654164    /* Get corresponding extra-data: */
    4166     const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, uID);
     4165    const QStringList data = extraDataStringList(GUI_SessionInformationDialogGeometry);
    41674166
    41684167    /* Parse loaded data: */
     
    42114210}
    42124211
    4213 bool UIExtraDataManager::informationWindowShouldBeMaximized(const QUuid &uID)
     4212bool UIExtraDataManager::sessionInformationDialogShouldBeMaximized()
    42144213{
    42154214    /* Get corresponding extra-data: */
    4216     const QStringList data = extraDataStringList(GUI_InformationWindowGeometry, uID);
     4215    const QStringList data = extraDataStringList(GUI_SessionInformationDialogGeometry);
    42174216
    42184217    /* Make sure 5th item has required value: */
     
    42204219}
    42214220
    4222 void UIExtraDataManager::setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QUuid &uID)
     4221void UIExtraDataManager::setSessionInformationDialogGeometry(const QRect &geometry, bool fMaximized)
    42234222{
    42244223    /* Serialize passed values: */
     
    42324231
    42334232    /* Re-cache corresponding extra-data: */
    4234     setExtraDataStringList(GUI_InformationWindowGeometry, data, uID);
     4233    setExtraDataStringList(GUI_SessionInformationDialogGeometry, data);
    42354234}
    42364235
     
    44364435{
    44374436    setDialogGeometry(GUI_GuestControl_ProcessControlDialogGeometry, geometry, fMaximized);
    4438 }
    4439 
    4440 
    4441 QMap<InformationElementType, bool> UIExtraDataManager::informationWindowElements()
    4442 {
    4443     /* Get corresponding extra-data: */
    4444     const QStringList data = extraDataStringList(GUI_InformationWindowElements);
    4445 
    4446     /* Desearialize passed elements: */
    4447     QMap<InformationElementType, bool> elements;
    4448     foreach (QString strItem, data)
    4449     {
    4450         bool fOpened = true;
    4451         if (strItem.endsWith("Closed", Qt::CaseInsensitive))
    4452         {
    4453             fOpened = false;
    4454             strItem.remove("Closed");
    4455         }
    4456         InformationElementType type = gpConverter->fromInternalString<InformationElementType>(strItem);
    4457         if (type != InformationElementType_Invalid)
    4458             elements[type] = fOpened;
    4459     }
    4460 
    4461     /* Return elements: */
    4462     return elements;
    4463 }
    4464 
    4465 void UIExtraDataManager::setInformationWindowElements(const QMap<InformationElementType, bool> &elements)
    4466 {
    4467     /* Prepare corresponding extra-data: */
    4468     QStringList data;
    4469 
    4470     /* Searialize passed elements: */
    4471     foreach (InformationElementType type, elements.keys())
    4472     {
    4473         QString strValue = gpConverter->toInternalString(type);
    4474         if (!elements[type])
    4475             strValue += "Closed";
    4476         data << strValue;
    4477     }
    4478 
    4479     /* Re-cache corresponding extra-data: */
    4480     setExtraDataStringList(GUI_InformationWindowElements, data);
    44814437}
    44824438
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r79921 r80773  
    642642    /** @} */
    643643
    644     /** @name Virtual Machine: Information dialog
    645       * @{ */
    646         /** Returns information-window geometry using @a pWidget and @a pParentWidget as hints. */
    647         QRect informationWindowGeometry(QWidget *pWidget, QWidget *pParentWidget, const QUuid &uID);
     644    /** @name Virtual Machine: Session Information dialog
     645      * @{ */
     646        /** Returns session information dialog geometry using @a pWidget and @a pParentWidget as hints. */
     647        QRect sessionInformationDialogGeometry(QWidget *pWidget, QWidget *pParentWidget);
    648648        /** Returns whether information-window should be maximized or not. */
    649         bool informationWindowShouldBeMaximized(const QUuid &uID);
     649        bool sessionInformationDialogShouldBeMaximized();
    650650        /** Defines information-window @a geometry and @a fMaximized state. */
    651         void setInformationWindowGeometry(const QRect &geometry, bool fMaximized, const QUuid &uID);
    652 
    653         /** Returns information-window elements. */
    654         QMap<InformationElementType, bool> informationWindowElements();
    655         /** Defines information-window @a elements. */
    656         void setInformationWindowElements(const QMap<InformationElementType, bool> &elements);
     651        void setSessionInformationDialogGeometry(const QRect &geometry, bool fMaximized);
    657652    /** @} */
    658653
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r80381 r80773  
    100100bool UIVMInformationDialog::shouldBeMaximized() const
    101101{
    102     return gEDataManager->informationWindowShouldBeMaximized(uiCommon().managedVMUuid());
     102    return gEDataManager->sessionInformationDialogShouldBeMaximized();
    103103}
    104104
     
    292292    {
    293293        /* Load geometry: */
    294         m_geometry = gEDataManager->informationWindowGeometry(this, m_pMachineWindow, uiCommon().managedVMUuid());
     294        m_geometry = gEDataManager->sessionInformationDialogGeometry(this, m_pMachineWindow);
    295295
    296296        /* Restore geometry: */
     
    307307        /* Save geometry: */
    308308#ifdef VBOX_WS_MAC
    309         gEDataManager->setInformationWindowGeometry(m_geometry, ::darwinIsWindowMaximized(this), uiCommon().managedVMUuid());
     309        gEDataManager->setSessionInformationDialogGeometry(m_geometry, ::darwinIsWindowMaximized(this));
    310310#else /* VBOX_WS_MAC */
    311         gEDataManager->setInformationWindowGeometry(m_geometry, isMaximized(), uiCommon().managedVMUuid());
     311        gEDataManager->setSessionInformationDialogGeometry(m_geometry, isMaximized());
    312312#endif /* !VBOX_WS_MAC */
    313313        LogRel2(("GUI: UIVMInformationDialog: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",
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