VirtualBox

Ignore:
Timestamp:
Jul 10, 2018 11:44:12 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123586
Message:

FE/Qt: bugref:9152: Export Appliance wizard: Storage and Expert page: Adding provider profile combo.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
Files:
4 edited

Legend:

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

    r73030 r73033  
    5555    , m_pProviderComboBoxLabel(0)
    5656    , m_pProviderComboBox(0)
     57    , m_pProfileComboBoxLabel(0)
     58    , m_pProfileComboBox(0)
    5759{
    5860}
     
    100102}
    101103
     104void UIWizardExportAppPage3::populateProfiles()
     105{
     106    /* Acquire profile list: */
     107    // Here goes the experiamental list with
     108    // arbitrary contents for testing purposes.
     109    QStringList profiles;
     110    profiles << "Profile 1";
     111    profiles << "Profile 2";
     112    profiles << "Profile 3";
     113    profiles << "Profile 4";
     114    m_pProfileComboBox->clear();
     115    m_pProfileComboBox->addItems(profiles);
     116
     117    /* Duplicate non-translated names to data fields: */
     118    for (int i = 0; i < m_pProfileComboBox->count(); ++i)
     119        m_pProfileComboBox->setItemData(i, m_pProfileComboBox->itemText(i));
     120}
     121
    102122void UIWizardExportAppPage3::updatePageAppearance()
    103123{
     
    234254    AssertMsg(iIndex != -1, ("Field not found!"));
    235255    m_pProviderComboBox->setCurrentIndex(iIndex);
     256}
     257
     258QString UIWizardExportAppPage3::profile() const
     259{
     260    const int iIndex = m_pProfileComboBox->currentIndex();
     261    return m_pProfileComboBox->itemData(iIndex).toString();
     262}
     263
     264void UIWizardExportAppPage3::setProfile(const QString &strProfile)
     265{
     266    const int iIndex = m_pProfileComboBox->findData(strProfile);
     267    AssertMsg(iIndex != -1, ("Field not found!"));
     268    m_pProfileComboBox->setCurrentIndex(iIndex);
    236269}
    237270
     
    372405                    }
    373406
     407                    /* Create profile combo-box: */
     408                    m_pProfileComboBox = new QComboBox;
     409                    if (m_pProfileComboBox)
     410                    {
     411                        /* Add into layout: */
     412                        pSettingsLayout2->addWidget(m_pProfileComboBox, 1, 1);
     413                    }
     414                    /* Create profile label: */
     415                    m_pProfileComboBoxLabel = new QLabel;
     416                    if (m_pProfileComboBoxLabel)
     417                    {
     418                        m_pProfileComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
     419                        m_pProfileComboBoxLabel->setBuddy(m_pProviderComboBox);
     420
     421                        /* Add into layout: */
     422                        pSettingsLayout2->addWidget(m_pProfileComboBoxLabel, 1, 0);
     423                    }
     424
    374425                    /* Create placeholder: */
    375426                    QWidget *pPlaceholder = new QWidget;
     
    377428                    {
    378429                        /* Add into layout: */
    379                         pSettingsLayout2->addWidget(pPlaceholder, 1, 0, 1, 2);
     430                        pSettingsLayout2->addWidget(pPlaceholder, 2, 0, 1, 2);
    380431                    }
    381432                }
     
    397448    /* Populate providers: */
    398449    populateProviders();
     450    /* Populate profiles: */
     451    populateProfiles();
    399452
    400453    /* Setup connections: */
     
    404457    connect(m_pProviderComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
    405458            this, &UIWizardExportAppPageBasic3::sltHandleProviderComboChange);
     459    connect(m_pProfileComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     460            this, &UIWizardExportAppPageBasic3::sltHandleProfileComboChange);
    406461
    407462    /* Register fields: */
     
    455510        }
    456511    }
     512
     513    /* Translate Profile combo-box: */
     514    m_pProfileComboBoxLabel->setText(UIWizardExportApp::tr("&Profile:"));
    457515
    458516    /* Refresh file selector name: */
     
    561619    /* Update tool-tip: */
    562620    updateProviderComboToolTip();
    563 }
     621
     622    /* Refresh required settings: */
     623    populateProfiles();
     624}
     625
     626void UIWizardExportAppPageBasic3::sltHandleProfileComboChange()
     627{
     628}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h

    r73030 r73033  
    4747    /** Populates providers. */
    4848    void populateProviders();
     49    /** Populates profiles. */
     50    void populateProfiles();
    4951
    5052    /** Updates page appearance. */
     
    8587    void setProvider(const QString &strProvider);
    8688
     89    /** Returns profile. */
     90    QString profile() const;
     91    /** Defines @a strProfile. */
     92    void setProfile(const QString &strProfile);
     93
    8794    /** Holds the default appliance name. */
    8895    QString  m_strDefaultApplianceName;
     
    115122    /** Holds the provider combo-box instance. */
    116123    QComboBox *m_pProviderComboBox;
     124
     125    /** Holds the profile combo-box label instance. */
     126    QLabel    *m_pProfileComboBoxLabel;
     127    /** Holds the profile combo-box instance. */
     128    QComboBox *m_pProfileComboBox;
    117129};
    118130
     
    157169    void sltHandleProviderComboChange();
    158170
     171    /** Handles change in profile combo-box. */
     172    void sltHandleProfileComboChange();
     173
    159174private:
    160175
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r73030 r73033  
    268268                            }
    269269
     270                            /* Create profile combo-box: */
     271                            m_pProfileComboBox = new QComboBox;
     272                            if (m_pProfileComboBox)
     273                            {
     274                                /* Add into layout: */
     275                                pSettingsLayout2->addWidget(m_pProfileComboBox, 1, 1);
     276                            }
     277                            /* Create profile label: */
     278                            m_pProfileComboBoxLabel = new QLabel;
     279                            if (m_pProfileComboBoxLabel)
     280                            {
     281                                m_pProfileComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
     282                                m_pProfileComboBoxLabel->setBuddy(m_pProviderComboBox);
     283
     284                                /* Add into layout: */
     285                                pSettingsLayout2->addWidget(m_pProfileComboBoxLabel, 1, 0);
     286                            }
     287
    270288                            /* Create placeholder: */
    271289                            QWidget *pPlaceholder = new QWidget;
     
    273291                            {
    274292                                /* Add into layout: */
    275                                 pSettingsLayout2->addWidget(pPlaceholder, 1, 0, 1, 2);
     293                                pSettingsLayout2->addWidget(pPlaceholder, 2, 0, 1, 2);
    276294                            }
    277295                        }
     
    299317    /* Populate providers: */
    300318    populateProviders();
     319    /* Populate profiles: */
     320    populateProfiles();
    301321
    302322    /* Setup connections: */
     
    309329    connect(m_pProviderComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
    310330            this, &UIWizardExportAppPageExpert::sltHandleProviderComboChange);
     331    connect(m_pProfileComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
     332            this, &UIWizardExportAppPageExpert::sltHandleProfileComboChange);
    311333
    312334    /* Register classes: */
     
    375397        }
    376398    }
     399
     400    /* Translate Profile combo-box: */
     401    m_pProfileComboBoxLabel->setText(UIWizardExportApp::tr("&Profile:"));
    377402
    378403    /* Refresh file selector name: */
     
    489514    /* Update tool-tip: */
    490515    updateProviderComboToolTip();
    491 }
     516
     517    /* Refresh required settings: */
     518    populateProfiles();
     519}
     520
     521void UIWizardExportAppPageExpert::sltHandleProfileComboChange()
     522{
     523}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h

    r73014 r73033  
    8787    void sltHandleProviderComboChange();
    8888
     89    /** Handles change in profile combo-box. */
     90    void sltHandleProfileComboChange();
     91
    8992private:
    9093
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