From 5b3207718b6d654a7c91c0c895d78aa617101d2d Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 13 Oct 2000 15:58:34 +0000 Subject: [PATCH] Add a browser to KDE print dialog. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1120 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 9 ++ src/frontends/kde/formprintdialog.C | 8 +- src/frontends/kde/formprintdialogdata.C | 184 ++++++++++++++++++++---- src/frontends/kde/formprintdialogdata.h | 2 +- 4 files changed, 177 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index a42a3bf17a..b2c2f3481b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2000-10-13 John Levon + + * src/frontends/kde/formprintdialog.C: add + file browser for selecting postscript output + + * src/frontends/kde/formprintdialogdata.C: + * src/frontends/kde/formprintdialogdata.h: re-generate + correctly + 2000-10-13 John Levon * src/frontends/gnome/Makefile.am: diff --git a/src/frontends/kde/formprintdialog.C b/src/frontends/kde/formprintdialog.C index 61bd37cd41..6650b11d66 100644 --- a/src/frontends/kde/formprintdialog.C +++ b/src/frontends/kde/formprintdialog.C @@ -7,6 +7,7 @@ #include "formprintdialogdata.h" #include "formprintdialog.h" #include "support/lstrings.h" +#include "support/filetools.h" #include #include @@ -26,5 +27,10 @@ FormPrintDialog::~FormPrintDialog() void FormPrintDialog::clickedBrowse() { - // FIXME: open a file dialog here + // FIXME: move into utility class later, accept URLs etc. + + KFileDialog filedlg(OnlyPath(filename->text()).c_str(), "*.ps|PostScript Files (*.ps)", this, 0, true, false); + + if (filedlg.exec() == QDialog::Accepted) + filename->setText(filedlg.selectedFile().data()); } diff --git a/src/frontends/kde/formprintdialogdata.C b/src/frontends/kde/formprintdialogdata.C index d7f426d198..ea5c055566 100644 --- a/src/frontends/kde/formprintdialogdata.C +++ b/src/frontends/kde/formprintdialogdata.C @@ -3,13 +3,15 @@ --- Qt Architect generated file --- File: formprintdialogdata.C - Last generated: Fri Oct 6 13:10:28 2000 + Last generated: Fri Oct 13 16:07:46 2000 DO NOT EDIT!!! This file will be automatically regenerated by qtarch. All changes will be lost. *********************************************************************/ +#include + #include #include #include "formprintdialogdata.h" @@ -37,7 +39,7 @@ FormPrintDialogData::FormPrintDialogData pagesGroupBox->setLineWidth( 1 ); pagesGroupBox->setMidLineWidth( 0 ); pagesGroupBox->QFrame::setMargin( 0 ); - pagesGroupBox->setTitle( "Pages" ); + pagesGroupBox->setTitle( _("Pages") ); pagesGroupBox->setAlignment( 1 ); pagesRadioGroup = new QButtonGroup( pagesGroupBox, "pagesRadioGroup" ); @@ -52,7 +54,7 @@ FormPrintDialogData::FormPrintDialogData pagesRadioGroup->setLineWidth( 1 ); pagesRadioGroup->setMidLineWidth( 0 ); pagesRadioGroup->QFrame::setMargin( 0 ); - pagesRadioGroup->setTitle( "" ); + pagesRadioGroup->setTitle( _("") ); pagesRadioGroup->setAlignment( 1 ); pagesRadioGroup->setExclusive( TRUE ); @@ -68,7 +70,7 @@ FormPrintDialogData::FormPrintDialogData copies->setLineWidth( 1 ); copies->setMidLineWidth( 0 ); copies->QFrame::setMargin( 0 ); - copies->setTitle( "Copies" ); + copies->setTitle( _("Copies") ); copies->setAlignment( 1 ); printToGroupBox = new QGroupBox( this, "printToGroupBox" ); @@ -83,7 +85,7 @@ FormPrintDialogData::FormPrintDialogData printToGroupBox->setLineWidth( 1 ); printToGroupBox->setMidLineWidth( 0 ); printToGroupBox->QFrame::setMargin( 0 ); - printToGroupBox->setTitle( "Print to" ); + printToGroupBox->setTitle( _("Print to") ); printToGroupBox->setAlignment( 1 ); printToRadioGroup = new QButtonGroup( printToGroupBox, "printToRadioGroup" ); @@ -98,7 +100,7 @@ FormPrintDialogData::FormPrintDialogData printToRadioGroup->setLineWidth( 1 ); printToRadioGroup->setMidLineWidth( 0 ); printToRadioGroup->QFrame::setMargin( 0 ); - printToRadioGroup->setTitle( "" ); + printToRadioGroup->setTitle( _("") ); printToRadioGroup->setAlignment( 1 ); printToRadioGroup->setExclusive( TRUE ); @@ -111,7 +113,7 @@ FormPrintDialogData::FormPrintDialogData print->setBackgroundMode( QWidget::PaletteBackground ); print->setFontPropagation( QWidget::NoChildren ); print->setPalettePropagation( QWidget::NoChildren ); - print->setText( "&Print" ); + print->setText( _("&Print") ); print->setAutoRepeat( FALSE ); print->setAutoResize( FALSE ); print->setToggleButton( FALSE ); @@ -128,7 +130,7 @@ FormPrintDialogData::FormPrintDialogData cancel->setBackgroundMode( QWidget::PaletteBackground ); cancel->setFontPropagation( QWidget::NoChildren ); cancel->setPalettePropagation( QWidget::NoChildren ); - cancel->setText( "&Cancel" ); + cancel->setText( _("&Cancel") ); cancel->setAutoRepeat( FALSE ); cancel->setAutoResize( FALSE ); cancel->setToggleButton( FALSE ); @@ -144,7 +146,7 @@ FormPrintDialogData::FormPrintDialogData allpages->setBackgroundMode( QWidget::PaletteBackground ); allpages->setFontPropagation( QWidget::NoChildren ); allpages->setPalettePropagation( QWidget::NoChildren ); - allpages->setText( "&All pages" ); + allpages->setText( _("&All pages") ); allpages->setAutoRepeat( FALSE ); allpages->setAutoResize( FALSE ); allpages->setChecked( FALSE ); @@ -157,7 +159,7 @@ FormPrintDialogData::FormPrintDialogData evenpages->setBackgroundMode( QWidget::PaletteBackground ); evenpages->setFontPropagation( QWidget::NoChildren ); evenpages->setPalettePropagation( QWidget::NoChildren ); - evenpages->setText( "&Even pages" ); + evenpages->setText( _("&Even pages") ); evenpages->setAutoRepeat( FALSE ); evenpages->setAutoResize( FALSE ); evenpages->setChecked( FALSE ); @@ -170,7 +172,7 @@ FormPrintDialogData::FormPrintDialogData from->setBackgroundMode( QWidget::PaletteBase ); from->setFontPropagation( QWidget::NoChildren ); from->setPalettePropagation( QWidget::NoChildren ); - from->setText( "" ); + from->setText( _("") ); from->setMaxLength( 32767 ); from->setFrame( QLineEdit::Normal ); from->setFrame( TRUE ); @@ -187,7 +189,7 @@ FormPrintDialogData::FormPrintDialogData fromLabel->setLineWidth( 1 ); fromLabel->setMidLineWidth( 0 ); fromLabel->QFrame::setMargin( 0 ); - fromLabel->setText( "From" ); + fromLabel->setText( _("From") ); fromLabel->setAlignment( 289 ); fromLabel->setMargin( -1 ); @@ -203,7 +205,7 @@ FormPrintDialogData::FormPrintDialogData toLabel->setLineWidth( 1 ); toLabel->setMidLineWidth( 0 ); toLabel->QFrame::setMargin( 0 ); - toLabel->setText( "To" ); + toLabel->setText( _("To") ); toLabel->setAlignment( 289 ); toLabel->setMargin( -1 ); @@ -215,7 +217,7 @@ FormPrintDialogData::FormPrintDialogData oddpages->setBackgroundMode( QWidget::PaletteBackground ); oddpages->setFontPropagation( QWidget::NoChildren ); oddpages->setPalettePropagation( QWidget::NoChildren ); - oddpages->setText( "&Odd pages" ); + oddpages->setText( _("&Odd pages") ); oddpages->setAutoRepeat( FALSE ); oddpages->setAutoResize( FALSE ); oddpages->setChecked( FALSE ); @@ -228,7 +230,7 @@ FormPrintDialogData::FormPrintDialogData toprinter->setBackgroundMode( QWidget::PaletteBackground ); toprinter->setFontPropagation( QWidget::NoChildren ); toprinter->setPalettePropagation( QWidget::NoChildren ); - toprinter->setText( "&Printer" ); + toprinter->setText( _("&Printer") ); toprinter->setAutoRepeat( FALSE ); toprinter->setAutoResize( FALSE ); toprinter->setChecked( FALSE ); @@ -241,7 +243,7 @@ FormPrintDialogData::FormPrintDialogData tofile->setBackgroundMode( QWidget::PaletteBackground ); tofile->setFontPropagation( QWidget::NoChildren ); tofile->setPalettePropagation( QWidget::NoChildren ); - tofile->setText( "&File" ); + tofile->setText( _("&File") ); tofile->setAutoRepeat( FALSE ); tofile->setAutoResize( FALSE ); tofile->setChecked( FALSE ); @@ -254,7 +256,7 @@ FormPrintDialogData::FormPrintDialogData printername->setBackgroundMode( QWidget::PaletteBase ); printername->setFontPropagation( QWidget::NoChildren ); printername->setPalettePropagation( QWidget::NoChildren ); - printername->setText( "" ); + printername->setText( _("") ); printername->setMaxLength( 32767 ); printername->setFrame( QLineEdit::Normal ); printername->setFrame( TRUE ); @@ -267,7 +269,7 @@ FormPrintDialogData::FormPrintDialogData reverse->setBackgroundMode( QWidget::PaletteBackground ); reverse->setFontPropagation( QWidget::NoChildren ); reverse->setPalettePropagation( QWidget::NoChildren ); - reverse->setText( "&Reverse order" ); + reverse->setText( _("&Reverse order") ); reverse->setAutoRepeat( FALSE ); reverse->setAutoResize( TRUE ); reverse->setChecked( FALSE ); @@ -280,7 +282,7 @@ FormPrintDialogData::FormPrintDialogData filename->setBackgroundMode( QWidget::PaletteBase ); filename->setFontPropagation( QWidget::NoChildren ); filename->setPalettePropagation( QWidget::NoChildren ); - filename->setText( "" ); + filename->setText( _("") ); filename->setMaxLength( 32767 ); filename->setFrame( QLineEdit::Normal ); filename->setFrame( TRUE ); @@ -293,7 +295,7 @@ FormPrintDialogData::FormPrintDialogData sort->setBackgroundMode( QWidget::PaletteBackground ); sort->setFontPropagation( QWidget::NoChildren ); sort->setPalettePropagation( QWidget::NoChildren ); - sort->setText( "&Sort" ); + sort->setText( _("&Sort") ); sort->setAutoRepeat( FALSE ); sort->setAutoResize( TRUE ); sort->setChecked( FALSE ); @@ -307,7 +309,7 @@ FormPrintDialogData::FormPrintDialogData browse->setBackgroundMode( QWidget::PaletteBackground ); browse->setFontPropagation( QWidget::NoChildren ); browse->setPalettePropagation( QWidget::NoChildren ); - browse->setText( "&Browse" ); + browse->setText( _("&Browse") ); browse->setAutoRepeat( FALSE ); browse->setAutoResize( FALSE ); browse->setToggleButton( FALSE ); @@ -323,7 +325,7 @@ FormPrintDialogData::FormPrintDialogData count->setBackgroundMode( QWidget::PaletteBase ); count->setFontPropagation( QWidget::NoChildren ); count->setPalettePropagation( QWidget::NoChildren ); - count->setText( "" ); + count->setText( _("") ); count->setMaxLength( 32767 ); count->setFrame( QLineEdit::Normal ); count->setFrame( TRUE ); @@ -340,7 +342,7 @@ FormPrintDialogData::FormPrintDialogData countLabel->setLineWidth( 1 ); countLabel->setMidLineWidth( 0 ); countLabel->QFrame::setMargin( 0 ); - countLabel->setText( "Count" ); + countLabel->setText( _("Count") ); countLabel->setAlignment( 289 ); countLabel->setMargin( -1 ); @@ -352,7 +354,7 @@ FormPrintDialogData::FormPrintDialogData to->setBackgroundMode( QWidget::PaletteBase ); to->setFontPropagation( QWidget::NoChildren ); to->setPalettePropagation( QWidget::NoChildren ); - to->setText( "" ); + to->setText( _("") ); to->setMaxLength( 32767 ); to->setFrame( QLineEdit::Normal ); to->setFrame( TRUE ); @@ -364,6 +366,140 @@ FormPrintDialogData::FormPrintDialogData printToRadioGroup->insert( toprinter ); printToRadioGroup->insert( tofile ); + if (print->sizeHint().width()!=-1) + print->setMinimumWidth(print->sizeHint().width()); + if (print->sizeHint().height()!=-1) + print->setMinimumHeight(print->sizeHint().height()); + if (print->sizeHint().width()!=-1) + print->setMaximumWidth(print->sizeHint().width()); + if (print->sizeHint().height()!=-1) + print->setMaximumHeight(print->sizeHint().height()); + if (cancel->sizeHint().width()!=-1) + cancel->setMinimumWidth(cancel->sizeHint().width()); + if (cancel->sizeHint().height()!=-1) + cancel->setMinimumHeight(cancel->sizeHint().height()); + if (cancel->sizeHint().width()!=-1) + cancel->setMaximumWidth(cancel->sizeHint().width()); + if (cancel->sizeHint().height()!=-1) + cancel->setMaximumHeight(cancel->sizeHint().height()); + if (allpages->sizeHint().width()!=-1) + allpages->setMinimumWidth(allpages->sizeHint().width()); + if (allpages->sizeHint().height()!=-1) + allpages->setMinimumHeight(allpages->sizeHint().height()); + if (allpages->sizeHint().width()!=-1) + allpages->setMaximumWidth(allpages->sizeHint().width()); + if (allpages->sizeHint().height()!=-1) + allpages->setMaximumHeight(allpages->sizeHint().height()); + if (evenpages->sizeHint().width()!=-1) + evenpages->setMinimumWidth(evenpages->sizeHint().width()); + if (evenpages->sizeHint().height()!=-1) + evenpages->setMinimumHeight(evenpages->sizeHint().height()); + if (evenpages->sizeHint().width()!=-1) + evenpages->setMaximumWidth(evenpages->sizeHint().width()); + if (evenpages->sizeHint().height()!=-1) + evenpages->setMaximumHeight(evenpages->sizeHint().height()); + if (from->sizeHint().width()!=-1) + from->setMinimumWidth(from->sizeHint().width()); + if (from->sizeHint().height()!=-1) + from->setMinimumHeight(from->sizeHint().height()); + if (from->sizeHint().height()!=-1) + from->setMaximumHeight(from->sizeHint().height()); + if (fromLabel->sizeHint().width()!=-1) + fromLabel->setMinimumWidth(fromLabel->sizeHint().width()); + if (fromLabel->sizeHint().height()!=-1) + fromLabel->setMinimumHeight(fromLabel->sizeHint().height()); + if (fromLabel->sizeHint().width()!=-1) + fromLabel->setMaximumWidth(fromLabel->sizeHint().width()); + if (fromLabel->sizeHint().height()!=-1) + fromLabel->setMaximumHeight(fromLabel->sizeHint().height()); + if (toLabel->sizeHint().width()!=-1) + toLabel->setMinimumWidth(toLabel->sizeHint().width()); + if (toLabel->sizeHint().height()!=-1) + toLabel->setMinimumHeight(toLabel->sizeHint().height()); + if (toLabel->sizeHint().width()!=-1) + toLabel->setMaximumWidth(toLabel->sizeHint().width()); + if (toLabel->sizeHint().height()!=-1) + toLabel->setMaximumHeight(toLabel->sizeHint().height()); + if (oddpages->sizeHint().width()!=-1) + oddpages->setMinimumWidth(oddpages->sizeHint().width()); + if (oddpages->sizeHint().height()!=-1) + oddpages->setMinimumHeight(oddpages->sizeHint().height()); + if (oddpages->sizeHint().width()!=-1) + oddpages->setMaximumWidth(oddpages->sizeHint().width()); + if (oddpages->sizeHint().height()!=-1) + oddpages->setMaximumHeight(oddpages->sizeHint().height()); + if (toprinter->sizeHint().width()!=-1) + toprinter->setMinimumWidth(toprinter->sizeHint().width()); + if (toprinter->sizeHint().height()!=-1) + toprinter->setMinimumHeight(toprinter->sizeHint().height()); + if (toprinter->sizeHint().width()!=-1) + toprinter->setMaximumWidth(toprinter->sizeHint().width()); + if (toprinter->sizeHint().height()!=-1) + toprinter->setMaximumHeight(toprinter->sizeHint().height()); + if (tofile->sizeHint().width()!=-1) + tofile->setMinimumWidth(tofile->sizeHint().width()); + if (tofile->sizeHint().height()!=-1) + tofile->setMinimumHeight(tofile->sizeHint().height()); + if (tofile->sizeHint().width()!=-1) + tofile->setMaximumWidth(tofile->sizeHint().width()); + if (tofile->sizeHint().height()!=-1) + tofile->setMaximumHeight(tofile->sizeHint().height()); + if (printername->sizeHint().width()!=-1) + printername->setMinimumWidth(printername->sizeHint().width()); + if (printername->sizeHint().height()!=-1) + printername->setMinimumHeight(printername->sizeHint().height()); + if (printername->sizeHint().height()!=-1) + printername->setMaximumHeight(printername->sizeHint().height()); + if (reverse->sizeHint().width()!=-1) + reverse->setMinimumWidth(reverse->sizeHint().width()); + if (reverse->sizeHint().height()!=-1) + reverse->setMinimumHeight(reverse->sizeHint().height()); + if (reverse->sizeHint().width()!=-1) + reverse->setMaximumWidth(reverse->sizeHint().width()); + if (reverse->sizeHint().height()!=-1) + reverse->setMaximumHeight(reverse->sizeHint().height()); + if (filename->sizeHint().width()!=-1) + filename->setMinimumWidth(filename->sizeHint().width()); + if (filename->sizeHint().height()!=-1) + filename->setMinimumHeight(filename->sizeHint().height()); + if (filename->sizeHint().height()!=-1) + filename->setMaximumHeight(filename->sizeHint().height()); + if (sort->sizeHint().width()!=-1) + sort->setMinimumWidth(sort->sizeHint().width()); + if (sort->sizeHint().height()!=-1) + sort->setMinimumHeight(sort->sizeHint().height()); + if (sort->sizeHint().width()!=-1) + sort->setMaximumWidth(sort->sizeHint().width()); + if (sort->sizeHint().height()!=-1) + sort->setMaximumHeight(sort->sizeHint().height()); + if (browse->sizeHint().width()!=-1) + browse->setMinimumWidth(browse->sizeHint().width()); + if (browse->sizeHint().height()!=-1) + browse->setMinimumHeight(browse->sizeHint().height()); + if (browse->sizeHint().width()!=-1) + browse->setMaximumWidth(browse->sizeHint().width()); + if (browse->sizeHint().height()!=-1) + browse->setMaximumHeight(browse->sizeHint().height()); + if (count->sizeHint().width()!=-1) + count->setMinimumWidth(count->sizeHint().width()); + if (count->sizeHint().height()!=-1) + count->setMinimumHeight(count->sizeHint().height()); + if (count->sizeHint().height()!=-1) + count->setMaximumHeight(count->sizeHint().height()); + if (countLabel->sizeHint().width()!=-1) + countLabel->setMinimumWidth(countLabel->sizeHint().width()); + if (countLabel->sizeHint().height()!=-1) + countLabel->setMinimumHeight(countLabel->sizeHint().height()); + if (countLabel->sizeHint().width()!=-1) + countLabel->setMaximumWidth(countLabel->sizeHint().width()); + if (countLabel->sizeHint().height()!=-1) + countLabel->setMaximumHeight(countLabel->sizeHint().height()); + if (to->sizeHint().width()!=-1) + to->setMinimumWidth(to->sizeHint().width()); + if (to->sizeHint().height()!=-1) + to->setMinimumHeight(to->sizeHint().height()); + if (to->sizeHint().height()!=-1) + to->setMaximumHeight(to->sizeHint().height()); QGridLayout* qtarch_layout_1 = new QGridLayout( this, 2, 1, 5, 5, NULL ); qtarch_layout_1->addColSpacing( 0, 5 ); qtarch_layout_1->setColStretch( 0, 1 ); diff --git a/src/frontends/kde/formprintdialogdata.h b/src/frontends/kde/formprintdialogdata.h index fb46d0262c..b3d08ba61a 100644 --- a/src/frontends/kde/formprintdialogdata.h +++ b/src/frontends/kde/formprintdialogdata.h @@ -3,7 +3,7 @@ --- Qt Architect generated file --- File: formprintdialogdata.h - Last generated: Fri Oct 6 13:10:28 2000 + Last generated: Fri Oct 13 16:07:46 2000 DO NOT EDIT!!! This file will be automatically regenerated by qtarch. All changes will be lost. -- 2.39.2