- Timestamp:
- Aug 19, 2024 5:27:02 PM (5 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp
r105730 r105735 32 32 #include <QPushButton> 33 33 #include <QTabBar> 34 #include <QVBoxLayout>35 34 36 35 /* GUI includes: */ … … 53 52 54 53 UIWizardNewCloudVMPageExpert::UIWizardNewCloudVMPageExpert() 55 : m_pLayoutProvider(0) 56 , m_pProviderLabel(0) 54 : m_pProviderLabel(0) 57 55 , m_pProviderComboBox(0) 58 56 , m_pProfileLabel(0) 59 57 , m_pProfileComboBox(0) 60 58 , m_pProfileToolButton(0) 59 , m_pSourceImageLabel(0) 61 60 , m_pSourceTabBar(0) 62 61 , m_pSourceImageList(0) 62 , m_pLabelOptions(0) 63 63 , m_pFormEditor(0) 64 64 { 65 65 /* Prepare main layout: */ 66 Q VBoxLayout *pLayoutMain = new QVBoxLayout(this);66 QGridLayout *pLayoutMain = new QGridLayout(this); 67 67 if (pLayoutMain) 68 68 { 69 /* Prepare location widget: */ 70 QWidget *pWidgetLocation = new QWidget(this); 71 if (pWidgetLocation) 72 { 73 /* Prepare location layout: */ 74 QVBoxLayout *pLayoutLocation = new QVBoxLayout(pWidgetLocation); 75 if (pLayoutLocation) 69 pLayoutMain->setContentsMargins(0, 0, 0, 0); 70 pLayoutMain->setColumnStretch(0, 0); 71 pLayoutMain->setColumnStretch(1, 1); 72 pLayoutMain->setRowStretch(2, 0); 73 pLayoutMain->setRowStretch(3, 1); 74 pLayoutMain->setRowStretch(4, 0); 75 pLayoutMain->setRowStretch(5, 1); 76 77 /* Prepare provider label: */ 78 m_pProviderLabel = new QLabel(this); 79 if (m_pProviderLabel) 80 pLayoutMain->addWidget(m_pProviderLabel, 0, 0, Qt::AlignRight); 81 82 /* Prepare provider combo-box: */ 83 m_pProviderComboBox = new QIComboBox(this); 84 if (m_pProviderComboBox) 85 { 86 m_pProviderLabel->setBuddy(m_pProviderComboBox); 87 pLayoutMain->addWidget(m_pProviderComboBox, 0, 1); 88 } 89 90 /* Prepare profile label: */ 91 m_pProfileLabel = new QLabel(this); 92 if (m_pProfileLabel) 93 pLayoutMain->addWidget(m_pProfileLabel, 1, 0, Qt::AlignRight); 94 95 /* Prepare profile layout: */ 96 QHBoxLayout *pLayoutProfile = new QHBoxLayout; 97 if (pLayoutProfile) 98 { 99 pLayoutProfile->setContentsMargins(0, 0, 0, 0); 100 pLayoutProfile->setSpacing(1); 101 102 /* Prepare profile combo-box: */ 103 m_pProfileComboBox = new QIComboBox(this); 104 if (m_pProfileComboBox) 76 105 { 77 pLayoutLocation->setContentsMargins(0, 0, 0, 0); 78 79 /* Prepare provider layout: */ 80 m_pLayoutProvider = new QGridLayout; 81 if (m_pLayoutProvider) 82 { 83 m_pLayoutProvider->setContentsMargins(0, 0, 0, 0); 84 m_pLayoutProvider->setColumnStretch(0, 0); 85 m_pLayoutProvider->setColumnStretch(1, 1); 86 87 /* Prepare provider label: */ 88 m_pProviderLabel = new QLabel(this); 89 if (m_pProviderLabel) 90 m_pLayoutProvider->addWidget(m_pProviderLabel, 0, 0, Qt::AlignRight); 91 92 /* Prepare provider combo-box: */ 93 m_pProviderComboBox = new QIComboBox(pWidgetLocation); 94 if (m_pProviderComboBox) 95 { 96 m_pProviderLabel->setBuddy(m_pProviderComboBox); 97 m_pLayoutProvider->addWidget(m_pProviderComboBox, 0, 1); 98 } 99 100 /* Prepare profile label: */ 101 m_pProfileLabel = new QLabel(this); 102 if (m_pProfileLabel) 103 m_pLayoutProvider->addWidget(m_pProfileLabel, 1, 0, Qt::AlignRight); 104 105 /* Prepare profile layout: */ 106 QHBoxLayout *pLayoutProfile = new QHBoxLayout; 107 if (pLayoutProfile) 108 { 109 pLayoutProfile->setContentsMargins(0, 0, 0, 0); 110 pLayoutProfile->setSpacing(1); 111 112 /* Prepare profile combo-box: */ 113 m_pProfileComboBox = new QIComboBox(pWidgetLocation); 114 if (m_pProfileComboBox) 115 { 116 m_pProfileLabel->setBuddy(m_pProfileComboBox); 117 pLayoutProfile->addWidget(m_pProfileComboBox); 118 } 119 120 /* Prepare profile tool-button: */ 121 m_pProfileToolButton = new QIToolButton(pWidgetLocation); 122 if (m_pProfileToolButton) 123 { 124 m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png", 125 ":/cloud_profile_manager_disabled_16px.png")); 126 pLayoutProfile->addWidget(m_pProfileToolButton); 127 } 128 129 /* Add into layout: */ 130 m_pLayoutProvider->addLayout(pLayoutProfile, 1, 1); 131 } 132 133 /* Add into layout: */ 134 pLayoutLocation->addLayout(m_pLayoutProvider); 135 } 106 m_pProfileLabel->setBuddy(m_pProfileComboBox); 107 pLayoutProfile->addWidget(m_pProfileComboBox); 136 108 } 137 109 110 /* Prepare profile tool-button: */ 111 m_pProfileToolButton = new QIToolButton(this); 112 if (m_pProfileToolButton) 113 { 114 m_pProfileToolButton->setIcon(UIIconPool::iconSet(":/cloud_profile_manager_16px.png", 115 ":/cloud_profile_manager_disabled_16px.png")); 116 pLayoutProfile->addWidget(m_pProfileToolButton); 117 } 118 138 119 /* Add into layout: */ 139 pLayoutMain->addWidget(pWidgetLocation); 140 } 120 pLayoutMain->addLayout(pLayoutProfile, 1, 1); 121 } 122 123 /* Prepare source image label: */ 124 m_pSourceImageLabel = new QLabel(this); 125 if (m_pSourceImageLabel) 126 pLayoutMain->addWidget(m_pSourceImageLabel, 2, 0, Qt::AlignRight); 141 127 142 128 /* Prepare source widget: */ … … 166 152 if (m_pSourceImageList) 167 153 { 154 m_pSourceImageLabel->setBuddy(m_pSourceImageList); 168 155 /* Make source image list fit 50 symbols 169 156 * horizontally and 8 lines vertically: */ … … 185 172 186 173 /* Add into layout: */ 187 pLayoutMain->addWidget(pWidgetSource); 188 } 189 190 /* Prepare settings widget: */ 191 QWidget *pWidgetSettings = new QWidget(this); 192 if (pWidgetSettings) 193 { 194 /* Prepare settings layout: */ 195 QVBoxLayout *pLayoutSettings = new QVBoxLayout(pWidgetSettings); 196 if (pLayoutSettings) 197 { 198 pLayoutSettings->setContentsMargins(0, 0, 0, 0); 199 200 /* Prepare form editor widget: */ 201 m_pFormEditor = new UIFormEditorWidget(pWidgetSettings); 202 if (m_pFormEditor) 203 { 204 /* Make form-editor fit 6 sections in height by default: */ 205 const int iDefaultSectionHeight = m_pFormEditor->verticalHeader() 206 ? m_pFormEditor->verticalHeader()->defaultSectionSize() 207 : 0; 208 if (iDefaultSectionHeight > 0) 209 m_pFormEditor->setMinimumHeight(6 * iDefaultSectionHeight); 210 211 /* Add into layout: */ 212 pLayoutSettings->addWidget(m_pFormEditor); 213 } 214 } 174 pLayoutMain->addWidget(pWidgetSource, 2, 1, 2, 1); 175 } 176 177 /* Prepare label: */ 178 m_pLabelOptions = new QLabel(this); 179 if (m_pLabelOptions) 180 pLayoutMain->addWidget(m_pLabelOptions, 4, 0); 181 182 /* Prepare form editor widget: */ 183 m_pFormEditor = new UIFormEditorWidget(this); 184 if (m_pFormEditor) 185 { 186 m_pLabelOptions->setBuddy(m_pSourceImageList); 187 /* Make form-editor fit 6 sections in height by default: */ 188 const int iDefaultSectionHeight = m_pFormEditor->verticalHeader() 189 ? m_pFormEditor->verticalHeader()->defaultSectionSize() 190 : 0; 191 if (iDefaultSectionHeight > 0) 192 m_pFormEditor->setMinimumHeight(6 * iDefaultSectionHeight); 215 193 216 194 /* Add into layout: */ 217 pLayoutMain->addWidget( pWidgetSettings);195 pLayoutMain->addWidget(m_pFormEditor, 4, 1, 2, 1); 218 196 } 219 197 } … … 267 245 268 246 /* Translate source tab-bar: */ 247 if (m_pSourceImageLabel) 248 m_pSourceImageLabel->setText(UIWizardNewCloudVM::tr("&Source:")); 269 249 if (m_pSourceTabBar) 270 250 { … … 278 258 279 259 /* Translate cloud VM properties table: */ 260 if (m_pLabelOptions) 261 m_pLabelOptions->setText(UIWizardNewCloudVM::tr("&Options:")); 280 262 if (m_pFormEditor) 281 263 m_pFormEditor->setWhatsThis(UIWizardNewCloudVM::tr("Lists all the cloud VM properties.")); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.h
r105730 r105735 37 37 38 38 /* Forward declarations: */ 39 class QGridLayout;40 39 class QLabel; 41 40 class QIListWidget; … … 96 95 QString m_strSourceImageId; 97 96 98 /** Holds the provider layout instance. */99 QGridLayout *m_pLayoutProvider;100 97 /** Holds the provider type label instance. */ 101 98 QLabel *m_pProviderLabel; … … 109 106 QIToolButton *m_pProfileToolButton; 110 107 108 /** Holds the source image label instance. */ 109 QLabel *m_pSourceImageLabel; 111 110 /** Holds the source tab-bar instance. */ 112 111 QTabBar *m_pSourceTabBar; … … 114 113 QIListWidget *m_pSourceImageList; 115 114 115 /** Holds the option label instance. */ 116 QLabel *m_pLabelOptions; 116 117 /** Holds the Form Editor widget instance. */ 117 118 UIFormEditorWidget *m_pFormEditor;
Note:
See TracChangeset
for help on using the changeset viewer.