Changeset 68068 in vbox
- Timestamp:
- Jul 20, 2017 2:46:24 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
-
globals/UIDefs.cpp (modified) (1 diff)
-
globals/UIDefs.h (modified) (1 diff)
-
wizards/exportappliance/UIWizardExportAppPageBasic3.cpp (modified) (7 diffs)
-
wizards/exportappliance/UIWizardExportAppPageBasic3.h (modified) (1 diff)
-
wizards/exportappliance/UIWizardExportAppPageExpert.cpp (modified) (5 diffs)
-
wizards/exportappliance/UIWizardExportAppPageExpert.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp
r62493 r68068 33 33 QStringList UIDefs::VBoxExtPackFileExts = QStringList() << "vbox-extpack"; 34 34 QStringList UIDefs::OVFFileExts = QStringList() << "ovf" << "ova"; 35 QStringList UIDefs::OPCFileExts = QStringList() << "tar.gz"; 35 36 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r64604 r68068 87 87 extern QStringList VBoxExtPackFileExts; 88 88 extern QStringList OVFFileExts; 89 extern QStringList OPCFileExts; 89 90 } 90 91 using namespace UIDefs /* if header included */; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r62493 r68068 5 5 6 6 /* 7 * Copyright (C) 2009-201 6Oracle Corporation7 * Copyright (C) 2009-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 100 100 } 101 101 102 /* Use the default filename: */ 103 QString strName = m_strDefaultApplianceName; 104 /* If it is one VM only, we use the VM name as filename: */ 102 /* Compose file-name: */ 103 QString strName; 104 105 /* If it's one VM only, we use the VM name as file-name: */ 105 106 if (fieldImp("machineNames").toStringList().size() == 1) 106 107 strName = fieldImp("machineNames").toStringList()[0]; 107 strName += ".ova"; 108 /* Otherwise => we use the default file-name: */ 109 else 110 strName = m_strDefaultApplianceName; 111 112 /* If the format is set to OPC: */ 113 if (fieldImp("format").toString() == "opc-1.0") 114 { 115 /* We use .tar.gz extension: */ 116 strName += ".tar.gz"; 117 118 /* Update file chooser accordingly: */ 119 m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Oracle Public Cloud Format Archive (%1)").arg("*.tar.gz")); 120 121 /* Disable manifest file creation: */ 122 m_pManifestCheckbox->setChecked(false); 123 m_pManifestCheckbox->setEnabled(false); 124 } 125 /* Otherwise: */ 126 else 127 { 128 /* We use the default (.ova) extension: */ 129 strName += ".ova"; 130 131 /* Update file chooser accordingly: */ 132 m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Open Virtualization Format Archive (%1)").arg("*.ova") + ";;" + 133 UIWizardExportApp::tr("Open Virtualization Format (%1)").arg("*.ovf")); 134 135 /* Enable manifest file creation: */ 136 m_pManifestCheckbox->setEnabled(true); 137 } 138 139 /* Copose file-path for 'Filesystem' storage case: */ 108 140 if (storageType == Filesystem) 109 141 strName = QDir::toNativeSeparators(QString("%1/%2").arg(vboxGlobal().documentsPath()).arg(strName)); 142 143 /* Assign file-path: */ 110 144 m_pFileSelector->setPath(strName); 111 145 } … … 240 274 m_pFormatComboBox = new QComboBox(this); 241 275 { 242 const QString strFormat09("ovf-0.9"); 243 const QString strFormat10("ovf-1.0"); 244 const QString strFormat20("ovf-2.0"); 245 m_pFormatComboBox->addItem(strFormat09, strFormat09); 246 m_pFormatComboBox->addItem(strFormat10, strFormat10); 247 m_pFormatComboBox->addItem(strFormat20, strFormat20); 248 connect(m_pFormatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(sltUpdateFormatComboToolTip())); 276 const QString strFormatOVF09("ovf-0.9"); 277 const QString strFormatOVF10("ovf-1.0"); 278 const QString strFormatOVF20("ovf-2.0"); 279 const QString strFormatOPC10("opc-1.0"); 280 m_pFormatComboBox->addItem(strFormatOVF09, strFormatOVF09); 281 m_pFormatComboBox->addItem(strFormatOVF10, strFormatOVF10); 282 m_pFormatComboBox->addItem(strFormatOVF20, strFormatOVF20); 283 m_pFormatComboBox->addItem(strFormatOPC10, strFormatOPC10); 284 connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 285 this, &UIWizardExportAppPageBasic3::sltHandleFormatComboChange); 249 286 } 250 287 m_pFormatComboBoxLabel = new QLabel(this); … … 291 328 } 292 329 330 void UIWizardExportAppPageBasic3::sltHandleFormatComboChange() 331 { 332 refreshCurrentSettings(); 333 updateFormatComboToolTip(); 334 } 335 293 336 void UIWizardExportAppPageBasic3::retranslateUi() 294 337 { … … 306 349 m_pFileSelector->setChooseButtonToolTip(tr("Choose a file to export the virtual appliance to...")); 307 350 m_pFileSelector->setFileDialogTitle(UIWizardExportApp::tr("Please choose a file to export the virtual appliance to")); 308 m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Open Virtualization Format Archive (%1)").arg("*.ova") + ";;" +309 UIWizardExportApp::tr("Open Virtualization Format (%1)").arg("*.ovf"));310 351 m_pFormatComboBoxLabel->setText(UIWizardExportApp::tr("F&ormat:")); 311 m_pFormatComboBox->setItemText(0, UIWizardExportApp::tr("OVF 0.9")); 312 m_pFormatComboBox->setItemText(1, UIWizardExportApp::tr("OVF 1.0")); 313 m_pFormatComboBox->setItemText(2, UIWizardExportApp::tr("OVF 2.0")); 352 m_pFormatComboBox->setItemText(0, UIWizardExportApp::tr("Open Virtualization Format 0.9")); 353 m_pFormatComboBox->setItemText(1, UIWizardExportApp::tr("Open Virtualization Format 1.0")); 354 m_pFormatComboBox->setItemText(2, UIWizardExportApp::tr("Open Virtualization Format 2.0")); 355 m_pFormatComboBox->setItemText(3, UIWizardExportApp::tr("Oracle Public Cloud Format 1.0")); 314 356 m_pFormatComboBox->setItemData(0, UIWizardExportApp::tr("Write in legacy OVF 0.9 format for compatibility " 315 357 "with other virtualization products."), Qt::ToolTipRole); 316 358 m_pFormatComboBox->setItemData(1, UIWizardExportApp::tr("Write in standard OVF 1.0 format."), Qt::ToolTipRole); 317 359 m_pFormatComboBox->setItemData(2, UIWizardExportApp::tr("Write in new experimental OVF 2.0 format."), Qt::ToolTipRole); 360 m_pFormatComboBox->setItemData(3, UIWizardExportApp::tr("Write in Oracle Public Cloud 1.0 format."), Qt::ToolTipRole); 318 361 m_pManifestCheckbox->setToolTip(UIWizardExportApp::tr("Create a Manifest file for automatic data integrity checks on import.")); 319 362 m_pManifestCheckbox->setText(UIWizardExportApp::tr("Write &Manifest file")); … … 339 382 { 340 383 const QString &strFile = m_pFileSelector->path().toLower(); 341 fResult = VBoxGlobal::hasAllowedExtension(strFile, OVFFileExts); 384 bool fOVF = field("format").toString() == "ovf-0.9" 385 || field("format").toString() == "ovf-1.0" 386 || field("format").toString() == "ovf-2.0"; 387 bool fOPC = field("format").toString() == "opc-1.0"; 388 fResult = ( fOVF 389 && VBoxGlobal::hasAllowedExtension(strFile, OVFFileExts)) 390 || ( fOPC 391 && VBoxGlobal::hasAllowedExtension(strFile, OPCFileExts)); 342 392 if (fResult) 343 393 { … … 377 427 case Filesystem: 378 428 { 379 m_pLabel->setText(tr("<p>Please choose a filename to export the OVF/OVA to.</p>" 380 "<p>If you use an <i>ova</i> extension, " 381 "then all the files will be combined into one Open Virtualization Format Archive.</p>" 382 "<p>If you use an <i>ovf</i> extension, " 383 "several files will be written separately.</p>" 384 "<p>Other extensions are not allowed.</p>")); 429 m_pLabel->setText(tr("<p>Please choose a filename to export the virtual appliance to.</p>" 430 "<p><b>Open Virtualization Format</b> supports only " 431 "<b>ovf</b> or <b>ova</b> extensions. " 432 "<br>If you use an <b>ovf</b> extension, " 433 "several files will be written separately." 434 "<br>If you use an <b>ova</b> extension, " 435 "all the files will be combined into one Open Virtualization Format archive.</p>" 436 "<p><b>Oracle Public Cloud Format</b> supports only <b>tar.gz</b> extension." 437 "<br>Each virtual disk file will be written separately.</p>")); 385 438 m_pFileSelector->setFocus(); 386 439 break; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h
r62493 r68068 112 112 113 113 /* Format combo change handler: */ 114 void slt UpdateFormatComboToolTip() { updateFormatComboToolTip(); }114 void sltHandleFormatComboChange(); 115 115 116 116 private: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r62493 r68068 5 5 6 6 /* 7 * Copyright (C) 2009-201 6Oracle Corporation7 * Copyright (C) 2009-2017 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 131 131 m_pFormatComboBox = new QComboBox(m_pSettingsCnt); 132 132 { 133 const QString strFormat09("ovf-0.9"); 134 const QString strFormat10("ovf-1.0"); 135 const QString strFormat20("ovf-2.0"); 136 m_pFormatComboBox->addItem(strFormat09, strFormat09); 137 m_pFormatComboBox->addItem(strFormat10, strFormat10); 138 m_pFormatComboBox->addItem(strFormat20, strFormat20); 139 connect(m_pFormatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(sltUpdateFormatComboToolTip())); 133 const QString strFormatOVF09("ovf-0.9"); 134 const QString strFormatOVF10("ovf-1.0"); 135 const QString strFormatOVF20("ovf-2.0"); 136 const QString strFormatOPC10("opc-1.0"); 137 m_pFormatComboBox->addItem(strFormatOVF09, strFormatOVF09); 138 m_pFormatComboBox->addItem(strFormatOVF10, strFormatOVF10); 139 m_pFormatComboBox->addItem(strFormatOVF20, strFormatOVF20); 140 m_pFormatComboBox->addItem(strFormatOPC10, strFormatOPC10); 141 connect(m_pFormatComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), 142 this, &UIWizardExportAppPageExpert::sltHandleFormatComboChange); 140 143 } 141 144 m_pFormatComboBoxLabel = new QLabel(m_pSettingsCnt); … … 214 217 /* Broadcast complete-change: */ 215 218 emit completeChanged(); 219 } 220 221 void UIWizardExportAppPageExpert::sltHandleFormatComboChange() 222 { 223 refreshCurrentSettings(); 224 updateFormatComboToolTip(); 216 225 } 217 226 … … 235 244 m_pFileSelector->setChooseButtonToolTip(tr("Choose a file to export the virtual appliance to...")); 236 245 m_pFileSelector->setFileDialogTitle(UIWizardExportApp::tr("Please choose a file to export the virtual appliance to")); 237 m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Open Virtualization Format Archive (%1)").arg("*.ova") + ";;" +238 UIWizardExportApp::tr("Open Virtualization Format (%1)").arg("*.ovf"));239 246 m_pFormatComboBoxLabel->setText(UIWizardExportApp::tr("F&ormat:")); 240 m_pFormatComboBox->setItemText(0, UIWizardExportApp::tr("OVF 0.9")); 241 m_pFormatComboBox->setItemText(1, UIWizardExportApp::tr("OVF 1.0")); 242 m_pFormatComboBox->setItemText(2, UIWizardExportApp::tr("OVF 2.0")); 247 m_pFormatComboBox->setItemText(0, UIWizardExportApp::tr("Open Virtualization Format 0.9")); 248 m_pFormatComboBox->setItemText(1, UIWizardExportApp::tr("Open Virtualization Format 1.0")); 249 m_pFormatComboBox->setItemText(2, UIWizardExportApp::tr("Open Virtualization Format 2.0")); 250 m_pFormatComboBox->setItemText(3, UIWizardExportApp::tr("Oracle Public Cloud Format 1.0")); 243 251 m_pFormatComboBox->setItemData(0, UIWizardExportApp::tr("Write in legacy OVF 0.9 format for compatibility " 244 252 "with other virtualization products."), Qt::ToolTipRole); 245 253 m_pFormatComboBox->setItemData(1, UIWizardExportApp::tr("Write in standard OVF 1.0 format."), Qt::ToolTipRole); 246 254 m_pFormatComboBox->setItemData(2, UIWizardExportApp::tr("Write in new experimental OVF 2.0 format."), Qt::ToolTipRole); 255 m_pFormatComboBox->setItemData(3, UIWizardExportApp::tr("Write in Oracle Public Cloud 1.0 format."), Qt::ToolTipRole); 247 256 m_pManifestCheckbox->setToolTip(UIWizardExportApp::tr("Create a Manifest file for automatic data integrity checks on import.")); 248 257 m_pManifestCheckbox->setText(UIWizardExportApp::tr("Write &Manifest file")); 249 258 250 259 /* Refresh current settings: */ 260 refreshCurrentSettings(); 251 261 updateFormatComboToolTip(); 252 262 } … … 275 285 { 276 286 const QString &strFile = m_pFileSelector->path().toLower(); 277 fResult = VBoxGlobal::hasAllowedExtension(strFile, OVFFileExts); 287 bool fOVF = field("format").toString() == "ovf-0.9" 288 || field("format").toString() == "ovf-1.0" 289 || field("format").toString() == "ovf-2.0"; 290 bool fOPC = field("format").toString() == "opc-1.0"; 291 fResult = ( fOVF 292 && VBoxGlobal::hasAllowedExtension(strFile, OVFFileExts)) 293 || ( fOPC 294 && VBoxGlobal::hasAllowedExtension(strFile, OPCFileExts)); 278 295 if (fResult) 279 296 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r62493 r68068 71 71 72 72 /* Format combo change handler: */ 73 void slt UpdateFormatComboToolTip() { updateFormatComboToolTip(); }73 void sltHandleFormatComboChange(); 74 74 75 75 private:
Note:
See TracChangeset
for help on using the changeset viewer.

