VirtualBox

Changeset 55276 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 15, 2015 11:11:36 AM (10 years ago)
Author:
vboxsync
Message:

FE/Qt: Settings dialog: Serialization progress dialog cleanup.

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

Legend:

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

    r55264 r55276  
    1 /* $Id$ */
     1/* $Id$ */
    22/** @file
    33 * VBox Qt GUI - UISettingsSerializer class implementation.
     
    181181    , m_pages(pages)
    182182    , m_pSerializer(0)
     183    , m_pLabelOperationProgress(0)
     184    , m_pBarOperationProgress(0)
    183185{
    184186    /* Prepare: */
     
    230232        AssertPtrReturnVoid(pLayoutTop);
    231233        {
    232             /* Create pixmap label: */
    233             QLabel *pLabelPixmap = new QLabel;
    234             AssertPtrReturnVoid(pLabelPixmap);
     234            /* Create pixmap layout: */
     235            QVBoxLayout *pLayoutPixmap = new QVBoxLayout;
     236            AssertPtrReturnVoid(pLayoutPixmap);
    235237            {
    236                 /* Configure label: */
    237                 const QIcon icon = UIIconPool::iconSet(":/progress_settings_90px.png");
    238                 pLabelPixmap->setPixmap(icon.pixmap(icon.availableSizes().first()));
    239                 /* Add label into layout: */
    240                 pLayoutTop->addWidget(pLabelPixmap);
     238                /* Create pixmap label: */
     239                QLabel *pLabelPixmap = new QLabel;
     240                AssertPtrReturnVoid(pLabelPixmap);
     241                {
     242                    /* Configure label: */
     243                    const QIcon icon = UIIconPool::iconSet(":/progress_settings_90px.png");
     244                    pLabelPixmap->setPixmap(icon.pixmap(icon.availableSizes().first()));
     245                    /* Add label into layout: */
     246                    pLayoutPixmap->addWidget(pLabelPixmap);
     247                }
     248                /* Add stretch: */
     249                pLayoutPixmap->addStretch();
     250                /* Add layout into parent: */
     251                pLayoutTop->addLayout(pLayoutPixmap);
    241252            }
    242253            /* Create progress layout: */
    243             QVBoxLayout *pLayoutProgress = new QVBoxLayout(this);
     254            QVBoxLayout *pLayoutProgress = new QVBoxLayout;
    244255            AssertPtrReturnVoid(pLayoutProgress);
    245256            {
    246                 /* Create progress label: */
    247                 m_pLabelProgress = new QLabel;
    248                 AssertPtrReturnVoid(m_pLabelProgress);
     257                /* Create operation progress label: */
     258                m_pLabelOperationProgress = new QLabel;
     259                AssertPtrReturnVoid(m_pLabelOperationProgress);
    249260                {
    250261                    /* Add label into layout: */
    251                     pLayoutProgress->addWidget(m_pLabelProgress);
     262                    pLayoutProgress->addWidget(m_pLabelOperationProgress);
    252263                }
    253                 /* Create progress bar: */
    254                 m_pBarProgress = new QProgressBar;
    255                 AssertPtrReturnVoid(m_pBarProgress);
     264                /* Create operation progress bar: */
     265                m_pBarOperationProgress = new QProgressBar;
     266                AssertPtrReturnVoid(m_pBarOperationProgress);
    256267                {
    257268                    /* Configure progress bar: */
    258                     m_pBarProgress->setMinimumWidth(200);
    259                     m_pBarProgress->setMaximum(m_pSerializer->pageCount() + 1);
    260                     m_pBarProgress->setMinimum(0);
    261                     m_pBarProgress->setValue(0);
    262                     connect(m_pBarProgress, SIGNAL(valueChanged(int)),
     269                    m_pBarOperationProgress->setMinimumWidth(300);
     270                    m_pBarOperationProgress->setMaximum(m_pSerializer->pageCount() + 1);
     271                    m_pBarOperationProgress->setMinimum(0);
     272                    m_pBarOperationProgress->setValue(0);
     273                    connect(m_pBarOperationProgress, SIGNAL(valueChanged(int)),
    263274                            this, SLOT(sltProgressValueChanged(int)));
    264275                    /* Add bar into layout: */
    265                     pLayoutProgress->addWidget(m_pBarProgress);
     276                    pLayoutProgress->addWidget(m_pBarOperationProgress);
    266277                }
    267278                /* Add stretch: */
     
    278289void UISettingsSerializerProgress::retranslateUi()
    279290{
    280     /* Translate progress label: */
    281     AssertPtrReturnVoid(m_pLabelProgress);
     291    /* Translate operation progress label: */
     292    AssertPtrReturnVoid(m_pLabelOperationProgress);
    282293    switch (m_pSerializer->direction())
    283294    {
    284         case UISettingsSerializer::Load: m_pLabelProgress->setText(tr("Loading Settings...")); break;
    285         case UISettingsSerializer::Save: m_pLabelProgress->setText(tr("Saving Settings...")); break;
     295        case UISettingsSerializer::Load: m_pLabelOperationProgress->setText(tr("Loading Settings...")); break;
     296        case UISettingsSerializer::Save: m_pLabelOperationProgress->setText(tr("Saving Settings...")); break;
    286297    }
    287298}
     
    307318{
    308319    /* Advance the serialize progress bar: */
    309     AssertPtrReturnVoid(m_pBarProgress);
    310     m_pBarProgress->setValue(m_pBarProgress->value() + 1);
     320    AssertPtrReturnVoid(m_pBarOperationProgress);
     321    m_pBarOperationProgress->setValue(m_pBarOperationProgress->value() + 1);
    311322}
    312323
    313324void UISettingsSerializerProgress::sltProgressValueChanged(int iValue)
    314325{
    315     AssertPtrReturnVoid(m_pBarProgress);
    316     if (iValue == m_pBarProgress->maximum())
     326    AssertPtrReturnVoid(m_pBarOperationProgress);
     327    if (iValue == m_pBarOperationProgress->maximum())
    317328        hide();
    318329}
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.h

    r55263 r55276  
    192192    UISettingsSerializer *m_pSerializer;
    193193
    194     /** Holds the progress label. */
    195     QLabel *m_pLabelProgress;
    196     /** Holds the progress bar. */
    197     QProgressBar *m_pBarProgress;
     194    /** Holds the operation progress label. */
     195    QLabel *m_pLabelOperationProgress;
     196    /** Holds the operation progress bar. */
     197    QProgressBar *m_pBarOperationProgress;
    198198};
    199199
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