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_->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,8 +54,76 @@ spacing - 3 + 6 + + QLineEdit + + name + fileED + + + enabled + true + + + toolTip + 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 @@ -75,6 +143,17 @@ Send output to the printer + + QLineEdit + + name + printerED + + + toolTip + Send output to the given printer + + QRadioButton @@ -90,47 +169,6 @@ Send output to a file - - QLineEdit - - name - printerED - - - toolTip - Send output to the given printer - - - - QLineEdit - - name - fileED - - - enabled - true - - - 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 + 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 + + + + + + QCheckBox + + name + oddCB text - &All + Print &odd-numbered pages checked true - - toolTip - Print all pages - - - QRadioButton + + QCheckBox name - oddRB + evenCB text - &Odd - - - toolTip - Print odd pages only - - - - QRadioButton - - name - evenRB + Print &even-numbered pages - text - &Even - - - toolTip - Print even pages only - - - - QLabel - - name - toPageL - - - enabled + checked true - - text - &Last page: - - - buddy - toED - - - QLineEdit - - name - toED - - - enabled - 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