Changeset 84918 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 23, 2020 1:12:08 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 138789
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.cpp
r84917 r84918 132 132 if (m_pUserNameLineEdit && m_pUserNameLineEdit->text().isEmpty()) 133 133 { 134 // mark user name the line edit134 markLineEdit(m_pUserNameLineEdit, true); 135 135 return false; 136 136 } 137 else 138 markLineEdit(m_pUserNameLineEdit, false); 139 bool fPasswordOK = true; 137 140 if (m_pPasswordLineEdit && m_pPasswordRepeatLineEdit) 138 141 { 139 142 if (m_pPasswordLineEdit->text() != m_pPasswordRepeatLineEdit->text()) 140 { 141 // mark password line edits 142 return false; 143 } 143 fPasswordOK = false; 144 144 if (m_pPasswordLineEdit->text().isEmpty()) 145 return false; 146 } 147 return true; 145 fPasswordOK = false; 146 } 147 markLineEdit(m_pPasswordLineEdit, !fPasswordOK); 148 markLineEdit(m_pPasswordRepeatLineEdit, !fPasswordOK); 149 return fPasswordOK; 148 150 } 149 151 … … 188 190 connect(pLineEdit, &T::textChanged, this, &UIUserNamePasswordEditor::sigSomeTextChanged); 189 191 return; 192 } 193 194 void UIUserNamePasswordEditor::markLineEdit(QLineEdit *pLineEdit, bool fError) 195 { 196 if (!pLineEdit) 197 return; 198 QPalette palette = pLineEdit->palette(); 199 if (fError) 200 palette.setColor(QPalette::Base, QColor(255, 180, 180)); 201 else 202 palette.setColor(QPalette::Base, m_orginalLineEditBaseColor); 203 pLineEdit->setPalette(palette); 190 204 } 191 205 … … 205 219 connect(m_pPasswordRepeatLineEdit, &UIPasswordLineEdit::sigTextVisibilityToggled, 206 220 this, &UIUserNamePasswordEditor::sltHandlePasswordVisibility); 221 /* Cache the original back color of the line edit to restore it correctly: */ 222 if (m_pUserNameLineEdit) 223 m_orginalLineEditBaseColor = m_pUserNameLineEdit->palette().color(QPalette::Base); 207 224 208 225 retranslateUi(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicInstallSetup.h
r84917 r84918 92 92 void retranslateUi(); 93 93 94 private slots: 95 96 void sltHandlePasswordVisibility(bool fPasswordVisible); 97 94 98 private: 95 99 … … 97 101 template <class T> 98 102 void addLineEdit(int &iRow, QLabel *&pLabel, T *&pLineEdit, QGridLayout *pLayout); 103 /** Changes @p pLineEdit's base color to indicate an error or reverts it to the original color. */ 104 void markLineEdit(QLineEdit *pLineEdit, bool fError); 99 105 100 106 QLineEdit *m_pUserNameLineEdit; … … 105 111 QLabel *m_pPasswordLabel; 106 112 QLabel *m_pPasswordRepeatLabel; 107 108 private slots: 109 110 void sltHandlePasswordVisibility(bool fPasswordVisible); 113 QColor m_orginalLineEditBaseColor; 111 114 }; 112 115 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasicNameType.cpp
r84917 r84918 355 355 void UIWizardNewVMPageBasicNameType::sltNameChanged(const QString &strNewName) 356 356 { 357 /* Call to base-class: */358 357 onNameChanged(strNewName); 359 358 composeMachineFilePath();
Note:
See TracChangeset
for help on using the changeset viewer.