diff --git a/src/Makefile.am b/src/Makefile.am index e78843e..377ec45 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_ldapcontroller.la -kcm_ldapcontroller_la_SOURCES = ldapcontroller.cpp ldapcontrollerconfigbase.ui +kcm_ldapcontroller_la_SOURCES = ldapcontroller.cpp ldapcontrollerconfigbase.ui realmwizard.cpp realmintropagedlg.ui realmintropage.cpp realmconfigpagedlg.ui realmconfigpage.cpp realmfinishpagedlg.ui realmfinishpage.cpp kcm_ldapcontroller_la_LIBADD = -lkio $(LIB_TDEUI) kcm_ldapcontroller_la_LDFLAGS = -avoid-version -module -no-undefined \ $(all_libraries) diff --git a/src/ldapcontroller.cpp b/src/ldapcontroller.cpp index b8a75a8..88fc9a4 100644 --- a/src/ldapcontroller.cpp +++ b/src/ldapcontroller.cpp @@ -34,6 +34,8 @@ #include #include #include +#include +#include #include "ldapcontroller.h" @@ -41,6 +43,9 @@ // Connect this to CMake/Automake #define KDE_CONFDIR "/etc/trinity" +#define ROLE_WORKSTATION 0 +#define ROLE_REALM_CONTROLLER 1 + typedef KGenericFactory ldapFactory; K_EXPORT_COMPONENT_FACTORY( kcm_ldapcontroller, ldapFactory("kcmldapcontroller")) @@ -64,19 +69,20 @@ LDAPController::LDAPController(TQWidget *parent, const char *name, const TQStrin layout->add(m_base); m_base->systemRole->clear(); - m_base->systemRole->insertItem("Workstation", -1); - m_base->systemRole->insertItem("Realm Controller", -1); - m_base->systemRole->setCurrentItem(0); + m_base->systemRole->insertItem("Workstation", ROLE_WORKSTATION); + m_base->systemRole->insertItem("Realm Controller", ROLE_REALM_CONTROLLER); setRootOnlyMsg(i18n("LDAP controller settings take effect system wide, and require administrator access to modify
To alter the system's realm controller settings, click on the \"Administrator Mode\" button below.")); setUseRootOnlyMsg(true); + connect(m_base->systemEnableSupport, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed())); + connect(m_base->systemEnableSupport, TQT_SIGNAL(clicked()), this, TQT_SLOT(processLockouts())); connect(m_base->systemRole, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(systemRoleChanged())); load(); if (getuid() != 0 || !m_systemconfig->checkConfigFilesWritable( true )) { - m_base->systemRole->setEnabled(false); + m_base->systemEnableSupport->setEnabled(false); } processLockouts(); @@ -86,17 +92,52 @@ LDAPController::~LDAPController() { } void LDAPController::systemRoleChanged() { - // RAJA FIXME - // Verify that this workstation was not already bonded to an LDAP realm! - changed(); + if (m_base->systemRole->currentItem() != m_prevRole) { + if (m_base->systemRole->currentItem() == ROLE_REALM_CONTROLLER) { + // Verify that this workstation was not already bonded to an LDAP realm! + bool bonded = false; + TQStringList cfgRealms = m_systemconfig->groupList(); + for (TQStringList::Iterator it(cfgRealms.begin()); it != cfgRealms.end(); ++it) { + if ((*it).startsWith("LDAPRealm-")) { + m_systemconfig->setGroup(*it); + if (m_systemconfig->readBoolEntry("bonded", false) == true) { + bonded = true; + } + } + } + + if (bonded) { + KMessageBox::error(0, i18n("You are already bonded to a realm!

