Changeset 73033 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 10, 2018 11:44:12 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123586
- 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 55 55 , m_pProviderComboBoxLabel(0) 56 56 , m_pProviderComboBox(0) 57 , m_pProfileComboBoxLabel(0) 58 , m_pProfileComboBox(0) 57 59 { 58 60 } … … 100 102 } 101 103 104 void 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 102 122 void UIWizardExportAppPage3::updatePageAppearance() 103 123 { … … 234 254 AssertMsg(iIndex != -1, ("Field not found!")); 235 255 m_pProviderComboBox->setCurrentIndex(iIndex); 256 } 257 258 QString UIWizardExportAppPage3::profile() const 259 { 260 const int iIndex = m_pProfileComboBox->currentIndex(); 261 return m_pProfileComboBox->itemData(iIndex).toString(); 262 } 263 264 void 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); 236 269 } 237 270 … … 372 405 } 373 406 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 374 425 /* Create placeholder: */ 375 426 QWidget *pPlaceholder = new QWidget; … … 377 428 { 378 429 /* Add into layout: */ 379 pSettingsLayout2->addWidget(pPlaceholder, 1, 0, 1, 2);430 pSettingsLayout2->addWidget(pPlaceholder, 2, 0, 1, 2); 380 431 } 381 432 } … … 397 448 /* Populate providers: */ 398 449 populateProviders(); 450 /* Populate profiles: */ 451 populateProfiles(); 399 452 400 453 /* Setup connections: */ … … 404 457 connect(m_pProviderComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 405 458 this, &UIWizardExportAppPageBasic3::sltHandleProviderComboChange); 459 connect(m_pProfileComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 460 this, &UIWizardExportAppPageBasic3::sltHandleProfileComboChange); 406 461 407 462 /* Register fields: */ … … 455 510 } 456 511 } 512 513 /* Translate Profile combo-box: */ 514 m_pProfileComboBoxLabel->setText(UIWizardExportApp::tr("&Profile:")); 457 515 458 516 /* Refresh file selector name: */ … … 561 619 /* Update tool-tip: */ 562 620 updateProviderComboToolTip(); 563 } 621 622 /* Refresh required settings: */ 623 populateProfiles(); 624 } 625 626 void UIWizardExportAppPageBasic3::sltHandleProfileComboChange() 627 { 628 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h
r73030 r73033 47 47 /** Populates providers. */ 48 48 void populateProviders(); 49 /** Populates profiles. */ 50 void populateProfiles(); 49 51 50 52 /** Updates page appearance. */ … … 85 87 void setProvider(const QString &strProvider); 86 88 89 /** Returns profile. */ 90 QString profile() const; 91 /** Defines @a strProfile. */ 92 void setProfile(const QString &strProfile); 93 87 94 /** Holds the default appliance name. */ 88 95 QString m_strDefaultApplianceName; … … 115 122 /** Holds the provider combo-box instance. */ 116 123 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; 117 129 }; 118 130 … … 157 169 void sltHandleProviderComboChange(); 158 170 171 /** Handles change in profile combo-box. */ 172 void sltHandleProfileComboChange(); 173 159 174 private: 160 175 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r73030 r73033 268 268 } 269 269 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 270 288 /* Create placeholder: */ 271 289 QWidget *pPlaceholder = new QWidget; … … 273 291 { 274 292 /* Add into layout: */ 275 pSettingsLayout2->addWidget(pPlaceholder, 1, 0, 1, 2);293 pSettingsLayout2->addWidget(pPlaceholder, 2, 0, 1, 2); 276 294 } 277 295 } … … 299 317 /* Populate providers: */ 300 318 populateProviders(); 319 /* Populate profiles: */ 320 populateProfiles(); 301 321 302 322 /* Setup connections: */ … … 309 329 connect(m_pProviderComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 310 330 this, &UIWizardExportAppPageExpert::sltHandleProviderComboChange); 331 connect(m_pProfileComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 332 this, &UIWizardExportAppPageExpert::sltHandleProfileComboChange); 311 333 312 334 /* Register classes: */ … … 375 397 } 376 398 } 399 400 /* Translate Profile combo-box: */ 401 m_pProfileComboBoxLabel->setText(UIWizardExportApp::tr("&Profile:")); 377 402 378 403 /* Refresh file selector name: */ … … 489 514 /* Update tool-tip: */ 490 515 updateProviderComboToolTip(); 491 } 516 517 /* Refresh required settings: */ 518 populateProfiles(); 519 } 520 521 void UIWizardExportAppPageExpert::sltHandleProfileComboChange() 522 { 523 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r73014 r73033 87 87 void sltHandleProviderComboChange(); 88 88 89 /** Handles change in profile combo-box. */ 90 void sltHandleProfileComboChange(); 91 89 92 private: 90 93
Note:
See TracChangeset
for help on using the changeset viewer.