VirtualBox

Changeset 78216 in vbox for trunk/src


Ignore:
Timestamp:
Apr 19, 2019 2:52:01 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
130153
Message:

FE/Qt: bugref:9434: Import Appliance wizard: 1st basic page: Passing chosen machine ID to next wizard page as field; Make sure at least one machine is selected if possible.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.cpp

    r78214 r78216  
    305305                {
    306306                    /* Push acquired names to list rows: */
    307                     foreach (const QString &strName, comNames.GetValues())
     307                    const QVector<QString> &names = comNames.GetValues();
     308                    const QVector<QString> &ids = comIDs.GetValues();
     309                    for (int i = 0; i < names.size(); ++i)
    308310                    {
    309311                        /* Create list item: */
    310                         QListWidgetItem *pItem = new QListWidgetItem(strName, m_pAccountInstanceList);
     312                        QListWidgetItem *pItem = new QListWidgetItem(names.at(i), m_pAccountInstanceList);
    311313                        if (pItem)
    312314                        {
    313                             /* Make item non-editable: */
    314315                            pItem->setFlags(pItem->flags() & ~Qt::ItemIsEditable);
     316                            pItem->setData(Qt::UserRole, ids.at(i));
    315317                        }
    316318                    }
     319                    /* Choose the 1st one by default if possible: */
     320                    if (m_pAccountInstanceList->count())
     321                        m_pAccountInstanceList->setCurrentRow(0);
    317322                }
    318323            }
     
    397402    const int iIndex = m_pAccountComboBox->currentIndex();
    398403    return m_pAccountComboBox->itemData(iIndex, AccountData_ProfileName).toString();
     404}
     405
     406QString UIWizardImportAppPage1::machineId() const
     407{
     408    QListWidgetItem *pItem = m_pAccountInstanceList->currentItem();
     409    return pItem ? pItem->data(Qt::UserRole).toString() : QString();
    399410}
    400411
     
    650661    connect(m_pAccountToolButton, &QIToolButton::clicked,
    651662            this, &UIWizardImportAppPageBasic1::sltHandleAccountButtonClick);
     663    connect(m_pAccountInstanceList, &QListWidget::currentRowChanged,
     664            this, &UIWizardImportAppPageBasic1::completeChanged);
    652665
    653666    /* Register fields: */
     
    656669    registerField("profile", this, "profile");
    657670    registerField("vsdForm", this, "vsdForm");
     671    registerField("machineId", this, "machineId");
    658672}
    659673
     
    754768                  || (   fCSP
    755769                      && !m_comCloudProfile.isNull()
    756                       && !m_comCloudClient.isNull());
     770                      && !m_comCloudClient.isNull()
     771                      && !machineId().isNull());
    757772    }
    758773
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h

    r78214 r78216  
    9797    /** Returns profile name. */
    9898    QString profileName() const;
     99    /** Returns machine ID. */
     100    QString machineId() const;
    99101    /** Returns Cloud Profile object. */
    100102    CCloudProfile profile() const;
     
    157159    Q_PROPERTY(CCloudProfile profile READ profile);
    158160    Q_PROPERTY(CVirtualSystemDescriptionForm vsdForm READ vsdForm);
     161    Q_PROPERTY(QString machineId READ machineId);
    159162
    160163public:
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