Changeset 90037 in vbox
- Timestamp:
- Jul 5, 2021 7:14:04 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.cpp
r88267 r90037 206 206 , m_pPasswordLabel(0) 207 207 , m_pPasswordRepeatLabel(0) 208 , m_fForceUnmark(false)209 208 , m_fShowPlaceholderText(true) 210 209 , m_fLabelsVisible(true) … … 256 255 if (m_pPasswordLineEdit->text() != m_pPasswordRepeatLineEdit->text()) 257 256 fPasswordOK = false; 257 #if 0 258 258 if (m_pPasswordLineEdit->text().isEmpty()) 259 259 fPasswordOK = false; 260 260 #endif 261 261 m_pPasswordLineEdit->mark(!fPasswordOK, m_strPasswordError); 262 262 m_pPasswordRepeatLineEdit->mark(!fPasswordOK, m_strPasswordError); … … 270 270 bool fPasswordField = isPasswordComplete(); 271 271 return fUserNameField && fPasswordField; 272 }273 274 void UIUserNamePasswordEditor::setForceUnmark(bool fForceUnmark)275 {276 m_fForceUnmark = fForceUnmark;277 isUserNameComplete();278 isPasswordComplete();279 272 } 280 273 … … 355 348 pLayout->addWidget(pLabel, iRow, 0, 1, 1); 356 349 357 358 350 pLineEdit = new T; 359 351 if (!pLineEdit) … … 363 355 pLabel->setBuddy(pLineEdit); 364 356 ++iRow; 365 connect(pLineEdit, &T::textChanged, this, &UIUserNamePasswordEditor::sltSomeTextChanged);366 357 return; 367 358 } … … 385 376 connect(m_pPasswordRepeatLineEdit, &UIPasswordLineEdit::sigTextVisibilityToggled, 386 377 this, &UIUserNamePasswordEditor::sltHandlePasswordVisibility); 378 connect(m_pPasswordLineEdit, &UIPasswordLineEdit::textChanged, 379 this, &UIUserNamePasswordEditor::sltPasswordChanged); 380 connect(m_pUserNameLineEdit, &QILineEdit::textChanged, 381 this, &UIUserNamePasswordEditor::sltUserNameChanged); 382 387 383 /* Cache the original back color of the line edit to restore it correctly: */ 388 384 if (m_pUserNameLineEdit) … … 400 396 } 401 397 402 void UIUserNamePasswordEditor::sltSomeTextChanged() 403 { 404 /* Check text lines edits and mark them accordingly: */ 405 isComplete(); 406 emit sigSomeTextChanged(); 407 } 398 void UIUserNamePasswordEditor::sltUserNameChanged() 399 { 400 if (isUserNameComplete()) 401 emit sigUserNameChanged(m_pUserNameLineEdit->text()); 402 } 403 404 void UIUserNamePasswordEditor::sltPasswordChanged() 405 { 406 if (isPasswordComplete()) 407 emit sigPasswordChanged(m_pPasswordLineEdit->text()); 408 } 409 408 410 409 411 #include "UIUserNamePasswordEditor.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIUserNamePasswordEditor.h
r87734 r90037 42 42 signals: 43 43 44 /** this is emitted whenever the content of one of the line edits is changed. */ 45 void sigSomeTextChanged(); 44 void sigUserNameChanged(const QString &strUserName); 45 void sigPasswordChanged(const QString &strPassword); 46 46 47 47 48 public: … … 57 58 /** Returns false if username or password fields are empty, or password fields do not match. */ 58 59 bool isComplete(); 59 /** Sets m_fForceUnmark flag. see it for more info. */60 void setForceUnmark(bool fForceUnmark);61 60 62 61 /** When fEnabled true place holder texts for the line edits are shown. */ … … 71 70 72 71 void sltHandlePasswordVisibility(bool fPasswordVisible); 73 void sltSomeTextChanged(); 72 void sltUserNameChanged(); 73 void sltPasswordChanged(); 74 74 75 75 private: … … 90 90 QLabel *m_pPasswordRepeatLabel; 91 91 QColor m_orginalLineEditBaseColor; 92 /** When true line edits are not marked even if they have to be. */ 93 bool m_fForceUnmark; 92 94 93 bool m_fShowPlaceholderText; 95 94 bool m_fLabelsVisible; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r90033 r90037 630 630 } 631 631 632 QString UIWizardNewVM::ISOFilePath() const633 {634 // QString strPath = getStringFieldValue("ISOFilePath");635 // if (strPath.isNull() || strPath.isEmpty())636 // return QString();637 // QFileInfo isoFileInfo(strPath);638 // if (isoFileInfo.exists() && isoFileInfo.isReadable())639 // return strPath;640 return QString();641 }642 643 632 CMedium &UIWizardNewVM::virtualDisk() 644 633 { … … 735 724 } 736 725 726 const QString &UIWizardNewVM::ISOFilePath() const 727 { 728 return m_strISOFilePath; 729 } 730 731 void UIWizardNewVM::setISOFilePath(const QString &strISOFilePath) 732 { 733 m_strISOFilePath = strISOFilePath; 734 } 735 736 const QString &UIWizardNewVM::userName() const 737 { 738 return m_strUserName; 739 } 740 741 void UIWizardNewVM::setUserName(const QString &strUserName) 742 { 743 m_strUserName = strUserName; 744 } 745 746 const QString &UIWizardNewVM::password() const 747 { 748 return m_strPassword; 749 } 750 751 void UIWizardNewVM::setPassword(const QString &strPassword) 752 { 753 m_strPassword = strPassword; 754 } 755 737 756 const UIUnattendedInstallData &UIWizardNewVM::unattendedInstallData() const 738 757 { 739 // m_unattendedInstallData.m_strISOPath = getStringFieldValue("ISOFilePath");758 m_unattendedInstallData.m_strISOPath = m_strISOFilePath; 740 759 // m_unattendedInstallData.m_strUserName = getStringFieldValue("userName"); 741 760 // m_unattendedInstallData.m_strHostname = getStringFieldValue("hostname"); 742 761 // m_unattendedInstallData.m_strPassword = getStringFieldValue("password"); 743 // m_unattendedInstallData.m_strDetectedOSTypeId = getStringFieldValue("detectedOSTypeId");762 m_unattendedInstallData.m_strDetectedOSTypeId = m_strDetectedOSTypeId; 744 763 // // m_unattendedInstallData.m_strDetectedOSVersion = getStringFieldValue("detectedOSVersion"); 745 764 // // m_unattendedInstallData.m_strDetectedOSFlavor = getStringFieldValue("detectedOSFlavor"); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r90033 r90037 111 111 void setInstallGuestAdditions(bool fInstallGA); 112 112 113 const QString &ISOFilePath() const; 114 void setISOFilePath(const QString &strISOFilePath); 115 116 const QString &userName() const; 117 void setUserName(const QString &strUserName); 118 119 const QString &password() const; 120 void setPassword(const QString &strPassword); 121 113 122 protected: 114 123 … … 138 147 QString getNextControllerName(KStorageBus type); 139 148 void setFieldsFromDefaultUnttendedInstallData(); 140 /* Returns ISO file path if a readable ISO file is selected. Returns an empty string otherwise. */141 QString ISOFilePath() const;142 149 143 150 /** @name Variables … … 154 161 mutable UIUnattendedInstallData m_unattendedInstallData; 155 162 /** @} */ 163 164 /** Path of the ISO file attached to the new vm. Possibly used for the unattended install. */ 165 QString m_strISOFilePath; 156 166 157 167 /** Path of the folder created by this wizard page. Used to remove previously created … … 174 184 /** True if guest additions are to be installed during unattended install. */ 175 185 bool m_fInstallGuestAdditions; 186 187 QString m_strUserName; 188 QString m_strPassword; 176 189 }; 177 190 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.cpp
r90033 r90037 463 463 { 464 464 UIWizardNewVMNameOSTypePage::determineOSType(strPath, m_pWizard); 465 if (m_pWizard && !m_pWizard->detectedOSTypeId().isEmpty()) 466 UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, m_pWizard->detectedOSTypeId()); 465 if (m_pWizard) 466 { 467 if (!m_pWizard->detectedOSTypeId().isEmpty()) 468 UIWizardNewVMNameOSTypePage::onNameChanged(m_pNameAndSystemEditor, m_pWizard->detectedOSTypeId()); 469 m_pWizard->setISOFilePath(strPath); 470 } 467 471 /* Update the global recent ISO path: */ 468 472 QFileInfo fileInfo(strPath); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMNameOSTypePageBasic.h
r90033 r90037 53 53 /** Return false if ISO path is not empty but points to an missing or unreadable file. */ 54 54 bool checkISOFile(UINameAndSystemEditor *pNameAndSystemEditor); 55 // /** @name Property getters/setters56 // * @{ */57 55 58 56 // QString guestOSFamiyId() const; 59 60 57 // const QString &detectedOSTypeId() const; 61 62 58 // bool skipUnattendedInstall() const; 63 // /** @} */64 65 66 // /** Colors the widgets red if they cause isComplete to fail. */67 // void retranslateWidgets();68 // QString ISOFilePath() const;69 70 71 //72 73 // private:74 75 76 // };77 59 } 78 60 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.cpp
r90033 r90037 85 85 86 86 87 // void UIWizardNewVMUnattendedPage::setInstallGuestAdditions(bool fInstallGA)88 // {89 // if (m_pGAInstallationISOContainer)90 // m_pGAInstallationISOContainer->setChecked(fInstallGA);91 // }92 87 93 88 // QString UIWizardNewVMUnattendedPage::guestAdditionsISOPath() const … … 171 166 void UIWizardNewVMUnattendedPageBasic::createConnections() 172 167 { 173 if (m_pUserNamePasswordEditor)174 connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged,175 this, &UIWizardNewVMUnattendedPageBasic::completeChanged);168 // if (m_pUserNamePasswordEditor) 169 // connect(m_pUserNamePasswordEditor, &UIUserNamePasswordEditor::sigSomeTextChanged, 170 // this, &UIWizardNewVMUnattendedPageBasic::completeChanged); 176 171 if (m_pGAISOFilePathSelector) 177 172 connect(m_pGAISOFilePathSelector, &UIFilePathSelector::pathChanged, -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMUnattendedPageBasic.h
r90033 r90037 87 87 void sltInstallGACheckBoxToggle(bool fChecked); 88 88 void sltGAISOPathChanged(const QString &strPath); 89 // void sltPasswordChanged(const QString &strPassword); 90 // void sltUserNameChanged(const QString &strUserName); 89 91 90 92 private:
Note:
See TracChangeset
for help on using the changeset viewer.