Changeset 90165 in vbox
- Timestamp:
- Jul 13, 2021 8:13:50 AM (4 years ago)
- 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
r90164 r90165 79 79 return false; 80 80 } 81 82 void UIUserNamePasswordGroupBox::setLabelsVisible(bool fVisible) 83 { 84 if (m_pUserNamePasswordEditor) 85 m_pUserNamePasswordEditor->setLabelsVisible(fVisible); 86 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardNewVMEditors.h
r90164 r90165 57 57 void setPassword(const QString &strPassword); 58 58 bool isComplete(); 59 void setLabelsVisible(bool fVisible); 59 60 /** @} */ 60 61 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r90163 r90165 43 43 #include "UIUserNamePasswordEditor.h" 44 44 #include "UIWizardNewVM.h" 45 #include "UIWizardNewVMEditors.h" 45 46 #include "UIWizardNewVMPageExpert.h" 46 47 … … 264 265 265 266 // /* Connections for username, password, and hostname: */ 266 // if (m_pUserNamePassword Editor)267 // connect(m_pUserNamePassword Editor, &UIUserNamePasswordEditor::sigSomeTextChanged,267 // if (m_pUserNamePasswordGroupBox) 268 // connect(m_pUserNamePasswordGroupBox, &UIUserNamePasswordEditor::sigSomeTextChanged, 268 269 // this, &UIWizardNewVMPageExpert::completeChanged); 269 270 // if (m_pGAISOFilePathSelector) … … 402 403 pLayout->setContentsMargins(0, 0, 0, 0); 403 404 int iRow = 0; 404 405 /* Username selector: */406 pLayout->addWidget( createUserNameWidgets(), iRow, 0, 1, 2);405 m_pUserNamePasswordGroupBox = new UIUserNamePasswordGroupBox; 406 AssertReturn(m_pUserNamePasswordGroupBox, 0); 407 pLayout->addWidget(m_pUserNamePasswordGroupBox, iRow, 0, 1, 2); 407 408 408 409 /* Additional options: */ … … 520 521 // fIsComplete = false; 521 522 // } 522 // if (m_pUserNamePassword Editor)523 // { 524 // if (!m_pUserNamePassword Editor->isComplete())523 // if (m_pUserNamePasswordGroupBox) 524 // { 525 // if (!m_pUserNamePasswordGroupBox->isComplete()) 525 526 // { 526 527 // m_pToolBox->setPageTitleIcon(ExpertToolboxItems_Unattended, … … 860 861 } 861 862 862 QWidget *UIWizardNewVMPageExpert::createUserNameWidgets()863 {864 if (m_pUserNameContainer)865 return m_pUserNameContainer;866 867 m_pUserNameContainer = new QGroupBox;868 QVBoxLayout *pUserNameContainerLayout = new QVBoxLayout(m_pUserNameContainer);869 m_pUserNamePasswordEditor = new UIUserNamePasswordEditor;870 AssertReturn(m_pUserNamePasswordEditor, 0);871 872 m_pUserNamePasswordEditor->setLabelsVisible(true);873 m_pUserNamePasswordEditor->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);874 pUserNameContainerLayout->addWidget(m_pUserNamePasswordEditor);875 876 return m_pUserNameContainer;877 }878 879 863 QWidget *UIWizardNewVMPageExpert::createAdditionalOptionsWidgets() 880 864 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r90159 r90165 43 43 class UINameAndSystemEditor; 44 44 class UIToolBox; 45 class UIUserNamePassword Editor;45 class UIUserNamePasswordGroupBox; 46 46 class QIToolButton; 47 47 … … 114 114 CMediumFormat medFormat, bool fPreferred /* = false */); 115 115 QWidget *createNameOSTypeWidgets(); 116 QWidget *createUserNameWidgets();117 116 QWidget *createAdditionalOptionsWidgets(); 118 117 QWidget *createGAInstallWidgets(); … … 152 151 UIFilePathSelector *m_pGAISOFilePathSelector; 153 152 QGroupBox *m_pUserNameContainer; 154 UIUserNamePassword Editor *m_pUserNamePasswordEditor;153 UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox; 155 154 156 155 /** @} */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp
r90157 r90165 31 31 #include "UIFilePathSelector.h" 32 32 #include "UIIconPool.h" 33 #include "UI UserNamePasswordEditor.h"33 #include "UIWizardNewVMEditors.h" 34 34 #include "UIHostnameDomainNameEditor.h" 35 35 #include "UIWizardNewVMUnattendedPageBasic.h" … … 57 57 UIWizardNewVMUnattendedPageBasic::UIWizardNewVMUnattendedPageBasic() 58 58 : m_pLabel(0) 59 , m_pUserNameContainer(0)60 59 , m_pAdditionalOptionsContainer(0) 61 60 , m_pGAInstallationISOContainer(0) 62 61 , m_pStartHeadlessCheckBox(0) 63 , m_pUserNamePassword Editor(0)62 , m_pUserNamePasswordGroupBox(0) 64 63 , m_pHostnameDomainNameEditor(0) 65 64 , m_pGAISOPathLabel(0) … … 78 77 if (m_pLabel) 79 78 pMainLayout->addWidget(m_pLabel, 0, 0, 1, 2); 80 pMainLayout->addWidget(createUserNameWidgets(), 1, 0, 1, 1); 79 m_pUserNamePasswordGroupBox = new UIUserNamePasswordGroupBox; 80 AssertReturnVoid(m_pUserNamePasswordGroupBox); 81 pMainLayout->addWidget(m_pUserNamePasswordGroupBox, 1, 0, 1, 1); 81 82 pMainLayout->addWidget(createAdditionalOptionsWidgets(), 1, 1, 1, 1); 82 83 pMainLayout->addWidget(createGAInstallWidgets(), 2, 0, 1, 2); 83 84 pMainLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding), 3, 0, 1, 2); 84 85 85 86 createConnections(); 86 87 } 87 88 88 89 void UIWizardNewVMUnattendedPageBasic::createConnections() 89 90 { 90 if (m_pUserNamePassword Editor)91 { 92 connect(m_pUserNamePassword Editor, &UIUserNamePasswordEditor::sigPasswordChanged,91 if (m_pUserNamePasswordGroupBox) 92 { 93 connect(m_pUserNamePasswordGroupBox, &UIUserNamePasswordGroupBox::sigPasswordChanged, 93 94 this, &UIWizardNewVMUnattendedPageBasic::sltPasswordChanged); 94 connect(m_pUserNamePassword Editor, &UIUserNamePasswordEditor::sigUserNameChanged,95 connect(m_pUserNamePasswordGroupBox, &UIUserNamePasswordGroupBox::sigUserNameChanged, 95 96 this, &UIWizardNewVMUnattendedPageBasic::sltUserNameChanged); 96 97 } … … 132 133 if (m_pProductKeyLabel) 133 134 m_pProductKeyLabel->setText(UIWizardNewVM::tr("&Product Key:")); 134 if (m_pUserName Container)135 m_pUserName Container->setTitle(UIWizardNewVM::tr("Username and Password"));135 if (m_pUserNamePasswordGroupBox) 136 m_pUserNamePasswordGroupBox->setTitle(UIWizardNewVM::tr("Username and Password")); 136 137 if (m_pAdditionalOptionsContainer) 137 138 m_pAdditionalOptionsContainer->setTitle(UIWizardNewVM::tr("Additional Options")); … … 154 155 AssertReturnVoid(pWizard); 155 156 /* Initialize user/password if they are not modified by the user: */ 156 if (m_pUserNamePassword Editor)157 { 158 m_pUserNamePassword Editor->blockSignals(true);157 if (m_pUserNamePasswordGroupBox) 158 { 159 m_pUserNamePasswordGroupBox->blockSignals(true); 159 160 if (!m_userModifiedParameters.contains("UserName")) 160 m_pUserNamePassword Editor->setUserName(pWizard->userName());161 m_pUserNamePasswordGroupBox->setUserName(pWizard->userName()); 161 162 if (!m_userModifiedParameters.contains("Password")) 162 m_pUserNamePassword Editor->setPassword(pWizard->password());163 m_pUserNamePassword Editor->blockSignals(false);163 m_pUserNamePasswordGroupBox->setPassword(pWizard->password()); 164 m_pUserNamePasswordGroupBox->blockSignals(false); 164 165 } 165 166 if (m_pHostnameDomainNameEditor) … … 199 200 !UIWizardNewVMUnattendedPage::checkGAISOFile(m_pGAISOFilePathSelector)) 200 201 return false; 201 if (m_pUserNamePassword Editor && !m_pUserNamePasswordEditor->isComplete())202 if (m_pUserNamePasswordGroupBox && !m_pUserNamePasswordGroupBox->isComplete()) 202 203 return false; 203 204 if (m_pHostnameDomainNameEditor && !m_pHostnameDomainNameEditor->isComplete()) … … 267 268 { 268 269 newVMWizardPropertySet(StartHeadless, fStartHeadless); 269 }270 271 QWidget *UIWizardNewVMUnattendedPageBasic::createUserNameWidgets()272 {273 if (m_pUserNameContainer)274 return m_pUserNameContainer;275 276 m_pUserNameContainer = new QGroupBox;277 QVBoxLayout *pUserNameContainerLayout = new QVBoxLayout(m_pUserNameContainer);278 m_pUserNamePasswordEditor = new UIUserNamePasswordEditor;279 if (m_pUserNamePasswordEditor)280 {281 m_pUserNamePasswordEditor->setLabelsVisible(true);282 m_pUserNamePasswordEditor->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);283 pUserNameContainerLayout->addWidget(m_pUserNamePasswordEditor);284 }285 return m_pUserNameContainer;286 270 } 287 271 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h
r90157 r90165 34 34 class QIRichTextLabel; 35 35 class UIFilePathSelector; 36 class UIUserNamePassword Editor;36 class UIUserNamePasswordGroupBox; 37 37 class UIHostnameDomainNameEditor; 38 38 struct UIUnattendedInstallData; … … 73 73 void prepare(); 74 74 void createConnections(); 75 QWidget *createUserNameWidgets();76 75 QWidget *createAdditionalOptionsWidgets(); 77 76 QWidget *createGAInstallWidgets(); … … 89 88 * @{ */ 90 89 QIRichTextLabel *m_pLabel; 91 QGroupBox *m_pUserNameContainer;92 90 QGroupBox *m_pAdditionalOptionsContainer; 93 91 QGroupBox *m_pGAInstallationISOContainer; 94 92 QCheckBox *m_pStartHeadlessCheckBox; 95 UIUserNamePassword Editor *m_pUserNamePasswordEditor;93 UIUserNamePasswordGroupBox *m_pUserNamePasswordGroupBox; 96 94 UIHostnameDomainNameEditor *m_pHostnameDomainNameEditor; 97 95 QLabel *m_pGAISOPathLabel;
Note:
See TracChangeset
for help on using the changeset viewer.