mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 17:50:52 +01:00
Rapatriement dans la branche 0.3 de toutes les modifications effectuees dans le trunk depuis la creation de la branche 0.3.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@793 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -17,12 +17,17 @@
|
||||
*/
|
||||
#include "qetprintpreviewdialog.h"
|
||||
#include "diagramschooser.h"
|
||||
#include "exportproperties.h"
|
||||
#include "exportpropertieswidget.h"
|
||||
#include "qetdiagrameditor.h"
|
||||
#include "qeticons.h"
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param project Projet a imprimer
|
||||
@param printer Imprimante a utiliser pour
|
||||
@param widget Widget parent
|
||||
@param f Flags passes au constructeur de QDialog puis QWidget
|
||||
*/
|
||||
QETPrintPreviewDialog::QETPrintPreviewDialog(QETProject *project, QPrinter *printer, QWidget *widget, Qt::WindowFlags f) :
|
||||
QDialog(widget, f),
|
||||
@@ -59,6 +64,13 @@ bool QETPrintPreviewDialog::fitDiagramsToPages() const {
|
||||
return(fit_diagram_to_page_ -> isChecked());
|
||||
}
|
||||
|
||||
/**
|
||||
@return les options de rendu definies par l'utilisateur
|
||||
*/
|
||||
ExportProperties QETPrintPreviewDialog::exportProperties() const {
|
||||
return(render_properties_ -> exportProperties());
|
||||
}
|
||||
|
||||
/**
|
||||
Passe a la premiere page
|
||||
*/
|
||||
@@ -114,7 +126,8 @@ void QETPrintPreviewDialog::useFullPage(bool full_page) {
|
||||
Fait tenir ou non chaque schema sur une page
|
||||
@param fit_diagram true pour adapter chaque schema sur une page, false sinon
|
||||
*/
|
||||
void QETPrintPreviewDialog::fitDiagramToPage(bool /*fit_diagram*/) {
|
||||
void QETPrintPreviewDialog::fitDiagramToPage(bool fit_diagram) {
|
||||
Q_UNUSED(fit_diagram);
|
||||
preview_ -> updatePreview();
|
||||
updateZoomList();
|
||||
}
|
||||
@@ -222,6 +235,12 @@ void QETPrintPreviewDialog::build() {
|
||||
fit_diagram_to_page_label_ -> setContentsMargins(20, 0, 0, 0);
|
||||
fit_diagram_to_page_ -> setChecked(true);
|
||||
|
||||
// recupere les parametres d'export definis dans la configuration de l'application
|
||||
ExportProperties default_print_properties = QETDiagramEditor::defaultPrintProperties();
|
||||
|
||||
render_properties_ = new ExportPropertiesWidget(default_print_properties);
|
||||
render_properties_ -> setPrintingMode(true);
|
||||
|
||||
buttons_ = new QDialogButtonBox();
|
||||
buttons_ -> addButton(new QPushButton(QET::Icons::DocumentPrint, tr("Imprimer")), QDialogButtonBox::AcceptRole);
|
||||
buttons_ -> addButton(QDialogButtonBox::Cancel);
|
||||
@@ -246,6 +265,8 @@ void QETPrintPreviewDialog::build() {
|
||||
connect(use_full_page_, SIGNAL(toggled(bool)), this, SLOT(useFullPage(bool)));
|
||||
connect(fit_diagram_to_page_, SIGNAL(toggled(bool)), this, SLOT(fitDiagramToPage(bool)));
|
||||
|
||||
connect(render_properties_, SIGNAL(optionChanged()), preview_, SLOT(updatePreview()));
|
||||
|
||||
connect(preview_, SIGNAL(previewChanged()), this, SLOT(updateZoomList()));
|
||||
connect(zoom_box_, SIGNAL(currentIndexChanged(int)), this, SLOT(updatePreviewZoom()));
|
||||
|
||||
@@ -271,6 +292,7 @@ void QETPrintPreviewDialog::build() {
|
||||
|
||||
vlayout0_ -> addWidget(toolbar_);
|
||||
vlayout0_ -> addLayout(hlayout0_);
|
||||
vlayout0_ -> addWidget(render_properties_);
|
||||
vlayout0_ -> addWidget(print_options_box_);
|
||||
vlayout0_ -> addWidget(buttons_);
|
||||
|
||||
@@ -289,6 +311,7 @@ void QETPrintPreviewDialog::requestPaint(QPrinter *printer) {
|
||||
paintRequested(
|
||||
diagrams_list_ -> selectedDiagrams(),
|
||||
fit_diagram_to_page_ -> isChecked(),
|
||||
render_properties_ -> exportProperties(),
|
||||
printer
|
||||
)
|
||||
);
|
||||
@@ -328,6 +351,7 @@ void QETPrintPreviewDialog::setDiagramsListVisible(bool display) {
|
||||
*/
|
||||
void QETPrintPreviewDialog::setPrintOptionsVisible(bool display) {
|
||||
print_options_box_ -> setVisible(display);
|
||||
render_properties_ -> setVisible(display);
|
||||
|
||||
if (display) {
|
||||
toggle_print_options_ -> setText(tr("Cacher les options d'impression"));
|
||||
|
||||
Reference in New Issue
Block a user