diff --git a/build-aux/flatpak/org.qelectrotech.QElectroTech.json b/build-aux/flatpak/org.qelectrotech.QElectroTech.json index 1db69b42f..4b0b18791 100644 --- a/build-aux/flatpak/org.qelectrotech.QElectroTech.json +++ b/build-aux/flatpak/org.qelectrotech.QElectroTech.json @@ -78,18 +78,17 @@ ] }, { - "name": "python3.6.0", + "name": "python3-PySimpleGUI", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} PySimpleGUI" + ], "sources": [ { - "type": "archive", - "url": "https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz", - "sha256": "b0c5f904f685e32d9232f7bdcbece9819a892929063b6e385414ad2dd6a23622" + "type": "file", + "url": "https://files.pythonhosted.org/packages/d0/c3/c1ce811a1e48d5e0f2df0b393ff189fae4842ec840bb6e4db79c8da55e74/PySimpleGUI-4.41.2.tar.gz", + "sha256": "cf42d9f61f28c8e790a9c031ce900a9cee5fd2f950da2f055ed36bbc487dcf11" } - ], - "config-opts": ["--enable-shared"], - "post-install": [ - "chmod +w ${FLATPAK_DEST}/lib/libpython3.6m.so.1.0", - "chmod +w ${FLATPAK_DEST}/lib/libpython3.so" ] }, { @@ -101,25 +100,10 @@ "sources": [ { "type": "file", - "url": "https://files.pythonhosted.org/packages/9e/c3/aaad3309a5f2ca08e2fa0ab01123bb6fafb15a92854bff88042039192a67/qet_tb_generator-1.1.7.tar.gz", - "sha256": "f626ab7bf4d9091fc85f63d33136585e611272b347499b448ece4e33cc04eeed" + "url": "https://files.pythonhosted.org/packages/45/be/d5940d365ebf256e490bc6c10837244e0b8dda08a7d790691767263c318d/qet_tb_generator-1.2.5.tar.gz", + "sha256": "37c3298602244f3152fbb7601caba9b4862bac782991fbb472eab91afb70d09c" } ] -}, - { - "name": "DXFtoQET-2020-1", - "buildsystem": "qmake", - "sources": [ - { - "type": "git", - "url": "https://github.com/qelectrotech/DXFtoQET-2020.git", - "commit": "01fbb2afe0fe66782cb1d1f901c73616c7d5299d" - } - ], - "post-install": [ - "mkdir -p ${FLATPAK_DEST}/bin", - "cp DXFtoQET ${FLATPAK_DEST}/bin/" - ] } ] } diff --git a/elements/10_electric/20_manufacturers_articles/gce/Wemos D1 ESP8266.elmt b/elements/10_electric/20_manufacturers_articles/arduino/Wemos D1 ESP8266.elmt similarity index 100% rename from elements/10_electric/20_manufacturers_articles/gce/Wemos D1 ESP8266.elmt rename to elements/10_electric/20_manufacturers_articles/arduino/Wemos D1 ESP8266.elmt diff --git a/elements/10_electric/20_manufacturers_articles/gce/Wemos D1 Pro ESP8266.elmt b/elements/10_electric/20_manufacturers_articles/arduino/Wemos D1 Pro ESP8266.elmt similarity index 100% rename from elements/10_electric/20_manufacturers_articles/gce/Wemos D1 Pro ESP8266.elmt rename to elements/10_electric/20_manufacturers_articles/arduino/Wemos D1 Pro ESP8266.elmt diff --git a/elements/10_electric/20_manufacturers_articles/arduino/esp8266.elmt b/elements/10_electric/20_manufacturers_articles/arduino/esp8266.elmt new file mode 100644 index 000000000..5de139039 --- /dev/null +++ b/elements/10_electric/20_manufacturers_articles/arduino/esp8266.elmt @@ -0,0 +1,76 @@ + + + + ESP8266 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lang/qet_da.qm b/lang/qet_da.qm index ceb72c179..0c64b8dc4 100644 Binary files a/lang/qet_da.qm and b/lang/qet_da.qm differ diff --git a/lang/qet_da.ts b/lang/qet_da.ts index acee064e9..d47be86b1 100644 --- a/lang/qet_da.ts +++ b/lang/qet_da.ts @@ -1486,7 +1486,7 @@ Bemærk: Disse muligheder VIL IKKE tillade eller blokere autonummereringer, kun Conserver la rotation visuel - Behold visuel rotation + Behold visuel rotation @@ -1501,7 +1501,7 @@ Bemærk: Disse muligheder VIL IKKE tillade eller blokere autonummereringer, kun Encadrer le texte - + Ramme om tekst @@ -1569,7 +1569,7 @@ Bemærk: Disse muligheder VIL IKKE tillade eller blokere autonummereringer, kun Modifier la conservation de l'angle - + Ændre vinkel bevarelse @@ -8787,7 +8787,7 @@ Voulez-vous la remplacer ? To install the plugin qet_tb_generator<br>Visit :<br><a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a><br><B><U> First install on macOSX</B></U><br>1. Install, if required, python 3.9 bundle only, <br>2 Run Profile.command script<br>because program use hardcoded PATH for localise qet-tb-generator plugin <br> Visit :<br><a href='https://qelectrotech.org/forum/viewtopic.php?pid=5674#p5674'>howto</a><br>2. pip3 install qet_tb_generator<br><B><U> Update on macOSX</B></U><br> pip3 install --upgrade qet_tb_generator<br> - + For at installere udvidelsesmodul qet_tb_generator<br>Besøg:<br><a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a><br><B><U>Første installaton på MacOSX</B></U><br>1. Installere, om nødvendigt, kun python 3.9 pakke<br>2 Kør Profile.command script<br>fordi programmet bruger hård kodet PATH til lokalisering af qet-tb-generator udvidelsesmodul<br>Besøg:<br><a href='https://qelectrotech.org/forum/viewtopic.php?pid=5674#p5674'>howto</a><br>2. pip3 install qet_tb_generator<br><B><U>Opdatering på macOSX</B></U><br>pip3 install --upgrade qet_tb_generator<br> @@ -8832,12 +8832,12 @@ Voulez-vous la remplacer ? Compilation : - Kompilering: + Kompilering: Compilation : - Kompilering: + Kompilering: @@ -11449,7 +11449,7 @@ De andre felter anvendes ikke. Green : MediumAquamarine element part filling - Grøn : Mellem havvand + Grøn : Mellem havvand @@ -11533,7 +11533,7 @@ De andre felter anvendes ikke. Cyan : LightSeaGreen element part filling - Turkis : Lys havgrøn + Turkis : Lys havgrøn @@ -11545,7 +11545,7 @@ De andre felter anvendes ikke. Cyan : DarkCyan element part filling - Turkis : Mørk turkis + Turkis : Mørk turkis @@ -11791,13 +11791,13 @@ De andre felter anvendes ikke. White : GhostWhite element part filling - Hvid : Spøgelse hvid + Hvid : Spøgelse hvid White : WhiteSmoke element part filling - Hvid : Hvid røg + Hvid : Hvid røg @@ -11863,7 +11863,7 @@ De andre felter anvendes ikke. Gray : LightGray element part filling - Grå : Lysegrå + Grå : Lysegrå @@ -11893,7 +11893,7 @@ De andre felter anvendes ikke. Gray : LightSlateGray element part filling - Grå : Lys skifergrå + Grå : Lys skifergrå diff --git a/lang/qet_nl.qm b/lang/qet_nl.qm index 2797e78d4..6a4f8fbf6 100644 Binary files a/lang/qet_nl.qm and b/lang/qet_nl.qm differ diff --git a/lang/qet_nl.ts b/lang/qet_nl.ts index 5950f9707..4525700f7 100644 --- a/lang/qet_nl.ts +++ b/lang/qet_nl.ts @@ -384,7 +384,7 @@ Sélectionner la police des en tête du tableau - Selecteer het lettertype van de.kopteksten van de tabel + Selecteer het lettertype van de kopteksten van de tabel @@ -594,12 +594,12 @@ -Update Only Existent: only existent Elements will be updated. New Elements will be assigned their formula but will not update once created. -Disable: both New and Existent Element labels will not be updated. This is valid for new folios as well. Note: These options DO NOT allow or block Auto Numberings, only their Update Policy. - In dit menu kun je instellen of en wat automatische nummering moet updaten. Voor automatisch nummeren van elementen zijn 4 opties mogelijk: + In dit menu kun je instellen of en wat een automatische nummering moet updaten. Voor het automatisch nummeren van elementen zijn 4 opties mogelijk: -Beide: nieuwe en bestaande elementen zullen worden geüpdatet. Dit is de standaard instelling. -Nieuwe: alleen nieuwe elementen zullen worden geüpdatet. Bestaande elementlabels blijven ongewijzigd. --Bestaande: alleen bestaande elementen zullen worden geüpdatet. Nieuwe elementen krijgen hun formule toegewezen maar worden na aanmaken niet geüpdatet. +-Bestaande: alleen bestaande elementen zullen worden geüpdatet. Nieuwe elementen krijgen hun formule toegewezen maar worden na het aanmaken niet geüpdatet. -Uitgeschakeld: Nieuwe noch bestaande labels zullen worden geüpdatet. Dit geldt ook voor nieuwe bladen. -Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen het updatebeleid. +Noot: Geen van deze opties bepalen het al of niet automatisch nummeren maar alleen het updatebeleid. @@ -667,7 +667,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Quantité numéro d'article Special field with name : designation quantity - Aantal itemnummer + Aantal itemnummers @@ -710,7 +710,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Dimensions du folio - Stramien + Bladafmetingen @@ -813,7 +813,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Type - Geleidertype + Type @@ -1005,7 +1005,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Apparence - Geleiderweergave + Weergave @@ -1143,7 +1143,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Choisir la nouvelle couleur de ce conducteur - Kies een nieuwe kleur voor deze geleider + Kies de nieuwe kleur voor deze geleider @@ -1476,7 +1476,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Conserver la rotation visuel - Oriëntatie behouden + Oriëntatie behouden @@ -1491,7 +1491,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Encadrer le texte - + Tekst omkaderen @@ -1569,7 +1569,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Modifier la conservation de l'angle - + De te bewaren hoek wijzigen @@ -1821,7 +1821,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Élément bornier - Elementaansluiting + Element-aansluitingen @@ -1847,7 +1847,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Simple - Eenvoudig + Enkelvoudig @@ -2059,12 +2059,12 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Informations disponibles - Beschikbare informatie + Beschikbare gegevens Informations à exporter - Te exporteren informatie + Te exporteren gegevens @@ -2129,12 +2129,12 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Type d'éléments - Elementtype + Te exporteren elementen Simples - Eenvoudige + Enkelvoudige @@ -2228,7 +2228,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Vous pouvez spécifier le nom de l'élément dans plusieurs langues. - U kunt voor meerdere talen een elementnaam opgeven. + U kunt de elementnaam in meerdere talen opgeven. @@ -2242,7 +2242,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Vous pouvez spécifier un nom par langue pour la catégorie. - U kunt voor elke taal een categorienaam opgeven. + U kunt de categorienaam in meerdere talen opgeven. @@ -2345,7 +2345,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Ouvrir le dossier correspondant - Bestandsmap openen + Bijbehorende map openen @@ -2365,7 +2365,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Recharger les collections - Herlaadt collecties + Collecties opnieuw laden @@ -2385,12 +2385,12 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen Afficher uniquement ce dossier - Alleen deze map tonen + Alleen deze map weergeven Afficher tous les dossiers - Alle mappen tonen + Alle mappen weergeven @@ -2426,7 +2426,7 @@ Noot: Geen van deze opties bepalen het wel of niet automatisch nummeren, alleen La suppression de l'élément a échoué. message box content - Verwijdering element mislukt. + Element kon niet worden verwijdert. @@ -2451,7 +2451,7 @@ Tout les éléments et les dossier contenus dans ce dossier seront supprimés. La suppression du dossier a échoué. message box content - Map verwijderen mislukt. + Map kon niet worden verwijdert. @@ -2545,7 +2545,7 @@ Tout les éléments et les dossier contenus dans ce dossier seront supprimés. Ouvrir le dossier correspondant - Open de bestandsmap + Open de bijbehorende map @@ -2663,7 +2663,7 @@ Tout les éléments et les dossier contenus dans ce dossier seront supprimés. Diamètres : - Doorsneden: + Doorsnede: @@ -8782,7 +8782,7 @@ Wilt u deze vervangen ? To install the plugin qet_tb_generator<br>Visit :<br><a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a><br><B><U> First install on macOSX</B></U><br>1. Install, if required, python 3.9 bundle only, <br>2 Run Profile.command script<br>because program use hardcoded PATH for localise qet-tb-generator plugin <br> Visit :<br><a href='https://qelectrotech.org/forum/viewtopic.php?pid=5674#p5674'>howto</a><br>2. pip3 install qet_tb_generator<br><B><U> Update on macOSX</B></U><br> pip3 install --upgrade qet_tb_generator<br> - + Installatie van de qet_tb_generator<br>Ga naar:<br><a href='https://pypi.python.org/pypi/qet-tb-generator'>qet-tb-generator</a><br><B><U> Eerste installatie onder macOSX</B></U><br>1. Installeer indien nodig de Python 3.9 bundle, <br>2 Voer het Profile.commando uit<br>omdat het programma het hardcoded pad voor de locatie van de qet-tb-generator plugin gebruikt <br> Ga naar :<br><a href='https://qelectrotech.org/forum/viewtopic.php?pid=5674#p5674'>howto</a><br>2. pip3 install qet_tb_generator<br><B><U> Update onder macOSx</B></U><br> pip3 install --upgrade qet_tb_generator<br> @@ -8827,12 +8827,12 @@ Wilt u deze vervangen ? Compilation : - Compilatie: + Compilatie: Compilation : - Compilatie : + Compilatie : diff --git a/sources/configdialog.cpp b/sources/configdialog.cpp index a0cac6fc2..ed9dd3a6c 100644 --- a/sources/configdialog.cpp +++ b/sources/configdialog.cpp @@ -17,7 +17,7 @@ */ #include #include "configdialog.h" -#include "configpages.h" +#include "ui/configpage/configpages.h" #include "qetapp.h" #include "machine_info.h" diff --git a/sources/editor/ui/elementpropertieseditorwidget.cpp b/sources/editor/ui/elementpropertieseditorwidget.cpp index 3cac32494..83a0cffb4 100644 --- a/sources/editor/ui/elementpropertieseditorwidget.cpp +++ b/sources/editor/ui/elementpropertieseditorwidget.cpp @@ -115,7 +115,7 @@ void ElementPropertiesEditorWidget::upDateInterface() */ void ElementPropertiesEditorWidget::setUpInterface() { - // Type combo box + // Type combo box ui->m_base_type_cb->addItem (tr("Simple"), ElementData::Simple); ui->m_base_type_cb->addItem (tr("Maître"), ElementData::Master); ui->m_base_type_cb->addItem (tr("Esclave"), ElementData::Slave); @@ -123,7 +123,7 @@ void ElementPropertiesEditorWidget::setUpInterface() ui->m_base_type_cb->addItem (tr("Renvoi de folio précédent"), ElementData::PreviousReport); ui->m_base_type_cb->addItem (tr("Bornier"), ElementData::Terminale); - // Slave option + // Slave option ui->m_state_cb->addItem(tr("Normalement ouvert"), ElementData::NO); ui->m_state_cb->addItem(tr("Normalement fermé"), ElementData::NC); ui->m_state_cb->addItem(tr("Inverseur"), ElementData::SW); @@ -133,24 +133,24 @@ void ElementPropertiesEditorWidget::setUpInterface() ui->m_type_cb->addItem(tr("Temporisé repos"), ElementData::DelayOff); ui->m_type_cb->addItem(tr("Temporisé travail & repos"), ElementData::delayOnOff); - //Master option + //Master option ui->m_master_type_cb->addItem(tr("Bobine"), ElementData::Coil); ui->m_master_type_cb->addItem(tr("Organe de protection"), ElementData::Protection); ui->m_master_type_cb->addItem(tr("Commutateur / bouton"), ElementData::Commutator); - //Terminal option + //Terminal option ui->m_terminal_type_cb->addItem(tr("Générique"), ElementData::TTGeneric); - ui->m_terminal_type_cb->addItem(tr("Fusible"), ElementData::Fuse); - ui->m_terminal_type_cb->addItem(tr("Séctionnable"), ElementData::Sectional); - ui->m_terminal_type_cb->addItem(tr("Diode"), ElementData::Diode); + ui->m_terminal_type_cb->addItem(tr("Fusible"), ElementData::TTFuse); + ui->m_terminal_type_cb->addItem(tr("Séctionnable"), ElementData::TTSectional); + ui->m_terminal_type_cb->addItem(tr("Diode"), ElementData::TTDiode); + ui->m_terminal_type_cb->addItem(tr("Terre"), ElementData::TTGround); ui->m_terminal_func_cb->addItem(tr("Générique"), ElementData::TFGeneric); - ui->m_terminal_func_cb->addItem(tr("Phase"), ElementData::Phase); - ui->m_terminal_func_cb->addItem(tr("Neutre"), ElementData::Neutral); - ui->m_terminal_func_cb->addItem(tr("Terre"), ElementData::PE); + ui->m_terminal_func_cb->addItem(tr("Phase"), ElementData::TFPhase); + ui->m_terminal_func_cb->addItem(tr("Neutre"), ElementData::TFNeutral); - //Disable the edition of the first column of the information tree - //by this little workaround + //Disable the edition of the first column of the information tree + //by this little workaround ui->m_tree->setItemDelegate(new EditorDelegate(this)); ui->m_tree->header()->resizeSection(0, 150); populateTree(); diff --git a/sources/factory/elementpicturefactory.cpp b/sources/factory/elementpicturefactory.cpp index eda6b4201..dbfeeebef 100644 --- a/sources/factory/elementpicturefactory.cpp +++ b/sources/factory/elementpicturefactory.cpp @@ -237,14 +237,16 @@ bool ElementPictureFactory::build(const ElementsLocation &location, painter.end(); low_painter.end(); + const auto uuid_ = location.uuid(); if (!picture) { - m_pictures_H.insert(location.uuid(), pic); - m_primitives_H.insert(location.uuid(), primitives_); + m_pictures_H.insert(uuid_, pic); + m_primitives_H.insert(uuid_, primitives_); } if (!low_picture) { - m_low_pictures_H.insert(location.uuid(), low_pic); - m_primitives_H.insert(location.uuid(), primitives_); + m_low_pictures_H.insert(uuid_, low_pic); + m_primitives_H.insert(uuid_, primitives_); } + return true; } diff --git a/sources/projectview.cpp b/sources/projectview.cpp index f5420dbfa..7edbb67e7 100644 --- a/sources/projectview.cpp +++ b/sources/projectview.cpp @@ -810,30 +810,39 @@ void ProjectView::loadDiagrams() setDisplayFallbackWidget(m_project -> diagrams().isEmpty()); - DialogWaiting *dialog = nullptr; - if(DialogWaiting::hasInstance()) + auto dialog = DialogWaiting::instance(); + if(dialog) { - dialog = DialogWaiting::instance(); dialog->setTitle( tr("

