Changeset 42253 in vbox
- Timestamp:
- Jul 20, 2012 11:33:08 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r41819 r42253 56 56 /* Setup widgets: */ 57 57 m_pAdapterNameCombo->setInsertPolicy(QComboBox::NoInsert); 58 m_pMACEditor->setValidator(new QRegExpValidator(QRegExp("[0-9A-Fa-f] [02468ACEace][0-9A-Fa-f]{10}"), this));58 m_pMACEditor->setValidator(new QRegExpValidator(QRegExp("[0-9A-Fa-f]{12}"), this)); 59 59 m_pMACEditor->setMinimumWidthByText(QString().fill('0', 12)); 60 60 … … 164 164 { 165 165 m_pValidator = pValidator; 166 connect(m_pMACEditor, SIGNAL(textEdited(const QString &)), m_pValidator, SLOT(revalidate())); 166 167 } 167 168 … … 215 216 break; 216 217 } 218 219 /* Validate MAC-address: */ 220 if (m_pMACEditor->text().size() < 12) 221 { 222 strWarning = tr("the value of the Mac address field in not complete."); 223 fValid = false; 224 } 225 else 226 { 227 QRegExp validator("[0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}"); 228 if (!validator.exactMatch(m_pMACEditor->text())) 229 { 230 strWarning = tr("the second digit cannot be odd, as only unicast Mac addresses allowed."); 231 fValid = false; 232 } 233 } 234 217 235 if (!fValid) 218 236 strTitle += ": " + vboxGlobal().removeAccelMark(tabTitle());
Note:
See TracChangeset
for help on using the changeset viewer.