diff --git a/sources/nomenclature.cpp b/sources/nomenclature.cpp index 436c6ccdc..01db83828 100644 --- a/sources/nomenclature.cpp +++ b/sources/nomenclature.cpp @@ -1,5 +1,5 @@ /* - Copyright 2006-2013 The QElectroTech team + Copyright 2006-2013 The QElectroTech Team This file is part of QElectroTech. QElectroTech is free software: you can redistribute it and/or modify diff --git a/sources/nomenclature.h b/sources/nomenclature.h index 8601d92ee..dcc9931d9 100644 --- a/sources/nomenclature.h +++ b/sources/nomenclature.h @@ -1,5 +1,5 @@ /* - Copyright 2006-2013 The QElectroTech team + Copyright 2006-2013 The QElectroTech Team This file is part of QElectroTech. QElectroTech is free software: you can redistribute it and/or modify diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index 0d5350b49..b9d3185de 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -32,6 +32,9 @@ #include "qetmessagebox.h" #include "qetresult.h" #include "genericpanel.h" +#include "nomenclature.h" + +#include "ui/dialogconductorautonum.h" #include @@ -221,6 +224,8 @@ void QETDiagramEditor::actions() { prj_add_diagram = new QAction(QET::Icons::DiagramAdd, tr("Ajouter un sch\351ma"), this); prj_del_diagram = new QAction(QET::Icons::DiagramDelete, tr("Supprimer le sch\351ma"), this); prj_clean = new QAction(QET::Icons::EditClear, tr("Nettoyer le projet"), this); + prj_conductorANum = new QAction(QET::Icons::ConductorSettings, tr("Annoter les conducteurs (beta)"), this); + prj_nomenclature = new QAction(QET::Icons::DocumentExport, tr("Exporter une nomenclature (beta)"), this); zoom_in = new QAction(QET::Icons::ZoomIn, tr("Zoom avant"), this); zoom_out = new QAction(QET::Icons::ZoomOut, tr("Zoom arri\350re"), this); @@ -367,6 +372,8 @@ void QETDiagramEditor::actions() { connect(prj_add_diagram, SIGNAL(triggered()), this, SLOT(addDiagramToProject()) ); connect(prj_del_diagram, SIGNAL(triggered()), this, SLOT(removeDiagramFromProject()) ); connect(prj_clean, SIGNAL(triggered()), this, SLOT(cleanCurrentProject()) ); + connect(prj_conductorANum, SIGNAL(triggered()), this, SLOT(conductorAutoNumProject()) ); + connect(prj_nomenclature, SIGNAL(triggered()), this, SLOT(nomenclatureProject()) ); connect(zoom_in, SIGNAL(triggered()), this, SLOT(slot_zoomIn()) ); connect(zoom_out, SIGNAL(triggered()), this, SLOT(slot_zoomOut()) ); connect(zoom_content, SIGNAL(triggered()), this, SLOT(slot_zoomContent()) ); @@ -482,6 +489,9 @@ void QETDiagramEditor::menus() { menu_project -> addAction(prj_add_diagram); menu_project -> addAction(prj_del_diagram); menu_project -> addAction(prj_clean); + menu_project -> addSeparator(); + menu_project -> addAction(prj_conductorANum); + menu_project -> addAction(prj_nomenclature); main_bar -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la barre d'outils principale")); view_bar -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la barre d'outils Affichage")); @@ -807,7 +817,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti delete project; return(false); } - + // a ce stade, l'ouverture du fichier a reussi // on l'ajoute a la liste des fichiers recents QETApp::projectsRecentFiles() -> fileWasOpened(filepath); @@ -1123,6 +1133,8 @@ void QETDiagramEditor::slot_updateActions() { prj_add_diagram -> setEnabled(editable_project); prj_del_diagram -> setEnabled(editable_project); prj_clean -> setEnabled(editable_project); + prj_conductorANum -> setEnabled(editable_project); + prj_nomenclature -> setEnabled(editable_project); import_diagram -> setEnabled(editable_project); export_diagram -> setEnabled(opened_diagram); print -> setEnabled(opened_diagram); @@ -1141,6 +1153,12 @@ void QETDiagramEditor::slot_updateActions() { add_row -> setEnabled(editable_diagram); remove_row -> setEnabled(editable_diagram); + //display the beta feature only in debug mode +#ifdef QT_NO_DEBUG + prj_conductorANum -> setVisible(false); + prj_nomenclature -> setVisible(false); +#endif + // affiche les actions correspondant au diagram view en cours if (dv) { if (can_update_actions) { @@ -1692,6 +1710,29 @@ void QETDiagramEditor::cleanCurrentProject() { } } +/** + * @brief launch AutoNumConductor dialog + */ +void QETDiagramEditor::conductorAutoNumProject() { + //TODO: Test dialog autonum CYRIL F. + DialogConductorAutoNum *dg = new DialogConductorAutoNum(); + dg->setModal(true); + dg->exec(); + + delete dg; +} + +/** + * @brief export nomemclature of schema + */ +void QETDiagramEditor::nomenclatureProject() { + //TODO: Test nomenclature CYRIL F. + nomenclature *nomencl= new nomenclature(currentProject()->project() ,this); + nomencl->saveToCSVFile(); + + delete nomencl; +} + /** Supprime le schema courant du projet courant */ diff --git a/sources/qetdiagrameditor.h b/sources/qetdiagrameditor.h index 8ac97bb26..a6445ac6f 100644 --- a/sources/qetdiagrameditor.h +++ b/sources/qetdiagrameditor.h @@ -146,6 +146,8 @@ class QETDiagramEditor : public QETMainWindow { void moveDiagramUp(Diagram *); void moveDiagramDown(Diagram *); void cleanCurrentProject(); + void conductorAutoNumProject(); + void nomenclatureProject(); void diagramWasAdded(DiagramView *); void diagramIsAboutToBeRemoved(DiagramView *); void diagramWasRemoved(DiagramView *); @@ -202,6 +204,8 @@ class QETDiagramEditor : public QETMainWindow { QAction *prj_add_diagram; ///< Add a diagram to the current project. QAction *prj_del_diagram; ///< Delete a diagram from the current project QAction *prj_clean; ///< Clean the content of the curent project by removing useless items + QAction *prj_conductorANum; ///< Auto numerotation conductors + QAction *prj_nomenclature; ///< generate nomenclature QAction *zoom_in; ///< Zoom in QAction *zoom_out; ///< Zoom out QAction *zoom_fit; ///< Adjust zoom to fit the whole diagram, including potential elements outside its borders, in the view diff --git a/sources/ui/dialogconductorautonum.cpp b/sources/ui/dialogconductorautonum.cpp new file mode 100644 index 000000000..286449cf0 --- /dev/null +++ b/sources/ui/dialogconductorautonum.cpp @@ -0,0 +1,16 @@ +#include "dialogconductorautonum.h" +#include "ui_dialogconductorautonum.h" + +#include "conductorautonumerotation.h" + +DialogConductorAutoNum::DialogConductorAutoNum(QWidget *parent) : + QDialog(parent), + ui(new Ui::DialogConductorAutoNum) +{ + ui->setupUi(this); +} + +DialogConductorAutoNum::~DialogConductorAutoNum() +{ + delete ui; +} diff --git a/sources/ui/dialogconductorautonum.h b/sources/ui/dialogconductorautonum.h new file mode 100644 index 000000000..aa9b6d5da --- /dev/null +++ b/sources/ui/dialogconductorautonum.h @@ -0,0 +1,22 @@ +#ifndef DIALOGCONDUCTORAUTONUM_H +#define DIALOGCONDUCTORAUTONUM_H + +#include + +namespace Ui { + class DialogConductorAutoNum; +} + +class DialogConductorAutoNum : public QDialog +{ + Q_OBJECT + + public: + explicit DialogConductorAutoNum(QWidget *parent = 0); + ~DialogConductorAutoNum(); + + private: + Ui::DialogConductorAutoNum *ui; +}; + +#endif // DIALOGCONDUCTORAUTONUM_H diff --git a/sources/ui/dialogconductorautonum.ui b/sources/ui/dialogconductorautonum.ui new file mode 100644 index 000000000..4e8202261 --- /dev/null +++ b/sources/ui/dialogconductorautonum.ui @@ -0,0 +1,116 @@ + + + DialogConductorAutoNum + + + + 0 + 0 + 523 + 313 + + + + Annotation des conducteurs + + + + :/ico/oxygen-icons/32x32/apps/qelectrotech.png:/ico/oxygen-icons/32x32/apps/qelectrotech.png + + + + + + + + Sélection + + + + + + + + RadioButton + + + + + + + RadioButton + + + + + + + + + + + + Annotation + + + + + + + + CheckBox + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Annotation + + + + + + + Supprimer l'annotation + + + + + + + Fermer + + + + + + + + + + + +