From e16866e072f94410321d70daedbcb855ea878cac Mon Sep 17 00:00:00 2001
From: Timothy Pearson Page Selection Here you can control if you print a certain selection only out of all"
+ " the pages from the complete document."
+ "
Note: this field is disabled if you print from" + " non-KDE applications like Mozilla or OpenOffice.org, since here KDEPrint has no" + " means to determine which document page you are currently viewing.
Example: \"4,6,10-13,17,20,23-25\" will print" + " the pages 4, 6, 10, 11, 12, 13, 17, 20, 23, 24, 25 of your document.
" + "Additional hint for power users: This KDEPrint GUI element matches " + " with the CUPS commandline job option parameter: " + "
" + " -o page-ranges=... # example: \"4,6,10-13,17,20,23-25\" " + "" + " " + "
Choose \"All Pages\", \"Even Pages\" or" + " \"Odd Pages\"" + " if you want to print a page selection matching one of these terms. The default" + " is \"All Pages\".
" + "Note: If you combine a selection of a \"Page Range\" with a" + " \"Page Set\" of \"Odd\" or \"Even\", you will only get the" + " odd or even pages from the originally selected page range. This is useful if you" + " odd or even pages from the originally selected page range. This is useful if you" + " want to print a page range in duplex on a simplex-only printer. In this case you" + " can feed the paper to the printer twice; in the first pass, select \"Odd\" or" + " \"Even\" (depending on your printer model), in second pass select the other" + " option. You may need to \"Reverse\" the output in one of the passes (depending" + " on your printer model).
" + "Additional hint for power users: This KDEPrint GUI element matches " + " with the CUPS commandline job option parameter: " + "
" + " -o page-set=... # example: \"odd\" or \"even\" " + "" + " " + "
The 'Copies' setting defaults to 1.
" + "Additional hint for power users: This KDEPrint GUI element matches " + " with the CUPS commandline job option parameter: " + "
" + " -o copies=... # examples: \"5\" or \"42\" " + "" + " " + ".
" + " -o outputorder=... # example: \"reverse\"" + "
" + " -o Collate=... # example: \"true\" or \"false\" " + "
Additional hint for power users: This KDEPrint GUI element matches " + " with the CUPS commandline job option parameter: " + "
" + " -o copies=... # examples: \"5\" or \"42\" " + "" + " " + "
If the \"Collate\" checkbox is enabled (default), the output order for" + " multiple copies of a multi-page document will be \"1-2-3-..., 1-2-3-..., 1-2-3-...\".
" + "If the \"Collate\" checkbox is disabled, the output order for" + " multiple copies of a multi-page document will be \"1-1-1-..., 2-2-2-..., 3-3-3-...\".
" + "Additional hint for power users: This KDEPrint GUI element matches " + " with the CUPS commandline job option parameter: " + "
" + " -o Collate=... # example: \"true\" or \"false\" " + "" + " " + "
If the \"Reverse\" checkbox is enabled, the output order for" + " multiple copies of a multi-page document will be \"...-3-2-1, ...-3-2-1, ...-3-2-1\", if you" + " also have enabled the \"Collate\" checkbox at the same time" + " (the usual usecase).
" + "If the \"Reverse\" checkbox is enabled, the output order for" + " multiple copies of a multi-page document will be \"...-3-3-3, ...-2-2-2, ...-1-1-1\", if you" + " have disabled the \"Collate\" checkbox at the same time.
" + "Additional hint for power users: This KDEPrint GUI element matches " + " with the CUPS commandline job option parameter: " + "
" + " -o outputorder=... # example: \"reverse\"" + " " + "" + " " + "
Enter pages or group of pages to print separated by commas (1,2-5,8).
")); +// TQWhatsThis::add(m_rangeedit, i18n("Enter pages or group of pages to print separated by commas (1,2-5,8).
")); + //TQLabel *m_rangeexpl = new TQLabel(m_pagebox); + //m_rangeexpl->setText(i18n("Enter pages or group of pages to print separated by commas (1,2-5,8).
")); + TQGroupBox *m_copybox = new TQGroupBox(0, Qt::Vertical, i18n("Output Settings"), this); + TQWhatsThis::add(m_copybox, whatsThisCopiesLabel); + m_collate = new TQCheckBox(i18n("Co&llate"), m_copybox); + TQWhatsThis::add(m_collate, whatsThisCollateLabel); + m_order = new TQCheckBox(i18n("Re&verse"), m_copybox); + TQWhatsThis::add(m_order, whatsThisReverseLabel); + m_collatepix = new TQLabel(m_copybox); + m_collatepix->tqsetAlignment(Qt::AlignCenter); + m_collatepix->setMinimumHeight(70); + TQLabel *m_copieslabel = new TQLabel(i18n("Cop&ies:"), m_copybox); + m_copies = new TQSpinBox(m_copybox); + m_copies->setRange(1,999); + TQWhatsThis::add(m_copies, whatsThisNumberOfCopiesLabel); + m_copieslabel->setBuddy(m_copies); + TQWhatsThis::add(m_copieslabel, whatsThisNumberOfCopiesLabel); + m_pageset = new TQComboBox(m_pagebox); + m_pageset->insertItem(i18n("All Pages")); + m_pageset->insertItem(i18n("Odd Pages")); + m_pageset->insertItem(i18n("Even Pages")); + TQWhatsThis::add(m_pageset, whatsThisPageSetLabel); + TQLabel *m_pagesetlabel = new TQLabel(i18n("Page &set:"), m_pagebox); + m_pagesetlabel->setBuddy(m_pageset); + TQWhatsThis::add(m_pagesetlabel, whatsThisPageSetLabel); + KSeparator *sepline = new KSeparator(Qt::Horizontal, m_pagebox); + sepline->setMinimumHeight(10); + + TQWidget::setTabOrder( m_all, m_current ); + TQWidget::setTabOrder( m_current, m_range ); + TQWidget::setTabOrder( m_range, m_rangeedit ); + TQWidget::setTabOrder( m_rangeedit, m_pageset ); + TQWidget::setTabOrder( m_pageset, m_copies ); + TQWidget::setTabOrder( m_copies, m_collate ); + TQWidget::setTabOrder( m_collate, m_order ); + + // layout creation + TQGridLayout *l1 = new TQGridLayout(this, 2, 2, 0, 5); + l1->setRowStretch(1,1); + l1->setColStretch(0,1); + l1->setColStretch(1,1); + l1->addWidget(m_pagebox,0,0); + l1->addWidget(m_copybox,0,1); + TQVBoxLayout *l3 = new TQVBoxLayout(TQT_TQLAYOUT(m_pagebox->tqlayout()), 5); + l3->addWidget(m_all); + l3->addWidget(m_current); + TQHBoxLayout *l4 = new TQHBoxLayout(0, 0, 5); + l3->addLayout(l4); + l4->addWidget(m_range,0); + l4->addWidget(m_rangeedit,1); + //l3->addWidget(m_rangeexpl); + l3->addWidget(sepline); + TQHBoxLayout *l2 = new TQHBoxLayout(0, 0, 5); + l3->addLayout(l2); + l2->addWidget(m_pagesetlabel,0); + l2->addWidget(m_pageset,1); + TQGridLayout *l5 = new TQGridLayout(m_copybox->tqlayout(), 4, 2, 10); + l5->setRowStretch(4,1); + l5->addWidget(m_copieslabel,0,0); + l5->addWidget(m_copies,0,1); + l5->addMultiCellWidget(m_collatepix,1,2,0,0); + l5->addWidget(m_collate,1,1); + l5->addWidget(m_order,2,1); + + // some initialization + m_all->setChecked(true); + m_copies->setValue(1); + initialize(m_useplugin); + slotCollateClicked(); + + // connections + connect(m_rangeedit,TQT_SIGNAL(textChanged(const TQString&)),TQT_SLOT(slotRangeEntered())); + connect(m_collate,TQT_SIGNAL(clicked()),TQT_SLOT(slotCollateClicked())); + connect(m_order,TQT_SIGNAL(clicked()),TQT_SLOT(slotCollateClicked())); + + if (!kapp->authorize("print/copies")) + { + setTitle(i18n("Pages")); + m_copybox->hide(); + } +} + +KPCopiesPage::~KPCopiesPage() +{ +} + +void KPCopiesPage::slotRangeEntered() +{ + m_range->setChecked(true); +} + +void KPCopiesPage::slotCollateClicked() +{ + TQString s("tdeprint_"); + s.append((m_collate->isChecked() ? "collate" : "uncollate")); + if (m_order->isChecked()) s.append("_reverse"); + m_collatepix->setPixmap(UserIcon(s)); +} + +void KPCopiesPage::initialize(bool usePlugin) +{ + m_useplugin = usePlugin; + int f = KMFactory::self()->uiManager()->copyFlags(m_printer, m_useplugin); + + m_current->setEnabled((f & KMUiManager::Current)); + m_range->setEnabled((f & KMUiManager::Range)); + m_rangeedit->setEnabled((f & KMUiManager::Range)); + m_collate->setEnabled((f & KMUiManager::Collate)); + m_order->setEnabled((f & KMUiManager::Order)); + m_pageset->setEnabled((f & KMUiManager::PageSet)); + + // by default, if collate disabled, set it to true + m_collate->setChecked(!(f & KMUiManager::NoAutoCollate)); + slotCollateClicked(); +} + +void KPCopiesPage::setOptions(const TQMap