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

kdeprint

  • kdeprint
  • management
kmpropertypage.cpp
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (c) 2001 Michael Goffioul <kdeprint@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 "kmpropertypage.h"
21 #include "kmpropwidget.h"
22 #include "kmpropcontainer.h"
23 #include "kmprinter.h"
24 #include "kmfactory.h"
25 #include "kmuimanager.h"
26 
27 #include "kmpropgeneral.h"
28 
29 #include <tqvbox.h>
30 #include <kiconloader.h>
31 
32 KMPropertyPage::KMPropertyPage(TQWidget *parent, const char *name)
33 : CJanusWidget(parent,name)
34 {
35  m_widgets.setAutoDelete(false);
36 
37  initialize();
38 }
39 
40 KMPropertyPage::~KMPropertyPage()
41 {
42 }
43 
44 void KMPropertyPage::setPrinter(KMPrinter *p)
45 {
46  TQPtrListIterator<KMPropWidget> it(m_widgets);
47  for (;it.current();++it)
48  it.current()->setPrinterBase(p);
49 }
50 
51 void KMPropertyPage::addPropPage(KMPropWidget *w)
52 {
53  if (w)
54  {
55  m_widgets.append(w);
56  KMPropContainer *ctn = new KMPropContainer(this,"Container");
57  ctn->setWidget(w);
58  connect(ctn,TQT_SIGNAL(enable(bool)),TQT_SLOT(slotEnable(bool)));
59 
60  TQPixmap icon = KGlobal::instance()->iconLoader()->loadIcon(
61  w->pixmap(),
62  KIcon::NoGroup,
63  KIcon::SizeMedium
64  );
65  addPage(ctn,w->title(),w->header(),icon);
66  }
67 }
68 
69 void KMPropertyPage::slotEnable(bool on)
70 {
71  TQWidget *w = (TQWidget*)(sender());
72  if (on)
73  enablePage(w);
74  else
75  disablePage(w);
76 }
77 
78 void KMPropertyPage::initialize()
79 {
80  // add General page
81  addPropPage(new KMPropGeneral(this, "General"));
82  // add plugin specific pages
83  KMFactory::self()->uiManager()->setupPropertyPages(this);
84 }
85 
86 void KMPropertyPage::reload()
87 {
88  clearPages();
89  m_widgets.clear();
90  initialize();
91  setPrinter(0);
92 }
93 
94 #include "kmpropertypage.moc"

kdeprint

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

kdeprint

Skip menu "kdeprint"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdeprint by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |