20 #include "kmconfigdialog.h"
21 #include "kmconfigpage.h"
22 #include "kmfactory.h"
23 #include "kmuimanager.h"
25 #include "kmconfiggeneral.h"
26 #include "kmconfigpreview.h"
27 #include "kmconfigcommand.h"
28 #include "kmconfigfilter.h"
29 #include "kmconfigfonts.h"
30 #include "kmconfigjobs.h"
33 #include <tdelocale.h>
34 #include <kiconloader.h>
35 #include <tdeconfig.h>
37 KMConfigDialog::KMConfigDialog(TQWidget *parent,
const char *name)
38 : KDialogBase(IconList,i18n(
"TDE Print Configuration"),Ok|Cancel,Ok,parent,name,true,true)
40 m_pages.setAutoDelete(
false);
41 addConfigPage(
new KMConfigGeneral(
this));
42 addConfigPage(
new KMConfigPreview(
this));
43 addConfigPage(
new KMConfigFonts(
this));
44 addConfigPage(
new KMConfigCommand(
this));
45 addConfigPage(
new KMConfigFilter(
this));
46 addConfigPage(
new KMConfigJobs(
this));
47 KMFactory::self()->uiManager()->setupConfigDialog(
this);
50 TDEConfig *conf = KMFactory::self()->printConfig();
51 TQPtrListIterator<KMConfigPage> it(m_pages);
52 for (;it.current();++it)
53 it.current()->loadConfig(conf);
59 void KMConfigDialog::addConfigPage(KMConfigPage *page)
63 TQPixmap icon = TDEGlobal::instance()->iconLoader()->loadIcon(
69 TQFrame *frame = addPage(page->pageName(),page->pageHeader(),icon);
70 page->reparent(frame,TQPoint(0,0));
71 TQVBoxLayout *lay =
new TQVBoxLayout(frame, 0, 0);
77 void KMConfigDialog::slotOk()
80 TDEConfig *conf = KMFactory::self()->printConfig();
81 TQPtrListIterator<KMConfigPage> it(m_pages);
82 for (;it.current();++it)
83 it.current()->saveConfig(conf);
84 KMFactory::self()->saveConfig();
87 KDialogBase::slotOk();
89 #include "kmconfigdialog.moc"