Please unbond from all realms before selecting a Realm Controller role"), i18n("Common Sense Failure")); + m_base->systemRole->setCurrentItem(0); + } + else { + // RAJA FIXME + changed(); + } + } + if (m_base->systemRole->currentItem() == ROLE_WORKSTATION) { + // RAJA FIXME + } + } } void LDAPController::processLockouts() { - // + bool enabled = (m_base->systemEnableSupport->isEnabled() && m_base->systemEnableSupport->isChecked()); + + m_base->systemRole->setEnabled(enabled); } -void LDAPController::load() { - // +void LDAPController::load() { + m_systemconfig->setGroup(NULL); + m_base->systemEnableSupport->setChecked(m_systemconfig->readBoolEntry("EnableLDAP", false)); + TQString ldapRole = m_systemconfig->readEntry("LDAPRole", "Workstation"); + if (ldapRole == "RealmController") { + m_base->systemRole->setCurrentItem(ROLE_REALM_CONTROLLER); + } + else { + m_base->systemRole->setCurrentItem(ROLE_WORKSTATION); + } + m_prevRole = m_base->systemRole->currentItem(); } void LDAPController::defaults() { diff --git a/src/ldapcontroller.h b/src/ldapcontroller.h index 9af7f42..a88ebfd 100644 --- a/src/ldapcontroller.h +++ b/src/ldapcontroller.h @@ -56,6 +56,8 @@ class LDAPController: public KCModule LDAPControllerConfigBase *m_base; KSimpleConfig *m_systemconfig; + + int m_prevRole; }; #endif // _LDAPCONTROLLER_H_ diff --git a/src/ldapcontrollerconfigbase.ui b/src/ldapcontrollerconfigbase.ui index 6dc2462..0c373cc 100644 --- a/src/ldapcontrollerconfigbase.ui +++ b/src/ldapcontrollerconfigbase.ui @@ -45,7 +45,15 @@ unnamed - + + + systemEnableSupport + + + &Enable LDAP Realm Support + + + unnamed @@ -53,7 +61,7 @@ System Role: - + systemRole diff --git a/src/realmconfigpage.cpp b/src/realmconfigpage.cpp new file mode 100644 index 0000000..e3bd736 --- /dev/null +++ b/src/realmconfigpage.cpp @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2012 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * 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 +#include +#include + +#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")); +} + +RealmConfigPage::~RealmConfigPage(){ + // +} + +#include "realmconfigpage.moc" diff --git a/src/realmconfigpage.h b/src/realmconfigpage.h new file mode 100644 index 0000000..f4bbc9b --- /dev/null +++ b/src/realmconfigpage.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2012 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * 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 REALMCONFIGPAGE_H +#define REALMCONFIGPAGE_H + +#include "realmconfigpagedlg.h" + +class TQStringList; + +/**Abstract class for the first wizard page. Sets the according selection on save() + *@author Timothy Pearson + */ + +class RealmConfigPage : public RealmConfigPageDlg { + Q_OBJECT +public: + RealmConfigPage(TQWidget *parent=0, const char *name=0); + ~RealmConfigPage(); +}; + +#endif diff --git a/src/realmconfigpagedlg.ui b/src/realmconfigpagedlg.ui new file mode 100644 index 0000000..446ebdf --- /dev/null +++ b/src/realmconfigpagedlg.ui @@ -0,0 +1,118 @@ + +RealmConfigPageDlg + + + RealmConfigPageDlg + + + + 0 + 0 + 678 + 452 + + + + + unnamed + + + + px_introSidebar + + + + 0 + 0 + 0 + 0 + + + + + 170 + 430 + + + + Panel + + + Sunken + + + true + + + 0 + + + + + txt_welcome + + + <h3>Welcome to the TDE LDAP Realming Wizard!</h3> + + + + + TextLabel6 + + + + 1 + 1 + 0 + 0 + + + + <p>This Wizard will help you bond your machine to an LDAP realm in three quick, easy steps.</p> + <p>Please note that you will need administrative access to the LDAP realm you will be bonding with.</p> + <p>If you wish to quit the Wizard, click <b>Cancel</b> at any time.</p> + + + RichText + + + WordBreak|AlignTop|AlignLeft + + + + + + + + + Spacer6 + + + Vertical + + + Fixed + + + + 20 + 30 + + + + + + Spacer5 + + + Vertical + + + Expanding + + + + + + + diff --git a/src/realmfinishpage.cpp b/src/realmfinishpage.cpp new file mode 100644 index 0000000..2689b4b --- /dev/null +++ b/src/realmfinishpage.cpp @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2012 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "realmfinishpage.h" + +RealmFinishPage::RealmFinishPage(TQWidget *parent, const char *name ) : RealmFinishPageDlg(parent,name) { + + px_introSidebar->setPixmap(UserIcon("step1.png")); +} + +RealmFinishPage::~RealmFinishPage(){ + // +} + +#include "realmfinishpage.moc" diff --git a/src/realmfinishpage.h b/src/realmfinishpage.h new file mode 100644 index 0000000..3f03e7c --- /dev/null +++ b/src/realmfinishpage.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2012 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * 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 REALMFINISHPAGE_H +#define REALMFINISHPAGE_H + +#include "realmfinishpagedlg.h" + +class TQStringList; + +/**Abstract class for the first wizard page. Sets the according selection on save() + *@author Timothy Pearson + */ + +class RealmFinishPage : public RealmFinishPageDlg { + Q_OBJECT +public: + RealmFinishPage(TQWidget *parent=0, const char *name=0); + ~RealmFinishPage(); +}; + +#endif diff --git a/src/realmfinishpagedlg.ui b/src/realmfinishpagedlg.ui new file mode 100644 index 0000000..a5604c8 --- /dev/null +++ b/src/realmfinishpagedlg.ui @@ -0,0 +1,118 @@ + +RealmFinishPageDlg + + + RealmFinishPageDlg + + + + 0 + 0 + 678 + 452 + + + + + unnamed + + + + px_introSidebar + + + + 0 + 0 + 0 + 0 + + + + + 170 + 430 + + + + Panel + + + Sunken + + + true + + + 0 + + + + + txt_welcome + + + <h3>Welcome to the TDE LDAP Realming Wizard!</h3> + + + + + TextLabel6 + + + + 1 + 1 + 0 + 0 + + + + <p>This Wizard will help you bond your machine to an LDAP realm in three quick, easy steps.</p> + <p>Please note that you will need administrative access to the LDAP realm you will be bonding with.</p> + <p>If you wish to quit the Wizard, click <b>Cancel</b> at any time.</p> + + + RichText + + + WordBreak|AlignTop|AlignLeft + + + + + + + + + Spacer6 + + + Vertical + + + Fixed + + + + 20 + 30 + + + + + + Spacer5 + + + Vertical + + + Expanding + + + + + + + diff --git a/src/realmintropage.cpp b/src/realmintropage.cpp new file mode 100644 index 0000000..a1f2450 --- /dev/null +++ b/src/realmintropage.cpp @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2012 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "realmintropage.h" + +RealmIntroPage::RealmIntroPage(TQWidget *parent, const char *name ) : RealmIntroPageDlg(parent,name) { + + px_introSidebar->setPixmap(UserIcon("step1.png")); +} + +RealmIntroPage::~RealmIntroPage(){ + // +} + +#include "realmintropage.moc" diff --git a/src/realmintropage.h b/src/realmintropage.h new file mode 100644 index 0000000..1c5a9e0 --- /dev/null +++ b/src/realmintropage.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2012 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * 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 REALMINTROPAGE_H +#define REALMINTROPAGE_H + +#include "realmintropagedlg.h" + +class TQStringList; + +/**Abstract class for the first wizard page. Sets the according selection on save() + *@author Timothy Pearson + */ + +class RealmIntroPage : public RealmIntroPageDlg { + Q_OBJECT +public: + RealmIntroPage(TQWidget *parent=0, const char *name=0); + ~RealmIntroPage(); +}; + +#endif diff --git a/src/realmintropagedlg.ui b/src/realmintropagedlg.ui new file mode 100644 index 0000000..fca7ead --- /dev/null +++ b/src/realmintropagedlg.ui @@ -0,0 +1,118 @@ + +RealmIntroPageDlg + + + RealmIntroPageDlg + + + + 0 + 0 + 678 + 452 + + + + + unnamed + + + + px_introSidebar + + + + 0 + 0 + 0 + 0 + + + + + 170 + 430 + + + + Panel + + + Sunken + + + true + + + 0 + + + + + txt_welcome + + + <h3>Welcome to the TDE LDAP Realming Wizard!</h3> + + + + + TextLabel6 + + + + 1 + 1 + 0 + 0 + + + + <p>This Wizard will help you bond your machine to an LDAP realm in three quick, easy steps.</p> + <p>Please note that you will need administrative access to the LDAP realm you will be bonding with.</p> + <p>If you wish to quit the Wizard, click <b>Cancel</b> at any time.</p> + + + RichText + + + WordBreak|AlignTop|AlignLeft + + + + + + + + + Spacer6 + + + Vertical + + + Fixed + + + + 20 + 30 + + + + + + Spacer5 + + + Vertical + + + Expanding + + + + + + + diff --git a/src/realmwizard.cpp b/src/realmwizard.cpp new file mode 100644 index 0000000..e60b778 --- /dev/null +++ b/src/realmwizard.cpp @@ -0,0 +1,208 @@ +/*************************************************************************** + * Copyright (C) 2012 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * 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 + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "realmintropage.h" +#include "realmconfigpage.h" +#include "realmfinishpage.h" + +#include "realmwizard.h" +#include "realmwizard.moc" + +RealmWizard::RealmWizard(TQWidget *parent, const char *name) + : KWizard(parent, name, true) { + + setCaption(i18n("LDAP Realm Wizard")); + + intropage = new RealmIntroPage(this); + addPage (intropage, i18n( "Step 1: Introduction" ) ); + setHelpEnabled(TQWizard::page(0), false); + + realmpage = new RealmConfigPage(this); + addPage (realmpage, i18n( "Step 2: Set Up New Realm" ) ); + setHelpEnabled(TQWizard::page(1), false); + + finishpage = new RealmFinishPage(this); + addPage (finishpage, i18n( "Step 3: Initialize New Realm" ) ); + setHelpEnabled(TQWizard::page(2), false); +// +// // Set up some defaults +// realmpage->txtKDCPort->setValue(88); +// realmpage->txtAdminServerPort->setValue(749); +// realmpage->txtUIDOffset->setValue(5000); +// realmpage->txtGIDOffset->setValue(5000); +// +// // Other setup +// finishpage->ldapAdminRealm->setEnabled(false); + + setFinishEnabled(TQWizard::page(2), true); + + setPosition(); +} + +RealmWizard::~RealmWizard() { +} + + +void RealmWizard::next() { + if (currentPage()==intropage) { + TQWizard::next(); + // RAJA FIXME +// realmpage->validateEntries(); + } + else if (currentPage()==realmpage) { + // Save realm information + // RAJA FIXME + TQWizard::next(); + } + if (currentPage()==finishpage) { + backButton()->setEnabled(false); + finishButton()->setFocus(); + } +} + +void RealmWizard::slotNext() { + TQWizard::next(); +} + +void RealmWizard::back() { + TQWizard::back(); +} + +bool RealmWizard::askClose(){ + TQString text; + if (currentPage()==intropage) { + return true; + } + else { + if (currentPage()==realmpage) { + text = i18n("

Are you sure you want to quit the LDAP Realm Wizard?

" + "

If yes, click Quit and all changes will be lost." + "
If not, click Cancel to return and finish your setup.

"); + } + else if (currentPage()==finishpage) { + // RAJA FIXME + text = i18n("

Are you sure you want to quit the LDAP Realm Wizard?

" + "

If yes, click Quit and the new realm will remain deactivated pending bonding." + "
If not, click Cancel to return and finish your setup.

"); + } + else { + text = i18n("

Are you sure you want to quit the LDAP Realm Wizard?

" + "

If not, click Cancel to return and finish setup.

"); + } + 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 RealmWizard::reject(){ + if (askClose()){ + done(0); + } +} + +void RealmWizard::closeEvent(TQCloseEvent* e){ + if ( askClose() ) + done(0); + else + e->ignore(); +} + +/** maybe call a dialog that the wizard has finished. */ +void RealmWizard::accept(){ + // Try to create realm + TQString errorString; + // RAJA FIXME +// if (m_ldapConfig->bondRealm(m_finalRealm, finishpage->ldapAdminUsername->text(), finishpage->ldapAdminPassword->password(), finishpage->ldapAdminRealm->text(), &errorString) == 0) { + done(0); +// } +// else { +// KMessageBox::error(this, i18n("Unable to create new realm!

Details: %1").arg(errorString), i18n("Unable to create new realm")); +// } +} + +/** calls all save functions after resetting all features/ OS/ theme selections to Trinity default */ +void RealmWizard::setDefaults(){ +// if(realm_dirty) +// realmpage->save(false); +} + +/** there seems to be a bug in TQWizard, that makes this evil hack necessary */ +void RealmWizard::setPosition() { + TQSize hint = intropage->sizeHint(); + TQSize realm_size = realmpage->sizeHint(); + TQSize finish_size = finishpage->sizeHint(); + + // get the width of the broadest child-widget + if ( hint.width() < realm_size.width() ) + hint.setWidth(realm_size.width()); + if ( hint.width() < finish_size.width() ) + hint.setWidth(finish_size.width()); + + // get the height of the highest child-widget + if ( hint.height() < realm_size.height() ) + hint.setHeight(realm_size.height()); + 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/realmwizard.h b/src/realmwizard.h new file mode 100644 index 0000000..3c0727f --- /dev/null +++ b/src/realmwizard.h @@ -0,0 +1,79 @@ +/*************************************************************************** + * Copyright (C) 2012 by Timothy Pearson * + * kb9vqf@pearsoncomputing.net * + * * + * 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 +#endif + +#include +#include + +/** prototypes */ +class KLanguageCombo; +class RealmIntroPage; +class RealmConfigPage; +class RealmFinishPage; + +/** RealmWizard is the base class of the project */ +class RealmWizard : public KWizard { + Q_OBJECT +public: + /** construtor */ + RealmWizard(TQWidget* parent=0, const char *name=0); + /** destructor */ + ~RealmWizard(); + + 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: + RealmIntroPage* intropage; + RealmConfigPage* realmpage; + RealmFinishPage* 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