From 470e4a059bac3893c0b6a339fa0ec5968c3ce8dd Mon Sep 17 00:00:00 2001 From: joshua Date: Tue, 21 Feb 2023 21:44:28 +0100 Subject: [PATCH] Add widget to edit terminal strip item layout The widget is available in the project properties editor. WIP --- qelectrotech.pro | 5 +- .../GraphicsItem/terminalstripdrawer.cpp | 16 +- .../GraphicsItem/terminalstripdrawer.h | 1 + .../terminalstripprojectconfigpage.cpp | 49 ++ .../terminalstripprojectconfigpage.h | 46 + .../ui/terminalstriplayouteditor.cpp | 199 +++++ .../ui/terminalstriplayouteditor.h | 54 ++ .../ui/terminalstriplayouteditor.ui | 791 ++++++++++++++++++ sources/ui/projectpropertiesdialog.cpp | 13 +- sources/ui/projectpropertiesdialog.h | 3 +- 10 files changed, 1171 insertions(+), 6 deletions(-) create mode 100644 sources/TerminalStrip/ui/ConfigPage/terminalstripprojectconfigpage.cpp create mode 100644 sources/TerminalStrip/ui/ConfigPage/terminalstripprojectconfigpage.h create mode 100644 sources/TerminalStrip/ui/terminalstriplayouteditor.cpp create mode 100644 sources/TerminalStrip/ui/terminalstriplayouteditor.h create mode 100644 sources/TerminalStrip/ui/terminalstriplayouteditor.ui diff --git a/qelectrotech.pro b/qelectrotech.pro index 887d65344..5729674e9 100644 --- a/qelectrotech.pro +++ b/qelectrotech.pro @@ -161,6 +161,7 @@ HEADERS += $$files(sources/*.h) \ $$files(sources/print/*.h) \ $$files(sources/TerminalStrip/*.h) \ $$files(sources/TerminalStrip/ui/*.h) \ + $$files(sources/TerminalStrip/ui/ConfigPage/*h) \ $$files(sources/TerminalStrip/UndoCommand/*.h) \ $$files(sources/TerminalStrip/GraphicsItem/*.h) \ $$files(sources/TerminalStrip/GraphicsItem/properties/*.h) \ @@ -202,6 +203,7 @@ SOURCES += $$files(sources/*.cpp) \ $$files(sources/print/*.cpp) \ $$files(sources/TerminalStrip/*.cpp) \ $$files(sources/TerminalStrip/ui/*.cpp) \ + $$files(sources/TerminalStrip/ui/ConfigPage/*cpp) \ $$files(sources/TerminalStrip/UndoCommand/*.cpp) \ $$files(sources/TerminalStrip/GraphicsItem/*.cpp) \ $$files(sources/TerminalStrip/GraphicsItem/properties/*.cpp) \ @@ -236,7 +238,8 @@ FORMS += $$files(sources/richtext/*.ui) \ $$files(sources/dataBase/ui/*.ui) \ $$files(sources/factory/ui/*.ui) \ $$files(sources/print/*.ui) \ - $$files(sources/TerminalStrip/ui/*.ui) + $$files(sources/TerminalStrip/ui/*.ui) \ + $$files(sources/TerminalStrip/ui/ConfigPage/*.ui) UI_SOURCES_DIR = sources/ui/ UI_HEADERS_DIR = sources/ui/ diff --git a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp index 9a608e08e..940a974ef 100644 --- a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp +++ b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.cpp @@ -62,6 +62,14 @@ void TerminalStripDrawer::paint(QPainter *painter) painter->setPen(pen_); painter->setBrush(brush_); + if (m_debug_draw) + { + painter->save(); + painter->setPen(Qt::blue); + painter->drawRect(boundingRect()); + painter->restore(); + } + //Draw header painter->drawRect(m_pattern->m_header_rect); @@ -141,6 +149,13 @@ void TerminalStripDrawer::paint(QPainter *painter) painter->drawText(text_rect, shared_real_terminal ? shared_real_terminal->label() : QLatin1String(), terminals_text_option[index_]); + + if (m_debug_draw) + { + painter->setPen(Qt::blue); + painter->drawRect(text_rect); + } + painter->restore(); //Add bridge anchor @@ -169,7 +184,6 @@ void TerminalStripDrawer::paint(QPainter *painter) x_offset += terminal_rect.width(); } } - painter->restore(); //Draw the bridges diff --git a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.h b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.h index b97e3658a..681a5b086 100644 --- a/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.h +++ b/sources/TerminalStrip/GraphicsItem/terminalstripdrawer.h @@ -44,6 +44,7 @@ class TerminalStripDrawer private: QPointer m_strip; QSharedPointer m_pattern; + bool m_debug_draw { false }; }; #endif // TERMINALSTRIPDRAWER_H diff --git a/sources/TerminalStrip/ui/ConfigPage/terminalstripprojectconfigpage.cpp b/sources/TerminalStrip/ui/ConfigPage/terminalstripprojectconfigpage.cpp new file mode 100644 index 000000000..985a3df8f --- /dev/null +++ b/sources/TerminalStrip/ui/ConfigPage/terminalstripprojectconfigpage.cpp @@ -0,0 +1,49 @@ +/* + Copyright 2006-2023 The QElectroTech Team + This file is part of QElectroTech. + + QElectroTech is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + QElectroTech is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QElectroTech. If not, see . +*/ +#include "terminalstripprojectconfigpage.h" +#include "../../../qeticons.h" +#include "../terminalstriplayouteditor.h" +#include "../../../qetproject.h" + +#include + +TerminalStripProjectConfigPage::TerminalStripProjectConfigPage(QETProject *project, + QWidget *parent) : + ProjectConfigPage { project, parent } +{ + initWidgets(); +} + +QString TerminalStripProjectConfigPage::title() const { + return tr("Plan de bornes"); +} + +QIcon TerminalStripProjectConfigPage::icon() const { + return QET::Icons::TerminalStrip; +} + +void TerminalStripProjectConfigPage::initWidgets() +{ + m_layout_editor = new TerminalStripLayoutEditor{ project()->projectPropertiesHandler().terminalStripLayoutHandler().defaultLayout(), + this }; + + auto v_layout = new QVBoxLayout { this }; + v_layout->addWidget(m_layout_editor); + v_layout->addStretch(); + setLayout(v_layout); +} diff --git a/sources/TerminalStrip/ui/ConfigPage/terminalstripprojectconfigpage.h b/sources/TerminalStrip/ui/ConfigPage/terminalstripprojectconfigpage.h new file mode 100644 index 000000000..404dd0812 --- /dev/null +++ b/sources/TerminalStrip/ui/ConfigPage/terminalstripprojectconfigpage.h @@ -0,0 +1,46 @@ +/* + Copyright 2006-2023 The QElectroTech Team + This file is part of QElectroTech. + + QElectroTech is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + QElectroTech is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QElectroTech. If not, see . +*/ +#ifndef TERMINALSTRIPPROJECTCONFIGPAGE_H +#define TERMINALSTRIPPROJECTCONFIGPAGE_H + +#include "../../../ui/configpage/projectconfigpages.h" + +class TerminalStripLayoutEditor; + +class TerminalStripProjectConfigPage : public ProjectConfigPage +{ + Q_OBJECT + public: + TerminalStripProjectConfigPage(QETProject *project, QWidget *parent = nullptr); + + QString title() const override; + QIcon icon() const override; + + void applyProjectConf() override {} + + protected: + void initWidgets() override; + void initLayout() override{} + void readValuesFromProject() override {} + void adjustReadOnly() override {} + + private: + TerminalStripLayoutEditor *m_layout_editor { nullptr }; +}; + +#endif // TERMINALSTRIPPROJECTCONFIGPAGE_H diff --git a/sources/TerminalStrip/ui/terminalstriplayouteditor.cpp b/sources/TerminalStrip/ui/terminalstriplayouteditor.cpp new file mode 100644 index 000000000..b9a573006 --- /dev/null +++ b/sources/TerminalStrip/ui/terminalstriplayouteditor.cpp @@ -0,0 +1,199 @@ +/* + Copyright 2006-2023 The QElectroTech Team + This file is part of QElectroTech. + + QElectroTech is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + QElectroTech is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QElectroTech. If not, see . +*/ +#include "terminalstriplayouteditor.h" +#include "ui_terminalstriplayouteditor.h" +#include "../GraphicsItem/properties/terminalstriplayoutpattern.h" + +TerminalStripLayoutEditor::TerminalStripLayoutEditor(QSharedPointer layout, + QWidget *parent) : + QWidget{ parent }, + ui{ new Ui::TerminalStripLayoutEditor }, + m_layout{ layout } +{ + ui->setupUi(this); + updateUi(); +} + +TerminalStripLayoutEditor::~TerminalStripLayoutEditor() +{ + delete ui; +} + +void TerminalStripLayoutEditor::valueEdited() +{ + if (!m_layout || m_ui_updating) { + return; + } + + //auto *data_ = m_layout.data(); + + m_layout.data()->m_header_rect.setRect(0, + ui->m_y_header_sb->value(), + ui->m_width_header_sb->value(), + ui->m_height_header_sb->value()); + + m_layout.data()->m_spacer_rect.setRect(0, + ui->m_y_spacer_sb->value(), + ui->m_width_spacer_sb->value(), + ui->m_height_spacer_sb->value()); + + m_layout.data()->m_terminal_rect[0].setRect(0, + ui->m_y_terminal_0_sb->value(), + ui->m_width_terminal_0_sb->value(), + ui->m_height_terminal_0_sb->value()); + + m_layout.data()->m_terminal_rect[1].setRect(0, + ui->m_y_terminal_1_sb->value(), + ui->m_width_terminal_1_sb->value(), + ui->m_height_terminal_1_sb->value()); + + m_layout.data()->m_terminal_rect[2].setRect(0, + ui->m_y_terminal_2_sb->value(), + ui->m_width_terminal_2_sb->value(), + ui->m_height_terminal_2_sb->value()); + + m_layout.data()->m_terminal_rect[3].setRect(0, + ui->m_y_terminal_3_sb->value(), + ui->m_width_terminal_3_sb->value(), + ui->m_height_terminal_3_sb->value()); + + m_layout.data()->m_bridge_point_y_offset[0] = ui->m_bridge_point_0_sb->value(); + m_layout.data()->m_bridge_point_y_offset[1] = ui->m_bridge_point_1_sb->value(); + m_layout.data()->m_bridge_point_y_offset[2] = ui->m_bridge_point_2_sb->value(); + m_layout.data()->m_bridge_point_y_offset[3] = ui->m_bridge_point_3_sb->value(); + + m_layout.data()->m_header_text_orientation = ui->m_header_text_orientation_cb->currentIndex() == 0 ? + Qt::Horizontal : + Qt::Vertical; + + switch (ui->m_header_text_alignment_cb->currentIndex()) { + case 0: + m_layout.data()->setHeaderTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); break; + case 1: + m_layout.data()->setHeaderTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter); break; + default: + m_layout.data()->setHeaderTextAlignment(Qt::AlignRight | Qt::AlignVCenter); break; + } + + m_layout.data()->m_terminals_text_orientation[0] = ui->m_terminal_text_orientation_cb->currentIndex() == 0 ? + Qt::Horizontal : + Qt::Vertical; + + switch (ui->m_terminal_text_alignment_cb->currentIndex()) { + case 0: + m_layout.data()->setTerminalsTextAlignment( + QVector { Qt::AlignLeft | Qt::AlignVCenter, + Qt::AlignLeft | Qt::AlignVCenter, + Qt::AlignLeft | Qt::AlignVCenter, + Qt::AlignLeft | Qt::AlignVCenter }); + break; + case 1: + m_layout.data()->setTerminalsTextAlignment( + QVector { Qt::AlignHCenter | Qt::AlignVCenter, + Qt::AlignHCenter | Qt::AlignVCenter, + Qt::AlignHCenter | Qt::AlignVCenter, + Qt::AlignHCenter | Qt::AlignVCenter }); + break; + default: + m_layout.data()->setTerminalsTextAlignment( + QVector { Qt::AlignRight | Qt::AlignVCenter, + Qt::AlignRight | Qt::AlignVCenter, + Qt::AlignRight | Qt::AlignVCenter, + Qt::AlignRight | Qt::AlignVCenter }); + break; + } + + +} + +void TerminalStripLayoutEditor::updateUi() +{ + if (!m_layout) { + return; + } + + const auto data = m_layout.data(); + + m_ui_updating = true; + + ui->m_y_header_sb->setValue(data->m_header_rect.y()); + ui->m_width_header_sb->setValue(data->m_header_rect.width()); + ui->m_height_header_sb->setValue(data->m_header_rect.height()); + + ui->m_y_spacer_sb->setValue(data->m_spacer_rect.y()); + ui->m_width_spacer_sb->setValue(data->m_spacer_rect.width()); + ui->m_height_spacer_sb->setValue(data->m_spacer_rect.height()); + + const auto terminal_0 = data->m_terminal_rect[0]; + ui->m_y_terminal_0_sb->setValue(terminal_0.y()); + ui->m_height_terminal_0_sb->setValue(terminal_0.height()); + ui->m_width_terminal_0_sb->setValue(terminal_0.width()); + + const auto terminal_1 = data->m_terminal_rect[1]; + ui->m_y_terminal_1_sb->setValue(terminal_1.y()); + ui->m_height_terminal_1_sb->setValue(terminal_1.height()); + ui->m_width_terminal_1_sb->setValue(terminal_1.width()); + + const auto terminal_2 = data->m_terminal_rect[2]; + ui->m_y_terminal_2_sb->setValue(terminal_2.y()); + ui->m_height_terminal_2_sb->setValue(terminal_2.height()); + ui->m_width_terminal_2_sb->setValue(terminal_2.width()); + + const auto terminal_3 = data->m_terminal_rect[3]; + ui->m_y_terminal_3_sb->setValue(terminal_3.y()); + ui->m_height_terminal_3_sb->setValue(terminal_3.height()); + ui->m_width_terminal_3_sb->setValue(terminal_3.width()); + + const auto bridge_point = data->m_bridge_point_y_offset; + ui->m_bridge_point_0_sb->setValue(bridge_point[0]); + ui->m_bridge_point_1_sb->setValue(bridge_point[1]); + ui->m_bridge_point_2_sb->setValue(bridge_point[2]); + ui->m_bridge_point_3_sb->setValue(bridge_point[3]); + + if (data->m_header_text_orientation == Qt::Horizontal) { + ui->m_header_text_orientation_cb->setCurrentIndex(0); + } else { + ui->m_header_text_orientation_cb->setCurrentIndex(1); + } + + if (data->m_terminals_text_orientation[0] == Qt::Horizontal) { + ui->m_terminal_text_orientation_cb->setCurrentIndex(0); + } else { + ui->m_terminal_text_orientation_cb->setCurrentIndex(1); + } + + const auto header_alignment = data->headerTextAlignment(); + if (header_alignment &Qt::AlignLeft) { + ui->m_header_text_alignment_cb->setCurrentIndex(0); + } else if (header_alignment &Qt::AlignHCenter) { + ui->m_header_text_alignment_cb->setCurrentIndex(1); + } else if (header_alignment &Qt::AlignRight) { + ui->m_header_text_alignment_cb->setCurrentIndex(2); + } + + const auto terminal_alignment = data->terminalsTextAlignment().at(0); + if (terminal_alignment &Qt::AlignLeft) { + ui->m_terminal_text_alignment_cb->setCurrentIndex(0); + } else if (terminal_alignment &Qt::AlignHCenter) { + ui->m_terminal_text_alignment_cb->setCurrentIndex(1); + } else if (terminal_alignment &Qt::AlignRight) { + ui->m_terminal_text_alignment_cb->setCurrentIndex(2); + } + + m_ui_updating = false; +} diff --git a/sources/TerminalStrip/ui/terminalstriplayouteditor.h b/sources/TerminalStrip/ui/terminalstriplayouteditor.h new file mode 100644 index 000000000..2d804ebc6 --- /dev/null +++ b/sources/TerminalStrip/ui/terminalstriplayouteditor.h @@ -0,0 +1,54 @@ +/* + Copyright 2006-2023 The QElectroTech Team + This file is part of QElectroTech. + + QElectroTech is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + QElectroTech is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with QElectroTech. If not, see . +*/ +#ifndef TERMINALSTRIPLAYOUTEDITOR_H +#define TERMINALSTRIPLAYOUTEDITOR_H + +#include + +class TerminalStripLayoutPattern; + +namespace Ui { + class TerminalStripLayoutEditor; +} + +/** + * @brief The TerminalStripLayoutEditor class + * Widget used to edit the layout of a terminal strip item + */ +class TerminalStripLayoutEditor : public QWidget +{ + Q_OBJECT + + public: + explicit TerminalStripLayoutEditor(QSharedPointer layout, + QWidget *parent = nullptr); + ~TerminalStripLayoutEditor(); + + private slots: + void valueEdited(); + + private: + void updateUi(); + + private: + Ui::TerminalStripLayoutEditor *ui; + QSharedPointer m_layout; + bool m_ui_updating { false } ; +}; + +#endif // TERMINALSTRIPLAYOUTEDITOR_H diff --git a/sources/TerminalStrip/ui/terminalstriplayouteditor.ui b/sources/TerminalStrip/ui/terminalstriplayouteditor.ui new file mode 100644 index 000000000..17460797b --- /dev/null +++ b/sources/TerminalStrip/ui/terminalstriplayouteditor.ui @@ -0,0 +1,791 @@ + + + TerminalStripLayoutEditor + + + + 0 + 0 + 553 + 311 + + + + Form + + + + + + Borne niveau 2 : + + + + + + + En tête : + + + + + + + 1000 + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + Horizontal + + + + + Vertical + + + + + + + + Alignement du texte d'en tête : + + + + + + + Orientation du texte d'en tête : + + + + + + + + Gauche + + + + + Centre + + + + + Droite + + + + + + + + Orientation du texte de borne : + + + + + + + + Horizontal + + + + + Vertical + + + + + + + + Alignement du texte de borne : + + + + + + + + Gauche + + + + + Centre + + + + + Droite + + + + + + + + + + + 1000 + + + + + + + 1000 + + + + + + + Qt::Horizontal + + + + + + + 1000 + + + + + + + 1000 + + + + + + + Décalage vertical + + + + + + + 1000 + + + + + + + Espace : + + + + + + + Borne niveau 0 : + + + + + + + 1000 + + + + + + + 1000 + + + + + + + 1000 + + + + + + + 1000 + + + + + + + Borne niveau 1 : + + + + + + + Hauteur + + + + + + + 1000 + + + + + + + 1000 + + + + + + + 1000 + + + + + + + Borne niveau 3 : + + + + + + + 1000 + + + + + + + Qt::Horizontal + + + + + + + Largeur + + + + + + + 1000 + + + + + + + 1000 + + + + + + + 1000 + + + + + + + 1000 + + + + + + + 1000 + + + + + + + 1000 + + + + + + + Point de pont + + + + + + + 1000 + + + + + + + 1000 + + + + + + + + + m_y_header_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 167 + 43 + + + 276 + 155 + + + + + m_y_terminal_1_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 167 + 158 + + + 276 + 155 + + + + + m_bridge_point_0_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 492 + 127 + + + 276 + 155 + + + + + m_height_terminal_0_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 384 + 127 + + + 276 + 155 + + + + + m_width_terminal_0_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 276 + 127 + + + 276 + 155 + + + + + m_y_terminal_0_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 167 + 127 + + + 276 + 155 + + + + + m_height_spacer_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 384 + 74 + + + 276 + 155 + + + + + m_height_header_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 384 + 43 + + + 276 + 155 + + + + + m_y_spacer_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 167 + 74 + + + 276 + 155 + + + + + m_width_spacer_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 276 + 74 + + + 276 + 155 + + + + + m_width_header_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 276 + 43 + + + 276 + 155 + + + + + m_y_terminal_2_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 167 + 189 + + + 276 + 155 + + + + + m_y_terminal_3_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 167 + 220 + + + 276 + 155 + + + + + m_width_terminal_1_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 276 + 158 + + + 276 + 155 + + + + + m_width_terminal_2_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 276 + 189 + + + 276 + 155 + + + + + m_width_terminal_3_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 276 + 220 + + + 276 + 155 + + + + + m_height_terminal_1_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 384 + 158 + + + 276 + 155 + + + + + m_height_terminal_2_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 384 + 189 + + + 276 + 155 + + + + + m_height_terminal_3_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 384 + 220 + + + 276 + 155 + + + + + m_bridge_point_1_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 492 + 158 + + + 276 + 155 + + + + + m_bridge_point_3_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 492 + 220 + + + 276 + 155 + + + + + m_bridge_point_2_sb + valueChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 492 + 189 + + + 276 + 155 + + + + + m_header_text_alignment_cb + currentIndexChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 506 + 259 + + + 276 + 155 + + + + + m_header_text_orientation_cb + currentIndexChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 235 + 259 + + + 276 + 155 + + + + + m_terminal_text_alignment_cb + currentIndexChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 506 + 289 + + + 276 + 155 + + + + + m_terminal_text_orientation_cb + currentIndexChanged(int) + TerminalStripLayoutEditor + valueEdited() + + + 235 + 289 + + + 276 + 155 + + + + + + valueEdited() + + diff --git a/sources/ui/projectpropertiesdialog.cpp b/sources/ui/projectpropertiesdialog.cpp index 7b4eff861..b8ced4391 100644 --- a/sources/ui/projectpropertiesdialog.cpp +++ b/sources/ui/projectpropertiesdialog.cpp @@ -20,6 +20,7 @@ #include "../configdialog.h" #include "configpage/configpages.h" #include "configpage/projectconfigpages.h" +#include "../TerminalStrip/ui/ConfigPage/terminalstripprojectconfigpage.h" #include @@ -29,14 +30,20 @@ @param project : project to edit properties @param parent : parent widget of this dialog */ -ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *parent) { - NewDiagramPage *newDiagramPage = new NewDiagramPage(project,parent,this); - ProjectAutoNumConfigPage *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project); +ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *parent) +{ m_properties_dialog = new ConfigDialog (parent); m_properties_dialog -> setWindowTitle(QObject::tr("Propriétés du projet", "window title")); m_properties_dialog -> addPage(new ProjectMainConfigPage(project)); + + NewDiagramPage *newDiagramPage = new NewDiagramPage(project,parent,this); m_properties_dialog -> addPage(newDiagramPage); + + ProjectAutoNumConfigPage *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project); m_properties_dialog -> addPage(projectAutoNumConfigPage); + + m_properties_dialog->addPage(new TerminalStripProjectConfigPage { project, parent }); + connect(projectAutoNumConfigPage,SIGNAL(setAutoNum(QString)),newDiagramPage,SLOT(setFolioAutonum(QString))); connect(projectAutoNumConfigPage,SIGNAL(saveCurrentTbp()),newDiagramPage,SLOT(saveCurrentTbp())); connect(projectAutoNumConfigPage,SIGNAL(loadSavedTbp()),newDiagramPage,SLOT(loadSavedTbp())); diff --git a/sources/ui/projectpropertiesdialog.h b/sources/ui/projectpropertiesdialog.h index 203521813..246175495 100644 --- a/sources/ui/projectpropertiesdialog.h +++ b/sources/ui/projectpropertiesdialog.h @@ -32,7 +32,8 @@ class ProjectPropertiesDialog : public QObject { enum Page { Main = 0, Diagram = 1, - Autonum = 2 + Autonum = 2, + TerminalStrip = 3 }; ProjectPropertiesDialog(QETProject *project, QWidget *parent = nullptr);