summaryrefslogtreecommitdiffstats
path: root/src/dialogs/tqprintdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs/tqprintdialog.cpp')
-rw-r--r--src/dialogs/tqprintdialog.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/dialogs/tqprintdialog.cpp b/src/dialogs/tqprintdialog.cpp
index 8430f2cbc..4cd57a02c 100644
--- a/src/dialogs/tqprintdialog.cpp
+++ b/src/dialogs/tqprintdialog.cpp
@@ -251,11 +251,11 @@ static int parsePrintcap( TQListView * printers, const TQString& fileName )
line_ascii[1024] = '\0';
TQString printerDesc;
- bool atEnd = FALSE;
+ bool atEnd = false;
while ( !atEnd ) {
if ( printcap.atEnd() || printcap.readLine( line_ascii, 1024 ) <= 0 )
- atEnd = TRUE;
+ atEnd = true;
TQString line = line_ascii;
line = line.stripWhiteSpace();
if ( line.length() >= 1 && line[int(line.length()) - 1] == '\\' )
@@ -300,7 +300,7 @@ static void parseEtcLpPrinters( TQListView * printers )
TQString remote( TQString::fromLatin1("Remote:") );
TQString contentType( TQString::fromLatin1("Content types:") );
TQString printerHost;
- bool canPrintPostscript = FALSE;
+ bool canPrintPostscript = false;
if ( configuration.open( IO_ReadOnly ) ) {
while ( !configuration.atEnd() &&
configuration.readLine( line, 1024 ) > 0 ) {
@@ -331,7 +331,7 @@ static void parseEtcLpPrinters( TQListView * printers )
*e = '\0';
if ( !qstrcmp( p, "postscript" ) ||
!qstrcmp( p, "any" ) )
- canPrintPostscript = TRUE;
+ canPrintPostscript = true;
*e = s;
if ( s == ',' )
e++;
@@ -356,11 +356,11 @@ static char * parsePrintersConf( TQListView * printers, bool *found = 0 )
TQFile pc( TQString::fromLatin1("/etc/printers.conf") );
if ( !pc.open( IO_ReadOnly ) ) {
if ( found )
- *found = FALSE;
+ *found = false;
return 0;
}
if ( found )
- *found = TRUE;
+ *found = true;
char * line = new char[1025];
line[1024] = '\0';
@@ -519,7 +519,7 @@ static char *parseNsswitchPrintersEntry( TQListView * printers, char *line )
k++
char *defaultPrinter = 0;
- bool stop = FALSE;
+ bool stop = false;
int lastStatus = NotFound;
int k = 8;
@@ -698,7 +698,7 @@ static void parseSpoolInterface( TQListView * printers )
configFile.close();
printerType = printerType.stripWhiteSpace();
- if ( printerType.find("postscript", 0, FALSE) < 0 )
+ if ( printerType.find("postscript", 0, false) < 0 )
continue;
int ii = 0;
@@ -732,7 +732,7 @@ static void parseQconfig( TQListView * printers )
TQString line;
TQString stanzaName; // either a queue or a device name
- bool up = TRUE; // queue up? default TRUE, can be FALSE
+ bool up = true; // queue up? default true, can be false
TQString remoteHost; // null if local
TQString deviceName; // null if remote
@@ -776,7 +776,7 @@ static void parseQconfig( TQListView * printers )
line.truncate( line.length()-1 );
if ( line.length() >= 1 && line.length() <= 20 )
stanzaName = line;
- up = TRUE;
+ up = true;
remoteHost = TQString::null;
deviceName = TQString::null;
} else {
@@ -865,7 +865,7 @@ static void qpd_cleanup_globaldialog()
*/
TQPrintDialog::TQPrintDialog( TQPrinter *prn, TQWidget *parent, const char *name )
- : TQDialog( parent, name, TRUE )
+ : TQDialog( parent, name, true )
{
d = new TQPrintDialogPrivate;
d->numCopies = 1;
@@ -917,7 +917,7 @@ TQPrintDialog::TQPrintDialog( TQPrinter *prn, TQWidget *parent, const char *name
d->ok = new TQPushButton( this, "ok" );
d->ok->setText( tr("OK") );
- d->ok->setDefault( TRUE );
+ d->ok->setDefault( true );
horiz->addWidget( d->ok );
if (! rightalign)
horiz->addStretch( 1 );
@@ -948,7 +948,7 @@ TQPrintDialog::TQPrintDialog( TQPrinter *prn, TQWidget *parent, const char *name
ms.setHeight( 460 );
resize( ms );
- setPrinter( prn, TRUE );
+ setPrinter( prn, true );
d->printers->setFocus();
}
@@ -1000,7 +1000,7 @@ TQGroupBox * TQPrintDialog::setupPrinterSettings()
rb = new TQRadioButton( tr( "Print in color if available" ),
g, "color" );
d->colorMode->insert( rb, TQPrinter::Color );
- rb->setChecked( TRUE );
+ rb->setChecked( true );
rb = new TQRadioButton( tr("Print in grayscale"),
g, "graysacle" );
@@ -1026,15 +1026,15 @@ TQGroupBox * TQPrintDialog::setupDestination()
"printer" );
tll->addWidget( rb );
d->printerOrFile->insert( rb, 0 );
- rb->setChecked( TRUE );
- d->outputToFile = FALSE;
+ rb->setChecked( true );
+ d->outputToFile = false;
TQBoxLayout * horiz = new TQBoxLayout( TQBoxLayout::LeftToRight );
tll->addLayout( horiz, 3 );
horiz->addSpacing( 19 );
d->printers = new TQListView( g, "list of printers" );
- d->printers->setAllColumnsShowFocus( TRUE );
+ d->printers->setAllColumnsShowFocus( true );
d->printers->addColumn( tr("Printer"), 125 );
d->printers->addColumn( tr("Host"), 125 );
d->printers->addColumn( tr("Comment"), 150 );
@@ -1135,7 +1135,7 @@ TQGroupBox * TQPrintDialog::setupDestination()
}
if ( d->printers->currentItem() )
- d->printers->setSelected( d->printers->currentItem(), TRUE );
+ d->printers->setSelected( d->printers->currentItem(), true );
if ( etcLpDefault ) // Avoid purify complaint
delete[] etcLpDefault;
@@ -1166,16 +1166,16 @@ TQGroupBox * TQPrintDialog::setupDestination()
horiz->addWidget( d->fileName, 1 );
horiz->addSpacing( 6 );
d->browse = new TQPushButton( tr("Browse..."), g, "browse files" );
- d->browse->setAutoDefault( FALSE );
+ d->browse->setAutoDefault( false );
#ifdef TQT_NO_FILEDIALOG
- d->browse->setEnabled( FALSE );
+ d->browse->setEnabled( false );
#endif
connect( d->browse, TQ_SIGNAL(clicked()),
this, TQ_SLOT(browseClicked()) );
horiz->addWidget( d->browse );
- d->fileName->setEnabled( FALSE );
- d->browse->setEnabled( FALSE );
+ d->fileName->setEnabled( false );
+ d->browse->setEnabled( false );
tll->activate();
@@ -1253,7 +1253,7 @@ TQGroupBox * TQPrintDialog::setupOptions()
g, "first page first" );
tll->addWidget( rb );
d->pageOrder->insert( rb, TQPrinter::FirstPageFirst );
- rb->setChecked( TRUE );
+ rb->setChecked( true );
rb = new TQRadioButton( tr("Print last page first"),
g, "last page first" );
@@ -1308,7 +1308,7 @@ TQGroupBox * TQPrintDialog::setupPaper()
d->pageSize = TQPrinter::A4;
// page orientation
- d->orientationCombo = new TQComboBox( FALSE, g );
+ d->orientationCombo = new TQComboBox( false, g );
d->orientationCombo->insertItem( tr( "Portrait" ), -1 );
d->orientationCombo->insertItem( tr( "Landscape" ), -1 );
@@ -1320,7 +1320,7 @@ TQGroupBox * TQPrintDialog::setupPaper()
this, TQ_SLOT( orientSelected(int) ) );
// paper size
- d->sizeCombo = new TQComboBox( FALSE, g );
+ d->sizeCombo = new TQComboBox( false, g );
int n;
for( n=0; n<TQPrinter::NPageSize; n++ )
@@ -1366,8 +1366,8 @@ TQGroupBox * TQPrintDialog::setupPaper()
/*!
Display a dialog and allow the user to configure the TQPrinter \a
- p for an optional widget \a w. Returns TRUE if the user clicks OK or
- presses Enter, FALSE if the user clicks Cancel or presses Esc.
+ p for an optional widget \a w. Returns true if the user clicks OK or
+ presses Enter, false if the user clicks Cancel or presses Esc.
getPrinterSetup() remembers the settings and provides the same
settings the next time the dialog is shown.
@@ -1381,10 +1381,10 @@ bool TQPrintDialog::getPrinterSetup( TQPrinter * p, TQWidget* w )
globalPrintDialog->setCaption( TQPrintDialog::tr( "Setup Printer" ) );
#endif
tqAddPostRoutine( qpd_cleanup_globaldialog );
- globalPrintDialog->setPrinter( p, TRUE );
+ globalPrintDialog->setPrinter( p, true );
globalPrintDialog->adjustSize();
} else {
- globalPrintDialog->setPrinter( p, TRUE );
+ globalPrintDialog->setPrinter( p, true );
}
globalPrintDialog->adjustPosition( w );
#ifndef TQT_NO_WIDGET_TOPEXTRA
@@ -1408,9 +1408,9 @@ bool TQPrintDialog::getPrinterSetup( TQPrinter * p, TQWidget* w )
void TQPrintDialog::printerOrFileSelected( int id )
{
- d->outputToFile = id ? TRUE : FALSE;
+ d->outputToFile = (id != 0);
if ( d->outputToFile ) {
- d->ok->setEnabled( TRUE );
+ d->ok->setEnabled( true );
fileNameEditChanged( d->fileName->text() );
if ( !d->fileName->edited() && d->fileName->text().isEmpty() ) {
TQString home = TQString::fromLatin1( ::getenv( "HOME" ) );
@@ -1428,17 +1428,17 @@ void TQPrintDialog::printerOrFileSelected( int id )
d->fileName->setCursorPosition( cur.length() );
d->fileName->selectAll();
}
- d->browse->setEnabled( TRUE );
- d->fileName->setEnabled( TRUE );
+ d->browse->setEnabled( true );
+ d->fileName->setEnabled( true );
d->fileName->setFocus();
- d->printers->setEnabled( FALSE );
+ d->printers->setEnabled( false );
} else {
d->ok->setEnabled( d->printers->childCount() != 0 );
- d->printers->setEnabled( TRUE );
+ d->printers->setEnabled( true );
if ( d->fileName->hasFocus() || d->browse->hasFocus() )
d->printers->setFocus();
- d->browse->setEnabled( FALSE );
- d->fileName->setEnabled( FALSE );
+ d->browse->setEnabled( false );
+ d->fileName->setEnabled( false );
}
}
@@ -1490,10 +1490,10 @@ void TQPrintDialog::okClicked()
d->firstPage->interpretText();
d->copies->interpretText();
if ( d->outputToFile ) {
- d->printer->setOutputToFile( TRUE );
+ d->printer->setOutputToFile( true );
d->printer->setOutputFileName( d->fileName->text() );
} else {
- d->printer->setOutputToFile( FALSE );
+ d->printer->setOutputToFile( false );
TQListViewItem * l = d->printers->currentItem();
if ( l )
d->printer->setPrinterName( l->text( 0 ) );
@@ -1521,7 +1521,7 @@ void TQPrintDialog::okClicked()
void TQPrintDialog::printRangeSelected( int id )
{
- bool enable = id == 2 ? TRUE : FALSE;
+ bool enable = (id == 2);
d->firstPage->setEnabled( enable );
d->lastPage->setEnabled( enable );
d->firstPageLabel->setEnabled( enable );
@@ -1545,8 +1545,8 @@ void TQPrintDialog::setLastPage( int lp )
/*!
Sets this dialog to configure printer \a p, or no printer if \a p
- is null. If \a pickUpSettings is TRUE, the dialog reads most of
- its settings from \a p. If \a pickUpSettings is FALSE (the
+ is null. If \a pickUpSettings is true, the dialog reads most of
+ its settings from \a p. If \a pickUpSettings is false (the
default) the dialog keeps its old settings.
*/
@@ -1566,8 +1566,8 @@ void TQPrintDialog::setPrinter( TQPrinter * p, bool pickUpSettings )
while ( i && i->text( 0 ) != p->printerName() )
i = i->nextSibling();
if ( i ) {
- d->printers->setSelected( i, TRUE );
- d->ok->setEnabled( TRUE );
+ d->printers->setSelected( i, true );
+ d->ok->setEnabled( true );
} else if ( d->fileName->text().isEmpty() ) {
d->ok->setEnabled( d->printers->childCount() != 0 );
}
@@ -1607,7 +1607,7 @@ void TQPrintDialog::setPrinter( TQPrinter * p, bool pickUpSettings )
}
if( p ) {
- d->printAllButton->setEnabled( TRUE );
+ d->printAllButton->setEnabled( true );
d->printSelectionButton
->setEnabled( d->printer->isOptionEnabled( TQPrinter::PrintSelection ) );
d->printRangeButton
@@ -1616,15 +1616,15 @@ void TQPrintDialog::setPrinter( TQPrinter * p, bool pickUpSettings )
TQPrinter::PrintRange range = p->printRange();
switch ( range ) {
case TQPrinter::AllPages:
- d->printAllButton->setChecked(TRUE);
+ d->printAllButton->setChecked(true);
printRangeSelected( d->printRange->id( d->printAllButton ) );
break;
case TQPrinter::Selection:
- d->printSelectionButton->setChecked(TRUE);
+ d->printSelectionButton->setChecked(true);
printRangeSelected( d->printRange->id( d->printSelectionButton ) );
break;
case TQPrinter::PageRange:
- d->printRangeButton->setChecked(TRUE);
+ d->printRangeButton->setChecked(true);
printRangeSelected( d->printRange->id( d->printRangeButton ) );
break;
}