File: printercmddialog.cpp

package info (click to toggle)
x2goclient 3.99.2.1-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,596 kB
  • sloc: cpp: 21,625; perl: 512; makefile: 129; sh: 17
file content (69 lines) | stat: -rw-r--r-- 1,515 bytes parent folder | download
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
//
// C++ Implementation: printercmddialog
//
// Description:
//
//
// Author: Oleksandr Shneyder <oleksandr.shneyder@obviously-nice.de>, (C) 2009
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "printercmddialog.h"
#include "x2goclientconfig.h"
#ifdef Q_OS_WIN
      #include "printwidget.h"
#endif
PrinterCmdDialog::PrinterCmdDialog ( QString* cmd, bool* stdinpr,
                                     bool* ps, QWidget* parent )
		: QDialog ( parent )
{
	ui.setupUi ( this );
	printCmd=cmd;
	printStdIn=stdinpr;
	printPs=ps;
	ui.leCmd->setText ( *printCmd );
	if ( *printStdIn )
		ui.rbStdIn->setChecked ( true );
	else
		ui.rbParam->setChecked ( true );
	if ( *printPs )
		ui.rbPS->setChecked ( true );
	else
		ui.rbPDF->setChecked ( true );
	connect ( ui.buttonBox,
	          SIGNAL ( accepted() ),this,SLOT ( slot_ok() ) );
#ifdef Q_OS_WIN
	QString txt=tr ( "Please enter your customized or"
	                         " individual printing command.\n"
	                         "Example:\n");
	
	QString ver,path;
	if(PrintWidget::gsViewInfo(ver,path))
		txt+=path+" -query -color";
	else
		txt+=tr("<Path to gsprint.exe> -query -color");
	ui.label->setText (txt);
	if(!PrintWidget::gsInfo(ver,path))
	{
		ui.rbPDF->setChecked ( true );
		ui.rbPS->setEnabled(false);
	}
#endif

}


PrinterCmdDialog::~PrinterCmdDialog()
{
}



void PrinterCmdDialog::slot_ok()
{
	*printCmd=ui.leCmd->text();
	*printPs=ui.rbPS->isChecked();
	*printStdIn=ui.rbStdIn->isChecked();
	accept();
}