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

tdeprint

  • tdeprint
  • management
kmpropwidget.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 "kmpropwidget.h"
21#include "kmwizard.h"
22#include "kmfactory.h"
23#include "kmmanager.h"
24#include "kmtimer.h"
25
26#include <tdemessagebox.h>
27#include <tdelocale.h>
28
29KMPropWidget::KMPropWidget(TQWidget *parent, const char *name)
30: TQWidget(parent,name)
31{
32 m_pixmap = "folder";
33 m_title = m_header = "Title";
34 m_printer = 0;
35 m_canchange = ((KMFactory::self()->manager()->printerOperationMask() & KMManager::PrinterCreation) && KMFactory::self()->manager()->hasManagement());
36
37 connect(this,TQ_SIGNAL(enable(bool)),this,TQ_SIGNAL(enableChange(bool)));
38}
39
40KMPropWidget::~KMPropWidget()
41{
42}
43
44void KMPropWidget::slotChange()
45{
46 KMTimer::self()->hold();
47 int value = requestChange();
48 if (value == -1)
49 {
50 KMessageBox::error(this, i18n("<qt>Unable to change printer properties. Error received from manager:<p>%1</p></qt>").arg(KMManager::self()->errorMsg()));
51 KMManager::self()->setErrorMsg(TQString::null);
52 }
53 KMTimer::self()->release((value == 1));
54}
55
56void KMPropWidget::setPrinterBase(KMPrinter *p)
57{
58 m_printer = p;
59 setPrinter(p);
60}
61
62void KMPropWidget::setPrinter(KMPrinter*)
63{
64}
65
66void KMPropWidget::configureWizard(KMWizard*)
67{
68}
69
70// return status:
71// -1 : error
72// 0 : nothing to be done (canceled)
73// 1 : success
74int KMPropWidget::requestChange()
75{
76 if (m_printer)
77 {
78 KMWizard dlg(this);
79 configureWizard(&dlg);
80 dlg.setPrinter(m_printer);
81 if (dlg.exec())
82 return (KMFactory::self()->manager()->modifyPrinter(m_printer,dlg.printer()) ? 1 : -1);
83 }
84 return 0;
85}
86#include "kmpropwidget.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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeprint by doxygen 1.9.4
This website is maintained by Timothy Pearson.