]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/gui/settingsdialog.cpp
Add .pro.user.* to svn:ignore and remove it in the release target.
[toast/confclerk.git] / src / gui / settingsdialog.cpp
index 36dbf4e1364cb17f7dadaf3d3ee3951cc401f3d8..1d57797af661337bf9424f828587e516e24b2f63 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
- * Copyright (C) 2011 Philipp Spitzer, gregor herrmann
+ * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
  * This file is part of ConfClerk.
  *
@@ -26,23 +26,19 @@ SettingsDialog::SettingsDialog(QWidget *aParent)
     : QDialog(aParent)
 {
     setupUi(this);
+    connect(directConnection, SIGNAL(clicked(bool)), SLOT(connectionTypeChanged(bool)));
+}
 
+
+void SettingsDialog::loadDialogData()
+{
     // deserialize dialog data
     address->setText(AppSettings::proxyAddress());
     port->setValue(AppSettings::proxyPort());
     directConnection->setChecked(AppSettings::isDirectConnection());
-
-    connect(buttonBox, SIGNAL(accepted()), SLOT(saveDialogData()));
-    connect(directConnection, SIGNAL(clicked(bool)), SLOT(connectionTypeChanged(bool)));
-
-    if(directConnection->isChecked())
-        proxyWidget->hide();
+    proxyWidget->setDisabled(directConnection->isChecked());
 }
 
-void SettingsDialog::connectionTypeChanged(bool aState)
-{
-    aState ? proxyWidget->hide() : proxyWidget->show();
-}
 
 void SettingsDialog::saveDialogData()
 {
@@ -50,7 +46,12 @@ void SettingsDialog::saveDialogData()
     AppSettings::setProxyAddress(address->text());
     AppSettings::setProxyPort(port->value());
     AppSettings::setDirectConnection(directConnection->isChecked());
+}
+
 
-    close();
+void SettingsDialog::connectionTypeChanged(bool aState)
+{
+    proxyWidget->setDisabled(aState);
 }
 
+