]> 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 1fa81d73f10328df48a71ab958a6fe7818433458..1d57797af661337bf9424f828587e516e24b2f63 100644 (file)
@@ -1,20 +1,21 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
+ * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
- * This file is part of fosdem-schedule.
+ * This file is part of ConfClerk.
  *
- * fosdem-schedule is free software: you can redistribute it and/or modify it
+ * ConfClerk is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation, either version 2 of the License, or (at your option)
  * any later version.
  *
- * fosdem-schedule is distributed in the hope that it will be useful, but
+ * ConfClerk is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
+ * ConfClerk.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "settingsdialog.h"
 
@@ -25,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()
 {
@@ -49,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);
 }
 
+