Changeset 73007 in vbox
- Timestamp:
- Jul 9, 2018 12:02:55 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123559
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp
r72932 r73007 135 135 "or on one of cloud servers you have registered.")); 136 136 m_pTypeLocalFilesystem->setText(UIWizardExportApp::tr("&This computer")); 137 m_pTypeCloudServiceProvider->setText(UIWizardExportApp::tr("&Cloud Service Provider"));137 m_pTypeCloudServiceProvider->setText(UIWizardExportApp::tr("&Cloud service provider")); 138 138 } 139 139 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r73006 r73007 48 48 } 49 49 50 void UIWizardExportAppPage3::populateProviders() 51 { 52 /* Acquire provider list: */ 53 // Here goes the experiamental list with 54 // arbitrary contents for testing purposes. 55 QStringList providers; 56 providers << "OCI"; 57 providers << "Amazon"; 58 providers << "Google"; 59 providers << "Microsoft"; 60 m_pProviderComboBox->addItems(providers); 61 62 /* Duplicate non-translated names to data fields: */ 63 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 64 m_pProviderComboBox->setItemData(i, m_pProviderComboBox->itemText(i)); 65 } 66 50 67 void UIWizardExportAppPage3::chooseDefaultSettings() 51 68 { 52 69 /* Choose defaults: */ 53 70 setFormat("ovf-1.0"); 71 setProvider("OCI"); 54 72 } 55 73 … … 68 86 m_pAdditionalLabel->setVisible(true); 69 87 m_pManifestCheckbox->setVisible(true); 88 m_pProviderComboBoxLabel->setVisible(false); 89 m_pProviderComboBox->setVisible(false); 70 90 break; 71 91 } … … 78 98 m_pAdditionalLabel->setVisible(false); 79 99 m_pManifestCheckbox->setVisible(false); 100 m_pProviderComboBoxLabel->setVisible(true); 101 m_pProviderComboBox->setVisible(true); 80 102 break; 81 103 } … … 135 157 } 136 158 159 void UIWizardExportAppPage3::updateProviderComboToolTip() 160 { 161 const int iCurrentIndex = m_pProviderComboBox->currentIndex(); 162 const QString strCurrentToolTip = m_pProviderComboBox->itemData(iCurrentIndex, Qt::ToolTipRole).toString(); 163 AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!")); 164 m_pProviderComboBox->setToolTip(strCurrentToolTip); 165 } 166 137 167 QString UIWizardExportAppPage3::path() const 138 168 { … … 166 196 { 167 197 m_pManifestCheckbox->setChecked(fChecked); 198 } 199 200 QString UIWizardExportAppPage3::provider() const 201 { 202 const int iIndex = m_pProviderComboBox->currentIndex(); 203 return m_pProviderComboBox->itemData(iIndex).toString(); 204 } 205 206 void UIWizardExportAppPage3::setProvider(const QString &strProvider) 207 { 208 const int iIndex = m_pProviderComboBox->findData(strProvider); 209 AssertMsg(iIndex != -1, ("Field not found!")); 210 m_pProviderComboBox->setCurrentIndex(iIndex); 168 211 } 169 212 … … 261 304 } 262 305 306 /* Create provider combo-box: */ 307 m_pProviderComboBox = new QComboBox; 308 if (m_pProviderComboBox) 309 { 310 /* Add into layout: */ 311 pSettingsLayout->addWidget(m_pProviderComboBox, 7, 1); 312 } 313 /* Create provider label: */ 314 m_pProviderComboBoxLabel = new QLabel; 315 if (m_pProviderComboBoxLabel) 316 { 317 m_pProviderComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 318 m_pProviderComboBoxLabel->setBuddy(m_pProviderComboBox); 319 320 /* Add into layout: */ 321 pSettingsLayout->addWidget(m_pProviderComboBoxLabel, 7, 0); 322 } 323 263 324 /* Add into layout: */ 264 325 pMainLayout->addLayout(pSettingsLayout); … … 269 330 } 270 331 332 /* Populate providers: */ 333 populateProviders(); 271 334 /* Choose default settings: */ 272 335 chooseDefaultSettings(); … … 276 339 connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 277 340 this, &UIWizardExportAppPageBasic3::sltHandleFormatComboChange); 341 connect(m_pProviderComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 342 this, &UIWizardExportAppPageBasic3::sltHandleProviderComboChange); 278 343 279 344 /* Register fields: */ … … 313 378 m_pManifestCheckbox->setText(UIWizardExportApp::tr("Write &Manifest file")); 314 379 380 /* Translate Provider combo-box: */ 381 m_pProviderComboBoxLabel->setText(UIWizardExportApp::tr("&Cloud Service Provider:")); 382 for (int i = 0; i < m_pProviderComboBox->count(); ++i) 383 { 384 if (m_pProviderComboBox->itemText(i) == "OCI") 385 { 386 m_pProviderComboBox->setItemText(i, UIWizardExportApp::tr("Oracle Cloud Infrastructure")); 387 m_pProviderComboBox->setItemData(i, UIWizardExportApp::tr("Write to Oracle Cloud Infrastructure"), Qt::ToolTipRole); 388 } 389 } 390 315 391 /* Refresh current settings: */ 316 392 refreshCurrentSettings(); 317 393 updateFormatComboToolTip(); 394 updateProviderComboToolTip(); 318 395 } 319 396 … … 385 462 m_pLabel->setText(tr("Please complete the additional fields and provide a filename for " 386 463 "the OVF target.")); 387 m_p Label->setFocus(); /// @todo fix it!464 m_pProviderComboBox->setFocus(); 388 465 break; 389 466 } … … 396 473 updateFormatComboToolTip(); 397 474 } 475 476 void UIWizardExportAppPageBasic3::sltHandleProviderComboChange() 477 { 478 refreshCurrentSettings(); 479 updateProviderComboToolTip(); 480 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h
r73006 r73007 42 42 UIWizardExportAppPage3(); 43 43 44 /** Populates providers. */ 45 void populateProviders(); 46 44 47 /** Chooses default settings. */ 45 48 void chooseDefaultSettings(); … … 50 53 /** Updates format combo tool-tips. */ 51 54 virtual void updateFormatComboToolTip(); 55 /** Updates provider combo tool-tips. */ 56 virtual void updateProviderComboToolTip(); 52 57 53 58 /** Returns path. */ … … 65 70 /** Defines whether manifest @a fSelected. */ 66 71 void setManifestSelected(bool fChecked); 72 73 /** Returns provider. */ 74 QString provider() const; 75 /** Defines @a strProvider. */ 76 void setProvider(const QString &strProvider); 67 77 68 78 /** Holds the default appliance name. */ … … 83 93 /** Holds the manifest check-box instance. */ 84 94 QCheckBox *m_pManifestCheckbox; 95 96 /** Holds the provider combo-box label instance. */ 97 QLabel *m_pProviderComboBoxLabel; 98 /** Holds the provider combo-box instance. */ 99 QComboBox *m_pProviderComboBox; 85 100 }; 86 101 … … 93 108 Q_PROPERTY(QString format READ format WRITE setFormat); 94 109 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 110 Q_PROPERTY(QString provider READ provider WRITE setProvider); 95 111 96 112 public: … … 121 137 void sltHandleFormatComboChange(); 122 138 139 /** Handles change in provider combo-box. */ 140 void sltHandleProviderComboChange(); 141 123 142 private: 124 143 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r72936 r73007 271 271 refreshCurrentSettings(); 272 272 updateFormatComboToolTip(); 273 updateProviderComboToolTip(); 273 274 } 274 275
Note:
See TracChangeset
for help on using the changeset viewer.