Changeset 37548 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 20, 2011 6:19:31 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72385
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/global
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.cpp
r37546 r37548 22 22 23 23 /* Local includes */ 24 #include "QIWidgetValidator.h" 24 25 #include "UIGlobalSettingsProxy.h" 25 26 #include "VBoxUtils.h" … … 27 28 /* General page constructor: */ 28 29 UIGlobalSettingsProxy::UIGlobalSettingsProxy() 30 : m_pValidator(0) 29 31 { 30 32 /* Apply UI decorations: */ … … 33 35 /* Setup widgets: */ 34 36 m_pPortEditor->setFixedWidthByText(QString().fill('0', 6)); 35 m_pHostEditor->setValidator(new QRegExpValidator(QRegExp("\\S *"), m_pPortEditor));36 m_pPortEditor->setValidator(new QRegExpValidator(QRegExp("\\d *"), m_pPortEditor));37 m_pLoginEditor->setValidator(new QRegExpValidator(QRegExp("\\S *"), m_pPortEditor));38 m_pPasswordEditor->setValidator(new QRegExpValidator(QRegExp("\\S *"), m_pPortEditor));37 m_pHostEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pHostEditor)); 38 m_pPortEditor->setValidator(new QRegExpValidator(QRegExp("\\d+"), m_pPortEditor)); 39 m_pLoginEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pLoginEditor)); 40 m_pPasswordEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pPasswordEditor)); 39 41 40 42 /* Setup connections: */ … … 113 115 } 114 116 117 /* Validation stuff: */ 118 void UIGlobalSettingsProxy::setValidator(QIWidgetValidator *pValidator) 119 { 120 m_pValidator = pValidator; 121 } 122 115 123 /* Navigation stuff: */ 116 124 void UIGlobalSettingsProxy::setOrderAfter(QWidget *pWidget) … … 133 141 void UIGlobalSettingsProxy::sltProxyToggled() 134 142 { 143 /* Update widgets availability: */ 135 144 m_pHostLabel->setEnabled(m_pProxyCheckbox->isChecked()); 136 145 m_pHostEditor->setEnabled(m_pProxyCheckbox->isChecked()); … … 138 147 m_pPortEditor->setEnabled(m_pProxyCheckbox->isChecked()); 139 148 m_pAuthCheckbox->setEnabled(m_pProxyCheckbox->isChecked()); 149 150 /* Update auth widgets also: */ 140 151 sltAuthToggled(); 141 152 } … … 143 154 void UIGlobalSettingsProxy::sltAuthToggled() 144 155 { 156 /* Update widgets availability: */ 145 157 m_pLoginLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked()); 146 158 m_pLoginEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked()); 147 159 m_pPasswordLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked()); 148 160 m_pPasswordEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked()); 161 162 /* Revalidate if possible: */ 163 if (m_pValidator) 164 m_pValidator->revalidate(); 149 165 } 150 166 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.h
r37544 r37548 62 62 void saveFromCacheTo(QVariant &data); 63 63 64 /* Validation stuff: */ 65 void setValidator(QIWidgetValidator *pValidator); 66 64 67 /* Navigation stuff: */ 65 68 void setOrderAfter(QWidget *pWidget); … … 75 78 private: 76 79 80 /* Validator: */ 81 QIWidgetValidator *m_pValidator; 82 77 83 /* Cache: */ 78 84 UISettingsCacheGlobalProxy m_cache;
Note:
See TracChangeset
for help on using the changeset viewer.