" "Ouverture du projet en cours...
" "Création des onglets de folio :" "

")); } - for(Diagram *diagram : m_project->diagrams()) + + for(auto diagram : m_project->diagrams()) { if(dialog) { dialog->setDetail(diagram->title()); dialog->setProgressBar(dialog->progressBarValue()+1); } - diagramAdded(diagram); + + auto dv = new DiagramView(diagram); + dv->setFrameStyle(QFrame::Plain | QFrame::NoFrame); + + auto index = m_project->folioIndex(diagram); + m_tab->insertTab(index, dv, QET::Icons::Diagram, dv->title()); + m_diagram_view_list.insert(index, dv); + + connect(dv, &DiagramView::showDiagram, this, QOverload::of(&ProjectView::showDiagram)); + connect(dv, &DiagramView::titleChanged, this, &ProjectView::updateTabTitle); + connect(dv, &DiagramView::findElementRequired, this, &ProjectView::findElementRequired); + connect(&dv->diagram()->border_and_titleblock , &BorderTitleBlock::titleBlockFolioChanged, [this, dv]() {this->updateTabTitle(dv);}); } - if (DiagramView *dv = currentDiagram()) - { - dv->diagram()->loadElmtFolioSeq(); - dv->diagram()->loadCndFolioSeq(); - } + rebuildDiagramsMap(); + updateAllTabsTitle(); + m_tab->setCurrentWidget(firstDiagram()); } diff --git a/sources/projectview.h b/sources/projectview.h index ba037761b..01f312e2a 100644 --- a/sources/projectview.h +++ b/sources/projectview.h @@ -87,10 +87,14 @@ class ProjectView : public QWidget private: ProjectView(const ProjectView &); + //Method related to construction of this class + void setProject(QETProject *project); + + + // methods public: QETProject *project(); - void setProject(QETProject *); QList diagram_views() const; DiagramView *currentDiagram() const; void closeEvent(QCloseEvent *) override; diff --git a/sources/properties/elementdata.cpp b/sources/properties/elementdata.cpp index 9cab02db4..f8ed284f6 100644 --- a/sources/properties/elementdata.cpp +++ b/sources/properties/elementdata.cpp @@ -307,26 +307,30 @@ QString ElementData::terminalTypeToString(ElementData::TerminalType type) { switch (type) { case ElementData::TTGeneric : - return QString("generic"); - case ElementData::Fuse : - return QString("fuse"); - case ElementData::Sectional: - return QString("sectional"); - case ElementData::Diode: - return QString("diode"); + return QStringLiteral("generic"); + case ElementData::TTFuse : + return QStringLiteral("fuse"); + case ElementData::TTSectional: + return QStringLiteral("sectional"); + case ElementData::TTDiode: + return QStringLiteral("diode"); + case ElementData::TTGround: + return QStringLiteral("ground"); } } ElementData::TerminalType ElementData::terminalTypeFromString(const QString &string) { - if (string == "generic") { + if (string == QLatin1String("generic")) { return ElementData::TTGeneric; - } else if (string == "fuse") { - return ElementData::Fuse; - } else if (string == "sectional") { - return ElementData::Sectional; - } else if (string == "diode") { - return ElementData::Diode; + } else if (string == QLatin1String("fuse")) { + return ElementData::TTFuse; + } else if (string == QLatin1String("sectional")) { + return ElementData::TTSectional; + } else if (string == QLatin1String("diode")) { + return ElementData::TTDiode; + } else if (string == QLatin1String("ground")) { + return ElementData::TTGround; } qDebug() << "ElementData::terminalTypeFromString : string : " @@ -340,12 +344,10 @@ QString ElementData::terminalFunctionToString(ElementData::TerminalFunction func switch (function) { case ElementData::TFGeneric: return QString("generic"); - case ElementData::Phase: + case ElementData::TFPhase: return QString ("phase"); - case ElementData::Neutral: + case ElementData::TFNeutral: return QString("neutral"); - case ElementData::PE: - return QString("pe"); } } @@ -354,11 +356,9 @@ ElementData::TerminalFunction ElementData::terminalFunctionFromString(const QStr if (string == "generic") { return ElementData::TFGeneric; } else if (string == "phase") { - return ElementData::Phase; + return ElementData::TFPhase; } else if (string == "neutral") { - return ElementData::Neutral; - } else if (string == "pe") { - return ElementData::PE; + return ElementData::TFNeutral; } qDebug() << "ElementData::terminalFunctionFromString : string : " diff --git a/sources/properties/elementdata.h b/sources/properties/elementdata.h index e7e3d740d..d2f034990 100644 --- a/sources/properties/elementdata.h +++ b/sources/properties/elementdata.h @@ -68,17 +68,17 @@ class ElementData : public PropertiesInterface enum TerminalType { TTGeneric, - Fuse, - Sectional, - Diode + TTFuse, + TTSectional, + TTDiode, + TTGround }; Q_ENUM(TerminalType) enum TerminalFunction { TFGeneric, - Phase, - Neutral, - PE + TFPhase, + TFNeutral, }; Q_ENUM(TerminalFunction) diff --git a/sources/properties/terminaldata.cpp b/sources/properties/terminaldata.cpp index 791cec88b..3420b1e92 100644 --- a/sources/properties/terminaldata.cpp +++ b/sources/properties/terminaldata.cpp @@ -182,7 +182,8 @@ QString TerminalData::typeToString(TerminalData::Type type) */ TerminalData::Type TerminalData::typeFromString(const QString &string) { - if (string == "Generic") { + if (string.isEmpty() || + string == "Generic") { return TerminalData::Generic; } else if (string == "Inner") { return TerminalData::Inner; diff --git a/sources/properties/xrefproperties.cpp b/sources/properties/xrefproperties.cpp index 06c513c19..15e142ead 100644 --- a/sources/properties/xrefproperties.cpp +++ b/sources/properties/xrefproperties.cpp @@ -187,13 +187,14 @@ QHash XRefProperties::defaultProperties() } bool XRefProperties::operator ==(const XRefProperties &xrp) const{ - return (m_show_power_ctc == xrp.m_show_power_ctc && - m_display == xrp.m_display && - m_snap_to == xrp.m_snap_to && - m_prefix == xrp.m_prefix && - m_master_label == xrp.m_master_label && - m_offset == xrp.m_offset && - m_xref_pos == xrp.m_xref_pos ); + return (m_show_power_ctc == xrp.m_show_power_ctc + && m_display == xrp.m_display + && m_snap_to == xrp.m_snap_to + && m_prefix == xrp.m_prefix + && m_master_label== xrp.m_master_label + && m_offset == xrp.m_offset + && m_xref_pos == xrp.m_xref_pos + && m_slave_label == xrp.m_slave_label); } bool XRefProperties::operator !=(const XRefProperties &xrp) const diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index 217066f56..7c90c0a05 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -18,7 +18,7 @@ #include "qetapp.h" #include "configdialog.h" -#include "configpages.h" +#include "ui/configpage/configpages.h" #include "editor/ui/qetelementeditor.h" #include "elementscollectioncache.h" #include "factory/elementfactory.h" diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp index 85d5519c5..ee187509b 100644 --- a/sources/qetproject.cpp +++ b/sources/qetproject.cpp @@ -1420,15 +1420,13 @@ void QETProject::readDiagramsXml(QDomDocument &xml_project) QDomElement diagram_xml_element = diagram_nodes .at(i) .toElement(); - Diagram *diagram = new Diagram(this); + auto diagram = new Diagram(this); + m_diagrams_list << diagram; - int diagram_order = -1; - if (!QET::attributeIsAnInteger(diagram_xml_element, - QStringLiteral("order"), - &diagram_order)) - diagram_order = 500000; - - addDiagram(diagram, diagram_order-1); + connect(&diagram->border_and_titleblock, &BorderTitleBlock::needFolioData, + this, &QETProject::updateDiagramsFolioData); + connect(diagram, &Diagram::usedTitleBlockTemplateChanged, + this, &QETProject::usedTitleBlockTemplateChanged); diagram->initFromXml(diagram_xml_element); if(dlgWaiting) @@ -1436,6 +1434,8 @@ void QETProject::readDiagramsXml(QDomDocument &xml_project) } } + updateDiagramsFolioData(); + //Initialise links between elements in this project //and refresh the text of conductor if(dlgWaiting) diff --git a/sources/configpage.h b/sources/ui/configpage/configpage.h similarity index 100% rename from sources/configpage.h rename to sources/ui/configpage/configpage.h diff --git a/sources/configpages.cpp b/sources/ui/configpage/configpages.cpp similarity index 95% rename from sources/configpages.cpp rename to sources/ui/configpage/configpages.cpp index 2ecde2345..6efd69193 100644 --- a/sources/configpages.cpp +++ b/sources/ui/configpage/configpages.cpp @@ -18,18 +18,18 @@ #include "configpages.h" -#include "NameList/nameslist.h" -#include "bordertitleblock.h" -#include "exportpropertieswidget.h" -#include "properties/reportproperties.h" -#include "qetapp.h" -#include "qeticons.h" -#include "qetproject.h" -#include "ui/borderpropertieswidget.h" -#include "ui/conductorpropertieswidget.h" -#include "ui/reportpropertiewidget.h" -#include "ui/titleblockpropertieswidget.h" -#include "ui/xrefpropertieswidget.h" +#include "../NameList/nameslist.h" +#include "../bordertitleblock.h" +#include "../exportpropertieswidget.h" +#include "../properties/reportproperties.h" +#include "../qetapp.h" +#include "../qeticons.h" +#include "../qetproject.h" +#include "../borderpropertieswidget.h" +#include "../conductorpropertieswidget.h" +#include "../reportpropertiewidget.h" +#include "../titleblockpropertieswidget.h" +#include "../xrefpropertieswidget.h" #include #include diff --git a/sources/configpages.h b/sources/ui/configpage/configpages.h similarity index 97% rename from sources/configpages.h rename to sources/ui/configpage/configpages.h index df8ce991d..20c71b6ba 100644 --- a/sources/configpages.h +++ b/sources/ui/configpage/configpages.h @@ -18,8 +18,8 @@ #ifndef CONFIG_PAGES_H #define CONFIG_PAGES_H #include "configpage.h" -#include "ui/projectpropertiesdialog.h" -#include "ui/titleblockpropertieswidget.h" +#include "../projectpropertiesdialog.h" +#include "../titleblockpropertieswidget.h" #include #include diff --git a/sources/ui/configpage/generalconfigurationpage.h b/sources/ui/configpage/generalconfigurationpage.h index 492ef8f68..a932fc71d 100644 --- a/sources/ui/configpage/generalconfigurationpage.h +++ b/sources/ui/configpage/generalconfigurationpage.h @@ -18,7 +18,7 @@ #ifndef GENERALCONFIGURATIONPAGE_H #define GENERALCONFIGURATIONPAGE_H -#include "../../configpage.h" +#include "configpage.h" #include diff --git a/sources/projectconfigpages.cpp b/sources/ui/configpage/projectconfigpages.cpp similarity index 97% rename from sources/projectconfigpages.cpp rename to sources/ui/configpage/projectconfigpages.cpp index 547b6b9d5..b8aa4eb93 100644 --- a/sources/projectconfigpages.cpp +++ b/sources/ui/configpage/projectconfigpages.cpp @@ -17,19 +17,19 @@ */ #include "projectconfigpages.h" -#include "autoNum/numerotationcontext.h" -#include "autoNum/ui/autonumberingmanagementw.h" -#include "autoNum/ui/folioautonumbering.h" -#include "autoNum/ui/formulaautonumberingw.h" -#include "autoNum/ui/selectautonumw.h" -#include "qeticons.h" -#include "qetproject.h" -#include "ui/borderpropertieswidget.h" -#include "ui/conductorpropertieswidget.h" -#include "ui/diagramcontextwidget.h" -#include "ui/reportpropertiewidget.h" -#include "ui/titleblockpropertieswidget.h" -#include "ui/xrefpropertieswidget.h" +#include "../autoNum/numerotationcontext.h" +#include "../autoNum/ui/autonumberingmanagementw.h" +#include "../autoNum/ui/folioautonumbering.h" +#include "../autoNum/ui/formulaautonumberingw.h" +#include "../autoNum/ui/selectautonumw.h" +#include "../qeticons.h" +#include "../qetproject.h" +#include "../borderpropertieswidget.h" +#include "../conductorpropertieswidget.h" +#include "../diagramcontextwidget.h" +#include "../reportpropertiewidget.h" +#include "../titleblockpropertieswidget.h" +#include "../xrefpropertieswidget.h" //#include "ui_autonumberingmanagementw.h" diff --git a/sources/projectconfigpages.h b/sources/ui/configpage/projectconfigpages.h similarity index 100% rename from sources/projectconfigpages.h rename to sources/ui/configpage/projectconfigpages.h diff --git a/sources/ui/projectpropertiesdialog.cpp b/sources/ui/projectpropertiesdialog.cpp index b0cd2093d..5ee49b892 100644 --- a/sources/ui/projectpropertiesdialog.cpp +++ b/sources/ui/projectpropertiesdialog.cpp @@ -18,8 +18,8 @@ #include "projectpropertiesdialog.h" #include "../configdialog.h" -#include "../configpages.h" -#include "../projectconfigpages.h" +#include "configpage/configpages.h" +#include "configpage/projectconfigpages.h" #include