summaryrefslogtreecommitdiffstats
path: root/src/kile/postscriptdialog.cpp
blob: 95c26bf223580a887cce9387a54d40f26420d924 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
/***************************************************************************
    date                 : Mar 12 2007
    version              : 0.20
    copyright            : (C) 2005-2007 by Holger Danielsson
    email                : holger.danielsson@versanet.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

// 2007-03-12 dani
//  - use KileDocument::Extensions

#include "postscriptdialog.h"

#include <tqlabel.h>
#include <tqlineedit.h>
#include <tqcheckbox.h>
#include <tqpushbutton.h>
#include <tqgroupbox.h>
#include "tqvgroupbox.h"
#include <tqlayout.h>
#include <tqpixmap.h>
#include <tqwhatsthis.h>
#include <tqstringlist.h>
#include <klocale.h>
#include <kfiledialog.h>
#include <kiconloader.h>
#include <ktempfile.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
#include "kiledebug.h"

#include "kiletool_enums.h"

namespace KileDialog 
{

PostscriptDialog::PostscriptDialog(TQWidget *tqparent, 
                                   const TQString &texfilename,const TQString &startdir,
                                   const TQString &latexextensions,
                                   KileWidget::LogMsg *log,KileWidget::Output *output) :
	KDialogBase( tqparent,0, true, i18n("Rearrange Postscript File"), User1 | Ok, User1, true ),
	m_startdir(startdir),
	m_log(log),
	m_output(output),
	m_proc(0)
{	
	// determine if a psfile already exists
	TQString psfilename;
	if ( ! texfilename.isEmpty() ) 
	{
			// working with a postscript document, so we try to determine the LaTeX source file
			TQStringList extlist = TQStringList::split( " ", latexextensions );
			for ( TQStringList::Iterator it=extlist.begin(); it!=extlist.end(); ++it )
			{
				if ( texfilename.find( (*it), -(*it).length() ) >= 0 ) 
				{
					psfilename = texfilename.left(texfilename.length()-(*it).length()) + ".ps";
					if ( ! TQFileInfo(psfilename).exists() )
						psfilename = TQString();
					break;
				}
			}
	}

	// prepare dialog   
	TQWidget *page = new TQWidget(this);
	setMainWidget(page);

	// Layout
	TQVBoxLayout *vbox = new TQVBoxLayout(page, 6,6 );

	// groupbox with file selection
	TQVGroupBox* group= new TQVGroupBox(i18n("Parameter"),page );
	TQWidget *widget = new TQWidget(group);
	TQGridLayout *grid = new TQGridLayout( widget, 7,3, 6,6, "");
	grid->setColStretch(1,1);

	// line 0: TQLabel
	bool pstops = ! KStandardDirs::findExe("pstops").isNull();
	bool psselect = ! KStandardDirs::findExe("psselect").isNull();

	TQString title = i18n("Conversion of ps files is made by 'pstops' and 'psselect'.\nBe sure to call 'dvips' with option '-t a4' and\nhyperref package (if needed) with option 'a4paper'.");

	if ( !pstops || !psselect ) {
		TQString msg = TQString();
		if ( ! pstops ) { 
			msg = "'pstops'";
			if ( ! psselect )
				msg += " and ";
		}
		if ( ! psselect ) {
			msg += "'psselect'";
		}
		title += "\n(Error: " + msg + " not found.)";		
	}
	
	TQLabel *label1 = new TQLabel(title,widget);
	label1->tqsetAlignment(TQt::AlignHCenter);
	grid->addMultiCellWidget( label1, 0,0, 0,2, TQt::AlignCenter );

	// empty line
	grid->setRowSpacing(1,10);
	
	// line 1: TQLabel
	TQLabel *label2 = new TQLabel(i18n("Input file:"), widget);
	grid->addWidget( label2, 2,0 );

	// line 1: TQLineEdit
	m_edInfile = new TQLineEdit("",widget);
	m_edInfile->setMinimumWidth(300);
	m_edInfile->setText(psfilename);
	grid->addWidget( m_edInfile, 2,1 );

	// line 1: Choose-Box
	TQPushButton *choose_in = new TQPushButton("", widget, "infilechooser" );
	choose_in->setPixmap( SmallIcon("fileopen") );
	choose_in->setFixedWidth(choose_in->tqsizeHint().width());        
	grid->addWidget(choose_in,2,2);

	// line 2: TQLabel
	TQLabel *label3 = new TQLabel(i18n("Output file:"), widget);
	grid->addWidget( label3, 3,0 );

	// line 2: TQLineEdit
	m_edOutfile = new TQLineEdit("",widget);
	m_edOutfile->setMinimumWidth(300);
	grid->addWidget( m_edOutfile, 3,1 );

	// line 3: choose box
	TQPushButton *choose_out = new TQPushButton("", widget, "outfilechooser" );
	choose_out->setPixmap( SmallIcon("fileopen") );
	choose_out->setFixedWidth(choose_out->tqsizeHint().width());  
	grid->addWidget(choose_out,3,2);

	// line 3: task selection
	TQLabel *label4 = new TQLabel(i18n("Task:"), widget);
	grid->addWidget( label4, 4,0 );

	// line 3: predefined tasks
	m_cbTask = new TQComboBox( false,widget );
	if ( pstops ) {
		m_cbTask->insertItem(i18n("1 DIN A5 Page + Empty Page --> DIN A4"));      // 0   PS_A5_EMPTY
		m_cbTask->insertItem(i18n("1 DIN A5 Page + Duplicate --> DIN A4"));       // 1   PS_A5_DUPLICATE
		m_cbTask->insertItem(i18n("2 DIN A5 Pages --> DIN A4"));                  // 2   PS_2xA5
		m_cbTask->insertItem(i18n("2 DIN A5L Pages --> DIN A4"));                 // 3   PS_2xA5L
		m_cbTask->insertItem(i18n("4 DIN A5 Pages --> DIN A4"));                  // 4   PS_4xA5
		m_cbTask->insertItem(i18n("1 DIN A4 Page + Empty Page --> DIN A4"));      // 5   PS_A4_EMPTY
		m_cbTask->insertItem(i18n("1 DIN A4 Page + Duplicate --> DIN A4"));       // 6   PS_A4_DUPLICATE
		m_cbTask->insertItem(i18n("2 DIN A4 Pages --> DIN A4"));                  // 7   PS_2xA4
		m_cbTask->insertItem(i18n("2 DIN A4L Pages --> DIN A4"));                 // 8   PS_2xA4L 
	}
	if ( psselect ) {
		m_cbTask->insertItem(i18n("Select Even Pages"));                          // 9   PS_EVEN  
		m_cbTask->insertItem(i18n("Select Odd Pages"));                           // 10  PS_ODD 
		m_cbTask->insertItem(i18n("Select Even Pages (reverse order)"));          // 11  PS_EVEN_REV 
		m_cbTask->insertItem(i18n("Select Odd Pages (reverse order)"));           // 12  PS_ODD_REV 
		m_cbTask->insertItem(i18n("Reverse All Pages"));                          // 13  PS_REVERSE
		m_cbTask->insertItem(i18n("Copy All Pages (sorted)"));                    // 14  PS_COPY_SORTED  
	}
	if ( pstops ) { 
		m_cbTask->insertItem(i18n("Copy All Pages (unsorted)"));                  // 15  PS_COPY_UNSORTED
		m_cbTask->insertItem(i18n("pstops: Choose Parameter"));                   // 16  PS_PSTOPS_FREE 
	}
	if ( psselect ) {  
		m_cbTask->insertItem(i18n("psselect: Choose Parameter"));                 // 17  PS_PSSELECT_FREE 
	}
	m_cbTask->setMinimumWidth(300+6+choose_out->width());
	grid->addMultiCellWidget( m_cbTask, 4,4,1,2 );

	// line 4: TQLabel (parameter or copies)
	m_lbParameter = new TQLabel(i18n("Parameter:"), widget);
	grid->addWidget( m_lbParameter, 5,0 );

	// line 4: TQLineEdit or TQSoinBox
	m_edParameter = new TQLineEdit("",widget);
	m_edParameter->setMinimumWidth(300);
	grid->addMultiCellWidget( m_edParameter, 5,5,1,2 );
	m_spCopies = new TQSpinBox(widget);
	m_spCopies->setValue(1);
	m_spCopies->setRange(1,99);
	grid->addMultiCellWidget( m_spCopies, 5,5,1,2 );

	// choose one common task
	m_cbTask->setCurrentItem(PS_2xA4);
	comboboxChanged(PS_2xA4);
      
	// line 5: TQLabel
	TQLabel *label6 = new TQLabel(i18n("Viewer:"), widget);
	grid->addWidget( label6, 6,0 );
	
	// line 5: TQCheckBox
	m_cbView = new TQCheckBox(i18n("Show ps file with 'kghostview'"),widget);
	m_cbView->setChecked(true);
	grid->addWidget( m_cbView, 6,1 );

	// build Layout 
	vbox->addWidget(group);
	vbox->addStretch();

	// set an user button to execute the task
	setButtonText(Ok,i18n("Done"));
	setButtonText(User1,i18n("Execute"));
	if ( !pstops && !psselect ) 
		enableButton(User1,false);
	
	TQWhatsThis::add(m_cbTask,i18n("Choose one of the 18 operations to convert a postscript file. The last four operations need specific parameters."));
	TQWhatsThis::add(choose_in,i18n("Choose the input file."));
	TQWhatsThis::add(choose_out,i18n("Choose the output file."));
	TQWhatsThis::add(m_edInfile,i18n("Input file, which should be converted."));
	TQWhatsThis::add(m_edOutfile,i18n("The name of the output file. This entry may also be empty, if you only want to view the result without saving it. In this case the viewer checkbox must be checked."));
	TQWhatsThis::add(m_edParameter,i18n("'Select pages' and 'Free Parameter' need some specific parameter, which you can enter here"));
	TQWhatsThis::add(m_spCopies,i18n("When you want to copy pages, you must enter the number of copies"));
	TQWhatsThis::add(m_cbView,i18n("View the result of the conversion process. KGhostview is always taken as an external viewer."));

	// some connections
	connect( choose_in, TQT_SIGNAL( clicked() ), this, TQT_SLOT( chooseInfile() ) );
	connect( choose_out, TQT_SIGNAL( clicked() ), this, TQT_SLOT( chooseOutfile() ) );
	connect( m_cbTask,TQT_SIGNAL( activated(int) ),this, TQT_SLOT( comboboxChanged(int) ) );
	connect( this, TQT_SIGNAL(output(const TQString &)), m_output, TQT_SLOT(receive(const TQString &)) );

	setFocusProxy( m_edInfile );

}

PostscriptDialog::~PostscriptDialog() 
{
	if ( m_proc )
		delete m_proc;
}

void PostscriptDialog::slotUser1()
{
	if ( checkParameter() ) {
		execute();
	}
}

void PostscriptDialog::execute()
{
	m_tempfile = buildTempfile();
	if ( m_tempfile != TQString() ) {
		m_log->clear();
		TQFileInfo from(m_edInfile->text());
		TQFileInfo to(m_edOutfile->text());
		
		// output for log window
		TQString msg = i18n("rearrange ps file: ") + from.fileName();
		if ( ! to.fileName().isEmpty() )
			msg += " ---> " + to.fileName();	
		m_log->printMsg(KileTool::Info,msg,m_program);

		// some output logs 
		m_output->clear();
		TQString s = TQString("*****\n")
		              + i18n("***** tool:        ") + m_program + ' ' + m_param + '\n'
		              + i18n("***** input file:  ") + from.fileName()+ '\n'
		              + i18n("***** output file: ") + to.fileName()+ '\n'
		              + i18n("***** viewer:      ") + ((m_cbView->isChecked()) ? i18n("yes") : i18n("no")) + '\n'
		              + "*****\n";
		emit( output(s) );
 
		// delete old KShellProcess
		if ( m_proc )
			delete m_proc;
			
		m_proc = new KShellProcess();
		m_proc->clearArguments(); 
		(*m_proc) << TQStringList::split(' ',"sh " + m_tempfile);
		   
		connect(m_proc, TQT_SIGNAL(receivedStdout(KProcess *,char *,int)), 
		        this, TQT_SLOT(slotProcessOutput(KProcess *,char *,int)));
		connect(m_proc, TQT_SIGNAL(receivedStderr(KProcess*,char*,int)),
		        this, TQT_SLOT(slotProcessOutput(KProcess*,char*,int)) );
		connect(m_proc, TQT_SIGNAL(processExited(KProcess *)), 
		        this, TQT_SLOT(slotProcessExited(KProcess *)));

		KILE_DEBUG() << "=== PostscriptDialog::runPsutils() ====================" << endl;
		KILE_DEBUG() << "   execute '" << m_tempfile << "'" << endl;
		//if ( ! proc->start(KProcess::NotifyOnExit, KProcess::NoCommunication) ) 
		if ( ! m_proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) ) 
			KILE_DEBUG() << "\tstart of shell process failed" << endl;
	}
	
}

void PostscriptDialog::slotProcessOutput(KProcess*,char* buf,int len)
{
	emit( output(TQCString(buf,len+1)) );
}


void PostscriptDialog::slotProcessExited (KProcess *proc)
{
	if ( ! proc->normalExit() ) 
		showError(i18n("An error occurred, while rearranging the file."));
		
	TQFile::remove(m_tempfile);
}

TQString PostscriptDialog::buildTempfile()
{
	// build command
	m_program = "pstops";          // default
	m_param = "";

	switch ( m_cbTask->currentItem() ) {
		case PS_A5_EMPTY:      m_param = "1:0L(29.7cm,0cm)";
		                       break;
		case PS_A5_DUPLICATE:  m_param = "1:0L(29.7cm,0cm)+0L(29.7cm,14.85cm)";
		                       break;
		case PS_2xA5:          m_param = "2:0L(29.7cm,0cm)+1L(29.7cm,14.85cm)";
		                       break;
		case PS_2xA5L:         break;
		case PS_4xA5:          m_param = "4:0@0.7(0cm,8.7cm)"
		                                 "+1@0.7(10.5cm,8.7cm)"
		                                 "+2@0.7(0cm,-6.15cm)"
		                                 "+3@0.7(10.5cm,-6.15cm)";
		                       break;
		case PS_A4_EMPTY:      m_param = "1:0L@0.7(21cm,0cm)";
		                       break;
		case PS_A4_DUPLICATE:  m_param = "1:0L@0.7(21cm,0cm)+0L@0.7(21cm,14.85cm)";
		                       break;
		case PS_2xA4:          m_param = "2:0L@0.7(21cm,0cm)+1L@0.7(21cm,14.85cm)";
		                       break;
		case PS_2xA4L:         m_param = "2:0R@0.7(0cm,29.7cm)+1R@0.7(0cm,14.85cm)";
		                       break;
		case PS_EVEN:          m_program = "psselect";
		                       m_param = "-e";
		                       break;
		case PS_ODD:           m_program = "psselect";
		                       m_param = "-o";
		                       break;
		case PS_EVEN_REV:      m_program = "psselect";
		                       m_param = "-e -r";
		                       break;
		case PS_ODD_REV:       m_program = "psselect";
		                       m_param = "-o -r";
		                       break;
		case PS_REVERSE:       m_program = "psselect";
		                       m_param = "-r";
		                       break;
		case PS_COPY_SORTED:   m_program = "psselect";
		                       m_param = "-p" + duplicateParameter("1-");
		                       break;
		case PS_COPY_UNSORTED: m_param = "1:" + duplicateParameter("0");
		                       break;
		case PS_PSTOPS_FREE:   m_param = m_edParameter->text();
		                       break;
		case PS_PSSELECT_FREE: m_program = "psselect";
		                       m_param = m_edParameter->text();
		                       break;
	}

	// create a temporary file
	KTempFile temp(TQString(),".sh");        
	TQString tempname = temp.name();
	
	TQTextStream *stream = temp.textStream();      
	*stream << "#! /bin/sh" << endl;

	// accept only ".ps" or ".ps.gz" as an input file
	TQFileInfo fi( m_edInfile->text() );
	bool zipped_psfile = ( fi.extension() == "ps.gz" ) ? true : false;

	// there are four possible cases
	//         outfile view
	//     1)    +      +        pstops/psselect + kghostview
	//     2)    +      -        pstops/psselect
	//     3)    -      +        pstops/psselect | kghostview (nur Shell)
	//     4)    -      -        error (already detected by checkParameter())

	// some files, which are used
	TQString command    = m_program + " \"" + m_param + "\"";
	TQString inputfile  = "\"" + m_edInfile->text() + "\""; 
	TQString outputfile = "\"" + m_edOutfile->text() + "\""; 
	bool viewer = m_cbView->isChecked();
	
	bool equalfiles = false;
	if ( inputfile == outputfile ) {
		outputfile = tempname + ".tmp";
		equalfiles = true;
	}
	
	if ( ! zipped_psfile ) {                                       // unzipped ps files          
		if ( m_edOutfile->text().isEmpty() ) {                      // pstops/psselect | kghostview
			*stream << command << " " << inputfile << " | kghostview -" << endl;  
			viewer = false;     
		} else {                                                    // pstops/psselect
			*stream << command << " " << inputfile << " " << outputfile << endl;        
		}
	} else {                                                      // zipped ps files  
		if ( m_edOutfile->text().isEmpty() ) {                     // pstops/psselect | kghostview
			*stream << "gunzip -c " << inputfile 
				     << " | " << command 
				     << " | kghostview -" 
				     << endl; 
			viewer = false;
		} else {      
			*stream << "gunzip -c " << inputfile                    // pstops/psselect
				     << " | " << command
				     << " > " << outputfile 
				     << endl; 
		}       
	}	
	
	// check, if we should stop
	if ( equalfiles || viewer ) {
		*stream << "if [ $? != 0 ]; then" << endl;   
		*stream << "   exit 1" << endl;   
		*stream << "fi" << endl;   
	}
	
	// replace the original file
	if ( equalfiles ) {
		*stream << "rm " << inputfile << endl;   
		*stream << "mv " << outputfile << " " << inputfile << endl;   
	}
	
	// viewer
	if ( viewer ) {                                                // viewer: kghostview
		*stream << "kghostview" << " " << (( equalfiles ) ? inputfile : outputfile) << endl;      
	}
	
	// everything is prepared to do the job
	temp.close();

	return(tempname);
}

void PostscriptDialog::chooseInfile()
{
	TQString fn = KFileDialog::getOpenFileName(
	                 m_startdir,
	                 i18n("*.ps|PS Files\n*.ps.gz|Zipped PS Files"),
	                 this,i18n("Select Input File") );

	if ( ! fn.isEmpty() ) {
		m_edInfile->setText( fn );
	}
}

void PostscriptDialog::chooseOutfile()
{
	TQString fn = KFileDialog::getOpenFileName(
	                 m_startdir,
	                 i18n("*.ps|PS Files"),
	                 this,i18n("Select Name of Output File") );

	if ( ! fn.isEmpty() ) {
		m_edOutfile->setText( fn );
	}
}

TQString PostscriptDialog::duplicateParameter(const TQString &param)
{
	TQString s = TQString();
	for (int i=0; i<m_spCopies->value(); ++i) {
		if ( i == 0 )
			s += param;
		else
			s+= ',' + param;
	}

	return s;
}


bool PostscriptDialog::checkParameter()
{
	TQString infile = m_edInfile->text();
	if ( infile.isEmpty() ) {
		showError( i18n("No input file is given.") );
		return false;
	}

	TQFileInfo fi( infile );
	if ( fi.extension()!="ps" && fi.extension()!="ps.gz" ) {
		showError( i18n("Unknown file format: only '.ps' and '.ps.gz' are accepted for input files.") );
		return false;
	}

	if ( ! fi.exists() ) {
		showError( i18n("This input file does not exist.")  );
		return false;
	}

	// check parameter
	int index = m_cbTask->currentItem();
	if ( m_edParameter->text().isEmpty() ) {
		if ( index == PS_PSSELECT_FREE ) {
			showError( i18n("psselect needs some parameters in this mode.") );
			return false;
		} else if ( index == PS_PSTOPS_FREE ) {
			showError( i18n("pstops needs some parameters in this mode.") );
			return false;
		}
	}
   
	TQString outfile = m_edOutfile->text();
	if ( outfile.isEmpty() && !m_cbView->isChecked() ) {
		showError( i18n("You need to define an output file or select the viewer.") );
		return false;
	}

	if ( ! outfile.isEmpty() ) {
		TQFileInfo fo( outfile );
		if ( fo.extension() != "ps" ) {
			showError( i18n("Unknown file format: only '.ps' is accepted as output file.") );
			return false;
		}
	
		if ( infile!=outfile && fo.exists() ) {
			TQString s = i18n("A file named \"%1\" already exists. Are you sure you want to overwrite it?").tqarg(fo.fileName());
			if ( KMessageBox::questionYesNo( this,
			       "<center>" + s + "</center>",
			       "Postscript tools" ) == KMessageBox::No ) {
				return false;
      	}
		}
	}
  
	return true;
}

void PostscriptDialog::comboboxChanged(int index)
{
	KILE_DEBUG() << index << endl;
	if ( index==PS_COPY_SORTED || index==PS_COPY_UNSORTED ) {
		m_lbParameter->setEnabled(true);
		m_lbParameter->setText(i18n("Copies:"));
		m_edParameter->hide();
		m_spCopies->show();
		m_spCopies->setEnabled(true);
	} else if ( index==PS_PSSELECT_FREE || index==PS_PSTOPS_FREE ) {
		m_lbParameter->setEnabled(true);
		m_lbParameter->setText(i18n("Parameter:"));
		m_spCopies->hide();
		m_edParameter->show();
		m_edParameter->setEnabled(true);
	} else {
		m_lbParameter->setEnabled(false);
		m_edParameter->setEnabled(false);
		m_spCopies->setEnabled(false);
	}
}

void PostscriptDialog::showError(const TQString &text)
{
	KMessageBox::error( this,i18n("<center>") + text + i18n("</center>"),i18n("Postscript Tools") );
}

}

#include "postscriptdialog.moc"