VirtualBox

Changeset 51514 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 3, 2014 2:42:36 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 6660: Advanced extra-data management framework: Integrate GUI_SplitterSizes.

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

Legend:

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

    r51484 r51514  
    311311}
    312312
    313 QRect UIExtraDataManager::selectorWindowGeometry(QWidget *pHintWidget /* = 0 */)
     313QRect UIExtraDataManager::selectorWindowGeometry(QWidget *pHintWidget /* = 0 */) const
    314314{
    315315    /* Load corresponding extra-data: */
     
    354354}
    355355
    356 bool UIExtraDataManager::isSelectorWindowShouldBeMaximized()
     356bool UIExtraDataManager::isSelectorWindowShouldBeMaximized() const
    357357{
    358358    /* Load corresponding extra-data: */
     
    376376    /* Re-cache corresponding extra-data: */
    377377    setExtraDataStringList(GUI_LastSelectorWindowPosition, data);
     378}
     379
     380QList<int> UIExtraDataManager::selectorWindowSplitterHints() const
     381{
     382    /* Load corresponding extra-data list: */
     383    const QStringList data = extraDataStringList(GUI_SplitterSizes);
     384
     385    /* Parse loaded data: */
     386    QList<int> hints;
     387    hints << (data.size() > 0 ? data[0].toInt() : 0);
     388    hints << (data.size() > 1 ? data[1].toInt() : 0);
     389
     390    /* Return hints: */
     391    return hints;
     392}
     393
     394void UIExtraDataManager::setSelectorWindowSplitterHints(const QList<int> &hints)
     395{
     396    /* Parse passed hints: */
     397    QStringList data;
     398    data << (hints.size() > 0 ? QString::number(hints[0]) : QString());
     399    data << (hints.size() > 1 ? QString::number(hints[1]) : QString());
     400
     401    /* Re-cache corresponding extra-data: */
     402    setExtraDataStringList(GUI_SplitterSizes, data);
    378403}
    379404
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r51484 r51514  
    132132
    133133    /** Returns selector-window geometry using @a pHintWidget as the hint. */
    134     QRect selectorWindowGeometry(QWidget *pHintWidget = 0);
     134    QRect selectorWindowGeometry(QWidget *pHintWidget = 0) const;
    135135    /** Returns whether selector-window should be maximized or not. */
    136     bool isSelectorWindowShouldBeMaximized();
     136    bool isSelectorWindowShouldBeMaximized() const;
    137137    /** Defines selector-window geometry to passed @a geometry which is @a fMaximized. */
    138138    void setSelectorWindowGeometry(const QRect &geometry, bool fMaximized);
     139
     140    /** Returns selector-window splitter hints. */
     141    QList<int> selectorWindowSplitterHints() const;
     142    /** Defines selector-window splitter @a hints. */
     143    void setSelectorWindowSplitterHints(const QList<int> &hints);
    139144
    140145    /** Returns whether this machine started for the first time. */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r51455 r51514  
    15431543    /* Restore splitter handle position: */
    15441544    {
    1545         QList<int> sizes = vbox.GetExtraDataIntList(GUI_SplitterSizes);
    1546 
    1547         if (sizes.size() == 2)
    1548             m_pSplitter->setSizes(sizes);
     1545        m_pSplitter->setSizes(gEDataManager->selectorWindowSplitterHints());
    15491546    }
    15501547
     
    15701567    /* Save splitter handle position: */
    15711568    {
    1572         vbox.SetExtraDataIntList(GUI_SplitterSizes, m_pSplitter->sizes());
     1569        gEDataManager->setSelectorWindowSplitterHints(m_pSplitter->sizes());
    15731570    }
    15741571
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