- Timestamp:
- Mar 28, 2013 6:36:46 AM (12 years ago)
- 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
r45193 r45220 137 137 { 138 138 /* Write the appliance: */ 139 const QString strVersion = field("OVF09Selected").toBool() ? "ovf-0.9" : "ovf-1.0"; 140 CProgress progress = appliance.Write(strVersion, field("manifestSelected").toBool() /* fManifest */, uri()); 139 CProgress progress = appliance.Write(field("format").toString(), field("manifestSelected").toBool() /* fManifest */, uri()); 141 140 bool fResult = appliance.isOk(); 142 141 if (fResult) -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.cpp
r45085 r45220 24 24 #include <QLabel> 25 25 #include <QLineEdit> 26 #include <QComboBox> 26 27 #include <QCheckBox> 27 28 … … 46 47 m_pBucketEditor->setText(vboxGlobal().virtualBox().GetExtraData(GUI_Export_Bucket)); 47 48 #else 48 /* Do nothing for now... */ 49 /* Choose defalt format: */ 50 setFormat("ovf-1.0"); 49 51 #endif 50 52 } … … 66 68 m_pBucketLabel->setVisible(false); 67 69 m_pBucketEditor->setVisible(false); 68 m_p OVF09Checkbox->setVisible(true);70 m_pFormatComboBox->setVisible(true); 69 71 m_pFileSelector->setChooserVisible(true); 70 72 break; … … 80 82 m_pBucketLabel->setVisible(true); 81 83 m_pBucketEditor->setVisible(true); 82 m_pOVF09Checkbox->setVisible(false); 83 m_pOVF09Checkbox->setChecked(false); 84 m_pFormatComboBox->setVisible(false); 84 85 m_pFileSelector->setChooserVisible(false); 85 86 break; … … 95 96 m_pBucketLabel->setVisible(true); 96 97 m_pBucketEditor->setVisible(true); 97 m_p OVF09Checkbox->setVisible(true);98 m_pFormatComboBox->setVisible(true); 98 99 m_pFileSelector->setChooserVisible(false); 99 100 break; … … 112 113 } 113 114 114 bool UIWizardExportAppPage3::isOVF09Selected() const 115 { 116 return m_pOVF09Checkbox->isChecked(); 117 } 118 119 void UIWizardExportAppPage3::setOVF09Selected(bool fChecked) 120 { 121 m_pOVF09Checkbox->setChecked(fChecked); 115 void UIWizardExportAppPage3::updateFormatComboToolTip() 116 { 117 int iCurrentIndex = m_pFormatComboBox->currentIndex(); 118 QString strCurrentIndexToolTip = m_pFormatComboBox->itemData(iCurrentIndex, Qt::ToolTipRole).toString(); 119 m_pFormatComboBox->setToolTip(strCurrentIndexToolTip); 120 } 121 122 QString UIWizardExportAppPage3::format() const 123 { 124 int iIndex = m_pFormatComboBox->currentIndex(); 125 return m_pFormatComboBox->itemData(iIndex).toString(); 126 } 127 128 void UIWizardExportAppPage3::setFormat(const QString &strFormat) 129 { 130 int iIndex = m_pFormatComboBox->findData(strFormat); 131 AssertMsg(iIndex != -1, ("Field not found!")); 132 m_pFormatComboBox->setCurrentIndex(iIndex); 122 133 } 123 134 … … 228 239 m_pFileSelectorLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 229 240 m_pFileSelectorLabel->setBuddy(m_pFileSelector); 241 } 242 m_pFormatComboBox = new QComboBox(this); 243 { 244 const QString strFormat09("ovf-0.9"); 245 const QString strFormat10("ovf-1.0"); 246 const QString strFormat20("ovf-2.0"); 247 m_pFormatComboBox->addItem(strFormat09, strFormat09); 248 m_pFormatComboBox->addItem(strFormat10, strFormat10); 249 m_pFormatComboBox->addItem(strFormat20, strFormat20); 250 connect(m_pFormatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(sltUpdateFormatComboToolTip())); 251 } 252 m_pFormatComboBoxLabel = new QLabel(this); 253 { 254 m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 255 m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox); 230 256 } 231 257 pSettingsLayout->addWidget(m_pUsernameLabel, 0, 0); … … 239 265 pSettingsLayout->addWidget(m_pFileSelectorLabel, 4, 0); 240 266 pSettingsLayout->addWidget(m_pFileSelector, 4, 1); 241 } 242 m_pOVF09Checkbox = new QCheckBox(this); 267 pSettingsLayout->addWidget(m_pFormatComboBoxLabel, 5, 0); 268 pSettingsLayout->addWidget(m_pFormatComboBox, 5, 1); 269 } 243 270 m_pManifestCheckbox = new QCheckBox(this); 244 271 pMainLayout->addWidget(m_pLabel); 245 272 pMainLayout->addLayout(pSettingsLayout); 246 pMainLayout->addWidget(m_pOVF09Checkbox);247 273 pMainLayout->addWidget(m_pManifestCheckbox); 248 274 pMainLayout->addStretch(); … … 258 284 259 285 /* Register fields: */ 260 registerField(" OVF09Selected", this, "OVF09Selected");286 registerField("format", this, "format"); 261 287 registerField("manifestSelected", this, "manifestSelected"); 262 288 registerField("username", this, "username"); … … 284 310 m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Open Virtualization Format Archive (%1)").arg("*.ova") + ";;" + 285 311 UIWizardExportApp::tr("Open Virtualization Format (%1)").arg("*.ovf")); 286 m_pOVF09Checkbox->setToolTip(UIWizardExportApp::tr("Write in legacy OVF 0.9 format for compatibility with other virtualization products.")); 287 m_pOVF09Checkbox->setText(UIWizardExportApp::tr("&Write legacy OVF 0.9")); 312 m_pFormatComboBoxLabel->setText(UIWizardExportApp::tr("F&ormat:")); 313 m_pFormatComboBox->setItemText(0, UIWizardExportApp::tr("OVF 0.9")); 314 m_pFormatComboBox->setItemText(1, UIWizardExportApp::tr("OVF 1.0")); 315 m_pFormatComboBox->setItemText(2, UIWizardExportApp::tr("OVF 2.0")); 316 m_pFormatComboBox->setItemData(0, UIWizardExportApp::tr("Write in legacy OVF 0.9 format for compatibility " 317 "with other virtualization products."), Qt::ToolTipRole); 318 m_pFormatComboBox->setItemData(1, UIWizardExportApp::tr("Write in standard OVF 1.0 format."), Qt::ToolTipRole); 319 m_pFormatComboBox->setItemData(2, UIWizardExportApp::tr("Write in new experimental OVF 2.0 format."), Qt::ToolTipRole); 288 320 m_pManifestCheckbox->setToolTip(UIWizardExportApp::tr("Create a Manifest file for automatic data integrity checks on import.")); 289 321 m_pManifestCheckbox->setText(UIWizardExportApp::tr("Write &Manifest file")); … … 291 323 /* Refresh current settings: */ 292 324 refreshCurrentSettings(); 325 updateFormatComboToolTip(); 293 326 } 294 327 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic3.h
r41021 r45220 30 30 class QLineEdit; 31 31 class VBoxEmptyFileSelector; 32 class QComboBox; 32 33 class QCheckBox; 33 34 class QIRichTextLabel; … … 44 45 void chooseDefaultSettings(); 45 46 virtual void refreshCurrentSettings(); 47 virtual void updateFormatComboToolTip(); 46 48 47 /* Stuff for ' OVF09Selected' field: */48 bool isOVF09Selected() const;49 void set OVF09Selected(bool fChecked);49 /* Stuff for 'format' field: */ 50 QString format() const; 51 void setFormat(const QString &strFormat); 50 52 /* Stuff for 'manifestSelected' field: */ 51 53 bool isManifestSelected() const; … … 81 83 QLabel *m_pFileSelectorLabel; 82 84 VBoxEmptyFileSelector *m_pFileSelector; 83 QCheckBox *m_pOVF09Checkbox; 85 QLabel *m_pFormatComboBoxLabel; 86 QComboBox *m_pFormatComboBox; 84 87 QCheckBox *m_pManifestCheckbox; 85 88 }; … … 89 92 { 90 93 Q_OBJECT; 91 Q_PROPERTY( bool OVF09Selected READ isOVF09Selected WRITE setOVF09Selected);94 Q_PROPERTY(QString format READ format WRITE setFormat); 92 95 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 93 96 Q_PROPERTY(QString username READ username WRITE setUserName); … … 106 109 /* Wrapper to access 'wizard-field' from base part: */ 107 110 QVariant fieldImp(const QString &strFieldName) const { return UIWizardPage::field(strFieldName); } 111 112 private slots: 113 114 /* Format combo change handler: */ 115 void sltUpdateFormatComboToolTip() { updateFormatComboToolTip(); } 108 116 109 117 private: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r45085 r45220 124 124 m_pFileSelectorLabel->setBuddy(m_pFileSelector); 125 125 } 126 m_pOVF09Checkbox = new QCheckBox(m_pSettingsCnt); 126 m_pFormatComboBox = new QComboBox(m_pSettingsCnt); 127 { 128 const QString strFormat09("ovf-0.9"); 129 const QString strFormat10("ovf-1.0"); 130 const QString strFormat20("ovf-2.0"); 131 m_pFormatComboBox->addItem(strFormat09, strFormat09); 132 m_pFormatComboBox->addItem(strFormat10, strFormat10); 133 m_pFormatComboBox->addItem(strFormat20, strFormat20); 134 connect(m_pFormatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(sltUpdateFormatComboToolTip())); 135 } 136 m_pFormatComboBoxLabel = new QLabel(m_pSettingsCnt); 137 { 138 m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 139 m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox); 140 } 127 141 m_pManifestCheckbox = new QCheckBox(m_pSettingsCnt); 128 142 pSettingsLayout->addWidget(m_pUsernameLabel, 0, 0); … … 136 150 pSettingsLayout->addWidget(m_pFileSelectorLabel, 4, 0); 137 151 pSettingsLayout->addWidget(m_pFileSelector, 4, 1); 138 pSettingsLayout->addWidget(m_pOVF09Checkbox, 5, 0, 1, 2); 152 pSettingsLayout->addWidget(m_pFormatComboBoxLabel, 5, 0); 153 pSettingsLayout->addWidget(m_pFormatComboBox, 5, 1); 139 154 pSettingsLayout->addWidget(m_pManifestCheckbox, 6, 0, 1, 2); 140 155 } … … 167 182 registerField("machineIDs", this, "machineIDs"); 168 183 registerField("storageType", this, "storageType"); 169 registerField(" OVF09Selected", this, "OVF09Selected");184 registerField("format", this, "format"); 170 185 registerField("manifestSelected", this, "manifestSelected"); 171 186 registerField("username", this, "username"); … … 217 232 m_pFileSelector->setFileFilters(UIWizardExportApp::tr("Open Virtualization Format Archive (%1)").arg("*.ova") + ";;" + 218 233 UIWizardExportApp::tr("Open Virtualization Format (%1)").arg("*.ovf")); 219 m_pOVF09Checkbox->setToolTip(UIWizardExportApp::tr("Write in legacy OVF 0.9 format for compatibility with other virtualization products.")); 220 m_pOVF09Checkbox->setText(UIWizardExportApp::tr("&Write legacy OVF 0.9")); 234 m_pFormatComboBoxLabel->setText(UIWizardExportApp::tr("F&ormat:")); 235 m_pFormatComboBox->setItemText(0, UIWizardExportApp::tr("OVF 0.9")); 236 m_pFormatComboBox->setItemText(1, UIWizardExportApp::tr("OVF 1.0")); 237 m_pFormatComboBox->setItemText(2, UIWizardExportApp::tr("OVF 2.0")); 238 m_pFormatComboBox->setItemData(0, UIWizardExportApp::tr("Write in legacy OVF 0.9 format for compatibility " 239 "with other virtualization products."), Qt::ToolTipRole); 240 m_pFormatComboBox->setItemData(1, UIWizardExportApp::tr("Write in standard OVF 1.0 format."), Qt::ToolTipRole); 241 m_pFormatComboBox->setItemData(2, UIWizardExportApp::tr("Write in new experimental OVF 2.0 format."), Qt::ToolTipRole); 221 242 m_pManifestCheckbox->setToolTip(UIWizardExportApp::tr("Create a Manifest file for automatic data integrity checks on import.")); 222 243 m_pManifestCheckbox->setText(UIWizardExportApp::tr("Write &Manifest file")); 244 245 /* Refresh current settings: */ 246 updateFormatComboToolTip(); 223 247 } 224 248 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h
r45083 r45220 40 40 Q_PROPERTY(QStringList machineIDs READ machineIDs); 41 41 Q_PROPERTY(StorageType storageType READ storageType WRITE setStorageType); 42 Q_PROPERTY( bool OVF09Selected READ isOVF09Selected WRITE setOVF09Selected);42 Q_PROPERTY(QString format READ format WRITE setFormat); 43 43 Q_PROPERTY(bool manifestSelected READ isManifestSelected WRITE setManifestSelected); 44 44 Q_PROPERTY(QString username READ username WRITE setUserName); … … 71 71 void sltStorageTypeChangeHandler(); 72 72 73 /* Format combo change handler: */ 74 void sltUpdateFormatComboToolTip() { updateFormatComboToolTip(); } 75 73 76 private: 74 77
Note:
See TracChangeset
for help on using the changeset viewer.