summaryrefslogtreecommitdiffstats
path: root/src/bondwizard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bondwizard.cpp')
-rw-r--r--src/bondwizard.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/bondwizard.cpp b/src/bondwizard.cpp
index eeddfa6..03ca5a6 100644
--- a/src/bondwizard.cpp
+++ b/src/bondwizard.cpp
@@ -42,6 +42,7 @@
#include <knuminput.h>
#include <klineedit.h>
#include <ktextedit.h>
+#include <kpassdlg.h>
#include <stdlib.h>
@@ -77,6 +78,9 @@ BondWizard::BondWizard(LDAPRealmConfigList *realmlist, LDAPConfig *ldapconfig, T
realmpage->txtUIDOffset->setValue(5000);
realmpage->txtGIDOffset->setValue(5000);
+ // Other setup
+ finishpage->ldapAdminRealm->setEnabled(false);
+
setFinishEnabled(TQWizard::page(2), true);
setPosition();
@@ -112,6 +116,8 @@ void BondWizard::next() {
if (!m_realmList->contains(realm.name)) {
m_realmList->insert(realm.name, realm);
m_ldapConfig->save();
+ finishpage->ldapAdminRealm->setText(realm.name);
+ m_finalRealm = realm;
TQWizard::next();
}
else {
@@ -119,6 +125,7 @@ void BondWizard::next() {
}
}
if (currentPage()==finishpage) {
+ backButton()->setEnabled(false);
finishButton()->setFocus();
}
}
@@ -141,7 +148,13 @@ bool BondWizard::askClose(){
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 {
+ }
+ else if (currentPage()==finishpage) {
+ text = i18n("<p>Are you sure you want to quit the LDAP Bonding Wizard?</p>"
+ "<p>If yes, click <b>Quit</b> and the new realm will remain deactivated pending bonding."
+ "<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>");
}
@@ -174,7 +187,14 @@ void BondWizard::closeEvent(TQCloseEvent* e){
/** maybe call a dialog that the wizard has finished. */
void BondWizard::accept(){
- done(0);
+ // Try to bond
+ if (m_ldapConfig->bondRealm(m_finalRealm, finishpage->ldapAdminUsername->text(), finishpage->ldapAdminPassword->password(), finishpage->ldapAdminRealm->text()) == 0) {
+ done(0);
+ }
+ else {
+ KMessageBox::error(this, i18n("<qt><b>Unable to bond to realm!</b><p>RAJA ERRORSTR</qt>"), i18n("Unable to Bond to Realm"));
+ // RAJA FIXME
+ }
}
/** calls all save functions after resetting all features/ OS/ theme selections to Trinity default */