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

kdeprint

  • kdeprint
  • management
kmpropbackend.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 "kmpropbackend.h"
21 #include "kmprinter.h"
22 #include "kmwizard.h"
23 
24 #include <tqlabel.h>
25 #include <tqlayout.h>
26 #include <klocale.h>
27 
28 KMPropBackend::KMPropBackend(TQWidget *parent, const char *name)
29 : KMPropWidget(parent,name)
30 {
31  m_uri = new TQLabel("",this);
32  m_type = new TQLabel("",this);
33 
34  TQLabel *l1 = new TQLabel(i18n("Printer type:"), this);
35  TQLabel *l2 = new TQLabel(i18n("URI:"), this);
36 
37  // layout
38  TQGridLayout *main_ = new TQGridLayout(this, 3, 2, 10, 7);
39  main_->setColStretch(0,0);
40  main_->setColStretch(1,1);
41  main_->setRowStretch(2,1);
42  main_->addWidget(l1,0,0);
43  main_->addWidget(l2,1,0);
44  main_->addWidget(m_type,0,1);
45  main_->addWidget(m_uri,1,1);
46 
47  m_pixmap = "connect_established";
48  m_title = i18n("Interface");
49  m_header = i18n("Interface Settings");
50 }
51 
52 KMPropBackend::~KMPropBackend()
53 {
54 }
55 
56 void KMPropBackend::setPrinter(KMPrinter *p)
57 {
58  if (p && p->isPrinter())
59  {
60  m_uri->setText(KURL(p->device()).prettyURL());
61  TQString prot = p->deviceProtocol();
62  if (prot == "ipp" || prot == "http") m_type->setText(i18n("IPP Printer"));
63  else if (prot == "usb") m_type->setText(i18n("Local USB Printer"));
64  else if (prot == "parallel") m_type->setText(i18n("Local Parallel Printer"));
65  else if (prot == "serial") m_type->setText(i18n("Local Serial Printer"));
66  else if (prot == "socket") m_type->setText(i18n("Network Printer (socket)"));
67  else if (prot == "smb") m_type->setText(i18n("SMB printers (Windows)"));
68  else if (prot == "lpd") m_type->setText(i18n("Remote LPD queue"));
69  else if (prot == "file") m_type->setText(i18n("File printer"));
70  else if (prot == "fax") m_type->setText(i18n("Serial Fax/Modem printer"));
71  else m_type->setText(i18n("Unknown Protocol", "Unknown"));
72  emit enable(true);
73  emit enableChange(p->isLocal());
74  }
75  else
76  {
77  emit enable(false);
78  m_type->setText("");
79  m_uri->setText("");
80  }
81 }
82 
83 void KMPropBackend::configureWizard(KMWizard *w)
84 {
85  w->configure(KMWizard::Backend,KMWizard::Driver,false);
86 }

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.8
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |