Changeset 23734 in vbox
- Timestamp:
- Oct 13, 2009 2:49:07 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 53454
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
r23723 r23734 53 53 class QLabel; 54 54 class QSpacerItem; 55 class QIWidgetValidator; 55 56 56 57 /* Local forwards */ … … 394 395 virtual void accept(); 395 396 397 void revalidate (QIWidgetValidator *aValidator); 398 void enableOk (const QIWidgetValidator *aValidator); 399 396 400 protected: 397 401 … … 401 405 402 406 VBoxSettingsPage *mSettings; 407 QIDialogButtonBox *mButtonBox; 403 408 CSession &mSession; 404 409 }; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r23723 r23734 43 43 #include "QIStateIndicator.h" 44 44 #include "QIStatusBar.h" 45 #include "QIWidgetValidator.h" 45 46 #include "VBoxConsoleWnd.h" 46 47 #include "VBoxConsoleView.h" … … 3413 3414 : QIWithRetranslateUI <QDialog> (aParent) 3414 3415 , mSettings (0) 3416 , mButtonBox (0) 3415 3417 , mSession (aSession) 3416 3418 { … … 3431 3433 mSettings->getFrom (aSession.GetMachine()); 3432 3434 3435 /* Setup validation */ 3436 QIWidgetValidator *validator = new QIWidgetValidator (mSettings, this); 3437 mSettings->setValidator (validator); 3438 3433 3439 /* Setup button's layout */ 3434 QIDialogButtonBox *buttonBox = new QIDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help); 3435 3436 connect (buttonBox, SIGNAL (helpRequested()), &vboxProblem(), SLOT (showHelpHelpDialog())); 3437 connect (buttonBox, SIGNAL (accepted()), this, SLOT (accept())); 3438 connect (buttonBox, SIGNAL (rejected()), this, SLOT (reject())); 3439 mainLayout->addWidget (buttonBox); 3440 mButtonBox = new QIDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help); 3441 mainLayout->addWidget (mButtonBox); 3442 3443 connect (mButtonBox, SIGNAL (helpRequested()), &vboxProblem(), SLOT (showHelpHelpDialog())); 3444 connect (mButtonBox, SIGNAL (accepted()), this, SLOT (accept())); 3445 connect (mButtonBox, SIGNAL (rejected()), this, SLOT (reject())); 3446 connect (validator, SIGNAL (isValidRequested (QIWidgetValidator*)), 3447 this, SLOT (revalidate (QIWidgetValidator*))); 3448 connect (validator, SIGNAL (validityChanged (const QIWidgetValidator*)), 3449 this, SLOT (enableOk (const QIWidgetValidator*))); 3440 3450 3441 3451 retranslateUi(); … … 3455 3465 vboxProblem().cannotSaveMachineSettings (machine); 3456 3466 QDialog::accept(); 3467 } 3468 3469 void VBoxStorageDialog::revalidate (QIWidgetValidator *aValidator) 3470 { 3471 QString warning, title; 3472 bool valid = mSettings->revalidate (warning, title); 3473 aValidator->setOtherValid (valid); 3474 } 3475 3476 void VBoxStorageDialog::enableOk (const QIWidgetValidator *aValidator) 3477 { 3478 mButtonBox->button (QDialogButtonBox::Ok)->setEnabled (aValidator->isValid()); 3457 3479 } 3458 3480
Note:
See TracChangeset
for help on using the changeset viewer.