summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-05-31 16:34:08 -0500
committerTimothy Pearson <[email protected]>2012-05-31 16:34:08 -0500
commit46d1d860d1ae8c455f19b4fd125eba4e0268022a (patch)
treeac06197f8a71d0abfddaf6fc82b374dfec9bb217
parentebe1ee0677547ebef722ef0523cc8ef1e0601657 (diff)
downloadkcmldapcontroller-46d1d860d1ae8c455f19b4fd125eba4e0268022a.tar.gz
kcmldapcontroller-46d1d860d1ae8c455f19b4fd125eba4e0268022a.zip
Pretty much ready to accept ldap and heimdal configuration routines
-rw-r--r--src/realmconfigpage.cpp49
-rw-r--r--src/realmconfigpage.h13
-rw-r--r--src/realmfinishpage.cpp2
-rw-r--r--src/realmwizard.cpp11
4 files changed, 66 insertions, 9 deletions
diff --git a/src/realmconfigpage.cpp b/src/realmconfigpage.cpp
index e3bd736..03df77d 100644
--- a/src/realmconfigpage.cpp
+++ b/src/realmconfigpage.cpp
@@ -30,16 +30,61 @@
#include <kiconloader.h>
#include <dcopclient.h>
#include <kprocess.h>
+#include <klineedit.h>
+#include <ktextedit.h>
+#include <kwizard.h>
+#include <kdialogbase.h>
+#include <tqpushbutton.h>
#include "realmconfigpage.h"
RealmConfigPage::RealmConfigPage(TQWidget *parent, const char *name ) : RealmConfigPageDlg(parent,name) {
- px_introSidebar->setPixmap(UserIcon("step1.png"));
+ px_introSidebar->setPixmap(UserIcon("step2.png"));
+
+ connect(txtRealmName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries()));
+ connect(txtKDC, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries()));
+ connect(txtAdminServer, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries()));
+
+ connect(txtRealmName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(realmNameChanged()));
+
+ m_parentWizard = dynamic_cast<KWizard*>(parent);
+ m_parentDialog = dynamic_cast<KDialogBase*>(parent);
}
-RealmConfigPage::~RealmConfigPage(){
+RealmConfigPage::~RealmConfigPage() {
//
}
+void RealmConfigPage::validateEntries() {
+ if (m_parentWizard) {
+ if ((txtRealmName->text() != "") && (txtKDC->text() != "") && (txtAdminServer->text() != "")) {
+ m_parentWizard->nextButton()->setEnabled(true);
+ }
+ else {
+ m_parentWizard->nextButton()->setEnabled(false);
+ }
+ }
+ if (m_parentDialog) {
+ if ((txtRealmName->text() != "") && (txtKDC->text() != "") && (txtAdminServer->text() != "")) {
+ m_parentDialog->enableButton(KDialogBase::Ok, true);
+ }
+ else {
+ m_parentDialog->enableButton(KDialogBase::Ok, false);
+ }
+ }
+}
+
+void RealmConfigPage::realmNameChanged() {
+ TQString realmName = txtRealmName->text();
+ txtRealmName->setText(realmName.upper());
+
+ TQString defaultDomainAliases;
+ defaultDomainAliases = realmName.lower();
+ defaultDomainAliases += "\n";
+ defaultDomainAliases += ".";
+ defaultDomainAliases += realmName.lower();
+ txtDomains->setText(defaultDomainAliases);
+}
+
#include "realmconfigpage.moc"
diff --git a/src/realmconfigpage.h b/src/realmconfigpage.h
index f4bbc9b..642d622 100644
--- a/src/realmconfigpage.h
+++ b/src/realmconfigpage.h
@@ -21,6 +21,8 @@
#ifndef REALMCONFIGPAGE_H
#define REALMCONFIGPAGE_H
+#include <kwizard.h>
+
#include "realmconfigpagedlg.h"
class TQStringList;
@@ -31,9 +33,20 @@ class TQStringList;
class RealmConfigPage : public RealmConfigPageDlg {
Q_OBJECT
+
public:
RealmConfigPage(TQWidget *parent=0, const char *name=0);
~RealmConfigPage();
+
+public slots:
+ void validateEntries();
+
+private slots:
+ void realmNameChanged();
+
+private:
+ KWizard* m_parentWizard;
+ KDialogBase* m_parentDialog;
};
#endif
diff --git a/src/realmfinishpage.cpp b/src/realmfinishpage.cpp
index 2689b4b..c9eb64e 100644
--- a/src/realmfinishpage.cpp
+++ b/src/realmfinishpage.cpp
@@ -35,7 +35,7 @@
RealmFinishPage::RealmFinishPage(TQWidget *parent, const char *name ) : RealmFinishPageDlg(parent,name) {
- px_introSidebar->setPixmap(UserIcon("step1.png"));
+ px_introSidebar->setPixmap(UserIcon("step3.png"));
}
RealmFinishPage::~RealmFinishPage(){
diff --git a/src/realmwizard.cpp b/src/realmwizard.cpp
index 9ca02d0..6cca2ec 100644
--- a/src/realmwizard.cpp
+++ b/src/realmwizard.cpp
@@ -77,9 +77,9 @@ RealmWizard::RealmWizard(LDAPController* controller, TQWidget *parent, const cha
// realmpage->txtAdminServerPort->setValue(749);
// realmpage->txtUIDOffset->setValue(5000);
// realmpage->txtGIDOffset->setValue(5000);
-//
-// // Other setup
-// finishpage->ldapAdminRealm->setEnabled(false);
+
+ // Other setup
+ finishpage->ldapAdminRealm->setEnabled(false);
setFinishEnabled(TQWizard::page(2), true);
@@ -93,16 +93,15 @@ RealmWizard::~RealmWizard() {
void RealmWizard::next() {
if (currentPage()==intropage) {
TQWizard::next();
- // RAJA FIXME
-// realmpage->validateEntries();
+ realmpage->validateEntries();
}
else if (currentPage()==realmpage) {
// Save realm information
// RAJA FIXME
+ finishpage->ldapAdminRealm->setText(realmpage->txtRealmName->text());
TQWizard::next();
}
if (currentPage()==finishpage) {
- backButton()->setEnabled(false);
finishButton()->setFocus();
}
}