[PC-BSD Commits] r17268 - pcbsd/current/src-qt4/pc-adsldap

svn at pcbsd.org svn at pcbsd.org
Wed Jun 13 10:06:16 PDT 2012


Author: kris
Date: 2012-06-13 17:06:13 +0000 (Wed, 13 Jun 2012)
New Revision: 17268

Modified:
   pcbsd/current/src-qt4/pc-adsldap/adsldap.cpp
   pcbsd/current/src-qt4/pc-adsldap/adsldap.h
   pcbsd/current/src-qt4/pc-adsldap/adsldap.ui
Log:

Add guts to ads / ldap utility, to save settings across sessions. Now need
to add export functionality



Modified: pcbsd/current/src-qt4/pc-adsldap/adsldap.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-adsldap/adsldap.cpp	2012-06-13 16:27:13 UTC (rev 17267)
+++ pcbsd/current/src-qt4/pc-adsldap/adsldap.cpp	2012-06-13 17:06:13 UTC (rev 17268)
@@ -12,10 +12,93 @@
 #include <QTextStream>
 #include <QString>
 #include <QDebug>
+#include <QSettings>
 #include <pcbsd-utils.h>
 #include "adsldap.h"
 
 void pcADSLDAP::programInit()
 {
+  connect(pushClose, SIGNAL(clicked()), this, SLOT(slotClose()));
+  connect(pushSave, SIGNAL(clicked()), this, SLOT(slotSave()));
 
+  loadSettings();
 }
+
+void pcADSLDAP::slotClose()
+{
+   saveSettings();
+   close();
+}
+
+void pcADSLDAP::slotSave()
+{
+   saveSettings();
+   exportSettings();
+}
+
+void pcADSLDAP::saveSettings()
+{
+   // Save ADS settings
+   QSettings settings("PCBSD", "ADS");
+   settings.setValue("Enabled", groupADS->isChecked());
+   settings.setValue("DomainController", lineADSDomainController->text());
+   settings.setValue("DomainName", lineADSDomainName->text());
+   settings.setValue("NetBIOS", lineADSNetBIOS->text());
+   settings.setValue("Workgroup", lineADSWorkgroup->text());
+   settings.setValue("TrustedDomains", checkADSTrustedDomains->isChecked());
+   settings.setValue("AdminName", lineADSAdminName->text());
+   settings.setValue("AdminPW", lineADSAdminPW->text());
+
+   QSettings settings2("PCBSD", "LDAP");
+   settings2.setValue("Enabled", groupLDAP->isChecked());
+   settings2.setValue("AnonBinding", checkLDAnonBinding->isChecked());
+   settings2.setValue("EncMode", comboLDEncMode->currentIndex());
+   settings2.setValue("PWEnc", comboLDPWEnc->currentIndex());
+   settings2.setValue("BaseDN", lineLDBaseDN->text());
+   settings2.setValue("GroupSuffix", lineLDGroupSuffix->text());
+   settings2.setValue("Hostname", lineLDHostname->text());
+   settings2.setValue("MachineSuffix", lineLDMachineSuffix->text());
+   settings2.setValue("PWSuffix", lineLDPWSuffix->text());
+   settings2.setValue("RootBindDN", lineLDRootBindDN->text());
+   settings2.setValue("RootBindPW", lineLDRootBindPW->text());
+   settings2.setValue("SelfSignedCert", lineLDSelfSignedCert->text());
+   settings2.setValue("UserSuffix", lineLDUserSuffix->text());
+   settings2.setValue("Aux", textLDAux->toPlainText());
+
+}
+
+void pcADSLDAP::loadSettings()
+{
+  QSettings settings("PCBSD", "ADS");
+  groupADS->setChecked(settings.value("Enabled", false).toBool());
+  lineADSDomainController->setText(settings.value("DomainController", QString()).toString());
+  lineADSDomainName->setText(settings.value("DomainName", QString()).toString());
+  lineADSNetBIOS->setText(settings.value("NetBIOS", QString()).toString());
+  lineADSWorkgroup->setText(settings.value("Workgroup", QString()).toString());
+  checkADSTrustedDomains->setChecked(settings.value("TrustedDomains", false).toBool());
+  lineADSAdminName->setText(settings.value("AdminName", QString()).toString());
+  lineADSAdminPW->setText(settings.value("AdminPW", QString()).toString());
+  lineADSAdminPW2->setText(settings.value("AdminPW", QString()).toString());
+
+  QSettings settings2("PCBSD", "LDAP");
+  groupLDAP->setChecked(settings2.value("Enabled", false).toBool());
+  checkLDAnonBinding->setChecked(settings2.value("AnonBinding", false).toBool());
+  comboLDEncMode->setCurrentIndex(settings2.value("EncMode", 0).toInt());
+  comboLDPWEnc->setCurrentIndex(settings2.value("PWEnc", 0).toInt());
+  lineLDBaseDN->setText(settings2.value("BaseDN", QString()).toString());
+  lineLDGroupSuffix->setText(settings2.value("GroupSuffix", QString()).toString());
+  lineLDHostname->setText(settings2.value("Hostname", QString()).toString());
+  lineLDMachineSuffix->setText(settings2.value("MachineSuffix", QString()).toString());
+  lineLDPWSuffix->setText(settings2.value("PWSuffix", QString()).toString());
+  lineLDRootBindDN->setText(settings2.value("RootBindDN", QString()).toString());
+  lineLDRootBindPW->setText(settings2.value("RootBindPW", QString()).toString());
+  lineLDSelfSignedCert->setText(settings2.value("SelfSignedCert", QString()).toString());
+  lineLDUserSuffix->setText(settings2.value("UserSuffix", QString()).toString());
+  textLDAux->insertPlainText(settings2.value("Aux", QString()).toString());
+
+}
+
+void pcADSLDAP::exportSettings()
+{
+
+}

Modified: pcbsd/current/src-qt4/pc-adsldap/adsldap.h
===================================================================
--- pcbsd/current/src-qt4/pc-adsldap/adsldap.h	2012-06-13 16:27:13 UTC (rev 17267)
+++ pcbsd/current/src-qt4/pc-adsldap/adsldap.h	2012-06-13 17:06:13 UTC (rev 17268)
@@ -24,8 +24,13 @@
 public slots:
 
 private slots:
+   void slotClose();
+   void slotSave();
 
 private:
+   void saveSettings();
+   void loadSettings();
+   void exportSettings();
 
 signals:
 

Modified: pcbsd/current/src-qt4/pc-adsldap/adsldap.ui
===================================================================
(Binary files differ)



More information about the Commits mailing list