Changeset 73020 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 10, 2018 9:08:57 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp
r73014 r73020 28 28 # include <QListWidget> 29 29 # include <QRadioButton> 30 # include <QStackedWidget> 30 31 # include <QVBoxLayout> 31 32 … … 46 47 47 48 UIWizardExportAppPageExpert::UIWizardExportAppPageExpert(const QStringList &selectedVMNames) 49 : m_pSelectorCnt(0) 50 , m_pApplianceCnt(0) 51 , m_pTypeCnt(0) 52 , m_pSettingsCnt(0) 48 53 { 49 54 /* Create widgets: */ … … 51 56 if (pMainLayout) 52 57 { 58 pMainLayout->setRowStretch(0, 1); 59 53 60 /* Create VM selector container: */ 54 61 m_pSelectorCnt = new QGroupBox; … … 135 142 { 136 143 /* Create settings widget container layout: */ 137 Q GridLayout *pSettingsLayout = new QGridLayout(m_pSettingsCnt);138 if (pSettings Layout)144 QVBoxLayout *pSettingsCntLayout = new QVBoxLayout(m_pSettingsCnt); 145 if (pSettingsCntLayout) 139 146 { 140 /* Create file selector: */ 141 m_pFileSelector = new UIEmptyFilePathSelector; 142 if (m_pFileSelector) 147 pSettingsCntLayout->setContentsMargins(0, 0, 0, 0); 148 149 /* Create settings widget: */ 150 m_pSettingsWidget = new QStackedWidget; 151 if (m_pSettingsWidget) 143 152 { 144 m_pFileSelector->setMode(UIEmptyFilePathSelector::Mode_File_Save); 145 m_pFileSelector->setEditable(true); 146 m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition); 147 m_pFileSelector->setDefaultSaveExt("ova"); 153 /* Create settings pane 1: */ 154 QWidget *pSettingsPane1 = new QWidget; 155 if (pSettingsPane1) 156 { 157 /* Create settings layout 1: */ 158 QGridLayout *pSettingsLayout1 = new QGridLayout(pSettingsPane1); 159 if (pSettingsLayout1) 160 { 161 pSettingsLayout1->setColumnStretch(0, 0); 162 pSettingsLayout1->setColumnStretch(1, 1); 163 164 /* Create file selector: */ 165 m_pFileSelector = new UIEmptyFilePathSelector; 166 if (m_pFileSelector) 167 { 168 m_pFileSelector->setMode(UIEmptyFilePathSelector::Mode_File_Save); 169 m_pFileSelector->setEditable(true); 170 m_pFileSelector->setButtonPosition(UIEmptyFilePathSelector::RightPosition); 171 m_pFileSelector->setDefaultSaveExt("ova"); 172 173 /* Add into layout: */ 174 pSettingsLayout1->addWidget(m_pFileSelector, 0, 1); 175 } 176 /* Create file selector label: */ 177 m_pFileSelectorLabel = new QLabel; 178 if (m_pFileSelectorLabel) 179 { 180 m_pFileSelectorLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 181 m_pFileSelectorLabel->setBuddy(m_pFileSelector); 182 183 /* Add into layout: */ 184 pSettingsLayout1->addWidget(m_pFileSelectorLabel, 0, 0); 185 } 186 187 /* Create format combo-box editor: */ 188 m_pFormatComboBox = new QComboBox; 189 if (m_pFormatComboBox) 190 { 191 const QString strFormatOVF09("ovf-0.9"); 192 const QString strFormatOVF10("ovf-1.0"); 193 const QString strFormatOVF20("ovf-2.0"); 194 const QString strFormatOPC10("opc-1.0"); 195 m_pFormatComboBox->addItem(strFormatOVF09, strFormatOVF09); 196 m_pFormatComboBox->addItem(strFormatOVF10, strFormatOVF10); 197 m_pFormatComboBox->addItem(strFormatOVF20, strFormatOVF20); 198 m_pFormatComboBox->addItem(strFormatOPC10, strFormatOPC10); 199 200 /* Add into layout: */ 201 pSettingsLayout1->addWidget(m_pFormatComboBox, 1, 1); 202 } 203 /* Create format combo-box label: */ 204 m_pFormatComboBoxLabel = new QLabel; 205 if (m_pFormatComboBoxLabel) 206 { 207 m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 208 m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox); 209 210 /* Add into layout: */ 211 pSettingsLayout1->addWidget(m_pFormatComboBoxLabel, 1, 0); 212 } 213 214 /* Create advanced label: */ 215 m_pAdditionalLabel = new QLabel; 216 if (m_pAdditionalLabel) 217 { 218 m_pAdditionalLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 219 220 /* Add into layout: */ 221 pSettingsLayout1->addWidget(m_pAdditionalLabel, 2, 0); 222 } 223 /* Create manifest check-box editor: */ 224 m_pManifestCheckbox = new QCheckBox; 225 if (m_pManifestCheckbox) 226 { 227 /* Add into layout: */ 228 pSettingsLayout1->addWidget(m_pManifestCheckbox, 2, 1); 229 } 230 231 /* Create placeholder: */ 232 QWidget *pPlaceholder = new QWidget; 233 if (pPlaceholder) 234 { 235 /* Add into layout: */ 236 pSettingsLayout1->addWidget(pPlaceholder, 3, 0, 1, 2); 237 } 238 } 239 240 /* Add into layout: */ 241 m_pSettingsWidget->addWidget(pSettingsPane1); 242 } 243 244 /* Create settings pane 2: */ 245 QWidget *pSettingsPane2 = new QWidget; 246 if (pSettingsPane2) 247 { 248 /* Create settings layout 2: */ 249 QGridLayout *pSettingsLayout2 = new QGridLayout(pSettingsPane2); 250 if (pSettingsLayout2) 251 { 252 pSettingsLayout2->setColumnStretch(0, 0); 253 pSettingsLayout2->setColumnStretch(1, 1); 254 255 /* Create provider combo-box: */ 256 m_pProviderComboBox = new QComboBox; 257 if (m_pProviderComboBox) 258 { 259 /* Hide it for now: */ 260 m_pProviderComboBox->hide(); 261 262 /* Add into layout: */ 263 pSettingsLayout2->addWidget(m_pProviderComboBox, 0, 1); 264 } 265 /* Create provider label: */ 266 m_pProviderComboBoxLabel = new QLabel; 267 if (m_pProviderComboBoxLabel) 268 { 269 /* Hide it for now: */ 270 m_pProviderComboBoxLabel->hide(); 271 272 m_pProviderComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 273 m_pProviderComboBoxLabel->setBuddy(m_pProviderComboBox); 274 275 /* Add into layout: */ 276 pSettingsLayout2->addWidget(m_pProviderComboBoxLabel, 0, 0); 277 } 278 279 /* Create placeholder: */ 280 QWidget *pPlaceholder = new QWidget; 281 if (pPlaceholder) 282 { 283 /* Add into layout: */ 284 pSettingsLayout2->addWidget(pPlaceholder, 1, 0, 1, 2); 285 } 286 } 287 288 /* Add into layout: */ 289 m_pSettingsWidget->addWidget(pSettingsPane2); 290 } 148 291 149 292 /* Add into layout: */ 150 pSettingsLayout->addWidget(m_pFileSelector, 4, 1); 151 } 152 /* Create file selector label: */ 153 m_pFileSelectorLabel = new QLabel; 154 if (m_pFileSelectorLabel) 155 { 156 m_pFileSelectorLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 157 m_pFileSelectorLabel->setBuddy(m_pFileSelector); 158 159 /* Add into layout: */ 160 pSettingsLayout->addWidget(m_pFileSelectorLabel, 4, 0); 161 } 162 163 /* Create format combo-box editor: */ 164 m_pFormatComboBox = new QComboBox; 165 if (m_pFormatComboBox) 166 { 167 const QString strFormatOVF09("ovf-0.9"); 168 const QString strFormatOVF10("ovf-1.0"); 169 const QString strFormatOVF20("ovf-2.0"); 170 const QString strFormatOPC10("opc-1.0"); 171 m_pFormatComboBox->addItem(strFormatOVF09, strFormatOVF09); 172 m_pFormatComboBox->addItem(strFormatOVF10, strFormatOVF10); 173 m_pFormatComboBox->addItem(strFormatOVF20, strFormatOVF20); 174 m_pFormatComboBox->addItem(strFormatOPC10, strFormatOPC10); 175 176 /* Add into layout: */ 177 pSettingsLayout->addWidget(m_pFormatComboBox, 5, 1); 178 } 179 /* Create format combo-box label: */ 180 m_pFormatComboBoxLabel = new QLabel; 181 if (m_pFormatComboBoxLabel) 182 { 183 m_pFormatComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 184 m_pFormatComboBoxLabel->setBuddy(m_pFormatComboBox); 185 186 /* Add into layout: */ 187 pSettingsLayout->addWidget(m_pFormatComboBoxLabel, 5, 0); 188 } 189 190 /* Create advanced label: */ 191 m_pAdditionalLabel = new QLabel; 192 if (m_pAdditionalLabel) 193 { 194 m_pAdditionalLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 195 196 /* Add into layout: */ 197 pSettingsLayout->addWidget(m_pAdditionalLabel, 6, 0); 198 } 199 /* Create manifest check-box editor: */ 200 m_pManifestCheckbox = new QCheckBox; 201 if (m_pManifestCheckbox) 202 { 203 /* Add into layout: */ 204 pSettingsLayout->addWidget(m_pManifestCheckbox, 6, 1); 205 } 206 207 /* Create provider combo-box: */ 208 m_pProviderComboBox = new QComboBox; 209 if (m_pProviderComboBox) 210 { 211 /* Hide it for now: */ 212 m_pProviderComboBox->hide(); 213 214 /* Add into layout: */ 215 pSettingsLayout->addWidget(m_pProviderComboBox, 7, 1); 216 } 217 /* Create provider label: */ 218 m_pProviderComboBoxLabel = new QLabel; 219 if (m_pProviderComboBoxLabel) 220 { 221 /* Hide it for now: */ 222 m_pProviderComboBoxLabel->hide(); 223 224 m_pProviderComboBoxLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 225 m_pProviderComboBoxLabel->setBuddy(m_pProviderComboBox); 226 227 /* Add into layout: */ 228 pSettingsLayout->addWidget(m_pProviderComboBoxLabel, 7, 0); 293 pSettingsCntLayout->addWidget(m_pSettingsWidget); 229 294 } 230 295 } … … 273 338 m_strDefaultApplianceName = UIWizardExportApp::tr("Appliance"); 274 339 275 /* Translate widgets: */340 /* Translate group-boxes: */ 276 341 m_pSelectorCnt->setTitle(UIWizardExportApp::tr("Virtual &machines to export")); 277 342 m_pApplianceCnt->setTitle(UIWizardExportApp::tr("Appliance &settings")); 278 343 m_pTypeCnt->setTitle(UIWizardExportApp::tr("&Destination")); 279 344 m_pSettingsCnt->setTitle(UIWizardExportApp::tr("&Storage settings")); 345 346 /* Translate radio-buttons: */ 280 347 m_pTypeLocalFilesystem->setText(UIWizardExportApp::tr("&Local Filesystem")); 281 348 m_pTypeCloudServiceProvider->setText(UIWizardExportApp::tr("&Cloud Service Provider")); 349 350 /* Translate File selector: */ 282 351 m_pFileSelectorLabel->setText(UIWizardExportApp::tr("&File:")); 283 352 m_pFileSelector->setChooseButtonToolTip(tr("Choose a file to export the virtual appliance to...")); 284 353 m_pFileSelector->setFileDialogTitle(UIWizardExportApp::tr("Please choose a file to export the virtual appliance to")); 354 355 /* Translate Format combo-box: */ 285 356 m_pFormatComboBoxLabel->setText(UIWizardExportApp::tr("F&ormat:")); 286 357 m_pFormatComboBox->setItemText(0, UIWizardExportApp::tr("Open Virtualization Format 0.9")); … … 293 364 m_pFormatComboBox->setItemData(2, UIWizardExportApp::tr("Write in new OVF 2.0 format."), Qt::ToolTipRole); 294 365 m_pFormatComboBox->setItemData(3, UIWizardExportApp::tr("Write in Oracle Public Cloud 1.0 format."), Qt::ToolTipRole); 366 367 /* Translate addtional stuff: */ 368 m_pAdditionalLabel->setText(UIWizardExportApp::tr("Additionally:")); 295 369 m_pManifestCheckbox->setToolTip(UIWizardExportApp::tr("Create a Manifest file for automatic data integrity checks on import.")); 296 370 m_pManifestCheckbox->setText(UIWizardExportApp::tr("Write &Manifest file")); … … 395 469 void UIWizardExportAppPageExpert::sltStorageTypeChangeHandler() 396 470 { 397 /* Refresh current settings: */398 refreshCurrentSettings();471 /* Update page appearance: */ 472 updatePageAppearance(); 399 473 400 474 /* Broadcast complete-change: */
Note:
See TracChangeset
for help on using the changeset viewer.