Changeset 47196 in vbox
- Timestamp:
- Jul 16, 2013 3:08:55 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/global
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.cpp
r43695 r47196 37 37 m_pHostEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pHostEditor)); 38 38 m_pPortEditor->setValidator(new QRegExpValidator(QRegExp("\\d+"), m_pPortEditor)); 39 #if 040 m_pLoginEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pLoginEditor));41 m_pPasswordEditor->setValidator(new QRegExpValidator(QRegExp("\\S+"), m_pPasswordEditor));42 #else43 m_pLoginLabel->hide();44 m_pLoginEditor->hide();45 m_pPasswordLabel->hide();46 m_pPasswordEditor->hide();47 #endif48 39 49 40 /* Setup connections: */ 50 connect(m_pProxyCheckbox, SIGNAL(stateChanged(int)), this, SLOT(sltProxyToggled())); 51 #if 0 52 connect(m_pAuthCheckbox, SIGNAL(stateChanged(int)), this, SLOT(sltAuthToggled())); 53 #else 54 m_pAuthCheckbox->hide(); 55 #endif 41 connect(m_pCheckboxProxy, SIGNAL(toggled(bool)), this, SLOT(sltProxyToggled())); 56 42 57 43 /* Apply language settings: */ … … 71 57 m_cache.m_strProxyHost = proxyManager.proxyHost(); 72 58 m_cache.m_strProxyPort = proxyManager.proxyPort(); 73 #if 074 m_cache.m_fAuthEnabled = proxyManager.authEnabled();75 m_cache.m_strAuthLogin = proxyManager.authLogin();76 m_cache.m_strAuthPassword = proxyManager.authPassword();77 #endif78 59 79 60 /* Upload properties & settings to data: */ … … 86 67 { 87 68 /* Fetch from cache: */ 88 m_p ProxyCheckbox->setChecked(m_cache.m_fProxyEnabled);69 m_pCheckboxProxy->setChecked(m_cache.m_fProxyEnabled); 89 70 m_pHostEditor->setText(m_cache.m_strProxyHost); 90 71 m_pPortEditor->setText(m_cache.m_strProxyPort); 91 #if 092 m_pAuthCheckbox->setChecked(m_cache.m_fAuthEnabled);93 m_pLoginEditor->setText(m_cache.m_strAuthLogin);94 m_pPasswordEditor->setText(m_cache.m_strAuthPassword);95 #endif96 72 sltProxyToggled(); 97 73 } … … 102 78 { 103 79 /* Upload to cache: */ 104 m_cache.m_fProxyEnabled = m_p ProxyCheckbox->isChecked();80 m_cache.m_fProxyEnabled = m_pCheckboxProxy->isChecked(); 105 81 m_cache.m_strProxyHost = m_pHostEditor->text(); 106 82 m_cache.m_strProxyPort = m_pPortEditor->text(); 107 #if 0108 m_cache.m_fAuthEnabled = m_pAuthCheckbox->isChecked();109 m_cache.m_strAuthLogin = m_pLoginEditor->text();110 m_cache.m_strAuthPassword = m_pPasswordEditor->text();111 #endif112 83 } 113 84 … … 123 94 proxyManager.setProxyHost(m_cache.m_strProxyHost); 124 95 proxyManager.setProxyPort(m_cache.m_strProxyPort); 125 #if 0126 proxyManager.setAuthEnabled(m_cache.m_fAuthEnabled);127 proxyManager.setAuthLogin(m_cache.m_strAuthLogin);128 proxyManager.setAuthPassword(m_cache.m_strAuthPassword);129 #endif130 96 m_settings.setProxySettings(proxyManager.toString()); 131 97 … … 134 100 } 135 101 136 /* Validation stuff: */137 102 void UIGlobalSettingsProxy::setValidator(QIWidgetValidator *pValidator) 138 103 { 104 /* Configure validation: */ 139 105 m_pValidator = pValidator; 140 106 } 141 107 142 /* Navigation stuff: */143 108 void UIGlobalSettingsProxy::setOrderAfter(QWidget *pWidget) 144 109 { 145 setTabOrder(pWidget, m_pProxyCheckbox); 146 setTabOrder(m_pProxyCheckbox, m_pHostEditor); 110 /* Configure navigation: */ 111 setTabOrder(pWidget, m_pCheckboxProxy); 112 setTabOrder(m_pCheckboxProxy, m_pHostEditor); 147 113 setTabOrder(m_pHostEditor, m_pPortEditor); 148 #if 0149 setTabOrder(m_pPortEditor, m_pAuthCheckbox);150 setTabOrder(m_pAuthCheckbox, m_pLoginEditor);151 setTabOrder(m_pLoginEditor, m_pPasswordEditor);152 #endif153 114 } 154 115 155 /* Translation stuff: */156 116 void UIGlobalSettingsProxy::retranslateUi() 157 117 { … … 163 123 { 164 124 /* Update widgets availability: */ 165 m_pHostLabel->setEnabled(m_pProxyCheckbox->isChecked()); 166 m_pHostEditor->setEnabled(m_pProxyCheckbox->isChecked()); 167 m_pPortLabel->setEnabled(m_pProxyCheckbox->isChecked()); 168 m_pPortEditor->setEnabled(m_pProxyCheckbox->isChecked()); 169 #if 0 170 m_pAuthCheckbox->setEnabled(m_pProxyCheckbox->isChecked()); 171 172 /* Update auth widgets also: */ 173 sltAuthToggled(); 174 #endif 125 m_pContainerProxy->setEnabled(m_pCheckboxProxy->isChecked()); 175 126 176 127 /* Revalidate if possible: */ … … 179 130 } 180 131 181 #if 0182 void UIGlobalSettingsProxy::sltAuthToggled()183 {184 /* Update widgets availability: */185 m_pLoginLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());186 m_pLoginEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());187 m_pPasswordLabel->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());188 m_pPasswordEditor->setEnabled(m_pProxyCheckbox->isChecked() && m_pAuthCheckbox->isChecked());189 }190 #endif191 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.h
r43678 r47196 29 29 UISettingsCacheGlobalProxy() 30 30 : m_fProxyEnabled(false) 31 #if 032 , m_fAuthEnabled(false)33 #endif34 31 {} 35 32 bool m_fProxyEnabled; 36 33 QString m_strProxyHost; 37 34 QString m_strProxyPort; 38 #if 039 bool m_fAuthEnabled;40 QString m_strAuthLogin;41 QString m_strAuthPassword;42 #endif43 35 }; 44 36 … … 69 61 void saveFromCacheTo(QVariant &data); 70 62 71 /* Validation stuff: */63 /* Helper: Validation stuff: */ 72 64 void setValidator(QIWidgetValidator *pValidator); 73 65 74 /* Navigation stuff: */66 /* Helper: Navigation stuff: */ 75 67 void setOrderAfter(QWidget *pWidget); 76 68 77 /* Translation stuff: */69 /* Helper: Translation stuff: */ 78 70 void retranslateUi(); 79 71 80 72 private slots: 81 73 74 /* Handler: Proxy-checkbox stuff: */ 82 75 void sltProxyToggled(); 83 #if 084 void sltAuthToggled();85 #endif86 76 87 77 private: 88 78 89 /* Va lidator: */79 /* Variable: Validation stuff: */ 90 80 QIWidgetValidator *m_pValidator; 91 81 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.ui
r43106 r47196 3 3 VBox frontends: Qt4 GUI ("VirtualBox"): 4 4 5 Copyright (C) 2011-201 2Oracle Corporation5 Copyright (C) 2011-2013 Oracle Corporation 6 6 7 7 This file is part of VirtualBox Open Source Edition (OSE), as … … 15 15 <class>UIGlobalSettingsProxy</class> 16 16 <widget class="QWidget" name="UIGlobalSettingsProxy"> 17 <property name="geometry">18 <rect>19 <x>0</x>20 <y>0</y>21 <width>300</width>22 <height>150</height>23 </rect>24 </property>25 17 <layout class="QGridLayout"> 26 18 <property name="margin"> 27 19 <number>0</number> 28 20 </property> 29 <item row="0" column="0"> 21 <item row="0" column="0" colspan="2"> 22 <widget class="QCheckBox" name="m_pCheckboxProxy"> 23 <property name="whatsThis"> 24 <string>When checked, VirtualBox will use the proxy settings supplied for tasks like downloading Guest Additions from the network or checking for updates.</string> 25 </property> 26 <property name="text"> 27 <string>&Enable proxy</string> 28 </property> 29 </widget> 30 </item> 31 <item row="1" column="0"> 30 32 <spacer> 31 33 <property name="orientation"> … … 37 39 <property name="sizeHint"> 38 40 <size> 39 <width>40</width> 40 <height>20</height> 41 </size> 42 </property> 43 </spacer> 44 </item> 45 <item row="0" column="1" colspan="4"> 46 <widget class="QCheckBox" name="m_pProxyCheckbox"> 47 <property name="whatsThis"> 48 <string>When checked, VirtualBox will use the proxy settings supplied for tasks like downloading Guest Additions from the network or checking for updates.</string> 49 </property> 50 <property name="text"> 51 <string>&Enable proxy</string> 52 </property> 53 <property name="checked"> 54 <bool>false</bool> 55 </property> 56 </widget> 57 </item> 58 <item row="1" column="1"> 59 <spacer> 60 <property name="orientation"> 61 <enum>Qt::Horizontal</enum> 62 </property> 63 <property name="sizeType"> 64 <enum>QSizePolicy::Fixed</enum> 65 </property> 66 <property name="sizeHint"> 67 <size> 68 <width>16</width> 41 <width>20</width> 69 42 <height>0</height> 70 43 </size> … … 72 45 </spacer> 73 46 </item> 74 <item row="1" column="2" colspan="3"> 75 <layout class="QHBoxLayout"> 76 <property name="margin"> 77 <number>0</number> 47 <item row="1" column="1" colspan="2"> 48 <widget class="QWidget" name="m_pContainerProxy"> 49 <property name="sizePolicy"> 50 <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding"> 51 <horstretch>1</horstretch> 52 <verstretch>0</verstretch> 53 </sizepolicy> 78 54 </property> 79 <item> 80 <widget class="QLabel" name="m_pHostLabel"> 81 <property name="text"> 82 <string>Ho&st:</string> 83 </property> 84 <property name="alignment"> 85 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 86 </property> 87 <property name="buddy"> 88 <cstring>m_pHostEditor</cstring> 89 </property> 90 </widget> 91 </item> 92 <item> 93 <widget class="QILineEdit" name="m_pHostEditor"> 94 <property name="whatsThis"> 95 <string>Changes the proxy host.</string> 96 </property> 97 </widget> 98 </item> 99 <item> 100 <widget class="QLabel" name="m_pPortLabel"> 101 <property name="text"> 102 <string>&Port:</string> 103 </property> 104 <property name="alignment"> 105 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 106 </property> 107 <property name="buddy"> 108 <cstring>m_pPortEditor</cstring> 109 </property> 110 </widget> 111 </item> 112 <item> 113 <widget class="QILineEdit" name="m_pPortEditor"> 114 <property name="whatsThis"> 115 <string>Changes the proxy port.</string> 116 </property> 117 </widget> 118 </item> 119 </layout> 120 </item> 121 <item row="2" column="2" colspan="3"> 122 <widget class="QCheckBox" name="m_pAuthCheckbox"> 123 <property name="whatsThis"> 124 <string>When checked the authentication supplied will be used with the proxy server.</string> 125 </property> 126 <property name="text"> 127 <string>&Use authentication</string> 128 </property> 129 <property name="checked"> 130 <bool>false</bool> 131 </property> 55 <layout class="QHBoxLayout"> 56 <property name="margin"> 57 <number>0</number> 58 </property> 59 <item> 60 <widget class="QLabel" name="m_pHostLabel"> 61 <property name="text"> 62 <string>Ho&st:</string> 63 </property> 64 <property name="alignment"> 65 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 66 </property> 67 <property name="buddy"> 68 <cstring>m_pHostEditor</cstring> 69 </property> 70 </widget> 71 </item> 72 <item> 73 <widget class="QILineEdit" name="m_pHostEditor"> 74 <property name="whatsThis"> 75 <string>Changes the proxy host.</string> 76 </property> 77 </widget> 78 </item> 79 <item> 80 <widget class="QLabel" name="m_pPortLabel"> 81 <property name="text"> 82 <string>&Port:</string> 83 </property> 84 <property name="alignment"> 85 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 86 </property> 87 <property name="buddy"> 88 <cstring>m_pPortEditor</cstring> 89 </property> 90 </widget> 91 </item> 92 <item> 93 <widget class="QILineEdit" name="m_pPortEditor"> 94 <property name="whatsThis"> 95 <string>Changes the proxy port.</string> 96 </property> 97 </widget> 98 </item> 99 </layout> 132 100 </widget> 133 101 </item> 134 <item row="3" column="2" rowspan="2"> 135 <spacer> 136 <property name="orientation"> 137 <enum>Qt::Horizontal</enum> 138 </property> 139 <property name="sizeType"> 140 <enum>QSizePolicy::Fixed</enum> 141 </property> 142 <property name="sizeHint"> 143 <size> 144 <width>16</width> 145 <height>0</height> 146 </size> 147 </property> 148 </spacer> 149 </item> 150 <item row="3" column="3"> 151 <widget class="QLabel" name="m_pLoginLabel"> 152 <property name="text"> 153 <string>User &name:</string> 154 </property> 155 <property name="alignment"> 156 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 157 </property> 158 <property name="buddy"> 159 <cstring>m_pLoginEditor</cstring> 160 </property> 161 </widget> 162 </item> 163 <item row="3" column="4"> 164 <widget class="QILineEdit" name="m_pLoginEditor"> 165 <property name="whatsThis"> 166 <string>Changes the user name used for authentication.</string> 167 </property> 168 </widget> 169 </item> 170 <item row="4" column="3"> 171 <widget class="QLabel" name="m_pPasswordLabel"> 172 <property name="text"> 173 <string>Pass&word:</string> 174 </property> 175 <property name="alignment"> 176 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 177 </property> 178 <property name="buddy"> 179 <cstring>m_pPasswordEditor</cstring> 180 </property> 181 </widget> 182 </item> 183 <item row="4" column="4"> 184 <widget class="QILineEdit" name="m_pPasswordEditor"> 185 <property name="whatsThis"> 186 <string>Changes the password used for authentication.</string> 187 </property> 188 </widget> 189 </item> 190 <item row="5" column="1" colspan="4"> 102 <item row="2" column="0" colspan="3"> 191 103 <spacer> 192 104 <property name="orientation">
Note:
See TracChangeset
for help on using the changeset viewer.