From 5f5672e088ac10ca0533e34384c9d464c6fb9147 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 11 Sep 2002 19:57:49 +0000 Subject: [PATCH] printer fixe git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5275 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 6 + src/frontends/qt2/QPrint.C | 66 ++--- src/frontends/qt2/ui/QPrintDialog.ui | 381 +++++++++++++++------------ 3 files changed, 243 insertions(+), 210 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 5deb40621b..3d2404e08a 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,9 @@ +2002-09-11 John Levon + + * QPrint.h: + * QPrint.C: + * ui/QPrintDialog.ui: update for odd/even changes + 2002-09-11 John Levon * QCitationDialog.C: show right info when selecting a cite diff --git a/src/frontends/qt2/QPrint.C b/src/frontends/qt2/QPrint.C index 7f6af2bb64..86d1bf2a3e 100644 --- a/src/frontends/qt2/QPrint.C +++ b/src/frontends/qt2/QPrint.C @@ -60,52 +60,28 @@ void QPrint::update_contents() dialog_->reverseCB->setChecked(pp.reverse_order); - QRadioButton * button; - switch (pp.which_pages) { - case PrinterParams::ALL: button = dialog_->allRB; break; - case PrinterParams::ODD: button = dialog_->oddRB; break; - case PrinterParams::EVEN: button = dialog_->evenRB; break; - } - button->setChecked(true); - - // hmmm... maybe a bit weird but maybe not - // we might just be remembering the last - // time this was printed. - if (!pp.from_page.empty()) { - dialog_->fromED->setText(pp.from_page.c_str()); - - dialog_->toED->setText(""); - if (pp.to_page) - dialog_->toED->setText(tostr(pp.to_page).c_str()); - } else { - dialog_->fromED->setText(""); - dialog_->toED->setText(""); + dialog_->copiesSB->setValue(pp.count_copies); + + dialog_->oddCB->setChecked(pp.odd_pages); + dialog_->evenCB->setChecked(pp.even_pages); + + if (pp.all_pages) { + dialog_->allRB->setChecked(true); + return; } - dialog_->copiesSB->setValue(pp.count_copies); + dialog_->rangeRB->setChecked(true); + + QString s; + s.setNum(pp.from_page); + dialog_->fromED->setText(s); + s.setNum(pp.to_page); + dialog_->toED->setText(s); } void QPrint::apply() { - PrinterParams::WhichPages wp; - - if (dialog_->allRB->isChecked()) - wp = PrinterParams::ALL; - else if (dialog_->oddRB->isChecked()) - wp = PrinterParams::ODD; - else - wp = PrinterParams::EVEN; - - string from; - int to(0); - if (!dialog_->fromED->text().isEmpty()) { - // we have at least one page requested - from = dialog_->fromED->text().latin1(); - if (!dialog_->toED->text().isEmpty()) - to = strToInt(dialog_->toED->text().latin1()); - } - PrinterParams::Target t = PrinterParams::PRINTER; if (dialog_->fileRB->isChecked()) t = PrinterParams::FILE; @@ -113,10 +89,14 @@ void QPrint::apply() PrinterParams const pp(t, dialog_->printerED->text().latin1(), dialog_->fileED->text().latin1(), - wp, from, to, - dialog_->reverseCB->isChecked(), - !dialog_->collateCB->isChecked(), - strToInt(dialog_->copiesSB->text().latin1())); + dialog_->allRB->isChecked(), + dialog_->fromED->text().toUInt(), + dialog_->toED->text().toUInt(), + dialog_->oddCB->isChecked(), + dialog_->evenCB->isChecked(), + dialog_->copiesSB->text().toUInt(), + dialog_->collateCB->isChecked(), + dialog_->reverseCB->isChecked()); controller().params() = pp; } diff --git a/src/frontends/qt2/ui/QPrintDialog.ui b/src/frontends/qt2/ui/QPrintDialog.ui index 2cd056148b..dd8da3d532 100644 --- a/src/frontends/qt2/ui/QPrintDialog.ui +++ b/src/frontends/qt2/ui/QPrintDialog.ui @@ -13,8 +13,8 @@ 0 0 - 327 - 342 + 225 + 395 @@ -54,40 +54,93 @@ spacing - 3 + 6 - - QRadioButton + + QLineEdit name - printerRB - - - text - P&rinter + fileED - checked + enabled true toolTip - Send output to the printer + Send output to a file - + + QLayoutWidget + + name + Layout5 + + + + margin + 0 + + + spacing + 6 + + + QPushButton + + name + browsePB + + + enabled + true + + + text + &Browse ... + + + + + name + Spacer15 + + + orientation + Horizontal + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + QRadioButton name - fileRB + printerRB text - &File + P&rinter + + + checked + true toolTip - Send output to a file + Send output to the printer @@ -101,36 +154,21 @@ Send output to the given printer - - QLineEdit + + QRadioButton name - fileED + fileRB - enabled - true + text + &File toolTip Send output to a file - - QPushButton - - name - browsePB - - - enabled - true - - - text - &Browse ... - - @@ -146,7 +184,7 @@ layoutSpacing - + margin 11 @@ -155,90 +193,154 @@ spacing 6 - - QRadioButton + + QLayoutWidget name - allRB - - - text - &All - - - checked - true - - - toolTip - Print all pages - + Layout3 + + + + margin + 0 + + + spacing + 6 + + + QLayoutWidget + + name + Layout2 + + + + margin + 0 + + + spacing + 6 + + + QLineEdit + + name + fromED + + + enabled + false + + + toolTip + Page number to print from + + + + QLabel + + name + toLA + + + text + &to + + + buddy + toED + + + + QLineEdit + + name + toED + + + enabled + false + + + toolTip + Page number to print to + + + + + + QRadioButton + + name + rangeRB + + + text + Fro&m + + + checked + false + + + toolTip + Print all pages + + + + QRadioButton + + name + allRB + + + text + &All + + + checked + true + + + toolTip + Print all pages + + + - - QRadioButton + + QCheckBox name - oddRB + oddCB text - &Odd - - - toolTip - Print odd pages only - - - - QRadioButton - - name - evenRB + Print &odd-numbered pages - text - &Even - - - toolTip - Print even pages only + checked + true - - QLabel + + QCheckBox name - toPageL - - - enabled - true + evenCB text - &Last page: - - - buddy - toED - - - - QLineEdit - - name - toED + Print &even-numbered pages - enabled + checked true - - toolTip - Page number to print to - - + QCheckBox name @@ -253,60 +355,7 @@ Print in reverse order - - QLineEdit - - name - fromED - - - enabled - true - - - toolTip - Page number to print from - - - - QLabel - - name - rangeLA - - - text - Ran&ge - - - buddy - fromED - - - toolTip - Set a range of pages to print - - - - QLabel - - name - fromPageL - - - enabled - true - - - text - &Starting range: - - - buddy - fromED - - - + QGroupBox @@ -485,18 +534,6 @@ QPrintDialogBase change_adaptor() - - oddRB - toggled(bool) - QPrintDialogBase - change_adaptor() - - - evenRB - toggled(bool) - QPrintDialogBase - change_adaptor() - reverseCB toggled(bool) @@ -545,6 +582,18 @@ QPrintDialogBase change_adaptor() + + rangeRB + toggled(bool) + fromED + setEnabled(bool) + + + rangeRB + toggled(bool) + toED + setEnabled(bool) + browseClicked() change_adaptor() copiesChanged(int) @@ -559,8 +608,6 @@ fileED browsePB allRB - oddRB - evenRB fromED toED reverseCB -- 2.39.5