Changeset 74445 in vbox
- Timestamp:
- Sep 24, 2018 3:35:26 PM (6 years ago)
- 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
r74440 r74445 45 45 : m_enmProxyMode(KProxyMode_System) 46 46 , m_strProxyHost(QString()) 47 , m_strProxyPort(QString())48 47 {} 49 48 … … 54 53 && (m_enmProxyMode == other.m_enmProxyMode) 55 54 && (m_strProxyHost == other.m_strProxyHost) 56 && (m_strProxyPort == other.m_strProxyPort)57 55 ; 58 56 } … … 67 65 /** Holds the proxy host. */ 68 66 QString m_strProxyHost; 69 /** Holds the proxy port. */70 QString m_strProxyPort;71 67 }; 72 68 … … 99 95 oldProxyData.m_enmProxyMode = m_properties.GetProxyMode(); 100 96 oldProxyData.m_strProxyHost = m_properties.GetProxyURL(); 101 oldProxyData.m_strProxyPort = "";102 if (!oldProxyData.m_strProxyHost.isEmpty())103 {104 QUrl url(oldProxyData.m_strProxyHost);105 if (url.port() != -1)106 {107 oldProxyData.m_strProxyPort = QString::number(url.port());108 url.setPort(-1);109 oldProxyData.m_strProxyHost = url.url();110 }111 }112 97 113 98 /* Cache old proxy data: */ … … 132 117 } 133 118 m_pHostEditor->setText(oldProxyData.m_strProxyHost); 134 m_pPortEditor->setText(oldProxyData.m_strProxyPort);135 119 sltHandleProxyToggle(); 136 120 … … 148 132 : m_pRadioProxyDisabled->isChecked() ? KProxyMode_NoProxy : KProxyMode_System; 149 133 newProxyData.m_strProxyHost = m_pHostEditor->text(); 150 newProxyData.m_strProxyPort = m_pPortEditor->text();151 134 152 135 /* Cache new proxy data: */ … … 182 165 { 183 166 message.second << tr("No proxy host is currently specified."); 184 fPass = false;185 }186 187 /* Check for port value: */188 if ( m_pPortEditor->text().trimmed().isEmpty()189 && QUrl(m_pHostEditor->text()).port() == -1)190 {191 message.second << tr("No proxy port is currently specified.");192 167 fPass = false; 193 168 } … … 245 220 connect(m_pHostEditor, SIGNAL(textEdited(const QString &)), this, SLOT(revalidate())); 246 221 } 247 248 /* Port editor created in the .ui file. */249 AssertPtrReturnVoid(m_pPortEditor);250 {251 /* Configure editor: */252 m_pPortEditor->setFixedWidthByText(QString().fill('0', 6));253 m_pPortEditor->setValidator(new QRegExpValidator(QRegExp("\\d+"), m_pPortEditor));254 connect(m_pPortEditor, SIGNAL(textEdited(const QString &)), this, SLOT(revalidate()));255 }256 222 } 257 223 … … 282 248 m_properties.SetProxyMode(newProxyData.m_enmProxyMode); 283 249 fSuccess &= m_properties.isOk(); 284 if (newProxyData.m_strProxyPort.isEmpty()) 285 m_properties.SetProxyURL(newProxyData.m_strProxyHost); 286 else 287 { 288 QUrl url(newProxyData.m_strProxyHost); 289 if (url.port() == -1) 290 url.setPort(newProxyData.m_strProxyPort.toUInt()); 291 m_properties.SetProxyURL(url.url()); 292 } 250 m_properties.SetProxyURL(newProxyData.m_strProxyHost); 293 251 fSuccess &= m_properties.isOk(); 294 252 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsProxy.ui
r71027 r74445 80 80 <widget class="QLabel" name="m_pHostLabel"> 81 81 <property name="text"> 82 <string> Ho&st:</string>82 <string>&URL:</string> 83 83 </property> 84 84 <property name="alignment"> … … 94 94 <property name="whatsThis"> 95 95 <string>Holds 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>Holds the proxy port.</string>116 96 </property> 117 97 </widget>
Note:
See TracChangeset
for help on using the changeset viewer.