Changeset 90174 in vbox
- Timestamp:
- Jul 14, 2021 7:27:04 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145690
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.cpp
r90170 r90174 17 17 18 18 /* Qt includes: */ 19 #include <QCheckBox> 19 20 #include <QLabel> 20 21 #include <QVBoxLayout> 21 22 22 23 /* GUI includes: */ 24 #include "QILineEdit.h" 23 25 #include "UICommon.h" 26 #include "UIHostnameDomainNameEditor.h" 24 27 #include "UIFilePathSelector.h" 25 28 #include "UIUserNamePasswordEditor.h" … … 36 39 37 40 UIUserNamePasswordGroupBox::UIUserNamePasswordGroupBox(QWidget *pParent /* = 0 */) 38 : QGroupBox(pParent)41 : QIWithRetranslateUI<QGroupBox>(pParent) 39 42 , m_pUserNamePasswordEditor(0) 40 43 { … … 55 58 connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigUserNameChanged, 56 59 this, &UIUserNamePasswordGroupBox::sigUserNameChanged); 60 retranslateUi(); 61 } 62 63 void UIUserNamePasswordGroupBox::retranslateUi() 64 { 65 setTitle(UIWizardNewVM::tr("Username and Password")); 57 66 } 58 67 … … 98 107 99 108 /********************************************************************************************************************************* 100 * UI UserNamePasswordGroupBox implementation.*109 * UIGAInstallationGroupBox implementation. * 101 110 *********************************************************************************************************************************/ 102 111 … … 182 191 m_pGAISOFilePathSelector->setEnabled(m_pGAISOFilePathSelector); 183 192 } 193 194 195 /********************************************************************************************************************************* 196 * UIAdditionalUnattendedOptions implementation. * 197 *********************************************************************************************************************************/ 198 199 UIAdditionalUnattendedOptions::UIAdditionalUnattendedOptions(QWidget *pParent /* = 0 */) 200 :QIWithRetranslateUI<QGroupBox>(pParent) 201 , m_pProductKeyLabel(0) 202 , m_pProductKeyLineEdit(0) 203 , m_pHostnameDomainNameEditor(0) 204 , m_pStartHeadlessCheckBox(0) 205 { 206 prepare(); 207 } 208 209 void UIAdditionalUnattendedOptions::prepare() 210 { 211 QGridLayout *pAdditionalOptionsContainerLayout = new QGridLayout(this); 212 pAdditionalOptionsContainerLayout->setColumnStretch(0, 0); 213 pAdditionalOptionsContainerLayout->setColumnStretch(1, 1); 214 215 m_pProductKeyLabel = new QLabel; 216 if (m_pProductKeyLabel) 217 { 218 m_pProductKeyLabel->setAlignment(Qt::AlignRight); 219 m_pProductKeyLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); 220 pAdditionalOptionsContainerLayout->addWidget(m_pProductKeyLabel, 0, 0); 221 } 222 m_pProductKeyLineEdit = new QILineEdit; 223 if (m_pProductKeyLineEdit) 224 { 225 m_pProductKeyLineEdit->setInputMask(">NNNNN-NNNNN-NNNNN-NNNNN-NNNNN;#"); 226 if (m_pProductKeyLabel) 227 m_pProductKeyLabel->setBuddy(m_pProductKeyLineEdit); 228 pAdditionalOptionsContainerLayout->addWidget(m_pProductKeyLineEdit, 0, 1, 1, 2); 229 } 230 231 m_pHostnameDomainNameEditor = new UIHostnameDomainNameEditor; 232 if (m_pHostnameDomainNameEditor) 233 pAdditionalOptionsContainerLayout->addWidget(m_pHostnameDomainNameEditor, 1, 0, 2, 3); 234 235 m_pStartHeadlessCheckBox = new QCheckBox; 236 if (m_pStartHeadlessCheckBox) 237 pAdditionalOptionsContainerLayout->addWidget(m_pStartHeadlessCheckBox, 3, 1); 238 239 if (m_pHostnameDomainNameEditor) 240 connect(m_pHostnameDomainNameEditor, &UIHostnameDomainNameEditor::sigHostnameDomainNameChanged, 241 this, &UIAdditionalUnattendedOptions::sigHostnameDomainNameChanged); 242 if (m_pProductKeyLineEdit) 243 connect(m_pProductKeyLineEdit, &QILineEdit::textChanged, 244 this, &UIAdditionalUnattendedOptions::sigProductKeyChanged); 245 if (m_pStartHeadlessCheckBox) 246 connect(m_pStartHeadlessCheckBox, &QCheckBox::toggled, 247 this, &UIAdditionalUnattendedOptions::sigStartHeadlessChanged); 248 249 250 retranslateUi(); 251 } 252 253 void UIAdditionalUnattendedOptions::retranslateUi() 254 { 255 setTitle(UIWizardNewVM::tr("Additional Options")); 256 257 if (m_pProductKeyLabel) 258 m_pProductKeyLabel->setText(UIWizardNewVM::tr("&Product Key:")); 259 260 if (m_pStartHeadlessCheckBox) 261 { 262 m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("&Install in Background")); 263 m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("<p>When checked, the newly created virtual machine will be started " 264 "in headless mode (without a GUI) for the unattended guest OS install.</p>")); 265 } 266 } 267 268 QString UIAdditionalUnattendedOptions::hostname() const 269 { 270 if (m_pHostnameDomainNameEditor) 271 return m_pHostnameDomainNameEditor->hostname(); 272 return QString(); 273 } 274 275 void UIAdditionalUnattendedOptions::setHostname(const QString &strHostname) 276 { 277 if (m_pHostnameDomainNameEditor) 278 return m_pHostnameDomainNameEditor->setHostname(strHostname); 279 } 280 281 QString UIAdditionalUnattendedOptions::domainName() const 282 { 283 if (m_pHostnameDomainNameEditor) 284 return m_pHostnameDomainNameEditor->domainName(); 285 return QString(); 286 } 287 288 void UIAdditionalUnattendedOptions::setDomainName(const QString &strDomainName) 289 { 290 if (m_pHostnameDomainNameEditor) 291 return m_pHostnameDomainNameEditor->setDomainName(strDomainName); 292 } 293 294 QString UIAdditionalUnattendedOptions::hostnameDomainName() const 295 { 296 if (m_pHostnameDomainNameEditor) 297 return m_pHostnameDomainNameEditor->hostnameDomainName(); 298 return QString(); 299 } 300 301 bool UIAdditionalUnattendedOptions::isComplete() const 302 { 303 if (m_pHostnameDomainNameEditor) 304 return m_pHostnameDomainNameEditor->isComplete(); 305 return false; 306 } 307 308 void UIAdditionalUnattendedOptions::disableEnableProductKeyWidgets(bool fEnabled) 309 { 310 if (m_pProductKeyLabel) 311 m_pProductKeyLabel->setEnabled(fEnabled); 312 if (m_pProductKeyLineEdit) 313 m_pProductKeyLineEdit->setEnabled(fEnabled); 314 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.h
r90169 r90174 30 30 31 31 /* Forward declarations: */ 32 class QCheckBox; 32 33 class QGridLayout; 33 34 class QLabel; 34 35 class QILineEdit; 35 36 class UIFilePathSelector; 37 class UIHostnameDomainNameEditor; 36 38 class UIPasswordLineEdit; 37 39 class UIUserNamePasswordEditor; 38 40 39 class UIUserNamePasswordGroupBox : public Q GroupBox41 class UIUserNamePasswordGroupBox : public QIWithRetranslateUI<QGroupBox> 40 42 { 41 43 Q_OBJECT; … … 51 53 52 54 /** @name Wrappers for UIUserNamePasswordEditor 53 * @{ */54 QString userName() const;55 void setUserName(const QString &strUserName);55 * @{ */ 56 QString userName() const; 57 void setUserName(const QString &strUserName); 56 58 57 QString password() const;58 void setPassword(const QString &strPassword);59 bool isComplete();60 void setLabelsVisible(bool fVisible);59 QString password() const; 60 void setPassword(const QString &strPassword); 61 bool isComplete(); 62 void setLabelsVisible(bool fVisible); 61 63 /** @} */ 62 64 … … 64 66 65 67 void prepare(); 68 virtual void retranslateUi() /* override final */; 66 69 67 70 UIUserNamePasswordEditor *m_pUserNamePasswordEditor; … … 82 85 83 86 /** @name Wrappers for UIFilePathSelector 84 * @{ */85 QString path() const;86 void setPath(const QString &strPath, bool fRefreshText = true);87 void mark(bool fError, const QString &strErrorMessage = QString());87 * @{ */ 88 QString path() const; 89 void setPath(const QString &strPath, bool fRefreshText = true); 90 void mark(bool fError, const QString &strErrorMessage = QString()); 88 91 /** @} */ 89 92 … … 102 105 }; 103 106 107 class UIAdditionalUnattendedOptions : public QIWithRetranslateUI<QGroupBox> 108 { 109 Q_OBJECT; 110 111 signals: 112 113 void sigHostnameDomainNameChanged(const QString &strHostnameDomainName); 114 void sigProductKeyChanged(const QString &strHostnameDomainName); 115 void sigStartHeadlessChanged(bool fChecked); 116 117 public: 118 119 UIAdditionalUnattendedOptions(QWidget *pParent = 0); 120 121 /** @name Wrappers for UIFilePathSelector 122 * @{ */ 123 QString hostname() const; 124 void setHostname(const QString &strHostname); 125 QString domainName() const; 126 void setDomainName(const QString &strDomain); 127 QString hostnameDomainName() const; 128 bool isComplete() const; 129 void disableEnableProductKeyWidgets(bool fEnabled); 130 /** @} */ 131 132 private: 133 134 void prepare(); 135 virtual void retranslateUi() /* override final */; 136 137 QLabel *m_pProductKeyLabel; 138 QILineEdit *m_pProductKeyLineEdit; 139 UIHostnameDomainNameEditor *m_pHostnameDomainNameEditor; 140 QCheckBox *m_pStartHeadlessCheckBox; 141 }; 142 104 143 #endif /* !FEQT_INCLUDED_SRC_wizards_editors_UIWizardNewVMEditors_h */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r90169 r90174 65 65 , m_pNameAndSystemLayout(0) 66 66 , m_pAdditionalOptionsContainer(0) 67 , m_pProductKeyLabel(0)68 , m_pProductKeyLineEdit(0)69 , m_pHostnameDomainNameEditor(0)70 , m_pStartHeadlessCheckBox(0)71 67 , m_pGAInstallationISOContainer(0) 72 , m_pUserNameContainer(0)73 68 { 74 69 /* Create widgets: */ … … 183 178 } 184 179 185 if (m_pStartHeadlessCheckBox)186 {187 m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("&Install in Background"));188 m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("<p>When checked, the newly created virtual machine will be started "189 "in headless mode (without a GUI) for the unattended guest OS install.</p>"));190 }191 192 if (m_pProductKeyLabel)193 m_pProductKeyLabel->setText(UIWizardNewVM::tr("&Product Key:"));194 195 if (m_pUserNameContainer)196 m_pUserNameContainer->setTitle(UIWizardNewVM::tr("Username and Password"));197 if (m_pAdditionalOptionsContainer)198 m_pAdditionalOptionsContainer->setTitle(UIWizardNewVM::tr("Additional Options"));199 200 180 if (m_pToolBox) 201 181 { … … 394 374 pLayout->addWidget(m_pUserNamePasswordGroupBox, iRow, 0, 1, 2); 395 375 396 /* Additional options: */ 397 pLayout->addWidget(createAdditionalOptionsWidgets(), iRow, 2, 1, 2); 376 m_pAdditionalOptionsContainer = new UIAdditionalUnattendedOptions; 377 AssertReturn(m_pAdditionalOptionsContainer, 0); 378 pLayout->addWidget(m_pAdditionalOptionsContainer, iRow, 2, 1, 2); 398 379 399 380 ++iRow; 381 400 382 /* Guest additions installation: */ 401 383 m_pGAInstallationISOContainer = new UIGAInstallationGroupBox; 402 384 AssertReturn(m_pGAInstallationISOContainer, 0); 403 385 pLayout->addWidget(m_pGAInstallationISOContainer, iRow, 0, 1, 4); 404 386 … … 849 831 return pContainerWidget; 850 832 } 851 852 QWidget *UIWizardNewVMPageExpert::createAdditionalOptionsWidgets()853 {854 if (m_pAdditionalOptionsContainer)855 return m_pAdditionalOptionsContainer;856 857 m_pAdditionalOptionsContainer = new QGroupBox;858 QGridLayout *pAdditionalOptionsContainerLayout = new QGridLayout(m_pAdditionalOptionsContainer);859 pAdditionalOptionsContainerLayout->setColumnStretch(0, 0);860 pAdditionalOptionsContainerLayout->setColumnStretch(1, 1);861 862 m_pProductKeyLabel = new QLabel;863 if (m_pProductKeyLabel)864 {865 m_pProductKeyLabel->setAlignment(Qt::AlignRight);866 m_pProductKeyLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);867 pAdditionalOptionsContainerLayout->addWidget(m_pProductKeyLabel, 0, 0);868 }869 m_pProductKeyLineEdit = new QLineEdit;870 if (m_pProductKeyLineEdit)871 {872 m_pProductKeyLineEdit->setInputMask(">NNNNN-NNNNN-NNNNN-NNNNN-NNNNN;#");873 if (m_pProductKeyLabel)874 m_pProductKeyLabel->setBuddy(m_pProductKeyLineEdit);875 pAdditionalOptionsContainerLayout->addWidget(m_pProductKeyLineEdit, 0, 1, 1, 2);876 }877 878 m_pHostnameDomainNameEditor = new UIHostnameDomainNameEditor;879 if (m_pHostnameDomainNameEditor)880 pAdditionalOptionsContainerLayout->addWidget(m_pHostnameDomainNameEditor, 1, 0, 2, 3);881 882 m_pStartHeadlessCheckBox = new QCheckBox;883 if (m_pStartHeadlessCheckBox)884 pAdditionalOptionsContainerLayout->addWidget(m_pStartHeadlessCheckBox, 3, 1);885 886 return m_pAdditionalOptionsContainer;887 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r90169 r90174 38 38 class QLineEdit; 39 39 class QVBoxLayout; 40 class UIAdditionalUnattendedOptions; 40 41 class UIFilePathSelector; 41 42 class UIGAInstallationGroupBox; … … 125 126 126 127 /** @name Variables 127 * @{ */ 128 UIToolBox *m_pToolBox; 129 QGroupBox *m_pDiskFormatGroupBox; 130 QGroupBox *m_pDiskVariantGroupBox; 131 QLabel *m_pLocationLabel; 132 QLineEdit *m_pLocationEditor; 133 QIToolButton *m_pLocationOpenButton; 134 QLabel *m_pMediumSizeEditorLabel; 135 UIMediumSizeEditor *m_pMediumSizeEditor; 136 QButtonGroup *m_pFormatButtonGroup; 137 QCheckBox *m_pFixedCheckBox; 138 QCheckBox *m_pSplitBox; 139 UINameAndSystemEditor *m_pNameAndSystemEditor; 140 QCheckBox *m_pSkipUnattendedCheckBox; 141 QGridLayout *m_pNameAndSystemLayout; 142 QGroupBox *m_pAdditionalOptionsContainer; 143 QLabel *m_pProductKeyLabel; 144 QLineEdit *m_pProductKeyLineEdit; 145 UIHostnameDomainNameEditor *m_pHostnameDomainNameEditor; 146 147 148 QCheckBox *m_pStartHeadlessCheckBox; 149 UIGAInstallationGroupBox *m_pGAInstallationISOContainer; 150 QGroupBox *m_pUserNameContainer; 151 UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox; 152 128 * @{ */ 129 UIToolBox *m_pToolBox; 130 QGroupBox *m_pDiskFormatGroupBox; 131 QGroupBox *m_pDiskVariantGroupBox; 132 QLabel *m_pLocationLabel; 133 QLineEdit *m_pLocationEditor; 134 QIToolButton *m_pLocationOpenButton; 135 QLabel *m_pMediumSizeEditorLabel; 136 UIMediumSizeEditor *m_pMediumSizeEditor; 137 QButtonGroup *m_pFormatButtonGroup; 138 QCheckBox *m_pFixedCheckBox; 139 QCheckBox *m_pSplitBox; 140 UINameAndSystemEditor *m_pNameAndSystemEditor; 141 QCheckBox *m_pSkipUnattendedCheckBox; 142 QGridLayout *m_pNameAndSystemLayout; 143 UIAdditionalUnattendedOptions *m_pAdditionalOptionsContainer; 144 UIGAInstallationGroupBox *m_pGAInstallationISOContainer; 145 UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox; 153 146 /** @} */ 154 147 }; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp
r90169 r90174 55 55 , m_pAdditionalOptionsContainer(0) 56 56 , m_pGAInstallationISOContainer(0) 57 , m_pStartHeadlessCheckBox(0)58 57 , m_pUserNamePasswordGroupBox(0) 59 , m_pHostnameDomainNameEditor(0)60 , m_pProductKeyLineEdit(0)61 , m_pProductKeyLabel(0)62 58 { 63 59 prepare(); … … 71 67 if (m_pLabel) 72 68 pMainLayout->addWidget(m_pLabel, 0, 0, 1, 2); 69 73 70 m_pUserNamePasswordGroupBox = new UIUserNamePasswordGroupBox; 74 71 AssertReturnVoid(m_pUserNamePasswordGroupBox); 75 72 pMainLayout->addWidget(m_pUserNamePasswordGroupBox, 1, 0, 1, 1); 76 pMainLayout->addWidget(createAdditionalOptionsWidgets(), 1, 1, 1, 1); 73 74 m_pAdditionalOptionsContainer = new UIAdditionalUnattendedOptions; 75 AssertReturnVoid(m_pAdditionalOptionsContainer); 76 pMainLayout->addWidget(m_pAdditionalOptionsContainer, 1, 1, 1, 1); 77 77 78 m_pGAInstallationISOContainer = new UIGAInstallationGroupBox; 79 AssertReturnVoid(m_pGAInstallationISOContainer); 78 80 pMainLayout->addWidget(m_pGAInstallationISOContainer, 2, 0, 1, 2); 81 79 82 pMainLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding), 3, 0, 1, 2); 80 83 … … 98 101 this, &UIWizardNewVMUnattendedPageBasic::sltGAISOPathChanged); 99 102 } 100 if (m_pHostnameDomainNameEditor) 101 connect(m_pHostnameDomainNameEditor, &UIHostnameDomainNameEditor::sigHostnameDomainNameChanged, 103 104 if (m_pAdditionalOptionsContainer) 105 { 106 connect(m_pAdditionalOptionsContainer, &UIAdditionalUnattendedOptions::sigHostnameDomainNameChanged, 102 107 this, &UIWizardNewVMUnattendedPageBasic::sltHostnameDomainNameChanged); 103 if (m_pProductKeyLineEdit) 104 connect(m_pProductKeyLineEdit, &QLineEdit::textChanged, 108 connect(m_pAdditionalOptionsContainer, &UIAdditionalUnattendedOptions::sigProductKeyChanged, 105 109 this, &UIWizardNewVMUnattendedPageBasic::sltProductKeyChanged); 106 if (m_pStartHeadlessCheckBox) 107 connect(m_pStartHeadlessCheckBox, &QCheckBox::toggled, 110 connect(m_pAdditionalOptionsContainer, &UIAdditionalUnattendedOptions::sigStartHeadlessChanged, 108 111 this, &UIWizardNewVMUnattendedPageBasic::sltStartHeadlessChanged); 112 } 109 113 } 110 114 … … 117 121 "hostname. Additionally you can enable guest additions install. " 118 122 "For Microsoft Windows guests it is possible to provide a product key.</p>")); 119 if (m_pProductKeyLabel)120 m_pProductKeyLabel->setText(UIWizardNewVM::tr("&Product Key:"));121 123 if (m_pUserNamePasswordGroupBox) 122 124 m_pUserNamePasswordGroupBox->setTitle(UIWizardNewVM::tr("Username and Password")); 125 } 126 127 128 void UIWizardNewVMUnattendedPageBasic::initializePage() 129 { 123 130 if (m_pAdditionalOptionsContainer) 124 m_pAdditionalOptionsContainer->setTitle(UIWizardNewVM::tr("Additional Options")); 125 if (m_pStartHeadlessCheckBox) 126 { 127 m_pStartHeadlessCheckBox->setText(UIWizardNewVM::tr("&Install in Background")); 128 m_pStartHeadlessCheckBox->setToolTip(UIWizardNewVM::tr("<p>When checked, the newly created virtual machine will be started " 129 "in headless mode (without a GUI) for the unattended guest OS install.</p>")); 130 } 131 } 132 133 134 void UIWizardNewVMUnattendedPageBasic::initializePage() 135 { 136 disableEnableProductKeyWidgets(isProductKeyWidgetEnabled()); 131 m_pAdditionalOptionsContainer->disableEnableProductKeyWidgets(isProductKeyWidgetEnabled()); 137 132 if (m_pGAInstallationISOContainer) 138 133 m_pGAInstallationISOContainer->sltToggleWidgetsEnabled(m_pGAInstallationISOContainer->isChecked()); … … 151 146 m_pUserNamePasswordGroupBox->blockSignals(false); 152 147 } 153 if (m_p HostnameDomainNameEditor)154 { 155 m_p HostnameDomainNameEditor->blockSignals(true);148 if (m_pAdditionalOptionsContainer) 149 { 150 m_pAdditionalOptionsContainer->blockSignals(true); 156 151 157 152 if (!m_userModifiedParameters.contains("HostnameDomainName")) 158 153 { 159 m_p HostnameDomainNameEditor->setHostname(pWizard->machineBaseName());160 m_p HostnameDomainNameEditor->setDomainName("myguest.virtualbox.org");154 m_pAdditionalOptionsContainer->setHostname(pWizard->machineBaseName()); 155 m_pAdditionalOptionsContainer->setDomainName("myguest.virtualbox.org"); 161 156 /* Initialize unattended hostname here since we cannot get the efault value from CUnattended this early (unlike username etc): */ 162 newVMWizardPropertySet(HostnameDomainName, m_p HostnameDomainNameEditor->hostnameDomainName());157 newVMWizardPropertySet(HostnameDomainName, m_pAdditionalOptionsContainer->hostnameDomainName()); 163 158 } 164 159 165 m_p HostnameDomainNameEditor->blockSignals(false);160 m_pAdditionalOptionsContainer->blockSignals(false); 166 161 } 167 162 if (m_pGAInstallationISOContainer && !m_userModifiedParameters.contains("InstallGuestAdditions")) … … 190 185 if (m_pUserNamePasswordGroupBox && !m_pUserNamePasswordGroupBox->isComplete()) 191 186 return false; 192 if (m_p HostnameDomainNameEditor && !m_pHostnameDomainNameEditor->isComplete())187 if (m_pAdditionalOptionsContainer && !m_pAdditionalOptionsContainer->isComplete()) 193 188 return false; 194 189 return true; … … 259 254 } 260 255 261 QWidget *UIWizardNewVMUnattendedPageBasic::createAdditionalOptionsWidgets()262 {263 if (m_pAdditionalOptionsContainer)264 return m_pAdditionalOptionsContainer;265 266 m_pAdditionalOptionsContainer = new QGroupBox;267 QGridLayout *pAdditionalOptionsContainerLayout = new QGridLayout(m_pAdditionalOptionsContainer);268 pAdditionalOptionsContainerLayout->setColumnStretch(0, 0);269 pAdditionalOptionsContainerLayout->setColumnStretch(1, 1);270 271 m_pProductKeyLabel = new QLabel;272 if (m_pProductKeyLabel)273 {274 m_pProductKeyLabel->setAlignment(Qt::AlignRight);275 m_pProductKeyLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);276 pAdditionalOptionsContainerLayout->addWidget(m_pProductKeyLabel, 0, 0);277 }278 m_pProductKeyLineEdit = new QLineEdit;279 if (m_pProductKeyLineEdit)280 {281 m_pProductKeyLineEdit->setInputMask(">NNNNN-NNNNN-NNNNN-NNNNN-NNNNN;#");282 if (m_pProductKeyLabel)283 m_pProductKeyLabel->setBuddy(m_pProductKeyLineEdit);284 pAdditionalOptionsContainerLayout->addWidget(m_pProductKeyLineEdit, 0, 1, 1, 2);285 }286 287 m_pHostnameDomainNameEditor = new UIHostnameDomainNameEditor;288 if (m_pHostnameDomainNameEditor)289 pAdditionalOptionsContainerLayout->addWidget(m_pHostnameDomainNameEditor, 1, 0, 2, 3);290 291 m_pStartHeadlessCheckBox = new QCheckBox;292 if (m_pStartHeadlessCheckBox)293 pAdditionalOptionsContainerLayout->addWidget(m_pStartHeadlessCheckBox, 3, 1);294 295 return m_pAdditionalOptionsContainer;296 }297 298 void UIWizardNewVMUnattendedPageBasic::disableEnableProductKeyWidgets(bool fEnabled)299 {300 if (m_pProductKeyLabel)301 m_pProductKeyLabel->setEnabled(fEnabled);302 if (m_pProductKeyLineEdit)303 m_pProductKeyLineEdit->setEnabled(fEnabled);304 }305 306 256 void UIWizardNewVMUnattendedPageBasic::markWidgets() const 307 257 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h
r90169 r90174 33 33 class QLineEdit; 34 34 class QIRichTextLabel; 35 class UIAdditionalUnattendedOptions; 35 36 class UIGAInstallationGroupBox; 36 37 class UIFilePathSelector; … … 74 75 void prepare(); 75 76 void createConnections(); 76 QWidget *createAdditionalOptionsWidgets();77 77 78 78 void retranslateUi(); … … 81 81 /** Returns true if we show the widgets for guest os product key. */ 82 82 bool isProductKeyWidgetEnabled() const; 83 void disableEnableProductKeyWidgets(bool fEnabled);84 83 void markWidgets() const; 85 84 … … 87 86 * @{ */ 88 87 QIRichTextLabel *m_pLabel; 89 QGroupBox*m_pAdditionalOptionsContainer;88 UIAdditionalUnattendedOptions *m_pAdditionalOptionsContainer; 90 89 UIGAInstallationGroupBox *m_pGAInstallationISOContainer; 91 QCheckBox *m_pStartHeadlessCheckBox;92 90 UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox; 93 UIHostnameDomainNameEditor *m_pHostnameDomainNameEditor; 94 /** Product key stuff. */ 95 QLineEdit *m_pProductKeyLineEdit; 96 QLabel *m_pProductKeyLabel; 91 97 92 /** @} */ 98 93 QSet<QString> m_userModifiedParameters;
Note:
See TracChangeset
for help on using the changeset viewer.