Changeset 73146 in vbox
- Timestamp:
- Jul 16, 2018 9:54:57 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123736
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp
r73090 r73146 288 288 /* Write the appliance: */ 289 289 QVector<KExportOptions> options; 290 switch (field("macAddressPolicy").value<MACAddressPolicy>()) 291 { 292 case MACAddressPolicy_StripAllNonNATMACs: 293 options.append(KExportOptions_StripAllNonNATMACs); 294 break; 295 case MACAddressPolicy_StripAllMACs: 296 options.append(KExportOptions_StripAllMACs); 297 break; 298 default: 299 break; 300 } 290 301 if (field("manifestSelected").toBool()) 291 302 options.append(KExportOptions_CreateManifest); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r73085 r73146 53 53 , m_pFormatComboBoxLabel(0) 54 54 , m_pFormatComboBox(0) 55 , m_pMACComboBoxLabel(0) 56 , m_pMACComboBox(0) 55 57 , m_pAdditionalLabel(0) 56 58 , m_pManifestCheckbox(0) … … 82 84 /* Set default: */ 83 85 setFormat("ovf-1.0"); 86 } 87 88 void UIWizardExportAppPage3::populateMACAddressPolicies() 89 { 90 AssertReturnVoid(m_pMACComboBox->count() == 0); 91 92 /* Apply hardcoded policies list: */ 93 for (int i = 0; i < (int)MACAddressPolicy_MAX; ++i) 94 { 95 m_pMACComboBox->addItem(QString::number(i)); 96 m_pMACComboBox->setItemData(i, i); 97 } 98 99 /* Set default: */ 100 setMACAddressPolicy(MACAddressPolicy_StripAllNonNATMACs); 84 101 } 85 102 … … 259 276 } 260 277 278 void UIWizardExportAppPage3::updateMACAddressPolicyComboToolTip() 279 { 280 const int iCurrentIndex = m_pMACComboBox->currentIndex(); 281 const QString strCurrentToolTip = m_pMACComboBox->itemData(iCurrentIndex, Qt::ToolTipRole).toString(); 282 AssertMsg(!strCurrentToolTip.isEmpty(), ("Data not found!")); 283 m_pMACComboBox->setToolTip(strCurrentToolTip); 284 } 285 261 286 void UIWizardExportAppPage3::updateProviderComboToolTip() 262 287 { … … 305 330 AssertMsg(iIndex != -1, ("Field not found!")); 306 331 m_pFormatComboBox->setCurrentIndex(iIndex); 332 } 333 334 MACAddressPolicy UIWizardExportAppPage3::macAddressPolicy() const 335 { 336 const int iIndex = m_pMACComboBox->currentIndex(); 337 return (MACAddressPolicy)m_pMACComboBox->itemData(iIndex).toInt(); 338 } 339 340 void UIWizardExportAppPage3::setMACAddressPolicy(MACAddressPolicy enmMACAddressPolicy) 341 { 342 const int iIndex = m_pMACComboBox->findData((int)enmMACAddressPolicy); 343 AssertMsg(iIndex != -1, ("Field not found!")); 344 m_pMACComboBox->setCurrentIndex(iIndex); 307 345 } 308 346 … … 429 467 } 430 468 469 /* Create MAC policy combo-box: */ 470 m_pMACComboBox = new QComboBox; 471 if (m_pMACComboBox) 472 { 473 /* Add into layout: */ 474 pSettingsLayout1->addWidget(m_pMACComboBox, 2, 1); 475 } 476 /* Create format combo-box label: */ 477 m_pMACComboBoxLabel = new QLabel; 478 if (m_pMACComboBoxLabel) 479 { 480 m_pMACComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 481 m_pMACComboBoxLabel->setBuddy(m_pMACComboBox); 482 483 /* Add into layout: */ 484 pSettingsLayout1->addWidget(m_pMACComboBoxLabel, 2, 0); 485 } 486 431 487 /* Create advanced label: */ 432 488 m_pAdditionalLabel = new QLabel; … … 436 492 437 493 /* Add into layout: */ 438 pSettingsLayout1->addWidget(m_pAdditionalLabel, 2, 0);494 pSettingsLayout1->addWidget(m_pAdditionalLabel, 3, 0); 439 495 } 440 496 /* Create manifest check-box: */ … … 443 499 { 444 500 /* Add into layout: */ 445 pSettingsLayout1->addWidget(m_pManifestCheckbox, 2, 1);501 pSettingsLayout1->addWidget(m_pManifestCheckbox, 3, 1); 446 502 } 447 503 /* Create include ISOs check-box: */ … … 450 506 { 451 507 /* Add into layout: */ 452 pSettingsLayout1->addWidget(m_pIncludeISOsCheckbox, 3, 1);508 pSettingsLayout1->addWidget(m_pIncludeISOsCheckbox, 4, 1); 453 509 } 454 510 … … 458 514 { 459 515 /* Add into layout: */ 460 pSettingsLayout1->addWidget(pPlaceholder, 4, 0, 1, 2);516 pSettingsLayout1->addWidget(pPlaceholder, 5, 0, 1, 2); 461 517 } 462 518 } … … 545 601 /* Populate formats: */ 546 602 populateFormats(); 603 /* Populate MAC address policies: */ 604 populateMACAddressPolicies(); 547 605 /* Populate providers: */ 548 606 populateProviders(); … … 556 614 connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 557 615 this, &UIWizardExportAppPageBasic3::sltHandleFormatComboChange); 616 connect(m_pMACComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 617 this, &UIWizardExportAppPageBasic3::sltHandleMACAddressPolicyComboChange); 558 618 connect(m_pProviderComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 559 619 this, &UIWizardExportAppPageBasic3::sltHandleProviderComboChange); … … 564 624 registerField("path", this, "path"); 565 625 registerField("format", this, "format"); 626 registerField("macAddressPolicy", this, "macAddressPolicy"); 566 627 registerField("manifestSelected", this, "manifestSelected"); 567 628 registerField("includeISOsSelected", this, "includeISOsSelected"); … … 613 674 m_pFormatComboBox->setItemData(3, UIWizardExportApp::tr("Write in Oracle Public Cloud 1.0 format."), Qt::ToolTipRole); 614 675 676 /* Translate MAC address policy combo-box: */ 677 m_pMACComboBoxLabel->setText(UIWizardExportApp::tr("MAC Address &Policy:")); 678 m_pMACComboBox->setItemText(MACAddressPolicy_KeepAllMACs, 679 UIWizardExportApp::tr("Include all network adapter MAC addresses")); 680 m_pMACComboBox->setItemText(MACAddressPolicy_StripAllNonNATMACs, 681 UIWizardExportApp::tr("Include only NAT network adapter MAC addresses")); 682 m_pMACComboBox->setItemText(MACAddressPolicy_StripAllMACs, 683 UIWizardExportApp::tr("Strip all network adapter MAC addresses")); 684 m_pMACComboBox->setItemData(MACAddressPolicy_KeepAllMACs, 685 UIWizardExportApp::tr("Include all network adapter MAC addresses to exported " 686 "appliance archive."), Qt::ToolTipRole); 687 m_pMACComboBox->setItemData(MACAddressPolicy_StripAllNonNATMACs, 688 UIWizardExportApp::tr("Include only NAT network adapter MAC addresses to " 689 "exported appliance archive."), Qt::ToolTipRole); 690 m_pMACComboBox->setItemData(MACAddressPolicy_StripAllMACs, 691 UIWizardExportApp::tr("Strip all network adapter MAC addresses from exported " 692 "appliance archive."), Qt::ToolTipRole); 693 615 694 /* Translate addtional stuff: */ 616 695 m_pAdditionalLabel->setText(UIWizardExportApp::tr("Additionally:")); … … 646 725 /* Update tool-tips: */ 647 726 updateFormatComboToolTip(); 727 updateMACAddressPolicyComboToolTip(); 648 728 updateProviderComboToolTip(); 649 729 } … … 743 823 } 744 824 825 void UIWizardExportAppPageBasic3::sltHandleMACAddressPolicyComboChange() 826 { 827 /* Update tool-tip: */ 828 updateMACAddressPolicyComboToolTip(); 829 } 830 745 831 void UIWizardExportAppPageBasic3::sltHandleProviderComboChange() 746 832 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h
r73085 r73146 36 36 37 37 38 /** MAC address policies. */ 39 enum MACAddressPolicy 40 { 41 MACAddressPolicy_KeepAllMACs, 42 MACAddressPolicy_StripAllNonNATMACs, 43 MACAddressPolicy_StripAllMACs, 44 MACAddressPolicy_MAX 45 }; 46 Q_DECLARE_METATYPE(MACAddressPolicy); 47 48 38 49 /** UIWizardPageBase extension for 3rd page of the Export Appliance wizard. */ 39 50 class UIWizardExportAppPage3 : public UIWizardPageBase … … 46 57 /** Populates formats. */ 47 58 void populateFormats(); 59 /** Populates MAC address policies. */ 60 void populateMACAddressPolicies(); 48 61 /** Populates providers. */ 49 62 void populateProviders(); … … 69 82 /** Updates format combo tool-tips. */ 70 83 void updateFormatComboToolTip(); 84 /** Updates MAC address policy combo tool-tips. */ 85 void updateMACAddressPolicyComboToolTip(); 71 86 /** Updates provider combo tool-tips. */ 72 87 void updateProviderComboToolTip(); … … 85 100 void setFormat(const QString &strFormat); 86 101 102 /** Returns MAC address policy. */ 103 MACAddressPolicy macAddressPolicy() const; 104 /** Defines @a enmMACAddressPolicy. */ 105 void setMACAddressPolicy(MACAddressPolicy enmMACAddressPolicy); 106 87 107 /** Returns whether manifest selected. */ 88 108 bool isManifestSelected() const; … … 125 145 /** Holds the format combo-box instance. */ 126 146 QComboBox *m_pFormatComboBox; 147 148 /** Holds the MAC address policy combo-box label instance. */ 149 QLabel *m_pMACComboBoxLabel; 150 /** Holds the MAC address policy check-box instance. */ 151 QComboBox *m_pMACComboBox; 127 152 128 153 /** Holds the additional label instance. */ … … 153 178 Q_PROPERTY(QString path READ path WRITE setPath); 154 179 Q_PROPERTY(QString format READ format WRITE setFormat); 180 Q_PROPERTY(MACAddressPolicy macAddressPolicy READ macAddressPolicy WRITE setMACAddressPolicy); 155 181 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 156 182 Q_PROPERTY(bool includeISOsSelected READ isIncludeISOsSelected WRITE setIncludeISOsSelected); … … 187 213 void sltHandleFormatComboChange(); 188 214 215 /** Handles change in MAC address policy combo-box. */ 216 void sltHandleMACAddressPolicyComboChange(); 217 189 218 /** Handles change in provider combo-box. */ 190 219 void sltHandleProviderComboChange(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r73085 r73146 205 205 } 206 206 207 /* Create MAC policy combo-box: */ 208 m_pMACComboBox = new QComboBox; 209 if (m_pMACComboBox) 210 { 211 /* Add into layout: */ 212 pSettingsLayout1->addWidget(m_pMACComboBox, 2, 1); 213 } 214 /* Create format combo-box label: */ 215 m_pMACComboBoxLabel = new QLabel; 216 if (m_pMACComboBoxLabel) 217 { 218 m_pMACComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 219 m_pMACComboBoxLabel->setBuddy(m_pMACComboBox); 220 221 /* Add into layout: */ 222 pSettingsLayout1->addWidget(m_pMACComboBoxLabel, 2, 0); 223 } 224 207 225 /* Create advanced label: */ 208 226 m_pAdditionalLabel = new QLabel; … … 212 230 213 231 /* Add into layout: */ 214 pSettingsLayout1->addWidget(m_pAdditionalLabel, 2, 0);232 pSettingsLayout1->addWidget(m_pAdditionalLabel, 3, 0); 215 233 } 216 234 /* Create manifest check-box editor: */ … … 219 237 { 220 238 /* Add into layout: */ 221 pSettingsLayout1->addWidget(m_pManifestCheckbox, 2, 1);239 pSettingsLayout1->addWidget(m_pManifestCheckbox, 3, 1); 222 240 } 223 241 /* Create include ISOs check-box: */ … … 226 244 { 227 245 /* Add into layout: */ 228 pSettingsLayout1->addWidget(m_pIncludeISOsCheckbox, 3, 1);246 pSettingsLayout1->addWidget(m_pIncludeISOsCheckbox, 4, 1); 229 247 } 230 248 … … 234 252 { 235 253 /* Add into layout: */ 236 pSettingsLayout1->addWidget(pPlaceholder, 4, 0, 1, 2);254 pSettingsLayout1->addWidget(pPlaceholder, 5, 0, 1, 2); 237 255 } 238 256 } … … 335 353 /* Populate formats: */ 336 354 populateFormats(); 355 /* Populate MAC address policies: */ 356 populateMACAddressPolicies(); 337 357 /* Populate providers: */ 338 358 populateProviders(); … … 349 369 connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 350 370 this, &UIWizardExportAppPageExpert::sltHandleFormatComboChange); 371 connect(m_pMACComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 372 this, &UIWizardExportAppPageExpert::sltHandleMACAddressPolicyComboChange); 351 373 connect(m_pProviderComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 352 374 this, &UIWizardExportAppPageExpert::sltHandleProviderComboChange); … … 364 386 registerField("path", this, "path"); 365 387 registerField("format", this, "format"); 388 registerField("macAddressPolicy", this, "macAddressPolicy"); 366 389 registerField("manifestSelected", this, "manifestSelected"); 367 390 registerField("includeISOsSelected", this, "includeISOsSelected"); … … 421 444 m_pFormatComboBox->setItemData(3, UIWizardExportApp::tr("Write in Oracle Public Cloud 1.0 format."), Qt::ToolTipRole); 422 445 446 /* Translate MAC address policy combo-box: */ 447 m_pMACComboBoxLabel->setText(UIWizardExportApp::tr("MAC Address &Policy:")); 448 m_pMACComboBox->setItemText(MACAddressPolicy_KeepAllMACs, 449 UIWizardExportApp::tr("Include all network adapter MAC addresses")); 450 m_pMACComboBox->setItemText(MACAddressPolicy_StripAllNonNATMACs, 451 UIWizardExportApp::tr("Include only NAT network adapter MAC addresses")); 452 m_pMACComboBox->setItemText(MACAddressPolicy_StripAllMACs, 453 UIWizardExportApp::tr("Strip all network adapter MAC addresses")); 454 m_pMACComboBox->setItemData(MACAddressPolicy_KeepAllMACs, 455 UIWizardExportApp::tr("Include all network adapter MAC addresses to exported " 456 "appliance archive."), Qt::ToolTipRole); 457 m_pMACComboBox->setItemData(MACAddressPolicy_StripAllNonNATMACs, 458 UIWizardExportApp::tr("Include only NAT network adapter MAC addresses to " 459 "exported appliance archive."), Qt::ToolTipRole); 460 m_pMACComboBox->setItemData(MACAddressPolicy_StripAllMACs, 461 UIWizardExportApp::tr("Strip all network adapter MAC addresses from exported " 462 "appliance archive."), Qt::ToolTipRole); 463 423 464 /* Translate addtional stuff: */ 424 465 m_pAdditionalLabel->setText(UIWizardExportApp::tr("Additionally:")); … … 451 492 /* Update tool-tips: */ 452 493 updateFormatComboToolTip(); 494 updateMACAddressPolicyComboToolTip(); 453 495 updateProviderComboToolTip(); 454 496 } … … 558 600 } 559 601 602 void UIWizardExportAppPageExpert::sltHandleMACAddressPolicyComboChange() 603 { 604 /* Update tool-tip: */ 605 updateMACAddressPolicyComboToolTip(); 606 } 607 560 608 void UIWizardExportAppPageExpert::sltHandleProviderComboChange() 561 609 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r73085 r73146 43 43 Q_PROPERTY(QString path READ path WRITE setPath); 44 44 Q_PROPERTY(QString format READ format WRITE setFormat); 45 Q_PROPERTY(MACAddressPolicy macAddressPolicy READ macAddressPolicy WRITE setMACAddressPolicy); 45 46 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 46 47 Q_PROPERTY(bool includeISOsSelected READ isIncludeISOsSelected WRITE setIncludeISOsSelected); … … 88 89 void sltHandleFormatComboChange(); 89 90 91 /** Handles change in MAC address policy combo-box. */ 92 void sltHandleMACAddressPolicyComboChange(); 93 90 94 /** Handles change in provider combo-box. */ 91 95 void sltHandleProviderComboChange();
Note:
See TracChangeset
for help on using the changeset viewer.