diff --git a/sources/configpages.cpp b/sources/configpages.cpp index 7ed6cc1f8..fb36c503d 100644 --- a/sources/configpages.cpp +++ b/sources/configpages.cpp @@ -210,6 +210,7 @@ ExportConfigPage::ExportConfigPage(QWidget *parent) : ConfigPage(parent) { horiz_line -> setFrameShape(QFrame::HLine); vlayout1 -> addWidget(horiz_line); vlayout1 -> addWidget(epw); + vlayout1 -> addStretch(); // activation du layout setLayout(vlayout1); diff --git a/sources/exportpropertieswidget.cpp b/sources/exportpropertieswidget.cpp index de8f0cde4..a80808963 100644 --- a/sources/exportpropertieswidget.cpp +++ b/sources/exportpropertieswidget.cpp @@ -81,6 +81,22 @@ void ExportPropertiesWidget::setExportProperties(const ExportProperties &export_ } } +/** + Passe le widget en mode Impression ou en mode Export. Le mode Impression + n'affiche pas autant d'options que le mode Export. + @param mode true pour utiliser le widget en mode impression, false pour + l'utiliser en mode export +*/ +void ExportPropertiesWidget::setPrintingMode(bool mode) { + dirpath_label -> setVisible(!mode); + dirpath -> setVisible(!mode); + button_browse -> setVisible(!mode); + format_label -> setVisible(!mode); + format -> setVisible(!mode); + export_border -> setVisible(!mode); + export_elements -> setVisible(!mode); +} + /** Slot demandant a l'utilisateur de choisir un dossier */ @@ -101,10 +117,11 @@ void ExportPropertiesWidget::slot_chooseADirectory() { void ExportPropertiesWidget::build() { // le dialogue est un empilement vertical d'elements QVBoxLayout *vboxLayout = new QVBoxLayout(); + vboxLayout -> setContentsMargins(0, 0, 0, 0); /* le dialogue comprend une ligne permettant d'indiquer un chemin de dossier (hboxLayout) */ QHBoxLayout *hboxLayout = new QHBoxLayout(); - QLabel *dirpath_label = new QLabel(tr("Dossier cible :"), this); + dirpath_label = new QLabel(tr("Dossier cible :"), this); dirpath = new QLineEdit(this); QCompleter *completer = new QCompleter(this); completer -> setModel(new QDirModel(completer)); @@ -119,7 +136,8 @@ void ExportPropertiesWidget::build() { /* une ligne permettant de choisir le format (hboxLayout1) */ QHBoxLayout *hboxLayout1 = new QHBoxLayout(); - hboxLayout1 -> addWidget(new QLabel(tr("Format :"), this)); + format_label = new QLabel(tr("Format :"), this); + hboxLayout1 -> addWidget(format_label); hboxLayout1 -> addWidget(format = new QComboBox(this)); format -> addItem(tr("PNG (*.png)"), "PNG"); format -> addItem(tr("JPEG (*.jpg)"), "JPG"); @@ -128,10 +146,9 @@ void ExportPropertiesWidget::build() { hboxLayout1 -> addStretch(); vboxLayout -> addLayout(hboxLayout1); - /* un cadre permettant de specifier les options de l'image finale */ - QGroupBox *groupbox_options = new QGroupBox(tr("Options")); + QGroupBox *groupbox_options = new QGroupBox(tr("Options de rendu", "groupbox title")); QGridLayout *optionshlayout = new QGridLayout(groupbox_options); // Choix de la zone du schema a exporter @@ -164,7 +181,6 @@ void ExportPropertiesWidget::build() { optionshlayout -> addWidget(draw_colored_conductors, 3, 0); vboxLayout -> addWidget(groupbox_options); - vboxLayout -> addStretch(); setLayout(vboxLayout); @@ -184,4 +200,9 @@ void ExportPropertiesWidget::build() { // emission de signaux lors du changement de format et lors du changement de zone exportee connect(format, SIGNAL(currentIndexChanged(int)), this, SIGNAL(formatChanged())); connect(exported_content_choices, SIGNAL(buttonClicked(QAbstractButton *)), this, SIGNAL(exportedAreaChanged())); + connect(draw_grid, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); + connect(draw_border, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); + connect(draw_inset, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); + connect(draw_terminals, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); + connect(draw_colored_conductors, SIGNAL(stateChanged(int)), this, SIGNAL(optionChanged())); } diff --git a/sources/exportpropertieswidget.h b/sources/exportpropertieswidget.h index 17319e620..bfa057b77 100644 --- a/sources/exportpropertieswidget.h +++ b/sources/exportpropertieswidget.h @@ -38,6 +38,7 @@ class ExportPropertiesWidget : public QWidget { public: void setExportProperties(const ExportProperties &); ExportProperties exportProperties() const; + void setPrintingMode(bool); public slots: void slot_chooseADirectory(); @@ -45,6 +46,7 @@ class ExportPropertiesWidget : public QWidget { signals: void formatChanged(); void exportedAreaChanged(); + void optionChanged(); // methodes privees private: @@ -52,8 +54,10 @@ class ExportPropertiesWidget : public QWidget { // attributs private: + QLabel *dirpath_label; QLineEdit *dirpath; QPushButton *button_browse; + QLabel *format_label; QComboBox *format; QCheckBox *draw_grid; QCheckBox *draw_border;