Changeset 73236 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 19, 2018 12:02:43 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.cpp
r73083 r73236 202 202 return fResult; 203 203 } 204 205 int UIWizardExportAppPageBasic1::nextId() const 206 { 207 /* Skip 2nd page as we are merging 2nd and 3rd now: */ 208 return UIWizardExportApp::Page3; 209 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic1.h
r73083 r73236 75 75 virtual bool validatePage() /* override */; 76 76 77 /** Defines the ID of the next page. */ 78 virtual int nextId() const /* override */; 79 77 80 private: 78 81 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r73234 r73236 52 52 53 53 UIWizardExportAppPage3::UIWizardExportAppPage3() 54 : m_pSettingsWidget(0) 54 : m_pFormatLayout(0) 55 , m_pSettingsLayout1(0) 56 , m_pSettingsLayout2(0) 57 , m_pFormatComboBoxLabel(0) 58 , m_pFormatComboBox(0) 59 , m_pSettingsWidget(0) 55 60 , m_pFileSelectorLabel(0) 56 61 , m_pFileSelector(0) 57 , m_pFormatComboBoxLabel(0)58 , m_pFormatComboBox(0)59 62 , m_pMACComboBoxLabel(0) 60 63 , m_pMACComboBox(0) … … 83 86 formats << "ovf-2.0"; 84 87 formats << "opc-1.0"; 88 formats << "csp-1.0"; 85 89 m_pFormatComboBox->addItems(formats); 86 90 … … 207 211 { 208 212 /* Update page appearance according to chosen storage-type: */ 209 const StorageType enmStorageType = fieldImp("storageType").value<StorageType>();210 m_pSettingsWidget->setCurrentIndex((int) enmStorageType);213 const bool fCSP = fieldImp("format").toString() == "csp-1.0"; 214 m_pSettingsWidget->setCurrentIndex((int)fCSP); 211 215 } 212 216 … … 226 230 void UIWizardExportAppPage3::refreshFileSelectorExtension() 227 231 { 228 /* If the format is set to OPC: */ 229 if (fieldImp("format").toString() == "opc-1.0") 232 /* If the format is set to CSP: */ 233 if (fieldImp("format").toString() == "csp-1.0") 234 { 235 /* We use no extension: */ 236 m_strFileSelectorExt.clear(); 237 238 /* Update file chooser accordingly: */ 239 m_pFileSelector->setFileFilters(QString()); 240 } 241 /* Else if the format is set to OPC: */ 242 else if (fieldImp("format").toString() == "opc-1.0") 230 243 { 231 244 /* We use .tar.gz extension: */ … … 263 276 void UIWizardExportAppPage3::refreshManifestCheckBoxAccess() 264 277 { 265 /* If the format is set to OPC: */ 266 if (fieldImp("format").toString() == "opc-1.0") 278 /* If the format is set to CSP || OPC: */ 279 if ( fieldImp("format").toString() == "csp-1.0" 280 || fieldImp("format").toString() == "opc-1.0") 267 281 { 268 282 /* Disable manifest check-box: */ … … 281 295 void UIWizardExportAppPage3::refreshIncludeISOsCheckBoxAccess() 282 296 { 283 /* If the format is set to OPC: */ 284 if (fieldImp("format").toString() == "opc-1.0") 297 /* If the format is set to CSP || OPC: */ 298 if ( fieldImp("format").toString() == "csp-1.0" 299 || fieldImp("format").toString() == "opc-1.0") 285 300 { 286 301 /* Disable include ISO check-box: */ … … 344 359 } 345 360 346 QString UIWizardExportAppPage3::path() const347 {348 return m_pFileSelector->path();349 }350 351 void UIWizardExportAppPage3::setPath(const QString &strPath)352 {353 m_pFileSelector->setPath(strPath);354 }355 356 361 QString UIWizardExportAppPage3::format() const 357 362 { … … 367 372 } 368 373 374 QString UIWizardExportAppPage3::path() const 375 { 376 return m_pFileSelector->path(); 377 } 378 379 void UIWizardExportAppPage3::setPath(const QString &strPath) 380 { 381 m_pFileSelector->setPath(strPath); 382 } 383 369 384 MACAddressPolicy UIWizardExportAppPage3::macAddressPolicy() const 370 385 { … … 425 440 426 441 UIWizardExportAppPageBasic3::UIWizardExportAppPageBasic3() 427 : m_pLabel(0) 442 : m_pLabelFormat(0) 443 , m_pLabelSettings(0) 428 444 { 429 445 /* Create main layout: */ … … 431 447 if (pMainLayout) 432 448 { 433 /* Create label: */434 m_pLabel = new QIRichTextLabel;435 if (m_pLabel )449 /* Create format label: */ 450 m_pLabelFormat = new QIRichTextLabel; 451 if (m_pLabelFormat) 436 452 { 437 453 /* Add into layout: */ 438 pMainLayout->addWidget(m_pLabel); 454 pMainLayout->addWidget(m_pLabelFormat); 455 } 456 457 /* Create format layout: */ 458 m_pFormatLayout = new QGridLayout; 459 if (m_pFormatLayout) 460 { 461 #ifdef VBOX_WS_MAC 462 m_pFormatLayout->setContentsMargins(0, 10, 0, 10); 463 m_pFormatLayout->setSpacing(10); 464 #else 465 m_pFormatLayout->setContentsMargins(0, qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin), 466 0, qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin)); 467 #endif 468 m_pFormatLayout->setColumnStretch(0, 0); 469 m_pFormatLayout->setColumnStretch(1, 1); 470 471 /* Create format combo-box: */ 472 m_pFormatComboBox = new QComboBox; 473 if (m_pFormatComboBox) 474 { 475 /* Add into layout: */ 476 m_pFormatLayout->addWidget(m_pFormatComboBox, 0, 1); 477 } 478 /* Create format combo-box label: */ 479 m_pFormatComboBoxLabel = new QLabel; 480 if (m_pFormatComboBoxLabel) 481 { 482 m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 483 m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox); 484 485 /* Add into layout: */ 486 m_pFormatLayout->addWidget(m_pFormatComboBoxLabel, 0, 0); 487 } 488 489 /* Add into layout: */ 490 pMainLayout->addLayout(m_pFormatLayout); 491 } 492 493 /* Create settings label: */ 494 m_pLabelSettings = new QIRichTextLabel; 495 if (m_pLabelSettings) 496 { 497 /* Add into layout: */ 498 pMainLayout->addWidget(m_pLabelSettings); 439 499 } 440 500 … … 448 508 { 449 509 /* Create settings layout 1: */ 450 QGridLayout *pSettingsLayout1 = new QGridLayout(pSettingsPane1);451 if ( pSettingsLayout1)510 m_pSettingsLayout1 = new QGridLayout(pSettingsPane1); 511 if (m_pSettingsLayout1) 452 512 { 453 513 #ifdef VBOX_WS_MAC 454 pSettingsLayout1->setContentsMargins(0, 10, 0, 10);455 pSettingsLayout1->setSpacing(10);514 m_pSettingsLayout1->setContentsMargins(0, 10, 0, 10); 515 m_pSettingsLayout1->setSpacing(10); 456 516 #else 457 pSettingsLayout1->setContentsMargins(0, qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin),458 0, qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin));517 m_pSettingsLayout1->setContentsMargins(0, qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin), 518 0, qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin)); 459 519 #endif 460 pSettingsLayout1->setColumnStretch(0, 0);461 pSettingsLayout1->setColumnStretch(1, 1);520 m_pSettingsLayout1->setColumnStretch(0, 0); 521 m_pSettingsLayout1->setColumnStretch(1, 1); 462 522 463 523 /* Create file selector: */ … … 471 531 472 532 /* Add into layout: */ 473 pSettingsLayout1->addWidget(m_pFileSelector, 0, 1, 1, 2);533 m_pSettingsLayout1->addWidget(m_pFileSelector, 0, 1, 1, 2); 474 534 } 475 535 /* Create file selector label: */ … … 481 541 482 542 /* Add into layout: */ 483 pSettingsLayout1->addWidget(m_pFileSelectorLabel, 0, 0); 484 } 485 486 /* Create format combo-box: */ 487 m_pFormatComboBox = new QComboBox; 488 if (m_pFormatComboBox) 489 { 490 /* Add into layout: */ 491 pSettingsLayout1->addWidget(m_pFormatComboBox, 1, 1, 1, 2); 492 } 493 /* Create format combo-box label: */ 494 m_pFormatComboBoxLabel = new QLabel; 495 if (m_pFormatComboBoxLabel) 496 { 497 m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 498 m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox); 499 500 /* Add into layout: */ 501 pSettingsLayout1->addWidget(m_pFormatComboBoxLabel, 1, 0); 543 m_pSettingsLayout1->addWidget(m_pFileSelectorLabel, 0, 0); 502 544 } 503 545 … … 507 549 { 508 550 /* Add into layout: */ 509 pSettingsLayout1->addWidget(m_pMACComboBox, 2, 1, 1, 2);551 m_pSettingsLayout1->addWidget(m_pMACComboBox, 1, 1, 1, 2); 510 552 } 511 553 /* Create format combo-box label: */ … … 517 559 518 560 /* Add into layout: */ 519 pSettingsLayout1->addWidget(m_pMACComboBoxLabel, 2, 0);561 m_pSettingsLayout1->addWidget(m_pMACComboBoxLabel, 1, 0); 520 562 } 521 563 … … 527 569 528 570 /* Add into layout: */ 529 pSettingsLayout1->addWidget(m_pAdditionalLabel, 3, 0);571 m_pSettingsLayout1->addWidget(m_pAdditionalLabel, 2, 0); 530 572 } 531 573 /* Create manifest check-box: */ … … 534 576 { 535 577 /* Add into layout: */ 536 pSettingsLayout1->addWidget(m_pManifestCheckbox, 3, 1);578 m_pSettingsLayout1->addWidget(m_pManifestCheckbox, 2, 1); 537 579 } 538 580 /* Create include ISOs check-box: */ … … 541 583 { 542 584 /* Add into layout: */ 543 pSettingsLayout1->addWidget(m_pIncludeISOsCheckbox, 4, 1);585 m_pSettingsLayout1->addWidget(m_pIncludeISOsCheckbox, 3, 1); 544 586 } 545 587 … … 549 591 { 550 592 /* Add into layout: */ 551 pSettingsLayout1->addWidget(pPlaceholder, 5, 0, 1, 3);593 m_pSettingsLayout1->addWidget(pPlaceholder, 4, 0, 1, 3); 552 594 } 553 595 } … … 562 604 { 563 605 /* Create settings layout 2: */ 564 QGridLayout *pSettingsLayout2 = new QGridLayout(pSettingsPane2);565 if ( pSettingsLayout2)606 m_pSettingsLayout2 = new QGridLayout(pSettingsPane2); 607 if (m_pSettingsLayout2) 566 608 { 567 609 #ifdef VBOX_WS_MAC 568 pSettingsLayout2->setContentsMargins(0, 10, 0, 10);569 pSettingsLayout2->setSpacing(10);610 m_pSettingsLayout2->setContentsMargins(0, 10, 0, 10); 611 m_pSettingsLayout2->setSpacing(10); 570 612 571 613 #else 572 pSettingsLayout2->setContentsMargins(0, qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin),573 0, qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin));614 m_pSettingsLayout2->setContentsMargins(0, qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin), 615 0, qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin)); 574 616 #endif 575 pSettingsLayout2->setColumnStretch(0, 0);576 pSettingsLayout2->setColumnStretch(1, 1);617 m_pSettingsLayout2->setColumnStretch(0, 0); 618 m_pSettingsLayout2->setColumnStretch(1, 1); 577 619 578 620 /* Create provider combo-box: */ … … 581 623 { 582 624 /* Add into layout: */ 583 pSettingsLayout2->addWidget(m_pAccountComboBox, 0, 1);625 m_pSettingsLayout2->addWidget(m_pAccountComboBox, 0, 1); 584 626 } 585 627 /* Create provider label: */ … … 591 633 592 634 /* Add into layout: */ 593 pSettingsLayout2->addWidget(m_pAccountComboBoxLabel, 0, 0);635 m_pSettingsLayout2->addWidget(m_pAccountComboBoxLabel, 0, 0); 594 636 } 595 637 /* Create profile property table: */ … … 603 645 const int iTotalHeight = 4 * iFontHeight; 604 646 m_pAccountPropertyTable->setMinimumSize(QSize(iTotalWidth, iTotalHeight)); 605 m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);647 // m_pAccountPropertyTable->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); 606 648 m_pAccountPropertyTable->setAlternatingRowColors(true); 607 649 m_pAccountPropertyTable->horizontalHeader()->setVisible(false); … … 610 652 611 653 /* Add into layout: */ 612 pSettingsLayout2->addWidget(m_pAccountPropertyTable, 1, 1);654 m_pSettingsLayout2->addWidget(m_pAccountPropertyTable, 1, 1); 613 655 } 614 656 } … … 642 684 643 685 /* Register fields: */ 686 registerField("format", this, "format"); 644 687 registerField("path", this, "path"); 645 registerField("format", this, "format");646 688 registerField("macAddressPolicy", this, "macAddressPolicy"); 647 689 registerField("manifestSelected", this, "manifestSelected"); … … 676 718 /* Translate objects: */ 677 719 m_strDefaultApplianceName = UIWizardExportApp::tr("Appliance"); 720 721 /* Translate format label: */ 722 m_pLabelFormat->setText(tr("<p>Please choose a format to export the virtual appliance to.</p>" 723 "<p>The <b>Open Virtualization Format</b> supports only <b>ovf</b> or <b>ova</b> extensions. " 724 "If you use the <b>ovf</b> extension, several files will be written separately. " 725 "If you use the <b>ova</b> extension, all the files will be combined into one Open " 726 "Virtualization Format archive.</p>" 727 "<p>The <b>Oracle Public Cloud Format</b> supports only the <b>tar.gz</b> extension. " 728 "Each virtual disk file will be written separately.</p>" 729 "<p>The <b>Cloud Service Provider Format</b> supports exporting to remote cloud services only. " 730 "Main virtual disk of each selected machine will be uploaded to remote server.</p>")); 678 731 679 732 /* Translate file selector: */ … … 688 741 m_pFormatComboBox->setItemText(2, UIWizardExportApp::tr("Open Virtualization Format 2.0")); 689 742 m_pFormatComboBox->setItemText(3, UIWizardExportApp::tr("Oracle Public Cloud Format 1.0")); 743 m_pFormatComboBox->setItemText(4, UIWizardExportApp::tr("Cloud Service Provider")); 690 744 m_pFormatComboBox->setItemData(0, UIWizardExportApp::tr("Write in legacy OVF 0.9 format for compatibility " 691 745 "with other virtualization products."), Qt::ToolTipRole); … … 693 747 m_pFormatComboBox->setItemData(2, UIWizardExportApp::tr("Write in new OVF 2.0 format."), Qt::ToolTipRole); 694 748 m_pFormatComboBox->setItemData(3, UIWizardExportApp::tr("Write in Oracle Public Cloud 1.0 format."), Qt::ToolTipRole); 749 m_pFormatComboBox->setItemData(4, UIWizardExportApp::tr("Export to Cloud Service Provider."), Qt::ToolTipRole); 695 750 696 751 /* Translate MAC address policy combo-box: */ … … 736 791 } 737 792 793 /* Adjust label widths: */ 794 QList<QWidget*> labels; 795 labels << m_pFormatComboBoxLabel; 796 labels << m_pFileSelectorLabel; 797 labels << m_pMACComboBoxLabel; 798 labels << m_pAdditionalLabel; 799 labels << m_pAccountComboBoxLabel; 800 int iMaxWidth = 0; 801 foreach (QWidget *pLabel, labels) 802 iMaxWidth = qMax(iMaxWidth, pLabel->minimumSizeHint().width()); 803 m_pFormatLayout->setColumnMinimumWidth(0, iMaxWidth); 804 m_pSettingsLayout1->setColumnMinimumWidth(0, iMaxWidth); 805 m_pSettingsLayout2->setColumnMinimumWidth(0, iMaxWidth); 806 738 807 /* Refresh file selector name: */ 739 808 refreshFileSelectorName(); … … 776 845 || field("format").toString() == "ovf-2.0"; 777 846 const bool fOPC = field("format").toString() == "opc-1.0"; 847 const bool fCSP = field("format").toString() == "csp-1.0"; 778 848 779 849 fResult = ( fOVF 780 850 && VBoxGlobal::hasAllowedExtension(strFile, OVFFileExts)) 781 851 || ( fOPC 782 && VBoxGlobal::hasAllowedExtension(strFile, OPCFileExts)); 852 && VBoxGlobal::hasAllowedExtension(strFile, OPCFileExts)) 853 || fCSP; 783 854 } 784 855 … … 792 863 793 864 /* Update page appearance according to chosen storage-type: */ 794 const StorageType enmStorageType = field("storageType").value<StorageType>(); 795 switch (enmStorageType) 796 { 797 case LocalFilesystem: 798 { 799 m_pLabel->setText(tr("<p>Please choose a filename to export the virtual appliance to.</p>" 800 "<p>The <b>Open Virtualization Format</b> supports only <b>ovf</b> or <b>ova</b> extensions. " 801 "If you use the <b>ovf</b> extension, several files will be written separately. " 802 "If you use the <b>ova</b> extension, all the files will be combined into one Open " 803 "Virtualization Format archive.</p>" 804 "<p>The <b>Oracle Public Cloud Format</b> supports only the <b>tar.gz</b> extension. " 805 "Each virtual disk file will be written separately.</p>")); 806 m_pFileSelector->setFocus(); 807 break; 808 } 809 case CloudProvider: 810 { 811 m_pLabel->setText(tr("<p>Please choose a cloud service <b>provider</b> and one of its <b>profiles</b> you have " 812 "registered to export virtual machines to.</p>" 813 "<p>Make sure profile settings reflected in the underlying table are valid. " 814 "They will be used to establish network connection required to upload your virtual machine " 815 "files to remote cloud facility.")); 816 m_pAccountComboBox->setFocus(); 817 break; 818 } 865 if (field("format").toString() == "csp-1.0") 866 { 867 m_pLabelSettings->setText(tr("<p>Please choose one of cloud service accounts you have registered to export virtual " 868 "machines to. Make sure profile settings reflected in the underlying table are valid. " 869 "They will be used to establish network connection required to upload your virtual machine " 870 "files to a remote cloud facility.")); 871 m_pAccountComboBox->setFocus(); 872 } 873 else 874 { 875 m_pLabelSettings->setText(tr("<p>Please choose a filename to export the virtual appliance to. Besides that you can " 876 "specify a certain amount of options which affects the size and content of resulting " 877 "archive.</p>")); 878 m_pFileSelector->setFocus(); 819 879 } 820 880 } … … 826 886 827 887 /* Refresh required settings: */ 888 updatePageAppearance(); 828 889 refreshFileSelectorExtension(); 829 890 refreshManifestCheckBoxAccess(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h
r73226 r73236 32 32 class QCheckBox; 33 33 class QComboBox; 34 class QGridLayout; 34 35 class QLabel; 35 36 class QLineEdit; … … 98 99 void adjustAccountPropertyTable(); 99 100 101 /** Returns format. */ 102 QString format() const; 103 /** Defines @a strFormat. */ 104 void setFormat(const QString &strFormat); 105 100 106 /** Returns path. */ 101 107 QString path() const; 102 108 /** Defines @a strPath. */ 103 109 void setPath(const QString &strPath); 104 105 /** Returns format. */106 QString format() const;107 /** Defines @a strFormat. */108 void setFormat(const QString &strFormat);109 110 110 111 /** Returns MAC address policy. */ … … 141 142 QString m_strFileSelectorExt; 142 143 144 /** Holds the format layout. */ 145 QGridLayout *m_pFormatLayout; 146 /** Holds the settings layout 1. */ 147 QGridLayout *m_pSettingsLayout1; 148 /** Holds the settings layout 2. */ 149 QGridLayout *m_pSettingsLayout2; 150 151 /** Holds the format combo-box label instance. */ 152 QLabel *m_pFormatComboBoxLabel; 153 /** Holds the format combo-box instance. */ 154 QComboBox *m_pFormatComboBox; 155 143 156 /** Holds the settings widget instance. */ 144 157 QStackedWidget *m_pSettingsWidget; … … 148 161 /** Holds the file selector instance. */ 149 162 UIEmptyFilePathSelector *m_pFileSelector; 150 151 /** Holds the format combo-box label instance. */152 QLabel *m_pFormatComboBoxLabel;153 /** Holds the format combo-box instance. */154 QComboBox *m_pFormatComboBox;155 163 156 164 /** Holds the MAC address policy combo-box label instance. */ … … 179 187 { 180 188 Q_OBJECT; 189 Q_PROPERTY(QString format READ format WRITE setFormat); 181 190 Q_PROPERTY(QString path READ path WRITE setPath); 182 Q_PROPERTY(QString format READ format WRITE setFormat);183 191 Q_PROPERTY(MACAddressPolicy macAddressPolicy READ macAddressPolicy WRITE setMACAddressPolicy); 184 192 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); … … 223 231 private: 224 232 225 /** Holds the label instance. */ 226 QIRichTextLabel *m_pLabel; 233 /** Holds the format label instance. */ 234 QIRichTextLabel *m_pLabelFormat; 235 236 /** Holds the settings label instance. */ 237 QIRichTextLabel *m_pLabelSettings; 227 238 }; 228 239 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r73234 r73236 148 148 if (pSettingsCntLayout) 149 149 { 150 pSettingsCntLayout->setContentsMargins(0, 0, 0, 0);151 150 #ifdef VBOX_WS_MAC 152 151 pSettingsCntLayout->setSpacing(5); 153 152 #endif 153 154 /* Create format layout: */ 155 m_pFormatLayout = new QGridLayout; 156 if (m_pFormatLayout) 157 { 158 m_pFormatLayout->setContentsMargins(0, 0, 0, 0); 159 #ifdef VBOX_WS_MAC 160 m_pFormatLayout->setSpacing(10); 161 #endif 162 m_pFormatLayout->setColumnStretch(0, 0); 163 m_pFormatLayout->setColumnStretch(1, 1); 164 165 /* Create format combo-box: */ 166 m_pFormatComboBox = new QComboBox; 167 if (m_pFormatComboBox) 168 { 169 /* Add into layout: */ 170 m_pFormatLayout->addWidget(m_pFormatComboBox, 0, 1); 171 } 172 /* Create format combo-box label: */ 173 m_pFormatComboBoxLabel = new QLabel; 174 if (m_pFormatComboBoxLabel) 175 { 176 m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); 177 m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox); 178 179 /* Add into layout: */ 180 m_pFormatLayout->addWidget(m_pFormatComboBoxLabel, 0, 0); 181 } 182 183 /* Add into layout: */ 184 pSettingsCntLayout->addLayout(m_pFormatLayout); 185 } 154 186 155 187 /* Create settings widget: */ … … 162 194 { 163 195 /* Create settings layout 1: */ 164 QGridLayout *pSettingsLayout1 = new QGridLayout(pSettingsPane1);165 if ( pSettingsLayout1)196 m_pSettingsLayout1 = new QGridLayout(pSettingsPane1); 197 if (m_pSettingsLayout1) 166 198 { 167 199 #ifdef VBOX_WS_MAC 168 pSettingsLayout1->setSpacing(10);200 m_pSettingsLayout1->setSpacing(10); 169 201 #endif 170 pSettingsLayout1->setContentsMargins(0, 0, 0, 0);171 pSettingsLayout1->setColumnStretch(0, 0);172 pSettingsLayout1->setColumnStretch(1, 1);202 m_pSettingsLayout1->setContentsMargins(0, 0, 0, 0); 203 m_pSettingsLayout1->setColumnStretch(0, 0); 204 m_pSettingsLayout1->setColumnStretch(1, 1); 173 205 174 206 /* Create file selector: */ … … 182 214 183 215 /* Add into layout: */ 184 pSettingsLayout1->addWidget(m_pFileSelector, 0, 1, 1, 2);216 m_pSettingsLayout1->addWidget(m_pFileSelector, 0, 1, 1, 2); 185 217 } 186 218 /* Create file selector label: */ … … 192 224 193 225 /* Add into layout: */ 194 pSettingsLayout1->addWidget(m_pFileSelectorLabel, 0, 0); 195 } 196 197 /* Create format combo-box editor: */ 198 m_pFormatComboBox = new QComboBox; 199 if (m_pFormatComboBox) 200 { 201 /* Add into layout: */ 202 pSettingsLayout1->addWidget(m_pFormatComboBox, 1, 1, 1, 2); 203 } 204 /* Create format combo-box label: */ 205 m_pFormatComboBoxLabel = new QLabel; 206 if (m_pFormatComboBoxLabel) 207 { 208 m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 209 m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox); 210 211 /* Add into layout: */ 212 pSettingsLayout1->addWidget(m_pFormatComboBoxLabel, 1, 0); 226 m_pSettingsLayout1->addWidget(m_pFileSelectorLabel, 0, 0); 213 227 } 214 228 … … 218 232 { 219 233 /* Add into layout: */ 220 pSettingsLayout1->addWidget(m_pMACComboBox, 2, 1, 1, 2);234 m_pSettingsLayout1->addWidget(m_pMACComboBox, 1, 1, 1, 2); 221 235 } 222 236 /* Create format combo-box label: */ … … 228 242 229 243 /* Add into layout: */ 230 pSettingsLayout1->addWidget(m_pMACComboBoxLabel, 2, 0);244 m_pSettingsLayout1->addWidget(m_pMACComboBoxLabel, 1, 0); 231 245 } 232 246 … … 238 252 239 253 /* Add into layout: */ 240 pSettingsLayout1->addWidget(m_pAdditionalLabel, 3, 0);254 m_pSettingsLayout1->addWidget(m_pAdditionalLabel, 2, 0); 241 255 } 242 256 /* Create manifest check-box editor: */ … … 245 259 { 246 260 /* Add into layout: */ 247 pSettingsLayout1->addWidget(m_pManifestCheckbox, 3, 1);261 m_pSettingsLayout1->addWidget(m_pManifestCheckbox, 2, 1); 248 262 } 249 263 /* Create include ISOs check-box: */ … … 252 266 { 253 267 /* Add into layout: */ 254 pSettingsLayout1->addWidget(m_pIncludeISOsCheckbox, 4, 1);268 m_pSettingsLayout1->addWidget(m_pIncludeISOsCheckbox, 3, 1); 255 269 } 256 270 … … 260 274 { 261 275 /* Add into layout: */ 262 pSettingsLayout1->addWidget(pPlaceholder, 5, 0, 1, 3);276 m_pSettingsLayout1->addWidget(pPlaceholder, 4, 0, 1, 3); 263 277 } 264 278 } … … 273 287 { 274 288 /* Create settings layout 2: */ 275 QGridLayout *pSettingsLayout2 = new QGridLayout(pSettingsPane2);276 if ( pSettingsLayout2)289 m_pSettingsLayout2 = new QGridLayout(pSettingsPane2); 290 if (m_pSettingsLayout2) 277 291 { 278 292 #ifdef VBOX_WS_MAC 279 pSettingsLayout2->setSpacing(10);293 m_pSettingsLayout2->setSpacing(10); 280 294 #endif 281 pSettingsLayout2->setContentsMargins(0, 0, 0, 0);282 pSettingsLayout2->setColumnStretch(0, 0);283 pSettingsLayout2->setColumnStretch(1, 1);295 m_pSettingsLayout2->setContentsMargins(0, 0, 0, 0); 296 m_pSettingsLayout2->setColumnStretch(0, 0); 297 m_pSettingsLayout2->setColumnStretch(1, 1); 284 298 285 299 /* Create account combo-box: */ … … 287 301 if (m_pAccountComboBox) 288 302 { 289 /* Hide it for now: */ 290 m_pAccountComboBox->hide(); 291 292 /* Add into layout: */ 293 pSettingsLayout2->addWidget(m_pAccountComboBox, 0, 1); 303 /* Add into layout: */ 304 m_pSettingsLayout2->addWidget(m_pAccountComboBox, 0, 1); 294 305 } 295 306 /* Create account label: */ … … 297 308 if (m_pAccountComboBoxLabel) 298 309 { 299 /* Hide it for now: */300 m_pAccountComboBoxLabel->hide();301 302 310 m_pAccountComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 303 311 m_pAccountComboBoxLabel->setBuddy(m_pAccountComboBox); 304 312 305 313 /* Add into layout: */ 306 pSettingsLayout2->addWidget(m_pAccountComboBoxLabel, 0, 0);314 m_pSettingsLayout2->addWidget(m_pAccountComboBoxLabel, 0, 0); 307 315 } 308 316 /* Create account property table: */ … … 323 331 324 332 /* Add into layout: */ 325 pSettingsLayout2->addWidget(m_pAccountPropertyTable, 1, 1);333 m_pSettingsLayout2->addWidget(m_pAccountPropertyTable, 1, 1); 326 334 } 327 335 } … … 374 382 registerField("machineIDs", this, "machineIDs"); 375 383 registerField("storageType", this, "storageType"); 384 registerField("format", this, "format"); 376 385 registerField("path", this, "path"); 377 registerField("format", this, "format");378 386 registerField("macAddressPolicy", this, "macAddressPolicy"); 379 387 registerField("manifestSelected", this, "manifestSelected"); … … 428 436 m_pFormatComboBox->setItemText(2, UIWizardExportApp::tr("Open Virtualization Format 2.0")); 429 437 m_pFormatComboBox->setItemText(3, UIWizardExportApp::tr("Oracle Public Cloud Format 1.0")); 438 m_pFormatComboBox->setItemText(4, UIWizardExportApp::tr("Cloud Service Provider")); 430 439 m_pFormatComboBox->setItemData(0, UIWizardExportApp::tr("Write in legacy OVF 0.9 format for compatibility " 431 440 "with other virtualization products."), Qt::ToolTipRole); … … 433 442 m_pFormatComboBox->setItemData(2, UIWizardExportApp::tr("Write in new OVF 2.0 format."), Qt::ToolTipRole); 434 443 m_pFormatComboBox->setItemData(3, UIWizardExportApp::tr("Write in Oracle Public Cloud 1.0 format."), Qt::ToolTipRole); 444 m_pFormatComboBox->setItemData(4, UIWizardExportApp::tr("Export to Cloud Service Provider."), Qt::ToolTipRole); 435 445 436 446 /* Translate MAC address policy combo-box: */ … … 476 486 } 477 487 488 /* Adjust label widths: */ 489 QList<QWidget*> labels; 490 labels << m_pFormatComboBoxLabel; 491 labels << m_pFileSelectorLabel; 492 labels << m_pMACComboBoxLabel; 493 labels << m_pAdditionalLabel; 494 labels << m_pAccountComboBoxLabel; 495 int iMaxWidth = 0; 496 foreach (QWidget *pLabel, labels) 497 iMaxWidth = qMax(iMaxWidth, pLabel->minimumSizeHint().width()); 498 m_pFormatLayout->setColumnMinimumWidth(0, iMaxWidth); 499 m_pSettingsLayout1->setColumnMinimumWidth(0, iMaxWidth); 500 m_pSettingsLayout2->setColumnMinimumWidth(0, iMaxWidth); 501 478 502 /* Refresh file selector name: */ 479 503 refreshFileSelectorName(); … … 519 543 || field("format").toString() == "ovf-2.0"; 520 544 const bool fOPC = field("format").toString() == "opc-1.0"; 545 const bool fCSP = field("format").toString() == "csp-1.0"; 521 546 522 547 fResult = ( fOVF 523 548 && VBoxGlobal::hasAllowedExtension(strFile, OVFFileExts)) 524 549 || ( fOPC 525 && VBoxGlobal::hasAllowedExtension(strFile, OPCFileExts)); 550 && VBoxGlobal::hasAllowedExtension(strFile, OPCFileExts)) 551 || fCSP; 526 552 } 527 553 … … 572 598 573 599 /* Refresh required settings: */ 600 updatePageAppearance(); 574 601 refreshFileSelectorExtension(); 575 602 refreshManifestCheckBoxAccess(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r73226 r73236 41 41 Q_PROPERTY(QStringList machineIDs READ machineIDs); 42 42 Q_PROPERTY(StorageType storageType READ storageType WRITE setStorageType); 43 Q_PROPERTY(QString format READ format WRITE setFormat); 43 44 Q_PROPERTY(QString path READ path WRITE setPath); 44 Q_PROPERTY(QString format READ format WRITE setFormat);45 45 Q_PROPERTY(MACAddressPolicy macAddressPolicy READ macAddressPolicy WRITE setMACAddressPolicy); 46 46 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected);
Note:
See TracChangeset
for help on using the changeset viewer.