- Timestamp:
- Apr 19, 2019 2:52:01 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 130153
- 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 305 305 { 306 306 /* 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) 308 310 { 309 311 /* Create list item: */ 310 QListWidgetItem *pItem = new QListWidgetItem( strName, m_pAccountInstanceList);312 QListWidgetItem *pItem = new QListWidgetItem(names.at(i), m_pAccountInstanceList); 311 313 if (pItem) 312 314 { 313 /* Make item non-editable: */314 315 pItem->setFlags(pItem->flags() & ~Qt::ItemIsEditable); 316 pItem->setData(Qt::UserRole, ids.at(i)); 315 317 } 316 318 } 319 /* Choose the 1st one by default if possible: */ 320 if (m_pAccountInstanceList->count()) 321 m_pAccountInstanceList->setCurrentRow(0); 317 322 } 318 323 } … … 397 402 const int iIndex = m_pAccountComboBox->currentIndex(); 398 403 return m_pAccountComboBox->itemData(iIndex, AccountData_ProfileName).toString(); 404 } 405 406 QString UIWizardImportAppPage1::machineId() const 407 { 408 QListWidgetItem *pItem = m_pAccountInstanceList->currentItem(); 409 return pItem ? pItem->data(Qt::UserRole).toString() : QString(); 399 410 } 400 411 … … 650 661 connect(m_pAccountToolButton, &QIToolButton::clicked, 651 662 this, &UIWizardImportAppPageBasic1::sltHandleAccountButtonClick); 663 connect(m_pAccountInstanceList, &QListWidget::currentRowChanged, 664 this, &UIWizardImportAppPageBasic1::completeChanged); 652 665 653 666 /* Register fields: */ … … 656 669 registerField("profile", this, "profile"); 657 670 registerField("vsdForm", this, "vsdForm"); 671 registerField("machineId", this, "machineId"); 658 672 } 659 673 … … 754 768 || ( fCSP 755 769 && !m_comCloudProfile.isNull() 756 && !m_comCloudClient.isNull()); 770 && !m_comCloudClient.isNull() 771 && !machineId().isNull()); 757 772 } 758 773 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic1.h
r78214 r78216 97 97 /** Returns profile name. */ 98 98 QString profileName() const; 99 /** Returns machine ID. */ 100 QString machineId() const; 99 101 /** Returns Cloud Profile object. */ 100 102 CCloudProfile profile() const; … … 157 159 Q_PROPERTY(CCloudProfile profile READ profile); 158 160 Q_PROPERTY(CVirtualSystemDescriptionForm vsdForm READ vsdForm); 161 Q_PROPERTY(QString machineId READ machineId); 159 162 160 163 public:
Note:
See TracChangeset
for help on using the changeset viewer.