Changeset 84906 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 22, 2020 2:34:49 PM (5 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r84892 r84906 1894 1894 comUnattendedInstaller.SetMachine(comMachine); 1895 1895 checkUnattendedInstallError(comUnattendedInstaller); 1896 comUnattendedInstaller.SetUser(unattendedData.m_strUserName); 1897 comUnattendedInstaller.SetPassword(unattendedData.m_strPassword); 1896 1898 comUnattendedInstaller.Prepare(); 1897 1899 checkUnattendedInstallError(comUnattendedInstaller); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r84892 r84906 514 514 { 515 515 m_unattendedInstallData = unattendedInstallData; 516 UIWizardNewVMPageBasicInstallSetup *pPage = qobject_cast<UIWizardNewVMPageBasicInstallSetup *>(page(PageInstallSetup)); 517 if (pPage) 518 pPage->setDefaultUnattendedInstallData(unattendedInstallData); 516 519 } 517 520 … … 529 532 if (!fieldValue.isNull() && fieldValue.isValid() && fieldValue.canConvert(QMetaType::Bool)) 530 533 m_unattendedInstallData.m_fStartHeadless = fieldValue.toBool(); 534 535 fieldValue = field("userName"); 536 if (!fieldValue.isNull() && fieldValue.isValid() && fieldValue.canConvert(QMetaType::QString)) 537 m_unattendedInstallData.m_strUserName = fieldValue.toString(); 538 539 fieldValue = field("password"); 540 if (!fieldValue.isNull() && fieldValue.isValid() && fieldValue.canConvert(QMetaType::QString)) 541 m_unattendedInstallData.m_strPassword = fieldValue.toString(); 531 542 532 543 m_unattendedInstallData.m_uMachineUid = createdMachineId(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.cpp
r84890 r84906 47 47 } 48 48 49 QString UIUserNamePasswordEditor::userName() const 50 { 51 if (m_pUserNameField) 52 return m_pUserNameField->text(); 53 return QString(); 54 } 55 56 void UIUserNamePasswordEditor::setUserName(const QString &strUserName) 57 { 58 if (m_pUserNameField) 59 return m_pUserNameField->setText(strUserName); 60 } 61 62 QString UIUserNamePasswordEditor::password() const 63 { 64 if (m_pPasswordField) 65 return m_pPasswordField->text(); 66 return QString(); 67 } 68 69 void UIUserNamePasswordEditor::setPassword(const QString &strPassword) 70 { 71 if (m_pPasswordField) 72 m_pPasswordField->setText(strPassword); 73 if (m_pPasswordRepeatField) 74 m_pPasswordRepeatField->setText(strPassword); 75 } 76 49 77 void UIUserNamePasswordEditor::retranslateUi() 50 78 { … … 68 96 } 69 97 70 void UIUserNamePasswordEditor::add Field(QLabel *&pLabel, QLineEdit *&pLineEdit, QGridLayout *pLayout, bool fIsPasswordField /* = false */)98 void UIUserNamePasswordEditor::addLineEdit(QLabel *&pLabel, QLineEdit *&pLineEdit, QGridLayout *pLayout, bool fIsPasswordField /* = false */) 71 99 { 72 100 static int iRow = 0; … … 97 125 setLayout(pMainLayout); 98 126 99 addField(m_pUserNameFieldLabel, m_pUserNameField, pMainLayout); 100 addField(m_pPasswordFieldLabel, m_pPasswordField, pMainLayout, true); 101 addField(m_pPasswordRepeatFieldLabel, m_pPasswordRepeatField, pMainLayout, true); 127 addLineEdit(m_pUserNameFieldLabel, m_pUserNameField, pMainLayout); 128 addLineEdit(m_pPasswordFieldLabel, m_pPasswordField, pMainLayout, true); 129 addLineEdit(m_pPasswordRepeatFieldLabel, m_pPasswordRepeatField, pMainLayout, true); 130 102 131 retranslateUi(); 103 132 } … … 107 136 { 108 137 } 138 139 QString UIWizardNewVMPageInstallSetup::userName() const 140 { 141 if (m_pUserNamePasswordEditor) 142 return m_pUserNamePasswordEditor->userName(); 143 return QString(); 144 } 145 146 QString UIWizardNewVMPageInstallSetup::password() const 147 { 148 if (m_pUserNamePasswordEditor) 149 return m_pUserNamePasswordEditor->password(); 150 return QString(); 151 } 152 109 153 110 154 UIWizardNewVMPageBasicInstallSetup::UIWizardNewVMPageBasicInstallSetup() … … 126 170 } 127 171 172 128 173 /* Register fields: */ 129 // registerField("baseMemory", this, "baseMemory"); 130 // registerField("VCPUCount", this, "VCPUCount"); 174 registerField("userName", this, "userName"); 175 registerField("password", this, "password"); 176 } 177 178 void UIWizardNewVMPageBasicInstallSetup::setDefaultUnattendedInstallData(const UIUnattendedInstallData &unattendedInstallData) 179 { 180 /* Initialize the widget data: */ 181 182 if (m_pUserNamePasswordEditor) 183 { 184 m_pUserNamePasswordEditor->setUserName(unattendedInstallData.m_strUserName); 185 m_pUserNamePasswordEditor->setPassword(unattendedInstallData.m_strPassword); 186 } 131 187 } 132 188 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.h
r84889 r84906 35 35 class QSpinBox; 36 36 class QIRichTextLabel; 37 struct UIUnattendedInstallData; 37 38 38 39 class UIUserNamePasswordEditor : public QIWithRetranslateUI<QWidget> … … 45 46 UIUserNamePasswordEditor(QWidget *pParent = 0); 46 47 48 QString userName() const; 49 void setUserName(const QString &strUserName); 50 51 QString password() const; 52 void setPassword(const QString &strPassword); 53 47 54 protected: 48 55 … … 52 59 53 60 void prepare(); 54 void add Field(QLabel *&pLabel, QLineEdit *&pLineEdit, QGridLayout *pLayout, bool fIsPasswordField = false);61 void addLineEdit(QLabel *&pLabel, QLineEdit *&pLineEdit, QGridLayout *pLayout, bool fIsPasswordField = false); 55 62 56 63 QLineEdit *m_pUserNameField; … … 67 74 class UIWizardNewVMPageInstallSetup : public UIWizardPageBase 68 75 { 76 public: 77 78 UIWizardNewVMPageInstallSetup(); 79 80 QString userName() const; 81 QString password() const; 82 69 83 protected: 70 84 71 /* Constructor: */72 UIWizardNewVMPageInstallSetup();73 85 74 86 … … 81 93 { 82 94 Q_OBJECT; 95 Q_PROPERTY(QString userName READ userName); 96 Q_PROPERTY(QString password READ password); 83 97 84 98 public: … … 86 100 /* Constructor: */ 87 101 UIWizardNewVMPageBasicInstallSetup(); 102 void setDefaultUnattendedInstallData(const UIUnattendedInstallData &unattendedInstallData); 88 103 89 104 private slots:
Note:
See TracChangeset
for help on using the changeset viewer.