[qet] [3763] print dialog, remove post script choice.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 3763
Author:   blacksun
Date:     2015-02-24 11:16:02 +0100 (Tue, 24 Feb 2015)
Log Message:
-----------
print dialog, remove post script choice.

Modified Paths:
--------------
    branches/Qt5/sources/diagramprintdialog.cpp
    branches/Qt5/sources/diagramprintdialog.h

Modified: branches/Qt5/sources/diagramprintdialog.cpp
===================================================================
--- branches/Qt5/sources/diagramprintdialog.cpp	2015-02-24 05:14:50 UTC (rev 3762)
+++ branches/Qt5/sources/diagramprintdialog.cpp	2015-02-24 10:16:02 UTC (rev 3763)
@@ -143,9 +143,10 @@
 //	}
 	loadPageSetupForCurrentPrinter();
 	
-	// Apercu avant impression
-#if defined Q_OS_X11
-	// suite a quelques soucis avec xfwm, on se contente d'une fenetre sous X11
+	//Preview before print
+#if defined Q_OS_LINUX
+	//Due to some bug with xfwm, we display this dialog has a windows on linux os (X11)
+	//@TODO see if we must this line with graphic server wayland
 	QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget(), Qt::Window);
 #else
 	QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget());
@@ -227,11 +228,11 @@
 	printtype_label_  = new QLabel(tr("Quel type d'impression désirez-vous effectuer ?"));
 	printer_icon_     = new QLabel();
 	pdf_icon_         = new QLabel();
-	ps_icon_          = new QLabel();
+//	ps_icon_          = new QLabel();
 	printtype_choice_ = new QButtonGroup();
 	printer_choice_   = new QRadioButton(tr("Impression sur une imprimante physique",               "Print type choice"));
 	pdf_choice_       = new QRadioButton(tr("Impression vers un fichier au format PDF",             "Print type choice"));
-	ps_choice_        = new QRadioButton(tr("Impression vers un fichier au format PostScript (PS)", "Print type choice"));
+//	ps_choice_        = new QRadioButton(tr("Impression vers un fichier au format PostScript (PS)", "Print type choice"));
 	filepath_field_   = new QLineEdit();
 	browse_button_    = new QPushButton("...");
 	buttons_          = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
@@ -239,17 +240,17 @@
 	dialog_ -> setWindowTitle(tr("Choix du type d'impression"));
 	printer_icon_ -> setPixmap(QET::Icons::Printer.pixmap(32, 32));
 	pdf_icon_     -> setPixmap(QET::Icons::PDF.pixmap(32, 32));
-	ps_icon_      -> setPixmap(QET::Icons::EPS.pixmap(32, 32));
+//	ps_icon_      -> setPixmap(QET::Icons::EPS.pixmap(32, 32));
 	printtype_choice_ -> addButton(printer_choice_);
 	printtype_choice_ -> addButton(pdf_choice_);
-	printtype_choice_ -> addButton(ps_choice_);
+//	printtype_choice_ -> addButton(ps_choice_);
 	printer_choice_ -> setChecked(true);
 	if (!file_name_.isEmpty()) filepath_field_ -> setText(file_name_ + ".pdf");
 	
 	// connexions signaux / slots
 	connect(printer_choice_, SIGNAL(toggled(bool)), this,    SLOT(updatePrintTypeDialog()));
 	connect(pdf_choice_,     SIGNAL(toggled(bool)), this,    SLOT(updatePrintTypeDialog()));
-	connect(ps_choice_,      SIGNAL(toggled(bool)), this,    SLOT(updatePrintTypeDialog()));
+//	connect(ps_choice_,      SIGNAL(toggled(bool)), this,    SLOT(updatePrintTypeDialog()));
 	connect(browse_button_,  SIGNAL(clicked(bool)), this,    SLOT(browseFilePrintTypeDialog()));
 	connect(buttons_,        SIGNAL(accepted()),    this,    SLOT(acceptPrintTypeDialog()));
 	connect(buttons_,        SIGNAL(rejected()),    dialog_, SLOT(reject()));
