Changeset 73030 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 10, 2018 10:23:23 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123582
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r73025 r73030 107 107 } 108 108 109 void UIWizardExportAppPage3::refreshCurrentSettings() 110 { 111 /* Compose file-name: */ 112 QString strName; 113 109 void UIWizardExportAppPage3::refreshFileSelectorName() 110 { 114 111 /* If it's one VM only, we use the VM name as file-name: */ 115 112 if (fieldImp("machineNames").toStringList().size() == 1) 116 strName = fieldImp("machineNames").toStringList()[0];113 m_strFileSelectorName = fieldImp("machineNames").toStringList()[0]; 117 114 /* Otherwise => we use the default file-name: */ 118 115 else 119 strName = m_strDefaultApplianceName; 120 116 m_strFileSelectorName = m_strDefaultApplianceName; 117 118 /* Cascade update for file selector path: */ 119 refreshFileSelectorPath(); 120 } 121 122 void UIWizardExportAppPage3::refreshFileSelectorExtension() 123 { 121 124 /* If the format is set to OPC: */ 122 125 if (fieldImp("format").toString() == "opc-1.0") 123 126 { 124 127 /* We use .tar.gz extension: */ 125 strName += ".tar.gz";128 m_strFileSelectorExt = ".tar.gz"; 126 129 127 130 /* Update file chooser accordingly: */ 128 131 m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Oracle Public Cloud Format Archive (%1)").arg("*.tar.gz")); 129 130 /* Disable manifest file creation: */131 m_pManifestCheckbox->setChecked(false);132 m_pManifestCheckbox->setEnabled(false);133 132 } 134 133 /* Otherwise: */ … … 136 135 { 137 136 /* We use the default (.ova) extension: */ 138 strName += ".ova";137 m_strFileSelectorExt = ".ova"; 139 138 140 139 /* Update file chooser accordingly: */ 141 140 m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Open Virtualization Format Archive (%1)").arg("*.ova") + ";;" + 142 141 UIWizardExportApp::tr("Open Virtualization Format (%1)").arg("*.ovf")); 143 144 /* Enable manifest file creation: */ 142 } 143 144 /* Cascade update for file selector path: */ 145 refreshFileSelectorPath(); 146 } 147 148 void UIWizardExportAppPage3::refreshFileSelectorPath() 149 { 150 /* Compose file selector path: */ 151 const QString strPath = QDir::toNativeSeparators(QString("%1/%2") 152 .arg(vboxGlobal().documentsPath()) 153 .arg(m_strFileSelectorName + m_strFileSelectorExt)); 154 155 /* Assign the path: */ 156 m_pFileSelector->setPath(strPath); 157 } 158 159 void UIWizardExportAppPage3::refreshManifestCheckBoxAccess() 160 { 161 /* If the format is set to OPC: */ 162 if (fieldImp("format").toString() == "opc-1.0") 163 { 164 /* Disable manifest check-box: */ 165 m_pManifestCheckbox->setChecked(false); 166 m_pManifestCheckbox->setEnabled(false); 167 } 168 /* Otherwise: */ 169 else 170 { 171 /* Enable manifest check-box: */ 145 172 m_pManifestCheckbox->setEnabled(true); 146 173 } 147 148 /* Copose file-path for 'LocalFilesystem' storage case: */149 const StorageType enmStorageType = fieldImp("storageType").value<StorageType>();150 if (enmStorageType == LocalFilesystem)151 strName = QDir::toNativeSeparators(QString("%1/%2").arg(vboxGlobal().documentsPath()).arg(strName));152 153 /* Assign file-path: */154 m_pFileSelector->setPath(strName);155 174 } 156 175 … … 437 456 } 438 457 439 /* Refresh current settings: */440 refresh CurrentSettings();458 /* Refresh file selector name: */ 459 refreshFileSelectorName(); 441 460 442 461 /* Update page appearance: */ … … 452 471 /* Translate page: */ 453 472 retranslateUi(); 473 474 /* Refresh file selector name: */ 475 // refreshFileSelectorName(); alreeady called from retranslateUi(); 476 /* Refresh file selector extension: */ 477 refreshFileSelectorExtension(); 478 /* Refresh manifest check-box access: */ 479 refreshManifestCheckBoxAccess(); 454 480 } 455 481 … … 526 552 updateFormatComboToolTip(); 527 553 528 /* Refresh current settings: */ 529 refreshCurrentSettings(); 554 /* Refresh required settings: */ 555 refreshFileSelectorExtension(); 556 refreshManifestCheckBoxAccess(); 530 557 } 531 558 … … 534 561 /* Update tool-tip: */ 535 562 updateProviderComboToolTip(); 536 537 /* Refresh current settings: */ 538 refreshCurrentSettings(); 539 } 563 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h
r73025 r73030 51 51 virtual void updatePageAppearance(); 52 52 53 /** Refreshes current settings. */ 54 void refreshCurrentSettings(); 53 /** Refresh file selector name. */ 54 void refreshFileSelectorName(); 55 /** Refresh file selector extension. */ 56 void refreshFileSelectorExtension(); 57 /** Refresh file selector path. */ 58 void refreshFileSelectorPath(); 59 /** Refresh Manifest check-box access. */ 60 void refreshManifestCheckBoxAccess(); 55 61 56 62 /** Updates format combo tool-tips. */ … … 81 87 /** Holds the default appliance name. */ 82 88 QString m_strDefaultApplianceName; 89 90 /** Holds the file selector name. */ 91 QString m_strFileSelectorName; 92 /** Holds the file selector ext. */ 93 QString m_strFileSelectorExt; 83 94 84 95 /** Holds the settings widget instance. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r73025 r73030 376 376 } 377 377 378 /* Refresh current settings: */379 refresh CurrentSettings();378 /* Refresh file selector name: */ 379 refreshFileSelectorName(); 380 380 381 381 /* Update tool-tips: */ … … 389 389 retranslateUi(); 390 390 391 /* Refresh current settings: */ 392 refreshCurrentSettings(); 391 /* Refresh file selector name: */ 392 // refreshFileSelectorName(); already called from retranslateUi(); 393 /* Refresh file selector extension: */ 394 refreshFileSelectorExtension(); 395 /* Refresh manifest check-box access: */ 396 refreshManifestCheckBoxAccess(); 397 393 398 /* Refresh appliance settings: */ 394 399 refreshApplianceSettingsWidget(); … … 453 458 void UIWizardExportAppPageExpert::sltVMSelectionChangeHandler() 454 459 { 455 /* Refresh currentsettings: */456 refresh CurrentSettings();460 /* Refresh required settings: */ 461 refreshFileSelectorName(); 457 462 refreshApplianceSettingsWidget(); 458 463 … … 475 480 updateFormatComboToolTip(); 476 481 477 /* Refresh current settings: */ 478 refreshCurrentSettings(); 482 /* Refresh required settings: */ 483 refreshFileSelectorExtension(); 484 refreshManifestCheckBoxAccess(); 479 485 } 480 486 … … 483 489 /* Update tool-tip: */ 484 490 updateProviderComboToolTip(); 485 486 /* Refresh current settings: */ 487 refreshCurrentSettings(); 488 } 491 }
Note:
See TracChangeset
for help on using the changeset viewer.