summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-05-18 03:12:25 -0500
committerTimothy Pearson <[email protected]>2012-05-18 03:12:25 -0500
commitfd4d12151ca6b034307f8eba345fbef97a3cbfaf (patch)
tree2fd264d0d0500192dc1f2c649e76fc379d0bbd59 /src
parent8fdae616e94a37d5abf2d8a02fcff8a93d2f2ed1 (diff)
downloadkcmldap-fd4d12151ca6b034307f8eba345fbef97a3cbfaf.tar.gz
kcmldap-fd4d12151ca6b034307f8eba345fbef97a3cbfaf.zip
Add skeleton wizards and dialogs
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/bondfinishpage.cpp45
-rw-r--r--src/bondfinishpage.h43
-rw-r--r--src/bondfinishpagedlg.ui82
-rw-r--r--src/bondrealmpage.cpp45
-rw-r--r--src/bondrealmpage.h43
-rw-r--r--src/bondrealmpagedlg.ui82
-rw-r--r--src/bondwizard.cpp156
-rw-r--r--src/bondwizard.h77
-rw-r--r--src/ldap.cpp74
-rw-r--r--src/ldap.desktop4
-rw-r--r--src/ldap.h33
-rw-r--r--src/ldapconfigbase.ui72
-rw-r--r--src/realmpropertiesbase.ui60
-rw-r--r--src/realmpropertiesdialog.cpp42
-rw-r--r--src/realmpropertiesdialog.h44
16 files changed, 881 insertions, 23 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index dc6eb14..9ac5f38 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,7 +4,7 @@ METASOURCES = AUTO
# Install this plugin in the KDE modules directory
kde_module_LTLIBRARIES = kcm_ldap.la
-kcm_ldap_la_SOURCES = ldap.cpp ldapconfigbase.ui
+kcm_ldap_la_SOURCES = ldap.cpp ldapconfigbase.ui realmpropertiesdialog.cpp realmpropertiesbase.ui bondrealmpage.cpp bondrealmpagedlg.ui bondfinishpage.cpp bondfinishpagedlg.ui bondwizard.cpp
kcm_ldap_la_LIBADD = -lkio $(LIB_TDEUI)
kcm_ldap_la_LDFLAGS = -avoid-version -module -no-undefined \
$(all_libraries)
diff --git a/src/bondfinishpage.cpp b/src/bondfinishpage.cpp
new file mode 100644
index 0000000..cec7bfe
--- /dev/null
+++ b/src/bondfinishpage.cpp
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Timothy Pearson *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <tqstringlist.h>
+#include <tqlabel.h>
+#include <tqmap.h>
+
+#include <kapplication.h>
+#include <ksimpleconfig.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kiconloader.h>
+#include <dcopclient.h>
+#include <kprocess.h>
+
+#include "bondfinishpage.h"
+
+BondFinishPage::BondFinishPage(TQWidget *parent, const char *name ) : BondFinishPageDlg(parent,name) {
+
+ px_introSidebar->setPixmap(UserIcon("step2.png"));
+}
+
+BondFinishPage::~BondFinishPage(){
+ //
+}
+
+#include "bondfinishpage.moc"
diff --git a/src/bondfinishpage.h b/src/bondfinishpage.h
new file mode 100644
index 0000000..c737904
--- /dev/null
+++ b/src/bondfinishpage.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Timothy Pearson *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef BONDFINISHPAGE_H
+#define BONDFINISHPAGE_H
+
+#include "ldap.h"
+
+#include "bondfinishpagedlg.h"
+
+class TQStringList;
+
+/**Abstract class for the first wizard page. Sets the according selection on save()
+ *@author Timothy Pearson
+ */
+
+class BondFinishPage : public BondFinishPageDlg {
+ Q_OBJECT
+public:
+ BondFinishPage(TQWidget *parent=0, const char *name=0);
+ ~BondFinishPage();
+
+ LDAPRealmConfig m_realmConfig;
+};
+
+#endif
diff --git a/src/bondfinishpagedlg.ui b/src/bondfinishpagedlg.ui
new file mode 100644
index 0000000..448fdd8
--- /dev/null
+++ b/src/bondfinishpagedlg.ui
@@ -0,0 +1,82 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BondFinishPageDlg</class>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>BondFinishPageDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>678</width>
+ <height>452</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="9" colspan="1">
+ <property name="name">
+ <cstring>px_introSidebar</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>170</width>
+ <height>430</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>Panel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="indent">
+ <number>0</number>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="7" column="1">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="3" margin="6"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/src/bondrealmpage.cpp b/src/bondrealmpage.cpp
new file mode 100644
index 0000000..09d9d31
--- /dev/null
+++ b/src/bondrealmpage.cpp
@@ -0,0 +1,45 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Timothy Pearson *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <tqstringlist.h>
+#include <tqlabel.h>
+#include <tqmap.h>
+
+#include <kapplication.h>
+#include <ksimpleconfig.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kstandarddirs.h>
+#include <kiconloader.h>
+#include <dcopclient.h>
+#include <kprocess.h>
+
+#include "bondrealmpage.h"
+
+BondRealmPage::BondRealmPage(TQWidget *parent, const char *name ) : BondRealmPageDlg(parent,name) {
+
+ px_introSidebar->setPixmap(UserIcon("step1.png"));
+}
+
+BondRealmPage::~BondRealmPage(){
+ //
+}
+
+#include "bondrealmpage.moc"
diff --git a/src/bondrealmpage.h b/src/bondrealmpage.h
new file mode 100644
index 0000000..79a0153
--- /dev/null
+++ b/src/bondrealmpage.h
@@ -0,0 +1,43 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Timothy Pearson *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef BONDREALMPAGE_H
+#define BONDREALMPAGE_H
+
+#include "ldap.h"
+
+#include "bondrealmpagedlg.h"
+
+class TQStringList;
+
+/**Abstract class for the first wizard page. Sets the according selection on save()
+ *@author Timothy Pearson
+ */
+
+class BondRealmPage : public BondRealmPageDlg {
+ Q_OBJECT
+public:
+ BondRealmPage(TQWidget *parent=0, const char *name=0);
+ ~BondRealmPage();
+
+ LDAPRealmConfig m_realmConfig;
+};
+
+#endif
diff --git a/src/bondrealmpagedlg.ui b/src/bondrealmpagedlg.ui
new file mode 100644
index 0000000..e888ea5
--- /dev/null
+++ b/src/bondrealmpagedlg.ui
@@ -0,0 +1,82 @@
+<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
+<class>BondRealmPageDlg</class>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>BondRealmPageDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>678</width>
+ <height>452</height>
+ </rect>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQLabel" row="0" column="0" rowspan="9" colspan="1">
+ <property name="name">
+ <cstring>px_introSidebar</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>170</width>
+ <height>430</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>Panel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="indent">
+ <number>0</number>
+ </property>
+ </widget>
+ <spacer row="2" column="1">
+ <property name="name">
+ <cstring>Spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="7" column="1">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<layoutdefaults spacing="3" margin="6"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+</UI>
diff --git a/src/bondwizard.cpp b/src/bondwizard.cpp
new file mode 100644
index 0000000..b0fe2b7
--- /dev/null
+++ b/src/bondwizard.cpp
@@ -0,0 +1,156 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Timothy Pearson *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <unistd.h>
+
+#include <tqpushbutton.h>
+#include <tqlabel.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
+#include <tqtimer.h>
+#include <tqcursor.h>
+
+#include <ksimpleconfig.h>
+#include <kglobal.h>
+#include <kglobalsettings.h>
+#include <kstandarddirs.h>
+#include <klocale.h>
+#include <kapplication.h>
+#include <klistview.h>
+#include <krun.h>
+#include <kmessagebox.h>
+#include <kconfig.h>
+
+#include <stdlib.h>
+
+#include <kdebug.h>
+
+#include "bondrealmpage.h"
+#include "bondfinishpage.h"
+
+#include "bondwizard.h"
+#include "bondwizard.moc"
+
+BondWizard::BondWizard(TQWidget *parent, const char *name)
+ : KWizard(parent, name, true) {
+
+ realmpage= new BondRealmPage(this);
+ addPage( realmpage, i18n( "Step 1: Introduction" ) );
+ setHelpEnabled(TQWizard::page(0), false);
+
+ finishpage= new BondFinishPage(this);
+ addPage(finishpage, i18n( "Step 2: I want it my Way..." ) );
+ setHelpEnabled(TQWizard::page(1), false);
+
+ setFinishEnabled(TQWizard::page(1), true);
+
+ setPosition();
+}
+
+BondWizard::~BondWizard() {
+}
+
+
+void BondWizard::next() {
+ if(currentPage()==realmpage) {
+ realm_dirty=true; // set the dirty flag, changes done that need reverting
+ // realmpage->save();
+ TQWizard::next();
+ }
+ if(currentPage()==finishpage) {
+ finishButton()->setFocus();
+ }
+}
+
+void BondWizard::slotNext() {
+ TQWizard::next();
+}
+
+void BondWizard::back() {
+ TQWizard::back();
+}
+
+bool BondWizard::askClose(){
+ TQString text;
+ if (currentPage()==realmpage) {
+ text = i18n("<p>Are you sure you want to quit the LDAP Bonding Wizard?</p>"
+ "<p>If yes, click <b>Quit</b> and all changes will be lost."
+ "<br>If not, click <b>Cancel</b> to return and finish your setup.</p>");
+ } else {
+ text = i18n("<p>Are you sure you want to quit the LDAP Bonding Wizard?</p>"
+ "<p>If not, click <b>Cancel</b> to return and finish bonding.</p>");
+ }
+ int status = KMessageBox::warningContinueCancel(this, text, i18n("All Changes Will Be Lost"), KStdGuiItem::quit());
+ if(status==KMessageBox::Continue){
+ setDefaults();
+ return true;
+ } else {
+ return false;
+ }
+}
+
+/** the cancel button is connected to the reject() slot of TQDialog,
+ * so we have to reimplement this here to add a dialogbox to ask if we
+ * really want to quit the wizard.
+ */
+void BondWizard::reject(){
+ if (askClose()){
+ exit(0);
+ }
+}
+
+void BondWizard::closeEvent(TQCloseEvent* e){
+ if ( askClose() )
+ exit(0);
+ else
+ e->ignore();
+}
+
+/** maybe call a dialog that the wizard has finished. */
+void BondWizard::accept(){
+ exit(0);
+}
+
+/** calls all save functions after resetting all features/ OS/ theme selections to Trinity default */
+void BondWizard::setDefaults(){
+// if(realm_dirty)
+// realmpage->save(false);
+}
+
+/** there seems to be a bug in TQWizard, that makes this evil hack necessary */
+void BondWizard::setPosition() {
+ TQSize hint = realmpage->sizeHint();
+ TQSize finish_size = finishpage->sizeHint();
+
+ // get the width of the broadest child-widget
+ if ( hint.width() < finish_size.width() )
+ hint.setWidth(finish_size.width());
+
+ // get the height of the highest child-widget
+ if ( hint.height() < finish_size.height() )
+ hint.setHeight(finish_size.height());
+
+ // set the position
+ TQRect rect = KGlobalSettings::desktopGeometry(TQCursor::pos());
+ int w = rect.x() + (rect.width() - hint.width())/2 - 9;
+ int h = rect.y() + (rect.height() - hint.height())/2;
+ move(w, h);
+}
diff --git a/src/bondwizard.h b/src/bondwizard.h
new file mode 100644
index 0000000..0cdfafd
--- /dev/null
+++ b/src/bondwizard.h
@@ -0,0 +1,77 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Timothy Pearson *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef BONDWIZARD_H
+#define BONDWIZARD_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <kapplication.h>
+#include <kwizard.h>
+
+/** prototypes */
+class KLanguageCombo;
+class BondRealmPage;
+class BondFinishPage;
+
+/** BondWizard is the base class of the project */
+class BondWizard : public KWizard {
+ Q_OBJECT
+public:
+ /** construtor */
+ BondWizard(TQWidget* parent=0, const char *name=0);
+ /** destructor */
+ ~BondWizard();
+
+ virtual void next();
+ virtual void back();
+
+public slots: // Public slots
+ /** calls all save functions after resetting all fields to Trinity default */
+ void setDefaults();
+ /** the cancel button is connected to the reject() slot of TQDialog,
+ * so we have to reimplement this here to add a dialogbox to
+ * ask if we really want to quit the wizard.
+ */
+ void reject();
+ /** maybe call a dialog that the wizard has finished.
+ * Calls applySettings() to save the current selection.
+ */
+ void accept();
+ /** We need this to use it in a TQTimer */
+ void slotNext();
+
+private:
+ void setPosition();
+
+private:
+ BondRealmPage* realmpage;
+ BondFinishPage* finishpage;
+ bool realm_dirty;
+
+protected: // Protected methods
+ // the close button on the titlebar sets e->accept() which we don't want.
+ virtual void closeEvent(TQCloseEvent*);
+ bool askClose();
+};
+
+#endif
diff --git a/src/ldap.cpp b/src/ldap.cpp
index 2cd0d27..7038989 100644
--- a/src/ldap.cpp
+++ b/src/ldap.cpp
@@ -22,6 +22,7 @@
#include <klocale.h>
#include <kglobal.h>
+#include <kcombobox.h>
#include <kparts/genericfactory.h>
#include <ksimpleconfig.h>
#include <kglobalsettings.h>
@@ -35,31 +36,24 @@
#include <tqheader.h>
#include "ldap.h"
+#include "bondwizard.h"
// FIXME
// Connect this to CMake/Automake
#define KDE_CONFDIR "/etc/trinity"
-typedef KGenericFactory<ldap, TQWidget> ldapFactory;
+typedef KGenericFactory<LDAPConfig, TQWidget> ldapFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_ldap, ldapFactory("kcmldap"))
-KSimpleConfig *systemconfig;
+KSimpleConfig *systemconfig = 0;
-ldap::ldap(TQWidget *parent, const char *name, const TQStringList&)
+LDAPConfig::LDAPConfig(TQWidget *parent, const char *name, const TQStringList&)
: KCModule(parent, name), myAboutData(0)
{
TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
- base = new LDAPConfigBase(this);
- layout->add(base);
-
- setRootOnlyMsg(i18n("<b>Bonded LDAP realms take effect system wide, and require administrator access to modify</b><br>To alter the system's bonded LDAP realms, click on the \"Administrator Mode\" button below."));
- setUseRootOnlyMsg(true);
-
- load();
-
KAboutData* about = new KAboutData("ldap", I18N_NOOP("TDE LDAP Manager"), "0.1",
I18N_NOOP("TDE LDAP Manager Control Panel Module"),
KAboutData::License_GPL,
@@ -68,34 +62,80 @@ ldap::ldap(TQWidget *parent, const char *name, const TQStringList&)
about->addAuthor("Timothy Pearson", 0, "[email protected]");
setAboutData( about );
+ base = new LDAPConfigBase(this);
+ layout->add(base);
+
+ setRootOnlyMsg(i18n("<b>Bonded LDAP realms take effect system wide, and require administrator access to modify</b><br>To alter the system's bonded LDAP realms, click on the \"Administrator Mode\" button below."));
+ setUseRootOnlyMsg(true);
+
+ connect(base->systemEnableSupport, TQT_SIGNAL(clicked()), TQT_SLOT(changed()));
+ connect(base->systemEnableSupport, TQT_SIGNAL(clicked()), TQT_SLOT(processLockouts()));
+
+ connect(base->btnBondRealm, TQT_SIGNAL(clicked()), TQT_SLOT(bondToNewRealm()));
+
+ load();
if (getuid() != 0 || !systemconfig->checkConfigFilesWritable( true )) {
base->systemEnableSupport->setEnabled(false);
}
+
+ processLockouts();
};
-ldap::~ldap() {
+LDAPConfig::~LDAPConfig() {
delete systemconfig;
}
-void ldap::load() {
+void LDAPConfig::load() {
kgs = new KGlobalSettings();
KStandardDirs *ksd = new KStandardDirs();
+
+ load(false);
+}
+
+void LDAPConfig::load(bool useDefaults )
+{
+ //Update the toggle buttons with the current configuration
+ systemconfig->setReadDefaults( useDefaults );
+
+ systemconfig->setGroup(NULL);
+ base->systemEnableSupport->setChecked(systemconfig->readBoolEntry("EnableLDAP", false));
+
+ // Load realms
+ TQStringList cfgRealms = systemconfig->groupList();
+ for (TQStringList::Iterator i(cfgRealms.begin()); i != cfgRealms.end(); ++i) {
+ (void)new TQListViewItem(base->ldapRealmList, "RAJA", *i);
+ }
+
+ emit changed(useDefaults);
}
-void ldap::defaults() {
+void LDAPConfig::defaults() {
}
-void ldap::save() {
+void LDAPConfig::save() {
}
-int ldap::buttons() {
+void LDAPConfig::processLockouts() {
+ bool panelIsEnabled = base->systemEnableSupport->isChecked();
+
+ base->groupRealms->setEnabled(panelIsEnabled);
+}
+
+void LDAPConfig::bondToNewRealm() {
+ // RAJA FIXME
+
+ BondWizard *bondwizard = new BondWizard(this);
+ bondwizard->show();
+}
+
+int LDAPConfig::buttons() {
return KCModule::Apply|KCModule::Help;
}
-TQString ldap::quickHelp() const
+TQString LDAPConfig::quickHelp() const
{
return i18n("This module configures which LDAP realms TDE uses for authentication.");
}
diff --git a/src/ldap.desktop b/src/ldap.desktop
index 72246c2..d2be8b1 100644
--- a/src/ldap.desktop
+++ b/src/ldap.desktop
@@ -6,8 +6,10 @@ Type=Application
X-KDE-ModuleType=Library
X-KDE-Library=ldap
-X-KDE-HasReadOnlyMode=false
+X-KDE-HasReadOnlyMode=true
X-KDE-ParentApp=kcontrol
+X-KDE-RootOnly=true
+X-KDE-SubstituteUID=true
[Desktop Entry]
Encoding=UTF-8
diff --git a/src/ldap.h b/src/ldap.h
index d543cef..f56e24d 100644
--- a/src/ldap.h
+++ b/src/ldap.h
@@ -37,25 +37,52 @@
#include <config.h>
#endif
-class ldap: public KCModule
+// PRIVATE
+class LDAPRealmConfig
+{
+ public:
+ TQString name;
+ bool bonded;
+ long uid_offset;
+ long gid_offset;
+ TQStringList domain_mappings;
+ TQString kdc;
+ int kdc_port;
+ TQString admin_server;
+ int admin_server_port;
+ bool pkinit_require_eku;
+ bool pkinit_require_krbtgt_otherName;
+ bool win2k_pkinit;
+ bool win2k_pkinit_require_binding;
+};
+
+typedef TQValueList<LDAPRealmConfig> LDAPRealmConfigList;
+
+class LDAPConfig: public KCModule
{
Q_OBJECT
public:
- ldap( TQWidget *parent=0, const char *name=0, const TQStringList& = TQStringList() );
- ~ldap();
+ LDAPConfig( TQWidget *parent=0, const char *name=0, const TQStringList& = TQStringList() );
+ ~LDAPConfig();
virtual void load();
+ virtual void load( bool useDefaults);
virtual void save();
virtual void defaults();
virtual int buttons();
virtual TQString quickHelp() const;
virtual const KAboutData *aboutData() const { return myAboutData; };
+ private slots:
+ void processLockouts();
+ void bondToNewRealm();
+
private:
KAboutData *myAboutData;
KGlobalSettings *kgs;
LDAPConfigBase *base;
+ LDAPRealmConfigList m_realms;
};
#endif
diff --git a/src/ldapconfigbase.ui b/src/ldapconfigbase.ui
index 8d00fad..de0b0d7 100644
--- a/src/ldapconfigbase.ui
+++ b/src/ldapconfigbase.ui
@@ -60,12 +60,82 @@
<cstring>groupRealms</cstring>
</property>
<property name="title">
- <string>Bonded Realms</string>
+ <string>Realm Bonding</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
+ <widget class="KListView" row="0" column="0" colspan="5">
+ <column>
+ <property name="text">
+ <string>Status</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>false</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Name</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizeable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>ldapRealmList</cstring>
+ </property>
+ <property name="rootIsDecorated">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>btnBondRealm</cstring>
+ </property>
+ <property name="text">
+ <string>Bond to New Realm</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>btnUnBondRealm</cstring>
+ </property>
+ <property name="text">
+ <string>Re-Bond to Realm</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>btnDeactivateRealm</cstring>
+ </property>
+ <property name="text">
+ <string>Deactivate Bond to Realm</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>btnRemoveRealm</cstring>
+ </property>
+ <property name="text">
+ <string>Remove Realm</string>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="4">
+ <property name="name">
+ <cstring>btnRealmProperties</cstring>
+ </property>
+ <property name="text">
+ <string>Realm Properties</string>
+ </property>
+ </widget>
</grid>
</widget>
<spacer row="4" column="0">
diff --git a/src/realmpropertiesbase.ui b/src/realmpropertiesbase.ui
new file mode 100644
index 0000000..6e61a44
--- /dev/null
+++ b/src/realmpropertiesbase.ui
@@ -0,0 +1,60 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>RealmPropertiesBase</class>
+<widget class="TQWidget">
+ <property name="name">
+ <cstring>RealmPropertiesBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>664</width>
+ <height>503</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>640</width>
+ <height>480</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>LDAP Realm Properties</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="TQGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Basic Settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/src/realmpropertiesdialog.cpp b/src/realmpropertiesdialog.cpp
new file mode 100644
index 0000000..2ae9428
--- /dev/null
+++ b/src/realmpropertiesdialog.cpp
@@ -0,0 +1,42 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Timothy Pearson *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include <klocale.h>
+#include <klineedit.h>
+#include <kactionselector.h>
+#include <tqlistbox.h>
+#include <kpushbutton.h>
+#include <tqpixmap.h>
+#include <tqiconset.h>
+
+#include "realmpropertiesdialog.h"
+
+RealmPropertiesDialog::RealmPropertiesDialog(LDAPRealmConfig* realm, TQWidget* parent, const char* name)
+ : KDialogBase(parent, name, true, i18n("Realm Properties"), Ok|Cancel, Ok, true), m_realmConfig(realm)
+{
+ m_base = new RealmPropertiesBase(this);
+}
+
+void RealmPropertiesDialog::slotOk()
+{
+ // accept(); or reject();
+}
+
+#include "realmpropertiesdialog.moc"
diff --git a/src/realmpropertiesdialog.h b/src/realmpropertiesdialog.h
new file mode 100644
index 0000000..4c10062
--- /dev/null
+++ b/src/realmpropertiesdialog.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+ * Copyright (C) 2012 by Timothy Pearson *
+ * *
+ * This program 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. *
+ * *
+ * This program 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 this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _SERVICECONFIGDIALOG_H_
+#define _SERVICECONFIGDIALOG_H_
+
+#include <kdialogbase.h>
+
+#include "ldap.h"
+#include "realmpropertiesbase.h"
+
+class RealmPropertiesDialog : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ RealmPropertiesDialog(LDAPRealmConfig* realm, TQWidget* parent = 0, const char* name = 0);
+
+public slots:
+ void slotOk();
+
+private:
+ RealmPropertiesBase *m_base;
+ LDAPRealmConfig* m_realmConfig;
+};
+
+#endif