From 46d1d860d1ae8c455f19b4fd125eba4e0268022a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 31 May 2012 16:34:08 -0500 Subject: Pretty much ready to accept ldap and heimdal configuration routines --- src/realmconfigpage.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- src/realmconfigpage.h | 13 +++++++++++++ src/realmfinishpage.cpp | 2 +- src/realmwizard.cpp | 11 +++++------ 4 files changed, 66 insertions(+), 9 deletions(-) (limited to 'src') 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 #include #include +#include +#include +#include +#include +#include #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(parent); + m_parentDialog = dynamic_cast(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 + #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(); } } -- cgit v1.2.1