summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-11-13 10:22:26 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-11-13 10:50:16 (GMT)
commit5fcc96c17e4f97fb8946880fce1fedc6afd8ed21 (patch)
tree7cc354ab0c9dcf2606bbb3e29a2345fe0bfe0913 /Swift/QtUI
parent59c1b26ba8f85bfb52f7c8e95bf1eca208d3de7b (diff)
downloadswift-contrib-5fcc96c17e4f97fb8946880fce1fedc6afd8ed21.zip
swift-contrib-5fcc96c17e4f97fb8946880fce1fedc6afd8ed21.tar.bz2
Don't show -1 as default port in UI.
Change-Id: I6ef93c0ea63fc39daacea832775f0f883d01ee12 Resolves: #1177
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtConnectionSettingsWindow.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Swift/QtUI/QtConnectionSettingsWindow.cpp b/Swift/QtUI/QtConnectionSettingsWindow.cpp
index 5bc2754..040b92a 100644
--- a/Swift/QtUI/QtConnectionSettingsWindow.cpp
+++ b/Swift/QtUI/QtConnectionSettingsWindow.cpp
@@ -71,6 +71,8 @@ QtConnectionSettingsWindow::QtConnectionSettingsWindow(const ClientOptions& opti
ui.manual_manualHost->setChecked(true);
ui.manual_manualHostName->setText(P2QSTRING(options.manualHostname));
+ if (options.manualPort >=0) {
ui.manual_manualHostPort->setText(P2QSTRING(boost::lexical_cast<std::string>(options.manualPort)));
}
+ }
ui.manual_proxyType->setCurrentIndex(options.proxyType);
if (!options.manualProxyHostname.empty()) {
@@ -113,5 +115,7 @@ ClientOptions QtConnectionSettingsWindow::getOptions() {
try {
options.manualPort = boost::lexical_cast<int>(Q2PSTRING(ui.manual_manualHostPort->text()));
- } catch (const boost::bad_lexical_cast&) {}
+ } catch (const boost::bad_lexical_cast&) {
+ options.manualPort = -1;
+ }
}
options.proxyType = static_cast<ClientOptions::ProxyType>(ui.manual_proxyType->currentIndex());