• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeprint
 

tdeprint

  • tdeprint
  • management
kmconfigdialog.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2001 Michael Goffioul <tdeprint@swing.be>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License version 2 as published by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB. If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  **/
19 
20 #include "kmconfigdialog.h"
21 #include "kmconfigpage.h"
22 #include "kmfactory.h"
23 #include "kmuimanager.h"
24 
25 #include "kmconfiggeneral.h"
26 #include "kmconfigpreview.h"
27 #include "kmconfigcommand.h"
28 #include "kmconfigfilter.h"
29 #include "kmconfigfonts.h"
30 #include "kmconfigjobs.h"
31 
32 #include <tqlayout.h>
33 #include <tdelocale.h>
34 #include <kiconloader.h>
35 #include <tdeconfig.h>
36 
37 KMConfigDialog::KMConfigDialog(TQWidget *parent, const char *name)
38 : KDialogBase(IconList,i18n("TDE Print Configuration"),Ok|Cancel,Ok,parent,name,true,true)
39 {
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);
48 
49  // initialize pages
50  TDEConfig *conf = KMFactory::self()->printConfig();
51  TQPtrListIterator<KMConfigPage> it(m_pages);
52  for (;it.current();++it)
53  it.current()->loadConfig(conf);
54 
55  // resize dialog
56  resize(450,400);
57 }
58 
59 void KMConfigDialog::addConfigPage(KMConfigPage *page)
60 {
61  if (page)
62  {
63  TQPixmap icon = TDEGlobal::instance()->iconLoader()->loadIcon(
64  page->pagePixmap(),
65  TDEIcon::NoGroup,
66  TDEIcon::SizeMedium
67  );
68 
69  TQFrame *frame = addPage(page->pageName(),page->pageHeader(),icon);
70  page->reparent(frame,TQPoint(0,0));
71  TQVBoxLayout *lay = new TQVBoxLayout(frame, 0, 0);
72  lay->addWidget(page);
73  m_pages.append(page);
74  }
75 }
76 
77 void KMConfigDialog::slotOk()
78 {
79  // save configuration
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();
85 
86  // close the dialog
87  KDialogBase::slotOk();
88 }
89 #include "kmconfigdialog.moc"

tdeprint

Skip menu "tdeprint"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

tdeprint

Skip menu "tdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.8.8
This website is maintained by Timothy Pearson.