Changeset 78275 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 24, 2019 2:53:31 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.cpp
r78274 r78275 19 19 #include <QLabel> 20 20 #include <QPointer> 21 #include <QStackedLayout> 21 22 #include <QVBoxLayout> 22 23 … … 39 40 40 41 UIWizardImportAppPage2::UIWizardImportAppPage2() 42 : m_pSettingsCntLayout(0) 41 43 { 42 44 } … … 47 49 if (comForm.isNotNull()) 48 50 m_pFormEditor->setVirtualSystemDescriptionForm(comForm); 51 } 52 53 void UIWizardImportAppPage2::updatePageAppearance() 54 { 55 /* Check whether there was cloud source selected: */ 56 const bool fIsSourceCloudOne = fieldImp("isSourceCloudOne").toBool(); 57 58 /* Update page appearance according to chosen source: */ 59 m_pSettingsCntLayout->setCurrentIndex((int)fIsSourceCloudOne); 49 60 } 50 61 … … 69 80 } 70 81 71 /* Create appliance widget: */ 72 m_pApplianceWidget = new UIApplianceImportEditorWidget(this); 82 /* Create settings container layout: */ 83 m_pSettingsCntLayout = new QStackedLayout; 84 if (m_pSettingsCntLayout) 73 85 { 74 m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); 75 m_pApplianceWidget->setFile(strFileName); 86 /* Create appliance widget container: */ 87 QWidget *pApplianceWidgetCnt = new QWidget(this); 88 if (pApplianceWidgetCnt) 89 { 90 /* Create appliance widget layout: */ 91 QVBoxLayout *pApplianceWidgetLayout = new QVBoxLayout(pApplianceWidgetCnt); 92 if (pApplianceWidgetLayout) 93 { 94 pApplianceWidgetLayout->setContentsMargins(0, 0, 0, 0); 95 96 /* Create appliance widget: */ 97 m_pApplianceWidget = new UIApplianceImportEditorWidget(pApplianceWidgetCnt); 98 if (m_pApplianceWidget) 99 { 100 m_pApplianceWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding); 101 m_pApplianceWidget->setFile(strFileName); 102 103 /* Add into layout: */ 104 pApplianceWidgetLayout->addWidget(m_pApplianceWidget); 105 } 106 107 /* Create certificate label: */ 108 m_pCertLabel = new QLabel(QString(), pApplianceWidgetCnt); 109 if (m_pCertLabel) 110 { 111 /* Add into layout: */ 112 pApplianceWidgetLayout->addWidget(m_pCertLabel); 113 } 114 } 115 116 /* Add into layout: */ 117 m_pSettingsCntLayout->addWidget(pApplianceWidgetCnt); 118 } 119 120 /* Create form editor container: */ 121 QWidget *pFormEditorCnt = new QWidget(this); 122 if (pFormEditorCnt) 123 { 124 /* Create form editor layout: */ 125 QVBoxLayout *pFormEditorLayout = new QVBoxLayout(pFormEditorCnt); 126 if (pFormEditorLayout) 127 { 128 pFormEditorLayout->setContentsMargins(0, 0, 0, 0); 129 130 /* Create form editor widget: */ 131 m_pFormEditor = new UIFormEditorWidget(pFormEditorCnt); 132 if (m_pFormEditor) 133 { 134 /* Add into layout: */ 135 pFormEditorLayout->addWidget(m_pFormEditor); 136 } 137 } 138 139 /* Add into layout: */ 140 m_pSettingsCntLayout->addWidget(pFormEditorCnt); 141 } 76 142 77 143 /* Add into layout: */ 78 pMainLayout->addWidget(m_pApplianceWidget); 79 } 80 81 /* Create form editor widget: */ 82 m_pFormEditor = new UIFormEditorWidget(this); 83 if (m_pFormEditor) 84 { 85 /* Add into layout: */ 86 pMainLayout->addWidget(m_pFormEditor); 87 } 88 89 /* Create certificate label: */ 90 m_pCertLabel = new QLabel("<cert label>", this); 91 if (m_pCertLabel) 92 { 93 /* Add into layout: */ 94 pMainLayout->addWidget(m_pCertLabel); 144 pMainLayout->addLayout(m_pSettingsCntLayout); 95 145 } 96 146 } … … 107 157 setTitle(UIWizardImportApp::tr("Appliance settings")); 108 158 109 /* Translate the description label: */ 110 const bool fIsSourceCloudOne = field("isSourceCloudOne").toBool(); 111 if (fIsSourceCloudOne) 112 m_pLabel->setText(UIWizardImportApp::tr("These are the the suggested settings of the cloud VM import " 113 "procedure, they are influencing the resulting local VM instance. " 114 "You can change many of the properties shown by double-clicking " 115 "on the items and disable others using the check boxes below.")); 116 else 117 m_pLabel->setText(UIWizardImportApp::tr("These are the virtual machines contained in the appliance " 118 "and the suggested settings of the imported VirtualBox machines. " 119 "You can change many of the properties shown by double-clicking " 120 "on the items and disable others using the check boxes below.")); 159 /* Update page appearance: */ 160 updatePageAppearance(); 121 161 122 162 /* Translate the certificate label: */ … … 155 195 void UIWizardImportAppPageBasic2::initializePage() 156 196 { 197 /* Update widget visibility: */ 198 updatePageAppearance(); 199 157 200 /* Check whether there was cloud source selected: */ 158 201 const bool fIsSourceCloudOne = field("isSourceCloudOne").toBool(); 159 160 /* Update widget visibility: */161 m_pFormEditor->setVisible(fIsSourceCloudOne);162 m_pApplianceWidget->setVisible(!fIsSourceCloudOne);163 m_pCertLabel->setVisible(!fIsSourceCloudOne);164 202 165 203 if (fIsSourceCloudOne) … … 260 298 return fResult; 261 299 } 300 301 void UIWizardImportAppPageBasic2::updatePageAppearance() 302 { 303 /* Call to base-class: */ 304 UIWizardImportAppPage2::updatePageAppearance(); 305 306 /* Check whether there was cloud source selected: */ 307 const bool fIsSourceCloudOne = field("isSourceCloudOne").toBool(); 308 if (fIsSourceCloudOne) 309 { 310 m_pLabel->setText(UIWizardImportApp::tr("These are the the suggested settings of the cloud VM import " 311 "procedure, they are influencing the resulting local VM instance. " 312 "You can change many of the properties shown by double-clicking " 313 "on the items and disable others using the check boxes below.")); 314 m_pFormEditor->setFocus(); 315 } 316 else 317 { 318 m_pLabel->setText(UIWizardImportApp::tr("These are the virtual machines contained in the appliance " 319 "and the suggested settings of the imported VirtualBox machines. " 320 "You can change many of the properties shown by double-clicking " 321 "on the items and disable others using the check boxes below.")); 322 m_pApplianceWidget->setFocus(); 323 } 324 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/importappliance/UIWizardImportAppPageBasic2.h
r78274 r78275 29 29 /* Forward declarations: */ 30 30 class QLabel; 31 class QStackedLayout; 31 32 class QIRichTextLabel; 32 33 … … 42 43 void populateFormPropertiesTable(); 43 44 45 /** Updates page appearance. */ 46 virtual void updatePageAppearance(); 47 44 48 /** Returns appliance widget instance. */ 45 49 ImportAppliancePointer applianceWidget() const { return m_pApplianceWidget; } 50 51 /** Holds the settings container layout instance. */ 52 QStackedLayout *m_pSettingsCntLayout; 46 53 47 54 /** Holds the appliance widget instance. */ … … 82 89 virtual bool validatePage() /* override */; 83 90 91 /** Updates page appearance. */ 92 virtual void updatePageAppearance() /* override */; 93 84 94 private: 85 95
Note:
See TracChangeset
for help on using the changeset viewer.