Changeset 47573 in vbox
- Timestamp:
- Aug 7, 2013 9:57:28 AM (11 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
r47563 r47573 337 337 QString strPageTitle = m_pSelector->itemTextByPage(pSettingsPage); 338 338 QString strMessageText; 339 bool fIsValid = pSettingsPage-> revalidate(strMessageText, strPageTitle);339 bool fIsValid = pSettingsPage->validate(strMessageText, strPageTitle); 340 340 341 341 /* Remember revalidation result: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp
r36594 r47573 18 18 */ 19 19 20 /* Local includes*/20 /* GUI includes: */ 21 21 #include "UISettingsPage.h" 22 #include "QIWidgetValidator.h" 22 23 23 24 /* Settings page constructor, hidden: */ … … 29 30 , m_fFailed(false) 30 31 , m_pFirstWidget(0) 32 , m_pValidator(0) 31 33 { 34 } 35 36 void UISettingsPage::setValidator(UIPageValidator *pValidator) 37 { 38 /* Make sure validator is not yet assigned: */ 39 AssertMsg(!m_pValidator, ("Validator already assigned!\n")); 40 if (m_pValidator) 41 return; 42 43 /* Assign validator: */ 44 m_pValidator = pValidator; 45 } 46 47 void UISettingsPage::revalidate() 48 { 49 /* Revalidate if possible: */ 50 if (m_pValidator) 51 m_pValidator->revalidate(); 32 52 } 33 53 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
r47563 r47573 93 93 94 94 /* Validation stuff: */ 95 v irtual void setValidator(UIPageValidator* /* pValidator */) {}96 virtual bool revalidate(QString& /* strWarningText */, QString& /* strTitle */) { return true; }95 void setValidator(UIPageValidator *pValidator); 96 virtual bool validate(QString& /* strWarningText */, QString& /* strTitle */) { return true; } 97 97 98 98 /* Navigation stuff: */ … … 129 129 virtual void polishPage() {} 130 130 131 public slots: 132 133 /* Handler: Validation stuff: */ 134 void revalidate(); 135 131 136 protected: 132 137 … … 136 141 private: 137 142 138 /* Private variables: */143 /* Variables: */ 139 144 UISettingsPageType m_pageType; 140 145 SettingsDialogType m_dialogType; … … 143 148 bool m_fFailed; 144 149 QWidget *m_pFirstWidget; 150 UIPageValidator *m_pValidator; 145 151 }; 146 152 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
r47563 r47573 36 36 /* Input page constructor: */ 37 37 UIGlobalSettingsInput::UIGlobalSettingsInput() 38 : m_pValidator(0) 39 , m_pTabWidget(0) 38 : m_pTabWidget(0) 40 39 , m_pSelectorFilterEditor(0), m_pSelectorModel(0), m_pSelectorTable(0) 41 40 , m_pMachineFilterEditor(0), m_pMachineModel(0), m_pMachineTable(0) … … 81 80 setTabOrder(m_pMachineFilterEditor, m_pMachineTable); 82 81 82 /* Prepare validation: */ 83 prepareValidation(); 84 83 85 /* Apply language settings: */ 84 86 retranslateUi(); … … 120 122 m_pEnableAutoGrabCheckbox->setChecked(m_cache.m_fAutoCapture); 121 123 122 /* Revalidate if possible: */ 123 if (m_pValidator) 124 m_pValidator->revalidate(); 124 /* Revalidate: */ 125 revalidate(); 125 126 } 126 127 … … 160 161 } 161 162 162 void UIGlobalSettingsInput::setValidator(UIPageValidator *pValidator) 163 { 164 /* Configure validation: */ 165 m_pValidator = pValidator; 166 connect(m_pSelectorModel, SIGNAL(sigRevalidationRequired()), m_pValidator, SLOT(revalidate())); 167 connect(m_pMachineModel, SIGNAL(sigRevalidationRequired()), m_pValidator, SLOT(revalidate())); 168 } 169 170 bool UIGlobalSettingsInput::revalidate(QString &strWarning, QString &strTitle) 163 bool UIGlobalSettingsInput::validate(QString &strWarning, QString &strTitle) 171 164 { 172 165 /* Check for unique shortcuts: */ … … 184 177 } 185 178 179 /* Pass by default: */ 186 180 return true; 187 181 } … … 209 203 m_pSelectorFilterEditor->setWhatsThis(tr("Enter a sequence to filter the shortcut list.")); 210 204 m_pMachineFilterEditor->setWhatsThis(tr("Enter a sequence to filter the shortcut list.")); 205 } 206 207 void UIGlobalSettingsInput::prepareValidation() 208 { 209 /* Prepare validation: */ 210 connect(m_pSelectorModel, SIGNAL(sigRevalidationRequired()), this, SLOT(revalidate())); 211 connect(m_pMachineModel, SIGNAL(sigRevalidationRequired()), this, SLOT(revalidate())); 211 212 } 212 213 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.h
r47563 r47573 140 140 141 141 /* API: Validation stuff: */ 142 void setValidator(UIPageValidator *pValidator); 143 bool revalidate(QString &strWarning, QString &strTitle); 142 bool validate(QString &strWarning, QString &strTitle); 144 143 145 144 /* Helper: Navigation stuff: */ … … 151 150 private: 152 151 153 /* Variable: Validationstuff: */154 UIPageValidator *m_pValidator;152 /* Helper: Prepare stuff: */ 153 void prepareValidation(); 155 154 156 155 /* Cache: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp
r47563 r47573 58 58 59 59 /* Validation stuff: */ 60 bool UIHostInterfaceItem:: revalidate(QString &strWarning, QString & /* strTitle */)60 bool UIHostInterfaceItem::validate(QString &strWarning, QString&) 61 61 { 62 62 /* Host-only interface validation: */ … … 196 196 /* Network page constructor: */ 197 197 UIGlobalSettingsNetwork::UIGlobalSettingsNetwork() 198 : m_pValidator(0) 199 , m_pAddAction(0), m_pDelAction(0), m_pEditAction(0) 198 : m_pAddAction(0), m_pDelAction(0), m_pEditAction(0) 200 199 , m_fChanged(false) 201 200 { … … 276 275 sltUpdateCurrentItem(); 277 276 278 /* Revalidate if possible: */ 279 if (m_pValidator) 280 m_pValidator->revalidate(); 277 /* Revalidate: */ 278 revalidate(); 281 279 } 282 280 … … 372 370 } 373 371 374 void UIGlobalSettingsNetwork::setValidator(UIPageValidator *pValidator)375 {376 /* Configure validation: */377 m_pValidator = pValidator;378 }379 380 372 /* Validation processing: */ 381 bool UIGlobalSettingsNetwork::revalidate(QString &strWarning, QString &strTitle) 382 { 373 bool UIGlobalSettingsNetwork::validate(QString &strWarning, QString &strTitle) 374 { 375 /* Redirect validation to items: */ 383 376 UIHostInterfaceItem *pItem = static_cast<UIHostInterfaceItem*>(m_pInterfacesTree->currentItem()); 384 return pItem ? pItem-> revalidate(strWarning, strTitle) : true;377 return pItem ? pItem->validate(strWarning, strTitle) : true; 385 378 } 386 379 … … 505 498 m_fChanged = true; 506 499 507 /* Revalidate if possible: */ 508 if (m_pValidator) 509 m_pValidator->revalidate(); 500 /* Revalidate: */ 501 revalidate(); 510 502 } 511 503 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.h
r47563 r47573 97 97 98 98 /* API: Validation stuff: */ 99 bool revalidate(QString &strWarning, QString &strTitle);99 bool validate(QString &strWarning, QString &strTitle); 100 100 101 101 /* API: Update stuff: */ … … 164 164 165 165 /* API: Validation stuff: */ 166 void setValidator(UIPageValidator *pValidator); 167 bool revalidate(QString &strWarning, QString &strTitle); 166 bool validate(QString &strWarning, QString &strTitle); 168 167 169 168 /* Navigation stuff: */ … … 190 189 void removeListItem(UIHostInterfaceItem *pItem); 191 190 192 /* Variable: Validation stuff: */193 UIPageValidator *m_pValidator;194 195 191 /* Helper actions: */ 196 192 QAction *m_pAddAction; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.cpp
r47563 r47573 28 28 /* General page constructor: */ 29 29 UIGlobalSettingsProxy::UIGlobalSettingsProxy() 30 : m_pValidator(0)31 30 { 32 31 /* Apply UI decorations: */ … … 72 71 sltProxyToggled(); 73 72 74 /* Revalidate if possible: */ 75 if (m_pValidator) 76 m_pValidator->revalidate(); 73 /* Revalidate: */ 74 revalidate(); 77 75 } 78 76 … … 104 102 } 105 103 106 void UIGlobalSettingsProxy::setValidator(UIPageValidator *pValidator)104 bool UIGlobalSettingsProxy::validate(QString &strWarning, QString&) 107 105 { 108 /* Configure validation: */ 109 m_pValidator = pValidator; 106 /* Pass if proxy is disabled: */ 107 if (!m_pCheckboxProxy->isChecked()) 108 return true; 109 110 /* Check for host/port values: */ 111 if (m_pHostEditor->text().trimmed().isEmpty()) 112 { 113 strWarning = tr("host is not specified."); 114 return false; 115 } 116 else if (m_pPortEditor->text().trimmed().isEmpty()) 117 { 118 strWarning = tr("port is not specified."); 119 return false; 120 } 121 122 /* Pass by default: */ 123 return true; 110 124 } 111 125 … … 129 143 m_pContainerProxy->setEnabled(m_pCheckboxProxy->isChecked()); 130 144 131 /* Revalidate if possible: */ 132 if (m_pValidator) 133 m_pValidator->revalidate(); 145 /* Revalidate: */ 146 revalidate(); 134 147 } 135 148 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.h
r47563 r47573 62 62 63 63 /* API: Validation stuff: */ 64 void setValidator(UIPageValidator *pValidator);64 bool validate(QString &strWarning, QString &strTitle); 65 65 66 66 /* Helper: Navigation stuff: */ … … 77 77 private: 78 78 79 /* Variable: Validation stuff: */80 UIPageValidator *m_pValidator;81 82 79 /* Cache: */ 83 80 UISettingsCacheGlobalProxy m_cache; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp
r47563 r47573 32 32 33 33 UIMachineSettingsDisplay::UIMachineSettingsDisplay() 34 : m_pValidator(0) 35 , m_iMinVRAM(0) 34 : m_iMinVRAM(0) 36 35 , m_iMaxVRAM(0) 37 36 , m_iMaxVRAMVisible(0) … … 71 70 checkVRAMRequirements(); 72 71 73 /* Revalidate if possible: */ 74 if (m_pValidator) 75 m_pValidator->revalidate(); 72 /* Revalidate: */ 73 revalidate(); 76 74 } 77 75 … … 177 175 polishPage(); 178 176 179 /* Revalidate if possible: */ 180 if (m_pValidator) 181 m_pValidator->revalidate(); 177 /* Revalidate: */ 178 revalidate(); 182 179 } 183 180 … … 304 301 } 305 302 306 void UIMachineSettingsDisplay::setValidator(UIPageValidator *pValidator) 307 { 308 /* Configure validation: */ 309 m_pValidator = pValidator; 310 connect(m_pCheckbox3D, SIGNAL(stateChanged(int)), m_pValidator, SLOT(revalidate())); 311 #ifdef VBOX_WITH_VIDEOHWACCEL 312 connect(m_pCheckbox2DVideo, SIGNAL(stateChanged(int)), m_pValidator, SLOT(revalidate())); 313 #endif /* VBOX_WITH_VIDEOHWACCEL */ 314 connect(m_pCheckboxRemoteDisplay, SIGNAL(toggled(bool)), m_pValidator, SLOT(revalidate())); 315 connect(m_pEditorRemoteDisplayPort, SIGNAL(textChanged(const QString&)), m_pValidator, SLOT(revalidate())); 316 connect(m_pEditorRemoteDisplayTimeout, SIGNAL(textChanged(const QString&)), m_pValidator, SLOT(revalidate())); 317 } 318 319 bool UIMachineSettingsDisplay::revalidate(QString &strWarning, QString& /* strTitle */) 303 bool UIMachineSettingsDisplay::validate(QString &strWarning, QString&) 320 304 { 321 305 /* Check if video RAM requirement changed first: */ … … 403 387 } 404 388 389 /* Pass by default: */ 405 390 return true; 406 391 } … … 498 483 m_pEditorVideoMemorySize->blockSignals(false); 499 484 500 /* Revalidate if possible: */ 501 if (m_pValidator) 502 m_pValidator->revalidate(); 485 /* Revalidate: */ 486 revalidate(); 503 487 } 504 488 … … 510 494 m_pSliderVideoMemorySize->blockSignals(false); 511 495 512 /* Revalidate if possible: */ 513 if (m_pValidator) 514 m_pValidator->revalidate(); 496 /* Revalidate: */ 497 revalidate(); 515 498 } 516 499 … … 528 511 updateVideoCaptureScreenCount(); 529 512 530 /* Revalidate if possible: */ 531 if (m_pValidator) 532 m_pValidator->revalidate(); 513 /* Revalidate: */ 514 revalidate(); 533 515 } 534 516 … … 546 528 updateVideoCaptureScreenCount(); 547 529 548 /* Revalidate if possible: */ 549 if (m_pValidator) 550 m_pValidator->revalidate(); 530 /* Revalidate: */ 531 revalidate(); 551 532 } 552 533 … … 667 648 prepareRemoteDisplayTab(); 668 649 prepareVideoCaptureTab(); 650 651 /* Prepare validation: */ 652 prepareValidation(); 669 653 670 654 /* Translate finally: */ … … 812 796 } 813 797 798 void UIMachineSettingsDisplay::prepareValidation() 799 { 800 /* Configure validation: */ 801 connect(m_pCheckbox3D, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 802 #ifdef VBOX_WITH_VIDEOHWACCEL 803 connect(m_pCheckbox2DVideo, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 804 #endif /* VBOX_WITH_VIDEOHWACCEL */ 805 connect(m_pCheckboxRemoteDisplay, SIGNAL(toggled(bool)), this, SLOT(revalidate())); 806 connect(m_pEditorRemoteDisplayPort, SIGNAL(textChanged(const QString&)), this, SLOT(revalidate())); 807 connect(m_pEditorRemoteDisplayTimeout, SIGNAL(textChanged(const QString&)), this, SLOT(revalidate())); 808 } 809 814 810 void UIMachineSettingsDisplay::checkVRAMRequirements() 815 811 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.h
r47563 r47573 146 146 147 147 /* API: Validation stuff: */ 148 void setValidator(UIPageValidator *pValidator); 149 bool revalidate(QString &strWarning, QString &strTitle); 148 bool validate(QString &strWarning, QString &strTitle); 150 149 151 150 /* Helper: Navigation stuff: */ … … 183 182 void prepareRemoteDisplayTab(); 184 183 void prepareVideoCaptureTab(); 184 void prepareValidation(); 185 185 186 186 /* Helpers: Video stuff: */ … … 195 195 static int calculateBitRate(int iFrameWidth, int iFrameHeight, int iFrameRate, int iQuality); 196 196 static int calculateQuality(int iFrameWidth, int iFrameHeight, int iFrameRate, int iBitRate); 197 198 /* Variable: Validation stuff: */199 UIPageValidator *m_pValidator;200 197 201 198 /* Guest OS type id: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
r47563 r47573 29 29 30 30 UIMachineSettingsGeneral::UIMachineSettingsGeneral() 31 : m_pValidator(0) 32 , m_fHWVirtExEnabled(false) 31 : m_fHWVirtExEnabled(false) 33 32 { 34 33 /* Apply UI decorations */ … … 54 53 #endif /* Q_WS_MAC */ 55 54 55 /* Prepare validation: */ 56 prepareValidation(); 57 56 58 /* Applying language settings */ 57 59 retranslateUi(); … … 72 74 m_fHWVirtExEnabled = fEnabled; 73 75 74 /* Revalidate if possible: */ 75 if (m_pValidator) 76 m_pValidator->revalidate(); 76 /* Revalidate: */ 77 revalidate(); 77 78 } 78 79 … … 146 147 polishPage(); 147 148 148 /* Revalidate if possible: */ 149 if (m_pValidator) 150 m_pValidator->revalidate(); 149 /* Revalidate: */ 150 revalidate(); 151 151 } 152 152 … … 224 224 } 225 225 226 void UIMachineSettingsGeneral::setValidator(UIPageValidator *pValidator) 227 { 228 /* Configure validation: */ 229 m_pValidator = pValidator; 230 connect(m_pNameAndSystemEditor, SIGNAL(sigOsTypeChanged()), m_pValidator, SLOT(revalidate())); 231 connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString&)), m_pValidator, SLOT(revalidate())); 232 } 233 234 bool UIMachineSettingsGeneral::revalidate(QString &strWarning, QString& /* strTitle */) 226 bool UIMachineSettingsGeneral::validate(QString &strWarning, QString&) 235 227 { 236 228 /* VM name validation: */ … … 250 242 } 251 243 244 /* Pass by default: */ 252 245 return true; 253 246 } … … 293 286 mCbDragAndDrop->setItemText (2, gpConverter->toString (KDragAndDropMode_GuestToHost)); 294 287 mCbDragAndDrop->setItemText (3, gpConverter->toString (KDragAndDropMode_Bidirectional)); 288 } 289 290 void UIMachineSettingsGeneral::prepareValidation() 291 { 292 /* Prepare validation: */ 293 connect(m_pNameAndSystemEditor, SIGNAL(sigOsTypeChanged()), this, SLOT(revalidate())); 294 connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString&)), this, SLOT(revalidate())); 295 295 } 296 296 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h
r47563 r47573 107 107 108 108 /* API: Validation stuff: */ 109 void setValidator(UIPageValidator *pValidator); 110 bool revalidate(QString &strWarning, QString &strTitle); 109 bool validate(QString &strWarning, QString &strTitle); 111 110 112 111 void setOrderAfter (QWidget *aWidget); … … 116 115 private: 117 116 117 /* Helper: Prepare stuff: */ 118 void prepareValidation(); 119 118 120 void polishPage(); 119 120 /* Variable: Validation stuff: */121 UIPageValidator *m_pValidator;122 121 123 122 /* Cache: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r47563 r47573 48 48 : QIWithRetranslateUI<QWidget>(0) 49 49 , m_pParent(pParent) 50 , m_pValidator(0)51 50 , m_iSlot(-1) 52 51 { … … 69 68 connect(this, SIGNAL(sigTabUpdated()), m_pParent, SLOT(sltHandleUpdatedTab())); 70 69 70 /* Prepare validation: */ 71 prepareValidation(); 72 71 73 /* Applying language settings: */ 72 74 retranslateUi(); … … 161 163 } 162 164 163 void UIMachineSettingsNetwork::setValidator(UIPageValidator *pValidator) 164 { 165 /* Configure validation: */ 166 m_pValidator = pValidator; 167 connect(m_pMACEditor, SIGNAL(textEdited(const QString &)), m_pValidator, SLOT(revalidate())); 168 } 169 170 bool UIMachineSettingsNetwork::revalidate(QString &strWarning, QString &strTitle) 171 { 172 /* 'True' for disabled adapter: */ 165 bool UIMachineSettingsNetwork::validate(QString &strWarning, QString &strTitle) 166 { 167 /* Pass if adapter is disabled: */ 173 168 if (!m_pEnableAdapterCheckBox->isChecked()) 174 169 return true; … … 219 214 220 215 /* Validate MAC-address length: */ 221 if ( m_pMACEditor->text().size() < 12)216 if (fValid && m_pMACEditor->text().size() < 12) 222 217 { 223 218 strWarning = tr("the MAC address must be 12 hexadecimal digits long."); … … 225 220 } 226 221 /* Make sure MAC-address is unicast: */ 227 if ( m_pMACEditor->text().size() >= 2)222 if (fValid && m_pMACEditor->text().size() >= 2) 228 223 { 229 224 QRegExp validator("^[0-9A-Fa-f][02468ACEace]"); … … 358 353 m_pAdapterOptionsContainer->setEnabled(m_pEnableAdapterCheckBox->isChecked()); 359 354 360 /* Revalidate if possible: */ 361 if (m_pValidator) 362 m_pValidator->revalidate(); 355 /* Revalidate: */ 356 m_pParent->revalidate(); 363 357 } 364 358 … … 484 478 } 485 479 486 /* Revalidate if possible: */ 487 if (m_pValidator) 488 m_pValidator->revalidate(); 480 /* Revalidate: */ 481 m_pParent->revalidate(); 489 482 } 490 483 … … 517 510 if (dlg.exec() == QDialog::Accepted) 518 511 m_portForwardingRules = dlg.rules(); 512 } 513 514 void UIMachineSettingsNetwork::prepareValidation() 515 { 516 /* Configure validation: */ 517 connect(m_pMACEditor, SIGNAL(textEdited(const QString &)), m_pParent, SLOT(revalidate())); 519 518 } 520 519 … … 727 726 /* UIMachineSettingsNetworkPage Stuff: */ 728 727 UIMachineSettingsNetworkPage::UIMachineSettingsNetworkPage() 729 : m_pValidator(0) 730 , m_pTwAdapters(0) 728 : m_pTwAdapters(0) 731 729 { 732 730 /* Setup main layout: */ … … 832 830 pTab->fetchAdapterCache(m_cache.child(iSlot)); 833 831 834 /* Setup page validation: */835 pTab->setValidator(m_pValidator);836 837 832 /* Setup tab order: */ 838 833 pLastFocusWidget = pTab->setOrderAfter(pLastFocusWidget); … … 845 840 polishPage(); 846 841 847 /* Revalidate if possible: */ 848 if (m_pValidator) 849 m_pValidator->revalidate(); 842 /* Revalidate: */ 843 revalidate(); 850 844 } 851 845 … … 945 939 } 946 940 947 void UIMachineSettingsNetworkPage::setValidator(UIPageValidator *pValidator) 948 { 949 /* Configure validation: */ 950 m_pValidator = pValidator; 951 } 952 953 bool UIMachineSettingsNetworkPage::revalidate(QString &strWarning, QString &strTitle) 954 { 941 bool UIMachineSettingsNetworkPage::validate(QString &strWarning, QString &strTitle) 942 { 943 /* Pass by default: */ 955 944 bool fValid = true; 956 945 946 /* Delegate validation to adapters: */ 957 947 for (int i = 0; i < m_pTwAdapters->count(); ++i) 958 948 { 959 949 UIMachineSettingsNetwork *pTab = qobject_cast<UIMachineSettingsNetwork*>(m_pTwAdapters->widget(i)); 960 950 Assert(pTab); 961 fValid = pTab-> revalidate(strWarning, strTitle);951 fValid = pTab->validate(strWarning, strTitle); 962 952 if (!fValid) 963 953 break; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.h
r47563 r47573 110 110 111 111 /* API: Validation stuff: */ 112 void setValidator(UIPageValidator *pValidator); 113 bool revalidate(QString &strWarning, QString &strTitle); 112 bool validate(QString &strWarning, QString &strTitle); 114 113 115 114 /* Navigation stuff: */ … … 145 144 private: 146 145 146 /* Helper: Prepare stuff: */ 147 void prepareValidation(); 148 147 149 /* Helping stuff: */ 148 150 void populateComboboxes(); … … 156 158 /* Parent page: */ 157 159 UIMachineSettingsNetworkPage *m_pParent; 158 159 /* Variable: Validation stuff: */160 UIPageValidator *m_pValidator;161 160 162 161 /* Other variables: */ … … 208 207 209 208 /* API: Validation stuff: */ 210 void setValidator(UIPageValidator *pValidator); 211 bool revalidate(QString &strWarning, QString &strTitle); 209 bool validate(QString &strWarning, QString &strTitle); 212 210 213 211 /* Translation stuff: */ … … 234 232 static void updateGenericProperties(CNetworkAdapter &adapter, const QString &strPropText); 235 233 236 /* Variable: Validation stuff: */237 UIPageValidator *m_pValidator;238 239 234 /* Tab holder: */ 240 235 QITabWidget *m_pTwAdapters; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.cpp
r47563 r47573 33 33 UIMachineSettingsParallel::UIMachineSettingsParallel(UIMachineSettingsParallelPage *pParent) 34 34 : QIWithRetranslateUI<QWidget> (0) 35 , m_pValidator(0)36 35 , m_pParent(pParent) 37 36 , m_iSlot(-1) … … 59 58 connect (mCbNumber, SIGNAL (activated (const QString &)), 60 59 this, SLOT (mCbNumberActivated (const QString &))); 60 61 /* Prepare validation: */ 62 prepareValidation(); 61 63 62 64 /* Applying language settings */ … … 114 116 } 115 117 116 void UIMachineSettingsParallel::setValidator(UIPageValidator *pValidator)117 {118 /* Configure validation: */119 m_pValidator = pValidator;120 connect(mLeIRQ, SIGNAL(textChanged(const QString&)), m_pValidator, SLOT(revalidate()));121 connect(mLeIOPort, SIGNAL(textChanged(const QString&)), m_pValidator, SLOT(revalidate()));122 connect(mLePath, SIGNAL(textChanged(const QString&)), m_pValidator, SLOT(revalidate()));123 }124 125 118 QWidget* UIMachineSettingsParallel::setOrderAfter (QWidget *aAfter) 126 119 { … … 157 150 mCbNumberActivated (mCbNumber->currentText()); 158 151 159 /* Revalidate if possible: */ 160 if (m_pValidator) 161 m_pValidator->revalidate(); 152 /* Revalidate: */ 153 m_pParent->revalidate(); 162 154 } 163 155 … … 175 167 } 176 168 177 /* Revalidate if possible: */ 178 if (m_pValidator) 179 m_pValidator->revalidate(); 169 /* Revalidate: */ 170 m_pParent->revalidate(); 171 } 172 173 void UIMachineSettingsParallel::prepareValidation() 174 { 175 /* Prepare validation: */ 176 connect(mLeIRQ, SIGNAL(textChanged(const QString&)), m_pParent, SLOT(revalidate())); 177 connect(mLeIOPort, SIGNAL(textChanged(const QString&)), m_pParent, SLOT(revalidate())); 178 connect(mLePath, SIGNAL(textChanged(const QString&)), m_pParent, SLOT(revalidate())); 180 179 } 181 180 … … 183 182 /* UIMachineSettingsParallelPage stuff */ 184 183 UIMachineSettingsParallelPage::UIMachineSettingsParallelPage() 185 : m_pValidator(0) 186 , mTabWidget(0) 184 : mTabWidget(0) 187 185 { 188 186 /* TabWidget creation */ … … 257 255 pPage->fetchPortData(m_cache.child(iPort)); 258 256 259 /* Setup page validation: */260 pPage->setValidator(m_pValidator);261 262 257 /* Setup tab order: */ 263 258 pLastFocusWidget = pPage->setOrderAfter(pLastFocusWidget); … … 270 265 polishPage(); 271 266 272 /* Revalidate if possible: */ 273 if (m_pValidator) 274 m_pValidator->revalidate(); 267 /* Revalidate: */ 268 revalidate(); 275 269 } 276 270 … … 331 325 } 332 326 333 void UIMachineSettingsParallelPage::setValidator(UIPageValidator *pValidator) 334 { 335 /* Configure validation: */ 336 m_pValidator = pValidator; 337 } 338 339 bool UIMachineSettingsParallelPage::revalidate (QString &aWarning, QString &aTitle) 327 bool UIMachineSettingsParallelPage::validate(QString &strWarning, QString &strTitle) 340 328 { 341 329 bool valid = true; … … 362 350 { 363 351 if (strIRQ.isEmpty()) 364 aWarning = tr("IRC not specified.");352 strWarning = tr("IRC not specified."); 365 353 else if (strIOPort.isEmpty()) 366 aWarning = tr("IO port not specified.");354 strWarning = tr("IO port not specified."); 367 355 else 368 aWarning = tr ("duplicate port attributes specified.");369 aTitle += ": " +356 strWarning = tr ("duplicate port attributes specified."); 357 strTitle += ": " + 370 358 vboxGlobal().removeAccelMark(mTabWidget->tabText(mTabWidget->indexOf(tab))); 371 359 } … … 379 367 if (!valid) 380 368 { 381 aWarning = path.isEmpty() ?369 strWarning = path.isEmpty() ? 382 370 tr ("Port path not specified ") : 383 371 tr ("Duplicate port path entered "); 384 aTitle += ": " +372 strTitle += ": " + 385 373 vboxGlobal().removeAccelMark (mTabWidget->tabText (mTabWidget->indexOf (tab))); 386 374 break; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsParallel.h
r47563 r47573 84 84 void uploadPortData(UICacheSettingsMachineParallelPort &portCache); 85 85 86 /* API: Validation stuff: */87 void setValidator(UIPageValidator *pValidator);88 89 86 QWidget* setOrderAfter (QWidget *aAfter); 90 87 … … 103 100 private: 104 101 105 /* Variable: Validationstuff: */106 UIPageValidator *m_pValidator;102 /* Helper: Prepare stuff: */ 103 void prepareValidation(); 107 104 108 105 UIMachineSettingsParallelPage *m_pParent; … … 139 136 140 137 /* API: Validation stuff: */ 141 void setValidator(UIPageValidator *pValidator); 142 bool revalidate (QString &aWarning, QString &aTitle); 138 bool validate(QString &strWarning, QString &strTitle); 143 139 144 140 void retranslateUi(); … … 147 143 148 144 void polishPage(); 149 150 /* Variable: Validation stuff: */151 UIPageValidator *m_pValidator;152 145 153 146 QITabWidget *mTabWidget; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp
r47563 r47573 34 34 UIMachineSettingsSerial::UIMachineSettingsSerial(UIMachineSettingsSerialPage *pParent) 35 35 : QIWithRetranslateUI<QWidget> (0) 36 , m_pValidator(0)37 36 , m_pParent(pParent) 38 37 , m_iSlot(-1) … … 67 66 connect (mCbMode, SIGNAL (activated (const QString &)), 68 67 this, SLOT (mCbModeActivated (const QString &))); 68 69 /* Prepare validation: */ 70 prepareValidation(); 69 71 70 72 /* Applying language settings */ … … 130 132 } 131 133 132 void UIMachineSettingsSerial::setValidator(UIPageValidator *pValidator)133 {134 /* Configure validation: */135 m_pValidator = pValidator;136 connect(mLeIRQ, SIGNAL(textChanged(const QString&)), m_pValidator, SLOT(revalidate()));137 connect(mLeIOPort, SIGNAL(textChanged(const QString&)), m_pValidator, SLOT(revalidate()));138 connect(mLePath, SIGNAL(textChanged(const QString&)), m_pValidator, SLOT(revalidate()));139 }140 141 134 QWidget* UIMachineSettingsSerial::setOrderAfter (QWidget *aAfter) 142 135 { … … 183 176 } 184 177 185 /* Revalidate if possible: */ 186 if (m_pValidator) 187 m_pValidator->revalidate(); 178 /* Revalidate: */ 179 m_pParent->revalidate(); 188 180 } 189 181 … … 201 193 } 202 194 203 /* Revalidate if possible: */ 204 if (m_pValidator) 205 m_pValidator->revalidate(); 195 /* Revalidate: */ 196 m_pParent->revalidate(); 206 197 } 207 198 … … 212 203 mLePath->setEnabled (mode != KPortMode_Disconnected); 213 204 214 /* Revalidate if possible: */ 215 if (m_pValidator) 216 m_pValidator->revalidate(); 205 /* Revalidate: */ 206 m_pParent->revalidate(); 207 } 208 209 void UIMachineSettingsSerial::prepareValidation() 210 { 211 /* Prepare validation: */ 212 connect(mLeIRQ, SIGNAL(textChanged(const QString&)), m_pParent, SLOT(revalidate())); 213 connect(mLeIOPort, SIGNAL(textChanged(const QString&)), m_pParent, SLOT(revalidate())); 214 connect(mLePath, SIGNAL(textChanged(const QString&)), m_pParent, SLOT(revalidate())); 217 215 } 218 216 … … 220 218 /* UIMachineSettingsSerialPage stuff */ 221 219 UIMachineSettingsSerialPage::UIMachineSettingsSerialPage() 222 : m_pValidator(0) 223 , mTabWidget(0) 220 : mTabWidget(0) 224 221 { 225 222 /* TabWidget creation */ … … 296 293 pPage->fetchPortData(m_cache.child(iPort)); 297 294 298 /* Setup page validation: */299 pPage->setValidator(m_pValidator);300 301 295 /* Setup tab order: */ 302 296 pLastFocusWidget = pPage->setOrderAfter(pLastFocusWidget); … … 309 303 polishPage(); 310 304 311 /* Revalidate if possible: */ 312 if (m_pValidator) 313 m_pValidator->revalidate(); 305 /* Revalidate: */ 306 revalidate(); 314 307 } 315 308 … … 375 368 } 376 369 377 void UIMachineSettingsSerialPage::setValidator(UIPageValidator *pValidator) 378 { 379 /* Configure validation: */ 380 m_pValidator = pValidator; 381 } 382 383 bool UIMachineSettingsSerialPage::revalidate (QString &aWarning, QString &aTitle) 370 bool UIMachineSettingsSerialPage::validate(QString &strWarning, QString &strTitle) 384 371 { 385 372 bool valid = true; … … 406 393 { 407 394 if (strIRQ.isEmpty()) 408 aWarning = tr("IRC not specified.");395 strWarning = tr("IRC not specified."); 409 396 else if (strIOPort.isEmpty()) 410 aWarning = tr("IO port not specified.");397 strWarning = tr("IO port not specified."); 411 398 else 412 aWarning = tr ("duplicate port attributes specified.");413 aTitle += ": " +399 strWarning = tr ("duplicate port attributes specified."); 400 strTitle += ": " + 414 401 vboxGlobal().removeAccelMark(mTabWidget->tabText(mTabWidget->indexOf(tab))); 415 402 } … … 430 417 else 431 418 { 432 aWarning = path.isEmpty() ?419 strWarning = path.isEmpty() ? 433 420 tr ("port path not specified.") : 434 421 tr ("duplicate port path entered."); 435 aTitle += ": " +422 strTitle += ": " + 436 423 vboxGlobal().removeAccelMark (mTabWidget->tabText (mTabWidget->indexOf (tab))); 437 424 break; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.h
r47563 r47573 90 90 void uploadPortData(UICacheSettingsMachineSerialPort &data); 91 91 92 /* API: Validation stuff: */93 void setValidator(UIPageValidator *pValidator);94 95 92 QWidget* setOrderAfter (QWidget *aAfter); 96 93 … … 110 107 private: 111 108 112 /* Variable: Validationstuff: */113 UIPageValidator *m_pValidator;109 /* Helper: Prepare stuff: */ 110 void prepareValidation(); 114 111 115 112 UIMachineSettingsSerialPage *m_pParent; … … 146 143 147 144 /* API: Validation stuff: */ 148 void setValidator(UIPageValidator *pValidator); 149 bool revalidate (QString &aWarning, QString &aTitle); 145 bool validate(QString &strWarning, QString &strTitle); 150 146 151 147 void retranslateUi(); … … 154 150 155 151 void polishPage(); 156 157 /* Variable: Validation stuff: */158 UIPageValidator *m_pValidator;159 152 160 153 QITabWidget *mTabWidget; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r47563 r47573 1719 1719 */ 1720 1720 UIMachineSettingsStorage::UIMachineSettingsStorage() 1721 : m_pValidator(0) 1722 , mStorageModel(0) 1721 : mStorageModel(0) 1723 1722 , mAddCtrAction(0), mDelCtrAction(0) 1724 1723 , mAddIDECtrAction(0), mAddSATACtrAction(0), mAddSCSICtrAction(0), mAddSASCtrAction(0), mAddFloppyCtrAction(0) … … 1896 1895 updateActionsState(); 1897 1896 1898 /* Revalidate if possible: */ 1899 if (m_pValidator) 1900 m_pValidator->revalidate(); 1897 /* Revalidate: */ 1898 revalidate(); 1901 1899 } 1902 1900 … … 2037 2035 polishPage(); 2038 2036 2039 /* Revalidate if possible: */ 2040 if (m_pValidator) 2041 m_pValidator->revalidate(); 2037 /* Revalidate: */ 2038 revalidate(); 2042 2039 } 2043 2040 … … 2107 2104 } 2108 2105 2109 void UIMachineSettingsStorage::setValidator(UIPageValidator *pValidator) 2110 { 2111 /* Configure validation: */ 2112 m_pValidator = pValidator; 2113 } 2114 2115 bool UIMachineSettingsStorage::revalidate (QString &strWarning, QString& /* strTitle */) 2106 bool UIMachineSettingsStorage::validate(QString &strWarning, QString&) 2116 2107 { 2117 2108 /* Check controllers for name emptiness & coincidence. … … 2191 2182 } 2192 2183 2184 /* Pass by default: */ 2193 2185 return true; 2194 2186 } … … 2280 2272 mStorageModel->setData (attIndex, attMediumId, StorageModel::R_AttMediumId); 2281 2273 2282 /* Revalidate if possible: */ 2283 if (m_pValidator) 2284 m_pValidator->revalidate(); 2274 /* Revalidate: */ 2275 revalidate(); 2285 2276 } 2286 2277 } … … 2302 2293 mStorageModel->setData (attIndex, UIMedium().id(), StorageModel::R_AttMediumId); 2303 2294 2304 /* Revalidate if possible: */ 2305 if (m_pValidator) 2306 m_pValidator->revalidate(); 2295 /* Revalidate: */ 2296 revalidate(); 2307 2297 } 2308 2298 } … … 2354 2344 emit storageChanged(); 2355 2345 2356 /* Revalidate if possible: */ 2357 if (m_pValidator) 2358 m_pValidator->revalidate(); 2346 /* Revalidate: */ 2347 revalidate(); 2359 2348 } 2360 2349 … … 2436 2425 emit storageChanged(); 2437 2426 2438 /* Revalidate if possible: */ 2439 if (m_pValidator) 2440 m_pValidator->revalidate(); 2427 /* Revalidate: */ 2428 revalidate(); 2441 2429 } 2442 2430 … … 2564 2552 } 2565 2553 2566 /* Revalidate if possible: */ 2567 if (m_pValidator) 2568 m_pValidator->revalidate(); 2554 /* Revalidate: */ 2555 revalidate(); 2569 2556 2570 2557 mIsLoadingInProgress = false; … … 3102 3089 emit storageChanged(); 3103 3090 3104 /* Revalidate if possible: */ 3105 if (m_pValidator) 3106 m_pValidator->revalidate(); 3091 /* Revalidate: */ 3092 revalidate(); 3107 3093 } 3108 3094 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r47563 r47573 674 674 675 675 /* API: Validation stuff: */ 676 void setValidator(UIPageValidator *pValidator); 677 bool revalidate (QString &aWarning, QString &aTitle); 676 bool validate(QString &strWarning, QString &strTitle); 678 677 679 678 void retranslateUi(); … … 757 756 void polishPage(); 758 757 759 /* Variable: Validation stuff: */760 UIPageValidator *m_pValidator;761 762 758 QString m_strMachineId; 763 759 QString m_strMachineSettingsFilePath; -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp
r47563 r47573 35 35 36 36 UIMachineSettingsSystem::UIMachineSettingsSystem() 37 : m_pValidator(0) 38 , m_uMinGuestCPU(0), m_uMaxGuestCPU(0) 37 : m_uMinGuestCPU(0), m_uMaxGuestCPU(0) 39 38 , m_uMinGuestCPUExecCap(0), m_uMedGuestCPUExecCap(0), m_uMaxGuestCPUExecCap(0) 40 39 , m_fOHCIEnabled(false) … … 68 67 m_fOHCIEnabled = fEnabled; 69 68 70 /* Revalidate if possible: */ 71 if (m_pValidator) 72 m_pValidator->revalidate(); 69 /* Revalidate: */ 70 revalidate(); 73 71 } 74 72 … … 187 185 polishPage(); 188 186 189 /* Revalidate if possible: */ 190 if (m_pValidator) 191 m_pValidator->revalidate(); 187 /* Revalidate: */ 188 revalidate(); 192 189 } 193 190 … … 288 285 } 289 286 290 void UIMachineSettingsSystem::setValidator(UIPageValidator *pValidator) 291 { 292 /* Configure validation: */ 293 m_pValidator = pValidator; 294 connect(m_pComboChipsetType, SIGNAL(currentIndexChanged(int)), m_pValidator, SLOT(revalidate())); 295 connect(m_pComboPointingHIDType, SIGNAL(currentIndexChanged(int)), m_pValidator, SLOT(revalidate())); 296 connect(m_pCheckBoxApic, SIGNAL(stateChanged(int)), m_pValidator, SLOT(revalidate())); 297 connect(m_pCheckBoxVirtualization, SIGNAL(stateChanged(int)), m_pValidator, SLOT(revalidate())); 298 } 299 300 bool UIMachineSettingsSystem::revalidate(QString &strWarning, QString& /* strTitle */) 287 bool UIMachineSettingsSystem::validate(QString &strWarning, QString&) 301 288 { 302 289 /* RAM amount test: */ … … 506 493 m_pEditorMemorySize->blockSignals(false); 507 494 508 /* Revalidate if possible: */ 509 if (m_pValidator) 510 m_pValidator->revalidate(); 495 /* Revalidate: */ 496 revalidate(); 511 497 } 512 498 … … 518 504 m_pSliderMemorySize->blockSignals(false); 519 505 520 /* Revalidate if possible: */ 521 if (m_pValidator) 522 m_pValidator->revalidate(); 506 /* Revalidate: */ 507 revalidate(); 523 508 } 524 509 … … 542 527 m_pEditorCPUCount->blockSignals(false); 543 528 544 /* Revalidate if possible: */ 545 if (m_pValidator) 546 m_pValidator->revalidate(); 529 /* Revalidate: */ 530 revalidate(); 547 531 } 548 532 … … 554 538 m_pSliderCPUCount->blockSignals(false); 555 539 556 /* Revalidate if possible: */ 557 if (m_pValidator) 558 m_pValidator->revalidate(); 540 /* Revalidate: */ 541 revalidate(); 559 542 } 560 543 … … 566 549 m_pEditorCPUExecCap->blockSignals(false); 567 550 568 /* Revalidate if possible: */ 569 if (m_pValidator) 570 m_pValidator->revalidate(); 551 /* Revalidate: */ 552 revalidate(); 571 553 } 572 554 … … 578 560 m_pSliderCPUExecCap->blockSignals(false); 579 561 580 /* Revalidate if possible: */ 581 if (m_pValidator) 582 m_pValidator->revalidate(); 562 /* Revalidate: */ 563 revalidate(); 583 564 } 584 565 … … 588 569 Ui::UIMachineSettingsSystem::setupUi(this); 589 570 590 /* Prepare 'motherboard' tab: */571 /* Prepare tabs: */ 591 572 prepareTabMotherboard(); 592 593 /* Prepare 'processor' tab: */594 573 prepareTabProcessor(); 574 575 /* Prepare validation: */ 576 prepareValidation(); 595 577 596 578 /* Retranslate finally: */ … … 711 693 connect(m_pSliderCPUExecCap, SIGNAL(valueChanged(int)), this, SLOT(sltHandleCPUExecCapSliderChange())); 712 694 connect(m_pEditorCPUExecCap, SIGNAL(valueChanged(int)), this, SLOT(sltHandleCPUExecCapEditorChange())); 695 } 696 697 void UIMachineSettingsSystem::prepareValidation() 698 { 699 /* Prepare validation: */ 700 connect(m_pComboChipsetType, SIGNAL(currentIndexChanged(int)), this, SLOT(revalidate())); 701 connect(m_pComboPointingHIDType, SIGNAL(currentIndexChanged(int)), this, SLOT(revalidate())); 702 connect(m_pCheckBoxApic, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 703 connect(m_pCheckBoxVirtualization, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 713 704 } 714 705 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.h
r47563 r47573 153 153 154 154 /* API: Validation stuff: */ 155 void setValidator(UIPageValidator *pValidator); 156 bool revalidate(QString &strWarning, QString &strTitle); 155 bool validate(QString &strWarning, QString &strTitle); 157 156 158 157 /* Helper: Navigation stuff: */ … … 186 185 void prepareTabMotherboard(); 187 186 void prepareTabProcessor(); 187 void prepareValidation(); 188 188 189 189 /* Helper: Pointing HID type combo stuff: */ … … 199 199 /* Handler: Event-filtration stuff: */ 200 200 bool eventFilter(QObject *aObject, QEvent *aEvent); 201 202 /* Variable: Validation stuff: */203 UIPageValidator *m_pValidator;204 201 205 202 /* Variable: Boot-table stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp
r47563 r47573 140 140 UIMachineSettingsUSB::UIMachineSettingsUSB(UISettingsPageType type) 141 141 : UISettingsPage(type) 142 , m_pValidator(0)143 142 , m_pToolBar(0) 144 143 , mNewAction(0), mAddAction(0), mEdtAction(0), mDelAction(0) … … 218 217 /* Setup dialog */ 219 218 mTwFilters->header()->hide(); 219 220 /* Prepare validation: */ 221 prepareValidation(); 220 222 221 223 /* Applying language settings */ … … 386 388 polishPage(); 387 389 388 /* Revalidate if possible: */ 389 if (m_pValidator) 390 m_pValidator->revalidate(); 390 /* Revalidate: */ 391 revalidate(); 391 392 } 392 393 … … 564 565 } 565 566 566 void UIMachineSettingsUSB::setValidator(UIPageValidator *pValidator) 567 { 568 /* Configure validation: */ 569 m_pValidator = pValidator; 570 connect(mGbUSB, SIGNAL(stateChanged(int)), m_pValidator, SLOT(revalidate())); 571 connect(mCbUSB2, SIGNAL(stateChanged(int)), m_pValidator, SLOT(revalidate())); 572 } 573 574 bool UIMachineSettingsUSB::revalidate(QString &strWarningText, QString& /* strTitle */) 575 { 567 bool UIMachineSettingsUSB::validate(QString &strWarningText, QString&) 568 { 569 NOREF(strWarningText); 570 571 #ifdef VBOX_WITH_EXTPACK 576 572 /* USB 2.0 Extension Pack presence test: */ 577 NOREF(strWarningText);578 #ifdef VBOX_WITH_EXTPACK579 573 CExtPack extPack = vboxGlobal().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName); 580 574 if (mGbUSB->isChecked() && mCbUSB2->isChecked() && (extPack.isNull() || !extPack.GetUsable())) … … 590 584 return true; 591 585 } 592 #endif 586 #endif /* VBOX_WITH_EXTPACK */ 587 588 /* Pass by default: */ 593 589 return true; 594 590 } … … 712 708 addUSBFilter(usbFilterData, true /* its new? */); 713 709 714 /* Revalidate if possible: */ 715 if (m_pValidator) 716 m_pValidator->revalidate(); 710 /* Revalidate: */ 711 revalidate(); 717 712 } 718 713 … … 760 755 addUSBFilter(usbFilterData, true /* its new? */); 761 756 762 /* Revalidate if possible: */ 763 if (m_pValidator) 764 m_pValidator->revalidate(); 757 /* Revalidate: */ 758 revalidate(); 765 759 } 766 760 … … 858 852 /* Update current item: */ 859 853 currentChanged(mTwFilters->currentItem()); 860 /* Revalidate if possible: */ 861 if (!mTwFilters->topLevelItemCount()) 862 { 863 /* Revalidate if possible: */ 864 if (m_pValidator) 865 m_pValidator->revalidate(); 866 } 854 855 /* Revalidate: */ 856 revalidate(); 867 857 } 868 858 … … 924 914 } 925 915 916 void UIMachineSettingsUSB::prepareValidation() 917 { 918 /* Prepare validation: */ 919 connect(mGbUSB, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 920 connect(mCbUSB2, SIGNAL(stateChanged(int)), this, SLOT(revalidate())); 921 } 922 926 923 void UIMachineSettingsUSB::addUSBFilter(const UIDataSettingsMachineUSBFilter &usbFilterData, bool fIsNew) 927 924 { -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h
r47563 r47573 143 143 144 144 /* API: Validation stuff: */ 145 void setValidator(UIPageValidator *pValidator); 146 bool revalidate(QString &strWarningText, QString &strTitle); 145 bool validate(QString &strWarningText, QString &strTitle); 147 146 148 147 void setOrderAfter (QWidget *aWidget); … … 167 166 private: 168 167 168 /* Helper: Prepare stuff: */ 169 void prepareValidation(); 170 169 171 void addUSBFilter(const UIDataSettingsMachineUSBFilter &usbFilterData, bool fIsNew); 170 172 … … 179 181 180 182 void polishPage(); 181 182 /* Variable: Validation stuff: */183 UIPageValidator *m_pValidator;184 183 185 184 /* Global data source: */
Note:
See TracChangeset
for help on using the changeset viewer.