mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Les options d'impression sont desormais configurables.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@760 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
BIN
ico/128x128/printer.png
Normal file
BIN
ico/128x128/printer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.8 KiB |
@@ -3,6 +3,7 @@
|
|||||||
<file>ico/128x128/diagram.png</file>
|
<file>ico/128x128/diagram.png</file>
|
||||||
<file>ico/128x128/settings.png</file>
|
<file>ico/128x128/settings.png</file>
|
||||||
<file>ico/128x128/document-export.png</file>
|
<file>ico/128x128/document-export.png</file>
|
||||||
|
<file>ico/128x128/printer.png</file>
|
||||||
<file>ico/16x16/add_col.png</file>
|
<file>ico/16x16/add_col.png</file>
|
||||||
<file>ico/16x16/add_row.png</file>
|
<file>ico/16x16/add_row.png</file>
|
||||||
<file>ico/16x16/application-exit.png</file>
|
<file>ico/16x16/application-exit.png</file>
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
|||||||
pages_list -> setViewMode(QListView::IconMode);
|
pages_list -> setViewMode(QListView::IconMode);
|
||||||
pages_list -> setIconSize(QSize(110, 110));
|
pages_list -> setIconSize(QSize(110, 110));
|
||||||
pages_list -> setMovement(QListView::Static);
|
pages_list -> setMovement(QListView::Static);
|
||||||
pages_list -> setMinimumWidth(135);
|
pages_list -> setMinimumWidth(150);
|
||||||
pages_list -> setMaximumWidth(135);
|
pages_list -> setMaximumWidth(150);
|
||||||
pages_list -> setSpacing(4);
|
pages_list -> setSpacing(4);
|
||||||
|
|
||||||
// pages
|
// pages
|
||||||
@@ -40,6 +40,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
|||||||
addPage(new GeneralConfigurationPage());
|
addPage(new GeneralConfigurationPage());
|
||||||
addPage(new NewDiagramPage());
|
addPage(new NewDiagramPage());
|
||||||
addPage(new ExportConfigPage());
|
addPage(new ExportConfigPage());
|
||||||
|
addPage(new PrintConfigPage());
|
||||||
buildPagesList();
|
buildPagesList();
|
||||||
|
|
||||||
// boutons
|
// boutons
|
||||||
|
|||||||
@@ -191,7 +191,6 @@ QString GeneralConfigurationPage::title() const {
|
|||||||
return(tr("G\351n\351ral", "configuration page title"));
|
return(tr("G\351n\351ral", "configuration page title"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructeur
|
Constructeur
|
||||||
@param parent QWidget parent
|
@param parent QWidget parent
|
||||||
@@ -238,3 +237,56 @@ QString ExportConfigPage::title() const {
|
|||||||
return(tr("Export", "configuration page title"));
|
return(tr("Export", "configuration page title"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Constructeur
|
||||||
|
@param parent QWidget parent
|
||||||
|
*/
|
||||||
|
PrintConfigPage::PrintConfigPage(QWidget *parent) : ConfigPage(parent) {
|
||||||
|
// epw contient les options d'export
|
||||||
|
epw = new ExportPropertiesWidget(QETDiagramEditor::defaultPrintProperties());
|
||||||
|
epw -> setPrintingMode(true);
|
||||||
|
|
||||||
|
// layout vertical contenant le titre, une ligne horizontale et epw
|
||||||
|
QVBoxLayout *vlayout1 = new QVBoxLayout();
|
||||||
|
|
||||||
|
QLabel *title = new QLabel(this -> title());
|
||||||
|
vlayout1 -> addWidget(title);
|
||||||
|
|
||||||
|
QFrame *horiz_line = new QFrame();
|
||||||
|
horiz_line -> setFrameShape(QFrame::HLine);
|
||||||
|
vlayout1 -> addWidget(horiz_line);
|
||||||
|
vlayout1 -> addWidget(epw);
|
||||||
|
vlayout1 -> addStretch();
|
||||||
|
|
||||||
|
// activation du layout
|
||||||
|
setLayout(vlayout1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Destructeur
|
||||||
|
PrintConfigPage::~PrintConfigPage() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Applique la configuration de cette page
|
||||||
|
*/
|
||||||
|
void PrintConfigPage::applyConf() {
|
||||||
|
QString prefix = "print/default";
|
||||||
|
|
||||||
|
QSettings &settings = QETApp::settings();
|
||||||
|
epw -> exportProperties().toSettings(settings, prefix);
|
||||||
|
|
||||||
|
// annule l'enregistrement de certaines proprietes non pertinentes
|
||||||
|
settings.remove(prefix + "path");
|
||||||
|
settings.remove(prefix + "format");
|
||||||
|
settings.remove(prefix + "area");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @return l'icone de cette page
|
||||||
|
QIcon PrintConfigPage::icon() const {
|
||||||
|
return(QET::Icons::Printer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @return le titre de cette page
|
||||||
|
QString PrintConfigPage::title() const {
|
||||||
|
return(tr("Impression", "configuration page title"));
|
||||||
|
}
|
||||||
|
|||||||
@@ -123,4 +123,27 @@ class ExportConfigPage : public ConfigPage {
|
|||||||
public:
|
public:
|
||||||
ExportPropertiesWidget *epw;
|
ExportPropertiesWidget *epw;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Cette classe represente la page de configuration du dialogue d'impression
|
||||||
|
*/
|
||||||
|
class PrintConfigPage : public ConfigPage {
|
||||||
|
Q_OBJECT
|
||||||
|
// constructeurs, destructeur
|
||||||
|
public:
|
||||||
|
PrintConfigPage(QWidget * = 0);
|
||||||
|
virtual ~PrintConfigPage();
|
||||||
|
private:
|
||||||
|
PrintConfigPage(const PrintConfigPage &);
|
||||||
|
|
||||||
|
// methodes
|
||||||
|
public:
|
||||||
|
void applyConf();
|
||||||
|
QString title() const;
|
||||||
|
QIcon icon() const;
|
||||||
|
|
||||||
|
// attributs
|
||||||
|
public:
|
||||||
|
ExportPropertiesWidget *epw;
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1777,3 +1777,17 @@ ExportProperties QETDiagramEditor::defaultExportProperties() {
|
|||||||
|
|
||||||
return(def);
|
return(def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@return Les parametres d'impression par defaut pour un schema
|
||||||
|
*/
|
||||||
|
ExportProperties QETDiagramEditor::defaultPrintProperties() {
|
||||||
|
// accede a la configuration de l'application
|
||||||
|
QSettings &settings = QETApp::settings();
|
||||||
|
|
||||||
|
ExportProperties def;
|
||||||
|
// lit les caracteristiques des conducteurs par defaut dans la configuration
|
||||||
|
def.fromSettings(settings, "print/default");
|
||||||
|
|
||||||
|
return(def);
|
||||||
|
}
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ class QETDiagramEditor : public QMainWindow {
|
|||||||
static BorderProperties defaultBorderProperties();
|
static BorderProperties defaultBorderProperties();
|
||||||
static ConductorProperties defaultConductorProperties();
|
static ConductorProperties defaultConductorProperties();
|
||||||
static ExportProperties defaultExportProperties();
|
static ExportProperties defaultExportProperties();
|
||||||
|
static ExportProperties defaultPrintProperties();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void actions();
|
void actions();
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ void QET::Icons::initIcons() {
|
|||||||
Phase .addFile(":/ico/16x16/phase.png");
|
Phase .addFile(":/ico/16x16/phase.png");
|
||||||
PrintAllPages .addFile(":/ico/22x22/all_pages.png");
|
PrintAllPages .addFile(":/ico/22x22/all_pages.png");
|
||||||
Printer .addFile(":/ico/32x32/printer.png");
|
Printer .addFile(":/ico/32x32/printer.png");
|
||||||
|
Printer .addFile(":/ico/128x128/printer.png");
|
||||||
PrintLandscape .addFile(":/ico/22x22/landscape.png");
|
PrintLandscape .addFile(":/ico/22x22/landscape.png");
|
||||||
PrintPortrait .addFile(":/ico/22x22/portrait.png");
|
PrintPortrait .addFile(":/ico/22x22/portrait.png");
|
||||||
PrintTwoPages .addFile(":/ico/22x22/two_pages.png");
|
PrintTwoPages .addFile(":/ico/22x22/two_pages.png");
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include "diagramschooser.h"
|
#include "diagramschooser.h"
|
||||||
#include "exportproperties.h"
|
#include "exportproperties.h"
|
||||||
#include "exportpropertieswidget.h"
|
#include "exportpropertieswidget.h"
|
||||||
|
#include "qetdiagrameditor.h"
|
||||||
#include "qeticons.h"
|
#include "qeticons.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -231,7 +232,10 @@ void QETPrintPreviewDialog::build() {
|
|||||||
fit_diagram_to_page_label_ -> setContentsMargins(20, 0, 0, 0);
|
fit_diagram_to_page_label_ -> setContentsMargins(20, 0, 0, 0);
|
||||||
fit_diagram_to_page_ -> setChecked(true);
|
fit_diagram_to_page_ -> setChecked(true);
|
||||||
|
|
||||||
render_properties_ = new ExportPropertiesWidget();
|
// 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);
|
render_properties_ -> setPrintingMode(true);
|
||||||
|
|
||||||
buttons_ = new QDialogButtonBox();
|
buttons_ = new QDialogButtonBox();
|
||||||
|
|||||||
Reference in New Issue
Block a user