mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 00:30:53 +01:00
Merge Qt5 branch sources folder to trunk
-Cette ligne, et les suivantes ci-dessous, seront ignorées-- M sources/aboutqet.cpp M sources/bordertitleblock.cpp M sources/conductorproperties.h M sources/configdialog.cpp M sources/configpages.cpp M sources/configpages.h M sources/createdxf.h M sources/diagram.cpp M sources/diagram.h M sources/diagramcommands.cpp M sources/diagramcommands.h M sources/diagramprintdialog.cpp M sources/diagramprintdialog.h M sources/diagramschooser.cpp M sources/diagramschooser.h M sources/diagramview.cpp M sources/diagramview.h M sources/dvevent/dveventaddimage.cpp M sources/dvevent/dveventaddshape.cpp M sources/editor/arceditor.cpp M sources/editor/arceditor.h M sources/editor/editorcommands.cpp M sources/editor/editorcommands.h M sources/editor/elementitemeditor.h M sources/editor/elementprimitivedecorator.cpp M sources/editor/elementscene.cpp M sources/editor/elementscene.h M sources/editor/elementview.cpp M sources/editor/ellipseeditor.cpp M sources/editor/ellipseeditor.h M sources/editor/esevent/eseventaddtext.cpp M sources/editor/esevent/eseventaddtextfield.cpp M sources/editor/esevent/eseventinterface.cpp M sources/editor/graphicspart/customelementpart.h M sources/editor/graphicspart/parttext.cpp M sources/editor/graphicspart/parttext.h M sources/editor/graphicspart/parttextfield.cpp M sources/editor/graphicspart/parttextfield.h M sources/editor/lineeditor.cpp M sources/editor/lineeditor.h M sources/editor/polygoneditor.cpp M sources/editor/qetelementeditor.cpp M sources/editor/qetelementeditor.h M sources/editor/rectangleeditor.cpp M sources/editor/rectangleeditor.h M sources/editor/styleeditor.cpp M sources/editor/styleeditor.h M sources/editor/terminaleditor.cpp M sources/editor/terminaleditor.h M sources/editor/texteditor.cpp M sources/editor/texteditor.h M sources/editor/textfieldeditor.cpp M sources/editor/textfieldeditor.h M sources/editor/ui/elementpropertieseditorwidget.cpp M sources/elementdefinition.cpp M sources/elementdeleter.cpp M sources/elementdeleter.h M sources/elementdialog.cpp M sources/elementscategorieslist.h M sources/elementscategorieswidget.cpp M sources/elementscategorieswidget.h M sources/elementscategory.cpp M sources/elementscategorydeleter.cpp M sources/elementscategorydeleter.h M sources/elementscategoryeditor.cpp M sources/elementscategoryeditor.h M sources/elementscollection.cpp M sources/elementscollectioncache.cpp M sources/elementspanel.cpp M sources/elementspanel.h M sources/elementspanelwidget.cpp M sources/elementspanelwidget.h M sources/elementtextsmover.h M sources/exportdialog.cpp M sources/exportdialog.h M sources/exportproperties.cpp M sources/exportpropertieswidget.cpp M sources/exportpropertieswidget.h M sources/genericpanel.cpp M sources/integrationmoveelementshandler.cpp M sources/integrationmoveelementshandler.h M sources/interactivemoveelementshandler.cpp M sources/nameslistwidget.cpp M sources/nameslistwidget.h M sources/newelementwizard.cpp M sources/newelementwizard.h M sources/nomenclature.cpp M sources/nomenclature.h M sources/projectconfigpages.cpp M sources/projectview.cpp M sources/projectview.h M sources/qet.cpp M sources/qetapp.cpp M sources/qetapp.h M sources/qetdiagrameditor.cpp M sources/qetdiagrameditor.h M sources/qetgraphicsitem/conductor.cpp M sources/qetgraphicsitem/conductortextitem.cpp M sources/qetgraphicsitem/customelement.cpp M sources/qetgraphicsitem/diagramimageitem.cpp M sources/qetgraphicsitem/diagramtextitem.cpp M sources/qetgraphicsitem/diagramtextitem.h M sources/qetgraphicsitem/element.cpp M sources/qetgraphicsitem/ghostelement.cpp M sources/qetgraphicsitem/qetshapeitem.cpp M sources/qetgraphicsitem/terminal.cpp M sources/qetgraphicsitem/terminal.h M sources/qeticons.cpp M sources/qeticons.h M sources/qetmainwindow.cpp M sources/qetmessagebox.cpp M sources/qetmessagebox.h M sources/qetprintpreviewdialog.cpp M sources/qetprintpreviewdialog.h M sources/qetproject.cpp M sources/qetsingleapplication.cpp M sources/qettabbar.h M sources/qfilenameedit.cpp M sources/qtextorientationspinboxwidget.cpp M sources/qtextorientationspinboxwidget.h M sources/qtextorientationwidget.cpp M sources/qtextorientationwidget.h M sources/richtext/richtexteditor.cpp M sources/richtext/richtexteditor_p.h M sources/richtext/ui_addlinkdialog.h M sources/titleblock/dimensionwidget.h M sources/titleblock/gridlayoutanimation.h M sources/titleblock/helpercell.h M sources/titleblock/integrationmovetemplateshandler.cpp M sources/titleblock/integrationmovetemplateshandler.h M sources/titleblock/qettemplateeditor.cpp M sources/titleblock/qettemplateeditor.h M sources/titleblock/templatecellsset.h M sources/titleblock/templatecellwidget.cpp M sources/titleblock/templatecellwidget.h M sources/titleblock/templatecommands.cpp M sources/titleblock/templatedeleter.cpp M sources/titleblock/templatedeleter.h M sources/titleblock/templatelocationchooser.cpp M sources/titleblock/templatelocationchooser.h M sources/titleblock/templatelocationsaver.cpp M sources/titleblock/templatelocationsaver.h M sources/titleblock/templatelogomanager.cpp M sources/titleblock/templatelogomanager.h M sources/titleblock/templateview.cpp M sources/titleblock/templatevisualcell.h M sources/titleblockcell.cpp M sources/titleblocktemplate.cpp M sources/treecoloranimation.h M sources/ui/conductorpropertieswidget.cpp M sources/ui/diagrampropertiesdialog.cpp M sources/ui/diagramselection.cpp M sources/ui/dialogautonum.cpp M sources/ui/dialogwaiting.cpp M sources/ui/elementpropertieswidget.cpp M sources/ui/elementselectorwidget.cpp M sources/ui/linksingleelementwidget.cpp M sources/ui/masterpropertieswidget.cpp M sources/ui/potentialtextsdialog.cpp M sources/ui/projectpropertiesdialog.cpp M sources/ui/selectautonumw.cpp M sources/ui/titleblockpropertieswidget.cpp M sources/ui/xrefpropertieswidget.cpp M sources/undocommand/changeelementinformationcommand.cpp git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3783 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -24,6 +24,9 @@
|
||||
#include "qeticons.h"
|
||||
#include "qetmessagebox.h"
|
||||
|
||||
#include <QPrinter>
|
||||
#include <QPrintDialog>
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param project Schema a imprimer
|
||||
@@ -119,24 +122,31 @@ void DiagramPrintDialog::exec() {
|
||||
if (printer_choice_ -> isChecked()) {
|
||||
// affichage du dialogue d'impression standard pour parametrer l'imprimante
|
||||
QPrintDialog print_dialog(printer_, parentWidget());
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
print_dialog.setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
print_dialog.setWindowTitle(tr("Options d'impression", "window title"));
|
||||
print_dialog.setEnabledOptions(QAbstractPrintDialog::PrintShowPageSize);
|
||||
if (print_dialog.exec() == QDialog::Rejected) return;
|
||||
} else if (pdf_choice_ -> isChecked()) {
|
||||
}
|
||||
else
|
||||
{
|
||||
printer_ -> setOutputFormat(QPrinter::PdfFormat);
|
||||
printer_ -> setOutputFileName(filepath_field_ -> text());
|
||||
} else {
|
||||
printer_ -> setOutputFormat(QPrinter::PostScriptFormat);
|
||||
printer_ -> setOutputFileName(filepath_field_ -> text());
|
||||
}
|
||||
//@TODO remove code below
|
||||
//post script isn't suported anymore in Qt5
|
||||
// else
|
||||
// {
|
||||
// printer_ -> setOutputFormat(QPrinter::PostScriptFormat);
|
||||
// printer_ -> setOutputFileName(filepath_field_ -> text());
|
||||
// }
|
||||
loadPageSetupForCurrentPrinter();
|
||||
|
||||
// Apercu avant impression
|
||||
#if defined Q_WS_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());
|
||||
@@ -211,18 +221,18 @@ int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, const ExportPropert
|
||||
void DiagramPrintDialog::buildPrintTypeDialog() {
|
||||
// initialisation des widgets
|
||||
dialog_ = new QDialog(parentWidget());
|
||||
#ifdef Q_WS_MAC
|
||||
#ifdef Q_OS_MAC
|
||||
dialog_ -> setWindowFlags(Qt::Sheet);
|
||||
#endif
|
||||
|
||||
printtype_label_ = new QLabel(tr("Quel type d'impression d\351sirez-vous effectuer ?"));
|
||||
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);
|
||||
@@ -230,17 +240,17 @@ void DiagramPrintDialog::buildPrintTypeDialog() {
|
||||
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()));
|
||||
@@ -256,8 +266,8 @@ void DiagramPrintDialog::buildPrintTypeDialog() {
|
||||
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_);
|
||||
@@ -281,18 +291,23 @@ void DiagramPrintDialog::updatePrintTypeDialog() {
|
||||
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);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -306,10 +321,10 @@ void DiagramPrintDialog::acceptPrintTypeDialog() {
|
||||
if (file_print) {
|
||||
// un fichier doit avoir ete entre
|
||||
if (filepath_field_ -> text().isEmpty()) {
|
||||
QET::MessageBox::information(
|
||||
QET::QetMessageBox::information(
|
||||
parentWidget(),
|
||||
tr("Fichier manquant", "message box title"),
|
||||
tr("Vous devez indiquer le chemin du fichier PDF/PS \340 cr\351er.", "message box content")
|
||||
tr("Vous devez indiquer le chemin du fichier PDF/PS à créer.", "message box content")
|
||||
);
|
||||
} else dialog_ -> accept();
|
||||
} else {
|
||||
@@ -326,14 +341,16 @@ void DiagramPrintDialog::browseFilePrintTypeDialog() {
|
||||
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(),
|
||||
@@ -609,8 +626,10 @@ QString DiagramPrintDialog::settingsSectionName(const QPrinter *printer) {
|
||||
return(printer -> printerName().replace(" ", "_"));
|
||||
} else if (printer_format == QPrinter::PdfFormat) {
|
||||
return("QET_PDF_Printing");
|
||||
} else if (printer_format == QPrinter::PostScriptFormat) {
|
||||
return("QET_PS_Printing");
|
||||
}
|
||||
//@TODO remove code below
|
||||
// else if (printer_format == QPrinter::PostScriptFormat) {
|
||||
// return("QET_PS_Printing");
|
||||
// }
|
||||
return(QString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user