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

tdeprint

  • tdeprint
driverview.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 "driverview.h"
21 #include "droptionview.h"
22 #include "driveritem.h"
23 #include "driver.h"
24 
25 #include <tqlistview.h>
26 #include <tqsplitter.h>
27 #include <tqheader.h>
28 #include <tqlayout.h>
29 #include <tqwhatsthis.h>
30 #include <tdelocale.h>
31 
32 DrListView::DrListView(TQWidget *parent, const char *name)
33 : TDEListView(parent,name)
34 {
35  addColumn("");
36  header()->hide();
37  setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken);
38  setSorting(-1);
39 }
40 
41 //****************************************************************************************************
42 
43 DriverView::DriverView(TQWidget *parent, const char *name)
44 : TQWidget(parent,name)
45 {
46  //WhatsThis strings.... (added by pfeifle@kde.org)
47  TQString whatsThisPPDOptionsDriverPage = i18n( " <qt> "
48  " <b>List of Driver Options (from PPD)</b>. "
49  " <p>The upper pane of this dialog page contains all printjob options as laid "
50  " down in the printer's description file (PostScript Printer Description == 'PPD') </p>"
51  " <p>Click on any item in the list and watch the lower pane of this dialog page "
52  " display the available values. </p> "
53  " <p>Set the values as needed. Then use one of the pushbuttons below to proceed:</p> "
54  " <ul> "
55  " <li><em>'Save'</em> your settings if you want to re-use "
56  " them in your next job(s) too. <em>'Save'</em> will store your settings permanently until "
57  " you change them again. </li>."
58  " <li>Click <em>'OK'</em> (without a prior click on <em>'Save'</em>, if you want to use "
59  " your selected settings just once, for the next print job. <em>'OK'</em> "
60  " will forget your current settings when kprinter is closed again, and will start next time "
61  " with the previously saved defaults. </li>"
62  " <li><em>'Cancel'</em> will not change anything. If you proceed to print after clicking "
63  " <em>'Cancel'</em>, the job will print with the default settings of this queue. "
64  " </ul>"
65  " <p><b>Note.</b> The number of available job options depends strongly on the actual "
66  " driver used for your print queue. <em>'Raw'</em> queues do not have a driver or a "
67  " PPD. For raw queues this tab page is not loaded by TDEPrint, and thus is not present "
68  " in the kprinter dialog.</p> "
69  " </qt>" );
70 
71  TQString whatsThisOptionSettingsDriverPage = i18n( " <qt> "
72  " <b>List of Possible Values for given Option (from PPD)</b>. "
73  " <p>The lower pane of this dialog page contains all possible values of the printoption "
74  " highlighted above, as laid "
75  " down in the printer's description file (PostScript Printer Description == 'PPD') </p>"
76  " <p>Select the value you want and proceed. </p> "
77  " <p>Then use one of the pushbuttons below to leave this dialog:</p> "
78  " <ul> "
79  " <li><em>'Save'</em> your settings if you want to re-use "
80  " them in your next job(s) too. <em>'Save'</em> will store your settings permanently until "
81  " you change them again. </li>."
82  " <li>Click <em>'OK'</em> if you want to use your selected settings just once, for the "
83  " next print job. <em>'OK'</em> "
84  " will forget your current settings when kprinter is closed again, and will start next time "
85  " with your previous defaults. </li>"
86  " <li><em>'Cancel'</em> will not change anything. If you proceed to print after clicking "
87  " <em>'Cancel'</em>, the job will print with the default settings of this queue. "
88  " </ul>"
89  " <p><b>Note.</b> The number of available job options depends strongly on the actual "
90  " driver used for your print queue. <em>'Raw'</em> queues do not have a driver or a "
91  " PPD. For raw queues this tab page is not loaded by TDEPrint, and thus is not present "
92  " in the kprinter dialog.</p> "
93  " </qt>" );
94 
95  m_driver = 0;
96 
97  TQSplitter *splitter = new TQSplitter(this);
98  splitter->setOrientation(TQt::Vertical);
99 
100  TQVBoxLayout *vbox = new TQVBoxLayout(this, 0, 10);
101  vbox->addWidget(splitter);
102 
103  m_view = new DrListView(splitter);
104  TQWhatsThis::add(m_view, whatsThisPPDOptionsDriverPage);
105  m_optview = new DrOptionView(splitter);
106  TQWhatsThis::add(m_optview, whatsThisOptionSettingsDriverPage);
107 
108  connect(m_view,TQ_SIGNAL(selectionChanged(TQListViewItem*)),m_optview,TQ_SLOT(slotItemSelected(TQListViewItem*)));
109  connect(m_optview,TQ_SIGNAL(changed()),TQ_SLOT(slotChanged()));
110 }
111 
112 DriverView::~DriverView()
113 {
114 }
115 
116 void DriverView::setDriver(DrMain *driver)
117 {
118  m_driver = driver;
119  if (m_driver)
120  {
121  m_view->clear();
122  m_driver->createTreeView(m_view);
123  slotChanged();
124  }
125 }
126 
127 void DriverView::slotChanged()
128 {
129  if (m_driver)
130  {
131  m_conflict = m_driver->checkConstraints();
132  ((DriverItem*)m_view->firstChild())->updateConflict();
133  }
134 }
135 
136 void DriverView::setOptions(const TQMap<TQString,TQString>& opts)
137 {
138  if (m_driver)
139  {
140  m_driver->setOptions(opts);
141  static_cast<DriverItem*>( m_view->firstChild() )->updateTextRecursive();
142  slotChanged();
143  m_optview->slotItemSelected(m_view->currentItem());
144  }
145 }
146 
147 void DriverView::getOptions(TQMap<TQString,TQString>& opts, bool incldef)
148 {
149  if (m_driver)
150  m_driver->getOptions(opts,incldef);
151 }
152 
153 void DriverView::setAllowFixed(bool on)
154 {
155  m_optview->setAllowFixed(on);
156 }
157 #include "driverview.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.1
This website is maintained by Timothy Pearson.