20 #include "driverview.h" 21 #include "droptionview.h" 22 #include "driveritem.h" 25 #include <tqlistview.h> 26 #include <tqsplitter.h> 29 #include <tqwhatsthis.h> 30 #include <tdelocale.h> 32 DrListView::DrListView(TQWidget *parent,
const char *name)
33 : TDEListView(parent,name)
37 setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken);
43 DriverView::DriverView(TQWidget *parent,
const char *name)
44 : TQWidget(parent,name)
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> " 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. " 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> " 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> " 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. " 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> " 97 TQSplitter *splitter =
new TQSplitter(
this);
98 splitter->setOrientation(Qt::Vertical);
100 TQVBoxLayout *vbox =
new TQVBoxLayout(
this, 0, 10);
101 vbox->addWidget(splitter);
103 m_view =
new DrListView(splitter);
104 TQWhatsThis::add(m_view, whatsThisPPDOptionsDriverPage);
105 m_optview =
new DrOptionView(splitter);
106 TQWhatsThis::add(m_optview, whatsThisOptionSettingsDriverPage);
108 connect(m_view,TQT_SIGNAL(selectionChanged(TQListViewItem*)),m_optview,TQT_SLOT(slotItemSelected(TQListViewItem*)));
109 connect(m_optview,TQT_SIGNAL(changed()),TQT_SLOT(slotChanged()));
112 DriverView::~DriverView()
116 void DriverView::setDriver(DrMain *driver)
122 m_driver->createTreeView(m_view);
127 void DriverView::slotChanged()
131 m_conflict = m_driver->checkConstraints();
132 ((DriverItem*)m_view->firstChild())->updateConflict();
136 void DriverView::setOptions(
const TQMap<TQString,TQString>& opts)
140 m_driver->setOptions(opts);
141 static_cast<DriverItem*
>( m_view->firstChild() )->updateTextRecursive();
143 m_optview->slotItemSelected(m_view->currentItem());
147 void DriverView::getOptions(TQMap<TQString,TQString>& opts,
bool incldef)
150 m_driver->getOptions(opts,incldef);
153 void DriverView::setAllowFixed(
bool on)
155 m_optview->setAllowFixed(on);
157 #include "driverview.moc"