summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-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());