Changeset 20568 in vbox
- Timestamp:
- Jun 14, 2009 8:52:22 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 48572
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxRegistrationDlg.h
r19225 r20568 52 52 private slots: 53 53 54 void tuneRadioButton (const QString &aNewText);54 void radioButtonToggled(); 55 55 56 56 void accept(); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxRegistrationDlg.cpp
r19413 r20568 237 237 mLeNewFirstName->setMaxLength (50); 238 238 239 mLeNewFirstName->setValidator (new QRegExpValidator (nameExp, this));239 mLeNewFirstName->setValidator (new QRegExpValidator (nameExp, this)); 240 240 241 241 mLeNewLastName->setMaxLength (50); … … 264 264 this, SLOT (revalidate (QIWidgetValidator *))); 265 265 266 connect (mRbOld, SIGNAL (toggled (bool)), mWvalReg, SLOT (revalidate())); 267 connect (mRbNew, SIGNAL (toggled (bool)), mWvalReg, SLOT (revalidate())); 268 269 connect (mLeOldEmail, SIGNAL (textEdited (const QString &)), 270 this, SLOT (tuneRadioButton (const QString &))); 271 connect (mLeOldPassword, SIGNAL (textEdited (const QString &)), 272 this, SLOT (tuneRadioButton (const QString &))); 273 connect (mLeNewFirstName, SIGNAL (textEdited (const QString &)), 274 this, SLOT (tuneRadioButton (const QString &))); 275 connect (mLeNewLastName, SIGNAL (textEdited (const QString &)), 276 this, SLOT (tuneRadioButton (const QString &))); 277 connect (mLeNewCompany, SIGNAL (textEdited (const QString &)), 278 this, SLOT (tuneRadioButton (const QString &))); 279 connect (mLeNewCountry, SIGNAL (textEdited (const QString &)), 280 this, SLOT (tuneRadioButton (const QString &))); 281 connect (mLeNewEmail, SIGNAL (textEdited (const QString &)), 282 this, SLOT (tuneRadioButton (const QString &))); 283 connect (mLeNewPassword, SIGNAL (textEdited (const QString &)), 284 this, SLOT (tuneRadioButton (const QString &))); 285 connect (mLeNewPassword2, SIGNAL (textEdited (const QString &)), 286 this, SLOT (tuneRadioButton (const QString &))); 266 connect (mRbOld, SIGNAL (toggled (bool)), this, SLOT (radioButtonToggled())); 267 connect (mRbNew, SIGNAL (toggled (bool)), this, SLOT (radioButtonToggled())); 287 268 288 269 /* Setup other connections */ … … 294 275 mLeOldEmail->setText (data.account()); 295 276 296 /* Update the next button state for pages with validation 297 * (validityChanged() connected to enableNext() will do the job) */ 298 mWvalReg->revalidate(); 277 radioButtonToggled(); 299 278 300 279 /* Initialize wizard hdr */ … … 325 304 } 326 305 327 void VBoxRegistrationDlg::tuneRadioButton (const QString &aNewText) 328 { 329 QList <QLineEdit*> oldSet; 330 oldSet << mLeOldEmail << mLeOldPassword; 331 332 QList <QLineEdit*> newSet; 333 newSet << mLeNewFirstName << mLeNewLastName 334 << mLeNewCompany << mLeNewCountry 335 << mLeNewEmail << mLeNewPassword << mLeNewPassword2; 336 337 QLineEdit *le = qobject_cast <QLineEdit*> (sender()); 338 339 if (le && !aNewText.isEmpty() && oldSet.contains (le)) 340 mRbOld->setChecked (true); 341 else if (le && !aNewText.isEmpty() && newSet.contains (le)) 342 mRbNew->setChecked (true); 306 void VBoxRegistrationDlg::radioButtonToggled() 307 { 308 QRadioButton *current = mRbOld->isChecked() ? mRbOld : mRbNew; 309 310 mLeOldEmail->setEnabled (current == mRbOld); 311 mLeOldPassword->setEnabled (current == mRbOld); 312 mLeNewFirstName->setEnabled (current == mRbNew); 313 mLeNewLastName->setEnabled (current == mRbNew); 314 mLeNewCompany->setEnabled (current == mRbNew); 315 mLeNewCountry->setEnabled (current == mRbNew); 316 mLeNewEmail->setEnabled (current == mRbNew); 317 mLeNewPassword->setEnabled (current == mRbNew); 318 mLeNewPassword2->setEnabled (current == mRbNew); 343 319 344 320 mWvalReg->revalidate(); … … 395 371 396 372 /* Enable control elements */ 397 mLeOldEmail->setEnabled (true); 398 mLeOldPassword->setEnabled (true); 399 mLeNewFirstName->setEnabled (true); 400 mLeNewLastName->setEnabled (true); 401 mLeNewCompany->setEnabled (true); 402 mLeNewCountry->setEnabled (true); 403 mLeNewEmail->setEnabled (true); 404 mLeNewPassword->setEnabled (true); 405 mLeNewPassword2->setEnabled (true); 373 radioButtonToggled(); 406 374 finishButton()->setEnabled (true); 407 375 cancelButton()->setEnabled (true);
Note:
See TracChangeset
for help on using the changeset viewer.