@@ -265,8 +266,8 @@
 	glayout0_ -> addWidget(printer_choice_, 0, 1);
 	glayout0_ -> addWidget(pdf_icon_,       1, 0);
 	glayout0_ -> addWidget(pdf_choice_,     1, 1);
-	glayout0_ -> addWidget(ps_icon_,        2, 0);
-	glayout0_ -> addWidget(ps_choice_,      2, 1);
+//	glayout0_ -> addWidget(ps_icon_,        2, 0);
+//	glayout0_ -> addWidget(ps_choice_,      2, 1);
 	glayout0_ -> addLayout(hlayout0_,       3, 1);
 	
 	vlayout0_ -> addWidget(printtype_label_);
@@ -290,18 +291,23 @@
 	browse_button_  -> setEnabled(file_print);
 	
 	// on corrige eventuellement l'extension du fichier deja selectionne
-	if (file_print) {
+	if (file_print)
+	{
 		QString filepath = filepath_field_ -> text();
-		if (!filepath.isEmpty()) {
-			if (pdf_choice_ -> isChecked() && filepath.endsWith(".ps")) {
+		if (!filepath.isEmpty())
+		{
+			if (pdf_choice_ -> isChecked() && filepath.endsWith(".ps"))
+			{
 				QRegExp re("\\.ps$", Qt::CaseInsensitive);
 				filepath.replace(re, ".pdf");
 				filepath_field_ -> setText(filepath);
-			} else if (ps_choice_ -> isChecked() && filepath.endsWith(".pdf")) {
-				QRegExp re("\\.pdf$", Qt::CaseInsensitive);
-				filepath.replace(re, ".ps");
-				filepath_field_ -> setText(filepath);
 			}
+//			else if (ps_choice_ -> isChecked() && filepath.endsWith(".pdf"))
+//			{
+//				QRegExp re("\\.pdf$", Qt::CaseInsensitive);
+//				filepath.replace(re, ".ps");
+//				filepath_field_ -> setText(filepath);
+//			}
 		}
 	}
 }
@@ -335,14 +341,16 @@
 	QString extension;
 	QString filter;
 	if (printer_choice_ -> isChecked()) return;
-	else if (pdf_choice_ -> isChecked()) {
+	else if (pdf_choice_ -> isChecked())
+	{
 		extension = ".pdf";
 		filter    = tr("Fichiers PDF (*.pdf)",       "file filter");
 	}
-	else if (ps_choice_ -> isChecked()) {
-		extension = ".ps";
-		filter    = tr("Fichiers PostScript (*.ps)", "file filter");
-	}
+//	else if (ps_choice_ -> isChecked())
+//	{
+//		extension = ".ps";
+//		filter    = tr("Fichiers PostScript (*.ps)", "file filter");
+//	}
 	
 	QString filepath = QFileDialog::getSaveFileName(
 		parentWidget(),

Modified: branches/Qt5/sources/diagramprintdialog.h
===================================================================
--- branches/Qt5/sources/diagramprintdialog.h	2015-02-24 05:14:50 UTC (rev 3762)
+++ branches/Qt5/sources/diagramprintdialog.h	2015-02-24 10:16:02 UTC (rev 3763)
@@ -29,7 +29,10 @@
 	This class implements both the dialog allowing users to configure the printing
 	of a project file and the printing itself.
 */
-class DiagramPrintDialog : public QWidget {
+class DiagramPrintDialog : public QWidget
+{
+		//@TODO Remove definitely the commented lines in this class related to post script
+
 	Q_OBJECT
 	// Constructors, destructor
 	public:
@@ -79,11 +82,11 @@
 	QHBoxLayout *hlayout0_;
 	QLabel *printer_icon_;
 	QLabel *pdf_icon_;
-	QLabel *ps_icon_;
+//	QLabel *ps_icon_;
 	QButtonGroup *printtype_choice_;
 	QRadioButton *printer_choice_;
 	QRadioButton *pdf_choice_;
-	QRadioButton *ps_choice_;
+//	QRadioButton *ps_choice_;
 	QLineEdit *filepath_field_;
 	QPushButton *browse_button_;
 	QDialogButtonBox *buttons_;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/