VirtualBox

Ignore:
Timestamp:
Nov 1, 2010 6:35:05 AM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: Async settings mechanism. Global and Machine settings reworked to use cache loaded and saved in parallel thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp

    r33540 r33631  
    161161}
    162162
     163void UISettingsDialog::sltCategoryChanged(int cId)
     164{
     165    QWidget *pRootPage = m_pSelector->rootPage(cId);
     166#ifdef Q_WS_MAC
     167    QSize cs = size();
     168    /* First make all fully resizeable: */
     169    setMinimumSize(QSize(minimumWidth(), 0));
     170    setMaximumSize(QSize(minimumWidth(), QWIDGETSIZE_MAX));
     171    for (int i = 0; i < m_pStack->count(); ++i)
     172        m_pStack->widget(i)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);
     173    int a = m_pStack->indexOf(pRootPage);
     174    if (a < m_sizeList.count())
     175    {
     176        QSize ss = m_sizeList.at(a);
     177        m_pStack->widget(a)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
     178        /* Switch to the new page first if we are shrinking: */
     179        if (cs.height() > ss.height())
     180            m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage));
     181        /* Do the animation: */
     182        ::darwinWindowAnimateResize(this, QRect (x(), y(), ss.width(), ss.height()));
     183        /* Switch to the new page last if we are zooming: */
     184        if (cs.height() <= ss.height())
     185            m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage));
     186        /* Make the widget fixed size: */
     187        setFixedSize(ss);
     188    }
     189    ::darwinSetShowsResizeIndicator(this, false);
     190#else
     191    m_pLbTitle->setText(m_pSelector->itemText(cId));
     192    m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage));
     193#endif
     194#ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS
     195    setWindowTitle(title());
     196#endif /* VBOX_GUI_WITH_TOOLBAR_SETTINGS */
     197}
     198
    163199void UISettingsDialog::retranslateUi()
    164200{
     
    371407}
    372408
    373 void UISettingsDialog::sltCategoryChanged(int cId)
    374 {
    375     QWidget *pRootPage = m_pSelector->rootPage(cId);
    376 #ifdef Q_WS_MAC
    377     QSize cs = size();
    378     /* First make all fully resizeable: */
    379     setMinimumSize(QSize(minimumWidth(), 0));
    380     setMaximumSize(QSize(minimumWidth(), QWIDGETSIZE_MAX));
    381     for (int i = 0; i < m_pStack->count(); ++i)
    382         m_pStack->widget(i)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);
    383     int a = m_pStack->indexOf(pRootPage);
    384     if (a < m_sizeList.count())
    385     {
    386         QSize ss = m_sizeList.at(a);
    387         m_pStack->widget(a)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
    388         /* Switch to the new page first if we are shrinking: */
    389         if (cs.height() > ss.height())
    390             m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage));
    391         /* Do the animation: */
    392         ::darwinWindowAnimateResize(this, QRect (x(), y(), ss.width(), ss.height()));
    393         /* Switch to the new page last if we are zooming: */
    394         if (cs.height() <= ss.height())
    395             m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage));
    396         /* Make the widget fixed size: */
    397         setFixedSize(ss);
    398     }
    399     ::darwinSetShowsResizeIndicator(this, false);
    400 #else
    401     m_pLbTitle->setText(m_pSelector->itemText(cId));
    402     m_pStack->setCurrentIndex(m_pStack->indexOf(pRootPage));
    403 #endif
    404 #ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS
    405     setWindowTitle(title());
    406 #endif /* VBOX_GUI_WITH_TOOLBAR_SETTINGS */
    407 }
    408 
    409409bool UISettingsDialog::eventFilter(QObject *pObject, QEvent *pEvent)
    410410{
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