From e16866e072f94410321d70daedbcb855ea878cac Mon Sep 17 00:00:00 2001
From: Timothy Pearson
Date: Sun, 6 Nov 2011 15:56:40 -0600
Subject: Actually move the kde files that were renamed in the last commit
---
kdeprint/kpgeneralpage.cpp | 736 ---------------------------------------------
1 file changed, 736 deletions(-)
delete mode 100644 kdeprint/kpgeneralpage.cpp
(limited to 'kdeprint/kpgeneralpage.cpp')
diff --git a/kdeprint/kpgeneralpage.cpp b/kdeprint/kpgeneralpage.cpp
deleted file mode 100644
index 98ab5d4a6..000000000
--- a/kdeprint/kpgeneralpage.cpp
+++ /dev/null
@@ -1,736 +0,0 @@
-/*
- * This file is part of the KDE libraries
- * Copyright (c) 2001 Michael Goffioul
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License version 2 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- **/
-
-#include "kpgeneralpage.h"
-#include "driver.h"
-#include "kmprinter.h"
-#include "kprinter.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-// Some ID's
-#define ORIENT_PORTRAIT_ID 0
-#define ORIENT_LANDSCAPE_ID 1
-#define ORIENT_REVLANDSCAPE_ID 2
-#define ORIENT_REVPORTRAIT_ID 3
-
-#define DUPLEX_NONE_ID 0
-#define DUPLEX_LONG_ID 1
-#define DUPLEX_SHORT_ID 2
-
-#define NUP_1_ID 0
-#define NUP_2_ID 1
-#define NUP_4_ID 2
-
-static void initCombo(TQComboBox *cb, DrListOption *opt)
-{
- cb->clear();
- TQPtrListIterator it(*(opt->choices()));
- for (;it.current();++it)
- {
- cb->insertItem(it.current()->get("text"));
- if (it.current() == opt->currentChoice())
- cb->setCurrentItem(cb->count()-1);
- }
-}
-
-static void setComboItem(TQComboBox *cb, const TQString& txt)
-{
- for (int i=0;icount();i++)
- if (cb->text(i) == txt)
- {
- cb->setCurrentItem(i);
- return;
- }
-}
-
-static int findOption(const char *strs[], int n, const TQString& txt)
-{
- for (int i=0;i "
- " \"General\"
"
- " This dialog page contains general print job settings."
- " General settings are applicable to most printers, most jobs "
- " and most job file types. "
- "
To get more specific help, enable the \"WhatsThis\" cursor and click on any of the "
- " text labels or GUI elements of this dialog. "
- " " );
- TQString whatsThisGeneralPageSizeLabel = i18n( " "
- " Page size: Select paper size to be printed on from "
- " the drop-down menu.
"
- " The exact list of choices depends on the printer driver (\"PPD\") you have installed.
"
- "
"
- "
"
- " Additional hint for power users: This KDEPrint GUI element matches "
- " with the CUPS commandline job option parameter: "
- "
"
- " -o PageSize=... # examples: \"A4\" or \"Letter\" "
- "
"
- "
"
- " " );
- TQString whatsThisGeneralPaperTypeLabel = i18n( " "
- " Paper type: Select paper type to be printed on from "
- " the drop-down menu.
"
- " The exact list of choices depends on the printer driver (\"PPD\") you have installed.
"
- "
"
- "
"
- " Additional hint for power users: This KDEPrint GUI element matches "
- " with the CUPS commandline job option parameter: "
- "
"
- " -o MediaType=... # example: \"Transparency\" "
- "
"
- "
"
- " " );
- TQString whatsThisGeneralPaperSourceLabel = i18n( " "
- " Paper source: Select paper source tray for the paper"
- " to be printed on from the drop-down menu. "
- "
The exact list of choices depends on the printer driver (\"PPD\") you have installed.
"
- "
"
- "
"
- " Additional hint for power users: This KDEPrint GUI element matches "
- " with the CUPS commandline job option parameter: "
- "
"
- " -o InputSlot=... # examples: \"Lower\" or \"LargeCapacity\" "
- "
"
- " "
- " " );
- TQString whatsThisGeneralOrientationLabel = i18n( " "
- " Image Orientation: Orientation of the printed "
- " page image on your paper is controlled by the radio buttons. By default, "
- " the orientation is Portrait "
- "
You can select 4 alternatives: "
- "
"
- " - Portrait..Portrait is the default setting.
"
- " - Landscape.
"
- " - Reverse Landscape. Reverse Landscape prints the images upside down.
"
- " - Reverse Portrait. Reverse Portrait prints the image upside down.
"
- "
"
- " The icon changes according to your selection."
- "
"
- "
"
- " Additional hint for power users: This KDEPrint GUI element matches "
- " with the CUPS commandline job option parameter: "
- "
"
- " -o orientation-requested=... # examples: \"landscape\" or \"reverse-portrait\" "
- "
"
- " "
- " " );
- TQString whatsThisGeneralDuplexLabel = i18n( " "
- " Duplex Printing: These controls may be grayed out if your printer "
- " does not support duplex printing (i.e. printing on both sides of the sheet). "
- " These controls are active if your printer supports duplex printing. "
- "
"
- " You can choose from 3 alternatives:
"
- " "
- " - None. This prints each page of the job on one side of the sheets only.
"
- " - Long Side. This prints the job on both sides of the paper sheets. "
- " It prints the job in a way so that the backside has the same orientation as the front "
- " side if you turn the paper over the long edge. (Some printer drivers name this mode "
- " duplex-non-tumbled).
"
- " - Short Side. This prints the job on both sides of the paper sheets. "
- " It prints the job so that the backside has the reverse orientation from the front "
- " side if you turn the paper over the long edge, but the same orientation, if you turn it over "
- " the short edge. (Some printer drivers name this mode "
- " duplex-tumbled).
"
- "
"
- "
"
- " Additional hint for power users: This KDEPrint GUI element matches "
- " with the CUPS commandline job option parameter: "
- "
"
- " -o duplex=... # examples: \"tumble\" or \"two-sided-short-edge\" "
- "
"
- " "
- " " );
- TQString whatsThisGeneralBannersLabel = i18n( " "
- " Banner Page(s): Select banner(s) to print one or two special sheets "
- " of paper just before or after your main job.
"
- " Banners may contain some pieces of job information, such as user name, time of printing, job"
- " title and more.
"
- " Banner pages are useful to separate different jobs more easily, especially in a multi-user "
- " environment.
"
- " Hint: You can design your own banner pages. To make use of them, just put the banner "
- " file into the standard CUPS banners directory (This is usually \"/usr/share/cups/banner/\" "
- " Your custom banner(s) must have one of the supported printable formats. "
- " Supported formats are ASCII text, PostScript, PDF and nearly any image format such as PNG, JPEG or "
- " GIF. Your added banner pages will appear in the drop down menu after a restart of CUPS.
"
- " CUPS comes with a selection of banner pages.
"
- "
"
- "
"
- " Additional hint for power users: This KDEPrint GUI element matches "
- " with the CUPS commandline job option parameter: "
- "
"
- " -o job-sheets=... # examples: \"standard\" or \"topsecret\" "
- "
"
- " "
- " " );
- TQString whatsThisGeneralPagesPerSheetLabel = i18n( " "
- " Pages per Sheet: "
- " You can choose to print more than one page onto each sheet of paper. "
- " This is sometimes useful to save paper.
"
- " Note 1: the page images get scaled down accordingly to print 2 or 4 pages per sheet. "
- " The page image does not get scaled if you print 1 page per sheet (the default setting.). "
- "
Note 2: If you select multiple pages per sheet here, the scaling and re-arranging is done "
- " by your printing system. Be aware, that some printers can by themselves print multiple pages per sheet. "
- " In this case you find the option in the printer driver settings. Be careful: if you enable multiple "
- " pages per sheet in both places, your printout will not look as you intended.
"
- "
"
- "
"
- " Additional hint for power users: This KDEPrint GUI element matches "
- " with the CUPS commandline job option parameter: "
- "
"
- " -o number-up=... # examples: \"2\" or \"4\" "
- "
"
- " "
- " " );
-
-
- setTitle(i18n("General"));
-
- // widget creation
- TQLabel *m_pagesizelabel = new TQLabel(i18n("Page s&ize:"), this);
- m_pagesizelabel->tqsetAlignment(Qt::AlignVCenter|Qt::AlignRight);
- TQWhatsThis::add(m_pagesizelabel, whatsThisGeneralPageSizeLabel);
-
- TQLabel *m_papertypelabel = new TQLabel(i18n("Paper t&ype:"), this);
- m_papertypelabel->tqsetAlignment(Qt::AlignVCenter|Qt::AlignRight);
- TQWhatsThis::add(m_papertypelabel, whatsThisGeneralPaperTypeLabel);
-
- TQLabel *m_inputslotlabel = new TQLabel(i18n("Paper so&urce:"), this);
- m_inputslotlabel->tqsetAlignment(Qt::AlignVCenter|Qt::AlignRight);
- TQWhatsThis::add(m_inputslotlabel, whatsThisGeneralPaperSourceLabel);
-
- m_pagesize = new TQComboBox(this);
- TQWhatsThis::add(m_pagesize, whatsThisGeneralPageSizeLabel);
-
- m_papertype = new TQComboBox(this);
- TQWhatsThis::add(m_papertype, whatsThisGeneralPaperTypeLabel);
-
- m_inputslot = new TQComboBox(this);
- TQWhatsThis::add(m_inputslot, whatsThisGeneralPaperSourceLabel);
-
- m_pagesizelabel->setBuddy(m_pagesize);
- m_papertypelabel->setBuddy(m_papertype);
- m_inputslotlabel->setBuddy(m_inputslot);
-
- m_orientbox = new TQButtonGroup(0, Qt::Vertical, i18n("Orientation"), this);
- TQWhatsThis::add(m_orientbox, whatsThisGeneralOrientationLabel);
-
- m_duplexbox = new TQButtonGroup(0, Qt::Vertical, i18n("Duplex Printing"), this);
- TQWhatsThis::add(m_duplexbox, whatsThisGeneralDuplexLabel);
-
- m_nupbox = new TQButtonGroup(0, Qt::Vertical, i18n("Pages per Sheet"), this);
- TQWhatsThis::add(m_nupbox, whatsThisGeneralPagesPerSheetLabel);
-
- m_bannerbox = new TQGroupBox(0, Qt::Vertical, i18n("Banners"), this);
- TQWhatsThis::add(m_bannerbox, whatsThisGeneralBannersLabel);
-
- TQRadioButton *m_portrait = new TQRadioButton(i18n("&Portrait"), m_orientbox);
- TQRadioButton *m_landscape = new TQRadioButton(i18n("&Landscape"), m_orientbox);
- TQRadioButton *m_revland = new TQRadioButton(i18n("&Reverse landscape"), m_orientbox);
- TQRadioButton *m_revport = new TQRadioButton(i18n("R&everse portrait"), m_orientbox);
-
- m_portrait->setChecked(true);
- m_orientpix = new TQLabel(m_orientbox);
- m_orientpix->tqsetAlignment(Qt::AlignCenter);
- TQRadioButton *m_dupnone = new TQRadioButton(i18n("duplex orientation", "&None"), m_duplexbox);
- TQRadioButton *m_duplong = new TQRadioButton(i18n("duplex orientation", "Lon&g side"), m_duplexbox);
- TQRadioButton *m_dupshort = new TQRadioButton(i18n("duplex orientation", "S&hort side"), m_duplexbox);
- m_dupnone->setChecked(true);
- m_duplexpix = new TQLabel(m_duplexbox);
- m_duplexpix->tqsetAlignment(Qt::AlignCenter);
- TQRadioButton *m_nup1 = new TQRadioButton("&1", m_nupbox);
- TQRadioButton *m_nup2 = new TQRadioButton("&2", m_nupbox);
- TQRadioButton *m_nup4 = new TQRadioButton("&4", m_nupbox);
- m_nup1->setChecked(true);
- m_nuppix = new TQLabel(m_nupbox);
- m_nuppix->tqsetAlignment(Qt::AlignCenter);
- m_startbanner = new TQComboBox(m_bannerbox);
- m_endbanner = new TQComboBox(m_bannerbox);
- TQLabel *m_startbannerlabel = new TQLabel(i18n("S&tart:"), m_bannerbox);
- TQLabel *m_endbannerlabel = new TQLabel(i18n("En&d:"), m_bannerbox);
- m_startbannerlabel->setBuddy(m_startbanner);
- m_endbannerlabel->setBuddy(m_endbanner);
-
- // layout creation
- TQVBoxLayout *lay0 = new TQVBoxLayout(this, 0, KDialog::spacingHint());
- TQWhatsThis::add(this, whatsThisPrintPropertiesGeneralPage);
- TQGridLayout *lay1 = new TQGridLayout(0, 3, 2, 0, KDialog::spacingHint());
- TQGridLayout *lay2 = new TQGridLayout(0, 2, 2, 0, KDialog::spacingHint());
- lay0->addStretch(1);
- lay0->addLayout(TQT_TQLAYOUT(lay1));
- lay0->addStretch(1);
- lay0->addLayout(TQT_TQLAYOUT(lay2));
- lay0->addStretch(2);
- lay1->addWidget(m_pagesizelabel, 0, 0);
- lay1->addWidget(m_papertypelabel, 1, 0);
- lay1->addWidget(m_inputslotlabel, 2, 0);
- lay1->addWidget(m_pagesize, 0, 1);
- lay1->addWidget(m_papertype, 1, 1);
- lay1->addWidget(m_inputslot, 2, 1);
- lay2->addWidget(m_orientbox, 0, 0);
- lay2->addWidget(m_bannerbox, 1, 0);
- lay2->addWidget(m_duplexbox, 0, 1);
- lay2->addWidget(m_nupbox, 1, 1);
- lay2->setColStretch(0, 1);
- lay2->setColStretch(1, 1);
- TQGridLayout *lay3 = new TQGridLayout(m_orientbox->tqlayout(), 4, 2,
- KDialog::spacingHint());
- lay3->addWidget(m_portrait, 0, 0);
- lay3->addWidget(m_landscape, 1, 0);
- lay3->addWidget(m_revland, 2, 0);
- lay3->addWidget(m_revport, 3, 0);
- lay3->addMultiCellWidget(m_orientpix, 0, 3, 1, 1);
- TQGridLayout *lay4 = new TQGridLayout(m_duplexbox->tqlayout(), 3, 2,
- KDialog::spacingHint());
- lay4->addWidget(m_dupnone, 0, 0);
- lay4->addWidget(m_duplong, 1, 0);
- lay4->addWidget(m_dupshort, 2, 0);
- lay4->addMultiCellWidget(m_duplexpix, 0, 2, 1, 1);
- lay4->setRowStretch( 0, 1 );
- TQGridLayout *lay5 = new TQGridLayout(m_nupbox->tqlayout(), 3, 2,
- KDialog::spacingHint());
- lay5->addWidget(m_nup1, 0, 0);
- lay5->addWidget(m_nup2, 1, 0);
- lay5->addWidget(m_nup4, 2, 0);
- lay5->addMultiCellWidget(m_nuppix, 0, 2, 1, 1);
- TQGridLayout *lay6 = new TQGridLayout(m_bannerbox->tqlayout(), 2, 2,
- KDialog::spacingHint());
- lay6->addWidget(m_startbannerlabel, 0, 0);
- lay6->addWidget(m_endbannerlabel, 1, 0);
- lay6->addWidget(m_startbanner, 0, 1);
- lay6->addWidget(m_endbanner, 1, 1);
- lay6->setColStretch(1, 1);
-
- // connections (+ misc)
- connect(m_orientbox,TQT_SIGNAL(clicked(int)),TQT_SLOT(slotOrientationChanged(int)));
- connect(m_nupbox,TQT_SIGNAL(clicked(int)),TQT_SLOT(slotNupChanged(int)));
- connect(m_duplexbox,TQT_SIGNAL(clicked(int)),TQT_SLOT(slotDuplexChanged(int)));
-
- // init
- initialize();
-}
-
-KPGeneralPage::~KPGeneralPage()
-{
-}
-
-void KPGeneralPage::initialize()
-{
- if (driver())
- {
- // Size, Type and Source
- DrListOption *opt = (DrListOption*)driver()->findOption("PageSize");
- if (opt) initCombo(m_pagesize,opt);
- else m_pagesize->setEnabled(false);
- opt = (DrListOption*)driver()->findOption("MediaType");
- if (opt) initCombo(m_papertype,opt);
- else m_papertype->setEnabled(false);
- opt = (DrListOption*)driver()->findOption("InputSlot");
- if (opt) initCombo(m_inputslot,opt);
- else m_inputslot->setEnabled(false);
- // Duplex
- opt = (DrListOption*)driver()->findOption("Duplex");
- if (opt)
- {
- if ( opt->choices()->count() == 2 )
- {
- // probably a On/Off option instead of the standard PS one
- TQButton *btn = static_cast(m_duplexbox->find( DUPLEX_SHORT_ID ));
- m_duplexbox->remove( btn );
- btn->hide();
- //delete btn;
- static_cast(m_duplexbox->find( DUPLEX_NONE_ID ))->setText( i18n( "Disabled" ) );
- static_cast(m_duplexbox->find( DUPLEX_LONG_ID ))->setText( i18n( "Enabled" ) );
- m_duplexpix->hide();
- }
- if (opt->currentChoice())
- {
- int ID(DUPLEX_NONE_ID);
- if (opt->currentChoice()->name() == "DuplexNoTumble" || opt->currentChoice()->name() == "On") ID = DUPLEX_LONG_ID;
- else if (opt->currentChoice()->name() == "DuplexTumble") ID = DUPLEX_SHORT_ID;
- m_duplexbox->setButton(ID);
- slotDuplexChanged(ID);
- }
- }
- else m_duplexbox->setEnabled(false);
- }
- else
- {
- // PageSize
- for (int i=SMALLSIZE_BEGIN+1;iinsertItem(i18n(default_size[i]));
- if ( printer()->printerCap() & KMPrinter::CapMedium )
- for ( int i=MEDIUMSIZE_BEGIN+1; iinsertItem(i18n(default_size[i]));
- if ( printer()->printerCap() & KMPrinter::CapLarge )
- for ( int i=HIGHSIZE_BEGIN+1; iinsertItem(i18n(default_size[i]));
- // set default page size using locale settings
- TQString psname = pageSizeToPageName((KPrinter::PageSize)(KGlobal::locale()->pageSize()));
- int index = findOption(default_size, DEFAULT_SIZE, psname);
- if (index >= 0)
- m_pagesize->setCurrentItem(index);
- // MediaType
- for (int i=1;iinsertItem(i18n(default_type[i]));
- // PageSize
- for (int i=1;iinsertItem(i18n(default_source[i]));
-
- // Enable duplex setting if supported
- m_duplexbox->setEnabled( printer()->printerCap() & KMPrinter::CapDuplex );
- }
-
- // Banners
- TQStringList values = TQStringList::split(',',printer()->option("kde-banners-supported"),false);
- if (values.count() > 0)
- {
- for (TQStringList::ConstIterator it = values.begin(); it != values.end(); ++it)
- {
- m_startbanner->insertItem(*it);
- m_endbanner->insertItem(*it);
- }
- values = TQStringList::split(',',printer()->option("kde-banners"),false);
- while (values.count() < 2) values.append("none");
- setComboItem(m_startbanner, values[0]);
- setComboItem(m_endbanner, values[1]);
- }
- else
- m_bannerbox->setEnabled(false);
-
- slotOrientationChanged(ORIENT_PORTRAIT_ID);
- slotNupChanged(NUP_1_ID);
-}
-
-void KPGeneralPage::setOptions(const TQMap& opts)
-{
- TQString value;
-
- if (driver())
- {
- value = opts["media"];
- TQStringList l = TQStringList::split(',',value,false);
- for(TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
- {
- value = *it;
- DrBase *ch;
- if ((ch = (driver()->findOption("PageSize"))) &&
- (ch = (static_cast(ch))->findChoice(value)))
- {
- if (m_pagesize->isEnabled())
- setComboItem(m_pagesize, ch->get("text"));
- }
- else if ((ch = (driver()->findOption("MediaType"))) &&
- (ch = (static_cast(ch))->findChoice(value)))
- {
- if (m_papertype->isEnabled())
- setComboItem(m_papertype, ch->get("text"));
- }
- else if ((ch = (driver()->findOption("InputSlot"))) &&
- (ch = static_cast(ch)->findChoice(value)))
- {
- if (m_inputslot)
- setComboItem(m_inputslot, ch->get("text"));
- }
- else
- {
- kdWarning() << "media option '" << value << "' not handled." << endl;
- }
- }
- value = opts["PageSize"];
- if (m_pagesize->isEnabled() && !value.isEmpty())
- {
- DrBase *ch = ((DrListOption*)driver()->findOption("PageSize"))->findChoice(value);
- if (ch) setComboItem(m_pagesize, ch->get("text"));
- }
- value = opts["MediaType"];
- if (m_papertype->isEnabled() && !value.isEmpty())
- {
- DrBase *ch = ((DrListOption*)driver()->findOption("MediaType"))->findChoice(value);
- if (ch) setComboItem(m_papertype, ch->get("text"));
- }
- value = opts["InputSlot"];
- if (m_inputslot && m_inputslot->isEnabled() && !value.isEmpty())
- {
- DrBase *ch = ((DrListOption*)driver()->findOption("InputSlot"))->findChoice(value);
- if (ch) setComboItem(m_inputslot, ch->get("text"));
- }
-
- value = opts["Duplex"];
- if (m_duplexbox->isEnabled() && !value.isEmpty())
- {
- int ID(0);
- if (value == "DuplexNoTumble" || value == "On") ID = 1;
- else if (value == "DuplexTumble") ID = 2;
- m_duplexbox->setButton(ID);
- slotDuplexChanged(ID);
- }
- }
- else
- {
- // Try to find "media" option
- value = opts["media"];
- if (!value.isEmpty())
- {
- int index(-1);
- TQStringList l = TQStringList::split(',',value,false);
- for(TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
- {
- value = *it;
-
- if ((index=findOption(default_size,DEFAULT_SIZE,value)) >= 0)
- m_pagesize->setCurrentItem(index);
- else if ((index=findOption(default_type,DEFAULT_TYPE,value)) >= 0)
- m_papertype->setCurrentItem(index);
- else if ((index=findOption(default_source,DEFAULT_SOURCE,value)) >= 0)
- m_inputslot->setCurrentItem(index);
- else
- kdWarning() << "media option '" << value << "' not handled." << endl;
- }
- }
-
- // Try to find "sides" option
- value = opts["sides"];
- int ID(0);
- if (value == "two-sided-long-edge") ID = 1;
- else if (value == "two-sided-short-edge") ID = 2;
- m_duplexbox->setButton(ID);
- slotDuplexChanged(ID);
- }
-
- // Banners
- value = opts["job-sheets"];
- if (!value.isEmpty())
- {
- TQStringList l = TQStringList::split(',',value,false);
- if (l.count() > 0) setComboItem(m_startbanner,l[0]);
- if (l.count() > 1) setComboItem(m_endbanner,l[1]);
- }
-
- // Orientation
- value = opts["orientation-requested"];
- if (!value.isEmpty())
- {
- bool ok;
- int ID = value.toInt(&ok)-3;
- if (ok)
- {
- m_orientbox->setButton(ID);
- slotOrientationChanged(ID);
- }
- }
-
- // N-up
- value = opts["number-up"];
- if (!value.isEmpty())
- {
- bool ok;
- int ID = TQMIN(value.toInt(&ok)-1,2);
- if (ok)
- {
- m_nupbox->setButton(ID);
- slotNupChanged(ID);
- }
- }
-
- if ( m_orientbox->isEnabled() )
- m_orientbox->setDisabled( opts[ "kde-orientation-fixed" ] == "1" );
- if ( m_pagesize->isEnabled() )
- m_pagesize->setDisabled( opts[ "kde-pagesize-fixed" ] == "1" );
-}
-
-void KPGeneralPage::getOptions(TQMap& opts, bool incldef)
-{
- TQString value;
-
- if (driver())
- {
- DrListOption *opt;
- if ((opt=(DrListOption*)driver()->findOption("PageSize")) != NULL)
- {
- DrBase *ch = opt->choices()->tqat(m_pagesize->currentItem());
- if (incldef || ch->name() != opt->get("default")) opts["PageSize"] = ch->name();
- }
- if ((opt=(DrListOption*)driver()->findOption("MediaType")) != NULL)
- {
- DrBase *ch = opt->choices()->tqat(m_papertype->currentItem());
- if (incldef || ch->name() != opt->get("default")) opts["MediaType"] = ch->name();
- }
- if ((opt=(DrListOption*)driver()->findOption("InputSlot")) != NULL)
- {
- DrBase *ch = opt->choices()->tqat(m_inputslot->currentItem());
- if (incldef || ch->name() != opt->get("default")) opts["InputSlot"] = ch->name();
- }
-
- if (m_duplexbox->isEnabled() && (opt=(DrListOption*)driver()->findOption("Duplex")) != NULL)
- {
- bool twoChoices = ( m_duplexbox->count() == 2 );
- switch (m_duplexbox->id(m_duplexbox->selected()))
- {
- case DUPLEX_NONE_ID: value = ( twoChoices ? "Off" : "None" ); break;
- case DUPLEX_LONG_ID: value = ( twoChoices ? "On" : "DuplexNoTumble" ); break;
- case DUPLEX_SHORT_ID: value = "DuplexTumble"; break;
- }
- if (incldef || value != opt->get("default")) opts["Duplex"] = value;
- }
- }
- else
- {
- value = TQString("%1,%2,%3").arg(default_size[m_pagesize->currentItem()*2]).arg(default_type[m_papertype->currentItem()*2]).arg(default_source[m_inputslot->currentItem()*2]);
- opts["media"] = value;
-
- if (m_duplexbox->isEnabled())
- {
- switch (m_duplexbox->id(m_duplexbox->selected()))
- {
- case 0: value = "one-sided"; break;
- case 1: value = "two-sided-long-edge"; break;
- case 2: value = "two-sided-short-edge"; break;
- }
- opts["sides"] = value;
- }
- }
-
- value = TQString::number(m_orientbox->id(m_orientbox->selected())+3);
- if (value != "3" || incldef) opts["orientation-requested"] = value;
-
- if (m_nupbox->isEnabled())
- {
- switch (m_nupbox->id(m_nupbox->selected()))
- {
- case 0: value = "1"; break;
- case 1: value = "2"; break;
- case 2: value = "4"; break;
- }
- if (value != "1" || incldef) opts["number-up"] = value;
- }
-
- if (m_bannerbox->isEnabled())
- {
- TQStringList l = TQStringList::split(',',printer()->option("kde-banners"),false);
- if (incldef || (l.count() == 2 && (l[0] != m_startbanner->currentText() || l[1] != m_endbanner->currentText()))
- || (l.count() == 0 && (m_startbanner->currentText() != "none" || m_endbanner->currentText() != "none")))
- {
- value = TQString("%1,%2").arg(m_startbanner->currentText()).arg(m_endbanner->currentText());
- opts["job-sheets"] = value;
- }
- }
-}
-
-void KPGeneralPage::slotOrientationChanged(int ID)
-{
- TQString iconstr;
- switch (ID)
- {
- case ORIENT_PORTRAIT_ID: iconstr = "tdeprint_portrait"; break;
- case ORIENT_LANDSCAPE_ID: iconstr = "tdeprint_landscape"; break;
- case ORIENT_REVPORTRAIT_ID: iconstr = "tdeprint_revportrait"; break;
- case ORIENT_REVLANDSCAPE_ID: iconstr = "tdeprint_revlandscape"; break;
- default: iconstr = "tdeprint_portrait"; break;
- }
- m_orientpix->setPixmap(UserIcon(iconstr));
-}
-
-void KPGeneralPage::slotNupChanged(int ID)
-{
- TQString iconstr;
- switch (ID)
- {
- case NUP_1_ID: iconstr = "tdeprint_nup1"; break;
- case NUP_2_ID: iconstr = "tdeprint_nup2"; break;
- case NUP_4_ID: iconstr = "tdeprint_nup4"; break;
- default: iconstr = "tdeprint_nup1"; break;
- }
- m_nuppix->setPixmap(UserIcon(iconstr));
-}
-
-void KPGeneralPage::slotDuplexChanged(int ID)
-{
- if (m_duplexbox->isEnabled())
- {
- TQString iconstr;
- switch (ID)
- {
- case DUPLEX_NONE_ID: iconstr = "tdeprint_duplex_none"; break;
- case DUPLEX_LONG_ID: iconstr = "tdeprint_duplex_long"; break;
- case DUPLEX_SHORT_ID: iconstr = "tdeprint_duplex_short"; break;
- default: iconstr = "tdeprint_duplex_none"; break;
- }
- m_duplexpix->setPixmap(UserIcon(iconstr));
- }
-}
-#include "kpgeneralpage.moc"
--
cgit v1.2.1