VirtualBox

Changeset 47806 in vbox


Ignore:
Timestamp:
Aug 16, 2013 12:52:34 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
88067
Message:

FE/Qt: Settings Dialog: Warning-pane: Cleanup and mouse-hovering workaround.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings
Files:
2 edited

Legend:

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

    r47772 r47806  
    5757    , m_fLoaded(false)
    5858    , m_fSaved(false)
    59     /* Status bar stuff: */
    60     , m_pStatusBar(new QStackedWidget(this))
    61     /* Process bar stuff: */
    62     , m_pProcessBar(new QProgressBar(this))
    63     /* Error/Warning stuff: */
     59    /* Status-bar stuff: */
     60    , m_pStatusBar(0)
     61    /* Process-bar stuff: */
     62    , m_pProcessBar(0)
     63    /* Warning-pane stuff: */
     64    , m_pWarningPane(0)
    6465    , m_fValid(true)
    6566    , m_fSilent(true)
    66     , m_pWarningPane(new UIWarningPane(this))
    6767    /* Whats-this stuff: */
    6868    , m_pWhatsThisTimer(new QTimer(this))
     
    7171    /* Apply UI decorations: */
    7272    Ui::UISettingsDialog::setupUi(this);
    73 
    74 #ifdef Q_WS_MAC
    75     /* No status bar on the mac: */
    76     setSizeGripEnabled(false);
    77     setStatusBar(0);
    78 #endif /* Q_WS_MAC */
    7973
    8074    /* Page-title font is derived from the system font: */
     
    8478    m_pLbTitle->setFont(pageTitleFont);
    8579
    86     /* Get main grid layout: */
     80    /* Prepare selector: */
    8781    QGridLayout *pMainLayout = static_cast<QGridLayout*>(centralWidget()->layout());
    8882#ifdef VBOX_GUI_WITH_TOOLBAR_SETTINGS
     
    10397    pMainLayout->setSpacing(10);
    10498#endif /* VBOX_GUI_WITH_TOOLBAR_SETTINGS */
    105 
    106     /* Creating stack of pages: */
     99    connect(m_pSelector, SIGNAL(categoryChanged(int)), this, SLOT(sltCategoryChanged(int)));
     100
     101    /* Prepare page-stack: */
    107102    m_pStack = new QStackedWidget(m_pWtStackHandler);
    108103    popupCenter().setPopupStackOrientation(m_pStack, UIPopupStackOrientation_Bottom);
     
    111106    pStackLayout->addWidget(m_pStack);
    112107
    113     /* Status bar: */
    114     m_pStatusBar->addWidget(new QWidget);
    115     m_pButtonBox->addExtraWidget(m_pStatusBar);
    116 
    117     /* Setup process bar stuff: */
    118     m_pStatusBar->addWidget(m_pProcessBar);
    119 
    120     /* Setup error & warning stuff: */
    121     m_pStatusBar->addWidget(m_pWarningPane);
     108    /* Prepare button-box: */
     109    m_pButtonBox->button(QDialogButtonBox::Ok)->setDefault(true);
     110    connect(m_pButtonBox, SIGNAL(helpRequested()), &msgCenter(), SLOT(sltShowHelpHelpDialog()));
     111
     112    /* Prepare process-bar: */
     113    m_pProcessBar = new QProgressBar;
     114
     115    /* Prepare warning-pane: */
     116    m_pWarningPane = new UIWarningPane;
    122117    connect(m_pWarningPane, SIGNAL(sigHoverEnter()), this, SLOT(sltHandleWarningPaneHovered()));
    123118    connect(m_pWarningPane, SIGNAL(sigHoverLeave()), this, SLOT(sltHandleWarningPaneUnhovered()));
     119
     120    /* Prepare status-bar: */
     121    m_pStatusBar = new QStackedWidget;
     122    /* Add empty widget: */
     123    m_pStatusBar->addWidget(new QWidget);
     124    /* Add process-bar widget: */
     125    m_pStatusBar->addWidget(m_pProcessBar);
     126    /* Add warning-pane: */
     127    m_pStatusBar->addWidget(m_pWarningPane);
     128    /* Add status-bar to button-box: */
     129    m_pButtonBox->addExtraWidget(m_pStatusBar);
    124130
    125131    /* Setup whatsthis stuff: */
     
    127133    m_pWhatsThisTimer->setSingleShot(true);
    128134    connect(m_pWhatsThisTimer, SIGNAL(timeout()), this, SLOT(sltUpdateWhatsThis()));
    129 
    130     /* Set the default button: */
    131     m_pButtonBox->button(QDialogButtonBox::Ok)->setDefault(true);
    132 
    133     /* Setup connections: */
    134     connect(m_pSelector, SIGNAL(categoryChanged(int)), this, SLOT(sltCategoryChanged(int)));
    135     connect(m_pButtonBox, SIGNAL(helpRequested()), &msgCenter(), SLOT(sltShowHelpHelpDialog()));
    136135
    137136    /* Translate UI: */
     
    335334    setError(QString());
    336335    setWarning(QString());
     336    m_pWarningPane->setWarningText(QString());
    337337
    338338    /* Enumerating all the validators we have: */
     
    371371    }
    372372
    373     /* Make sure message-pane visible if necessary: */
     373    /* Make sure warning-pane visible if necessary: */
    374374    if ((!m_fValid || !m_fSilent) && m_pStatusBar->currentIndex() == 0)
    375375        m_pStatusBar->setCurrentWidget(m_pWarningPane);
    376     /* Make sure whats-this-pane visible otherwise: */
     376    /* Make sure empty-pane visible otherwise: */
    377377    else if (m_fValid && m_fSilent && m_pStatusBar->currentWidget() == m_pWarningPane)
    378378        m_pStatusBar->setCurrentIndex(0);
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h

    r47763 r47806  
    139139
    140140    /* Error & Warning stuff: */
     141    UIWarningPane *m_pWarningPane;
    141142    bool m_fValid;
    142143    bool m_fSilent;
     
    145146    QString m_strErrorString;
    146147    QString m_strWarningString;
    147     UIWarningPane *m_pWarningPane;
    148148
    149149    /* Whats-This stuff: */
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