summaryrefslogtreecommitdiffabout
path: root/microkde/kutils/kcmultidialog.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kutils/kcmultidialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kutils/kcmultidialog.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/microkde/kutils/kcmultidialog.cpp b/microkde/kutils/kcmultidialog.cpp
index 13be2ce..c2378fb 100644
--- a/microkde/kutils/kcmultidialog.cpp
+++ b/microkde/kutils/kcmultidialog.cpp
@@ -13,117 +13,118 @@
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <qhbox.h>
#include <qvbox.h>
#include <qcursor.h>
#include <qlayout.h>
#include <klocale.h>
#include <kglobal.h>
#include <kdebug.h>
#include <kiconloader.h>
#include <kmessagebox.h>
//US #include <klibloader.h>
#include <krun.h>
#include <kprocess.h>
#include "kcmultidialog.h"
+#include "kprefs.h"
//US #include "kcmultidialog.moc"
//US #include "kcmoduleloader.h"
-KCMultiDialog::KCMultiDialog(const QString& baseGroup, QWidget *parent, const char *name, bool modal)
+KCMultiDialog::KCMultiDialog(KPrefs* prefs, const QString& baseGroup, QWidget *parent, const char *name, bool modal)
: KDialogBase(IconList, i18n("Configure"), Default |Cancel | Apply | Ok, Ok,
- parent, name, modal, true), d(0L)
+ parent, name, modal, true), mPrefs(prefs), d(0L)
{
enableButton(Apply, false);
//connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *)));
connect( this, SIGNAL( defaultClicked() ), SLOT( slotDefault() ) );
_baseGroup = baseGroup;
mMainWidget = new KJanusWidget( this, "JanusWidget", KJanusWidget::Tabbed );
setMainWidget(mMainWidget );
#ifdef DESKTOP_VERSION
resize(640,480);
#else
resize(640,480);
setMaximumSize( KMIN(KGlobal::getDesktopWidth()-5, 640), KMIN(KGlobal::getDesktopHeight()-20, 480));
//showMaximized();
#endif
}
KCMultiDialog::~KCMultiDialog()
{
//US moduleDict.setAutoDelete(true);
}
void KCMultiDialog::slotDefault()
{
int curPageIndex = mMainWidget->activePageIndex();
QPtrListIterator<KCModule> it(modules);
for (; it.current(); ++it)
{
if (pageIndex((QWidget *)(*it)->parent()) == curPageIndex)
{
- (*it)->defaults();
+ (*it)->defaults(mPrefs);
clientChanged(true);
return;
}
}
}
void KCMultiDialog::slotApply()
{
qDebug("KCMultiDialog::slotApply clicked");
QPtrListIterator<KCModule> it(modules);
for (; it.current(); ++it)
- (*it)->save();
+ (*it)->save(mPrefs);
clientChanged(false);
emit applyClicked();
}
void KCMultiDialog::slotOk()
{
qDebug("KCMultiDialog::slotOk clicked");
QPtrListIterator<KCModule> it(modules);
for (; it.current(); ++it)
- (*it)->save();
+ (*it)->save(mPrefs);
accept();
emit okClicked();
}
void KCMultiDialog::slotHelp()
{
/*US
KURL url( KURL("help:/"), _docPath );
if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") {
KProcess process;
process << "khelpcenter"
<< url.url();
process.start(KProcess::DontCare);
process.detach();
} else {
new KRun(url);
}
*/
}
void KCMultiDialog::clientChanged(bool state)
{
@@ -139,48 +140,50 @@ void KCMultiDialog::addModule(const QString& path, bool withfallback)
QHBox* page = addHBoxPage(info.moduleName(), info.comment(),
KGlobal::iconLoader()->loadIcon(info.icon(), KIcon::Desktop, KIcon::SizeMedium));
if(!page) {
KCModuleLoader::unloadModule(info);
return;
}
moduleDict.insert(page, new LoadInfo(path, withfallback));
if (modules.isEmpty())
slotAboutToShow(page);
}
*/
QVBox * KCMultiDialog::getNewVBoxPage( const QString & modulename )
{
QVBox *page = mMainWidget->addVBoxPage(modulename , QString::null,QPixmap() );
return page;
}
//US special method for microkde. We dop noty want to load everything dynamically.
void KCMultiDialog::addModule(KCModule* module ) //, const QString& modulename, const QString& iconname)
{
modules.append(module);
connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool)));
+//US
+ module->load(mPrefs);
}
void KCMultiDialog::slotAboutToShow(QWidget *page)
{
/*US
LoadInfo *loadInfo = moduleDict[page];
if (!loadInfo)
return;
QApplication::setOverrideCursor(Qt::WaitCursor);
moduleDict.remove(page);
KCModuleInfo info(loadInfo->path, _baseGroup);
KCModule *module = KCModuleLoader::loadModule(info, loadInfo->withfallback);
if (!module)
{
QApplication::restoreOverrideCursor();
KCModuleLoader::showLastLoaderError(this);
delete loadInfo;