VirtualBox

Ignore:
Timestamp:
Apr 9, 2019 1:42:47 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9434: A bit of cleanup for r129879.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp

    r77388 r78061  
    500500void UIWizardExportAppPage2::updatePageAppearance()
    501501{
    502     /* Update page appearance according to chosen storage-type: */
     502    /* Update page appearance according to chosen format: */
    503503    m_pSettingsWidget->setCurrentIndex((int)isFormatCloudOne());
    504504}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp

    r78046 r78061  
    5454UIWizardImportAppPage1::UIWizardImportAppPage1()
    5555    : m_pSourceLabel(0)
    56     , m_pSourceSelector(0)
     56    , m_pSourceComboBox(0)
    5757    , m_pStackedLayout(0)
    5858    , m_pFileSelector(0)
     
    8080        }
    8181
    82         /* Create source selector layout: */
    83         QHBoxLayout *pSourceSelectorLayout = new QHBoxLayout;
    84         if (pSourceSelectorLayout)
     82        /* Create source layout: */
     83        QHBoxLayout *pSourceLayout = new QHBoxLayout;
     84        if (pSourceLayout)
    8585        {
    8686            /* Create source label: */
     
    9393
    9494                /* Add into layout: */
    95                 pSourceSelectorLayout->addWidget(m_pSourceLabel);
     95                pSourceLayout->addWidget(m_pSourceLabel);
    9696            }
    9797
    9898            /* Create source selector: */
    99             m_pSourceSelector = new QIComboBox(this);
    100             if (m_pSourceSelector)
    101             {
    102                 m_pSourceLabel->setBuddy(m_pSourceSelector);
    103                 m_pSourceSelector->hide();
    104                 m_pSourceSelector->addItem(QString(), QVariant::fromValue(ImportSourceType_Local));
    105                 m_pSourceSelector->addItem(QString(), QVariant::fromValue(ImportSourceType_Cloud));
    106                 connect(m_pSourceSelector, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated),
    107                         this, static_cast<void(UIWizardImportAppPageBasic1::*)(int)>(&UIWizardImportAppPageBasic1::sltHandleSourceChange));
    108 
    109                 /* Add into layout: */
    110                 pSourceSelectorLayout->addWidget(m_pSourceSelector);
     99            m_pSourceComboBox = new QIComboBox(this);
     100            if (m_pSourceComboBox)
     101            {
     102                m_pSourceLabel->setBuddy(m_pSourceComboBox);
     103                m_pSourceComboBox->hide();
     104                m_pSourceComboBox->addItem(QString(), QVariant::fromValue(ImportSourceType_Local));
     105                m_pSourceComboBox->addItem(QString(), QVariant::fromValue(ImportSourceType_Cloud));
     106                connect(m_pSourceComboBox, static_cast<void(QIComboBox::*)(int)>(&QIComboBox::activated),
     107                        this, &UIWizardImportAppPageBasic1::sltHandleSourceChange);
     108
     109                /* Add into layout: */
     110                pSourceLayout->addWidget(m_pSourceComboBox);
    111111            }
    112112
    113113            /* Add into layout: */
    114             pMainLayout->addLayout(pSourceSelectorLayout);
     114            pMainLayout->addLayout(pSourceLayout);
    115115        }
    116116
     
    182182}
    183183
    184 void UIWizardImportAppPageBasic1::sltHandleSourceChange(int iIndex)
    185 {
    186     m_pStackedLayout->setCurrentIndex(m_stackedLayoutIndexMap.value(m_pSourceSelector->itemData(iIndex).value<ImportSourceType>()));
    187 }
    188 
    189184void UIWizardImportAppPageBasic1::retranslateUi()
    190185{
     
    197192                                            "To continue, select the file to import below.</p>"));
    198193
    199     /* Translate source selector: */
    200     m_pSourceLabel->setText(tr("Source:"));
    201     for (int i = 0; i < m_pSourceSelector->count(); ++i)
    202         m_pSourceSelector->setItemText(i, ImportSourceTypeConverter::toString(m_pSourceSelector->itemData(i).value<ImportSourceType>()));
     194    /* Translate source label: */
     195    m_pSourceLabel->setText(tr("&Source:"));
     196    /* Translate received values of Source combo-box.
     197     * We are enumerating starting from 0 for simplicity: */
     198    for (int i = 0; i < m_pSourceComboBox->count(); ++i)
     199        m_pSourceComboBox->setItemText(i, ImportSourceTypeConverter::toString(m_pSourceComboBox->itemData(i).value<ImportSourceType>()));
    203200
    204201    /* Translate file selector: */
     
    210207void UIWizardImportAppPageBasic1::initializePage()
    211208{
     209    /* Translate page: */
    212210    retranslateUi();
    213211}
     
    239237    return pImportApplianceWidget->isValid();
    240238}
     239
     240void UIWizardImportAppPageBasic1::sltHandleSourceChange(int iIndex)
     241{
     242    m_pStackedLayout->setCurrentIndex(m_stackedLayoutIndexMap.value(m_pSourceComboBox->itemData(iIndex).value<ImportSourceType>()));
     243}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h

    r78046 r78061  
    5050    /** Holds the source type label instance. */
    5151    QLabel     *m_pSourceLabel;
    52     /** Holds the source type selector instance. */
    53     QIComboBox *m_pSourceSelector;
     52    /** Holds the source type combo-box instance. */
     53    QIComboBox *m_pSourceComboBox;
    5454
    5555    /** Holds the stacked layout instance. */
     
    7272    UIWizardImportAppPageBasic1();
    7373
    74 private slots:
    75 
    76     /** Handles change of import source to one with specified @a iIndex. */
    77     void sltHandleSourceChange(int iIndex);
    78 
    79 private:
     74protected:
    8075
    8176    /** Handles translation event. */
     
    9186    virtual bool validatePage() /* override */;
    9287
     88private slots:
     89
     90    /** Handles change of import source to one with specified @a iIndex. */
     91    void sltHandleSourceChange(int iIndex);
     92
     93private:
     94
    9395    /** Holds the label instance. */
    9496    QIRichTextLabel *m_pLabel;
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