diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index 77286b850..27560a43c 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -34,7 +34,7 @@ #include "genericpanel.h" #include "nomenclature.h" -#include "ui/dialogconductorautonum.h" +#include "ui/dialogautonum.h" #include @@ -224,8 +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); + prj_diagramNum = new QAction(QET::Icons::ConductorSettings, tr("Annoter les sch\351mas (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); @@ -372,7 +372,7 @@ 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_diagramNum, SIGNAL(triggered()), this, SLOT(diagramNumProject()) ); 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()) ); @@ -490,7 +490,7 @@ void QETDiagramEditor::menus() { menu_project -> addAction(prj_del_diagram); menu_project -> addAction(prj_clean); menu_project -> addSeparator(); - menu_project -> addAction(prj_conductorANum); + menu_project -> addAction(prj_diagramNum); menu_project -> addAction(prj_nomenclature); main_bar -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la barre d'outils principale")); @@ -1131,7 +1131,7 @@ 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_diagramNum -> setEnabled(editable_project); prj_nomenclature -> setEnabled(editable_project); import_diagram -> setEnabled(editable_project); export_diagram -> setEnabled(opened_diagram); @@ -1153,7 +1153,7 @@ void QETDiagramEditor::slot_updateActions() { //display the beta feature only in debug mode #ifdef QT_NO_DEBUG - prj_conductorANum -> setVisible(false); + prj_diagramNum -> setVisible(false); prj_nomenclature -> setVisible(false); #endif @@ -1709,10 +1709,10 @@ void QETDiagramEditor::cleanCurrentProject() { } /** - * @brief launch AutoNumConductor dialog + * @brief launch dialog for numerate diagram */ -void QETDiagramEditor::conductorAutoNumProject() { - DialogConductorAutoNum *dg = new DialogConductorAutoNum(currentDiagram()->diagram(), this); +void QETDiagramEditor::diagramNumProject() { + DialogAutoNum *dg = new DialogAutoNum(currentDiagram()->diagram(), this); dg->setModal(true); dg->exec(); diff --git a/sources/qetdiagrameditor.h b/sources/qetdiagrameditor.h index a6445ac6f..5a31fd2ed 100644 --- a/sources/qetdiagrameditor.h +++ b/sources/qetdiagrameditor.h @@ -146,7 +146,7 @@ class QETDiagramEditor : public QETMainWindow { void moveDiagramUp(Diagram *); void moveDiagramDown(Diagram *); void cleanCurrentProject(); - void conductorAutoNumProject(); + void diagramNumProject(); void nomenclatureProject(); void diagramWasAdded(DiagramView *); void diagramIsAboutToBeRemoved(DiagramView *); @@ -204,7 +204,7 @@ 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_diagramNum; ///< Numerotation des schemas QAction *prj_nomenclature; ///< generate nomenclature QAction *zoom_in; ///< Zoom in QAction *zoom_out; ///< Zoom out diff --git a/sources/ui/dialogconductorautonum.cpp b/sources/ui/dialogautonum.cpp similarity index 64% rename from sources/ui/dialogconductorautonum.cpp rename to sources/ui/dialogautonum.cpp index 1aef1fba4..a2a9e67a0 100644 --- a/sources/ui/dialogconductorautonum.cpp +++ b/sources/ui/dialogautonum.cpp @@ -15,43 +15,48 @@ You should have received a copy of the GNU General Public License along with QElectroTech. If not, see . */ -#include "dialogconductorautonum.h" -#include "ui_dialogconductorautonum.h" +#include "dialogautonum.h" +#include "ui_dialogautonum.h" #include "conductorautonumerotation.h" #include "qetmessagebox.h" - -DialogConductorAutoNum::DialogConductorAutoNum(Diagram *dg, QWidget *parent) : +/** + * @brief DialogAutoNum::DialogAutoNum + * @param dg + * @param parent + */ +DialogAutoNum::DialogAutoNum(Diagram *dg, QWidget *parent) : QDialog(parent), - ui(new Ui::DialogConductorAutoNum) + ui(new Ui::DialogAutoNum) { ui -> setupUi(this); dg_ = dg; // create widget of diagram selection - dgselect_ = new diagramselection( dg_ ->project(), this ); + dgselect_ = new diagramselection( dg_ -> project(), this ); ui -> verticalLayout_Selection -> addWidget( dgselect_ ); } -DialogConductorAutoNum::~DialogConductorAutoNum() -{ +/** + * @brief Destructor + */ +DialogAutoNum::~DialogAutoNum(){ delete ui; } - /** - * @brief DialogConductorAutoNum::on_pushButton_delete_clicked + * @brief DialogAutoNum::on_pushButton_delete_clicked */ -void DialogConductorAutoNum::on_pushButton_delete_clicked() { +void DialogAutoNum::on_pushButton_delete_clicked() { // get list of diagrams selected - QListlistDiag = dgselect_ ->list_of_DiagramSelected(); + QListlistDiag = dgselect_ -> list_of_DiagramSelected(); if(listDiag.count()<=0) return; QString diagramsTitle; for(int i=0; ititle(); - if(i+1 title(); + if(i+1 < listDiag.count()) diagramsTitle += ", "; } // Ask if user is sure to delete the conductor numerotation QMessageBox::StandardButton answer = QET::MessageBox::critical( @@ -73,25 +78,18 @@ void DialogConductorAutoNum::on_pushButton_delete_clicked() { } } -/** - * @brief Close the dialog - */ -void DialogConductorAutoNum::on_pushButton_close_clicked() { - close(); -} - /** * @brief set the autonum to all diagram selected */ -void DialogConductorAutoNum::on_pushButton_annotation_clicked(){ +void DialogAutoNum::on_pushButton_annotation_clicked(){ // Get list of diagrams selected - QListlistDiag = dgselect_ ->list_of_DiagramSelected(); + QListlistDiag = dgselect_ -> list_of_DiagramSelected(); if(listDiag.count()<=0) return; QString diagramsTitle; for(int i=0; ititle(); - if(i+1 title(); + if(i+1 < listDiag.count()) diagramsTitle += ", "; } // Ask if user is sure to numerate the conductor QMessageBox::StandardButton answer = QET::MessageBox::warning( @@ -106,15 +104,25 @@ void DialogConductorAutoNum::on_pushButton_annotation_clicked(){ // if yes numerate all if( answer == QMessageBox::Yes) { - NumerotationContext num; - for(int i=0; isetNumerotation(Diagram::Conductors, num); - qDebug() << "ok"; - } } } +/** + * @brief Close the dialog + */ +void DialogAutoNum::on_pushButton_close_clicked() { + close(); +} + +/* + NumerotationContext num; + for(int i=0; isetNumerotation(Diagram::Conductors, num); + qDebug() << "ok"; + } +*/ + diff --git a/sources/ui/dialogconductorautonum.h b/sources/ui/dialogautonum.h similarity index 74% rename from sources/ui/dialogconductorautonum.h rename to sources/ui/dialogautonum.h index fe9613874..d1c4e9112 100644 --- a/sources/ui/dialogconductorautonum.h +++ b/sources/ui/dialogautonum.h @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with QElectroTech. If not, see . */ -#ifndef DIALOGCONDUCTORAUTONUM_H -#define DIALOGCONDUCTORAUTONUM_H +#ifndef DIALOGAUTONUM_H +#define DIALOGAUTONUM_H #include @@ -24,16 +24,16 @@ #include "ui/diagramselection.h" namespace Ui { - class DialogConductorAutoNum; + class DialogAutoNum; } -class DialogConductorAutoNum : public QDialog +class DialogAutoNum : public QDialog { Q_OBJECT public: - explicit DialogConductorAutoNum(Diagram *dg, QWidget *parent = 0); - ~DialogConductorAutoNum(); + explicit DialogAutoNum(Diagram *dg, QWidget *parent = 0); + ~DialogAutoNum(); private slots: void on_pushButton_annotation_clicked(); @@ -41,10 +41,10 @@ class DialogConductorAutoNum : public QDialog void on_pushButton_close_clicked(); private: - Ui::DialogConductorAutoNum *ui; + Ui::DialogAutoNum *ui; Diagram *dg_; diagramselection *dgselect_; }; -#endif // DIALOGCONDUCTORAUTONUM_H +#endif // DialogAutoNum_H diff --git a/sources/ui/dialogautonum.ui b/sources/ui/dialogautonum.ui new file mode 100644 index 000000000..cbc37783e --- /dev/null +++ b/sources/ui/dialogautonum.ui @@ -0,0 +1,165 @@ + + + DialogAutoNum + + + + 0 + 0 + 482 + 416 + + + + Annotation des schémas + + + + :/ico/oxygen-icons/32x32/apps/qelectrotech.png:/ico/oxygen-icons/32x32/apps/qelectrotech.png + + + + + + 0 + + + + Configuration + + + + + + + + + + Annotation + + + + + + + + Sélection + + + + + + + + Conducteurs + + + + :/ico/22x22/conductor2.png:/ico/22x22/conductor2.png + + + true + + + + + + + false + + + Composants + + + + :/ico/22x22/single_page.png:/ico/22x22/single_page.png + + + + + + + + + + + + + + + + + Annotation + + + + :/ico/16x16/edit-select-all.png:/ico/16x16/edit-select-all.png + + + + + + + Supprimer l'annotation + + + + :/ico/16x16/edit-delete.png:/ico/16x16/edit-delete.png + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Fermer + + + true + + + + + + + + + + + + diff --git a/sources/ui/dialogconductorautonum.ui b/sources/ui/dialogconductorautonum.ui deleted file mode 100644 index 3d31722dc..000000000 --- a/sources/ui/dialogconductorautonum.ui +++ /dev/null @@ -1,127 +0,0 @@ - - - DialogConductorAutoNum - - - - 0 - 0 - 482 - 382 - - - - Annotation des conducteurs - - - - :/ico/oxygen-icons/32x32/apps/qelectrotech.png:/ico/oxygen-icons/32x32/apps/qelectrotech.png - - - - - - - - Sélection - - - - - - - - - - - - Annotation - - - - - - - - - - - - - Format : - - - - - - - - :/ico/16x16/configure.png:/ico/16x16/configure.png - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Annotation - - - - :/ico/16x16/edit-select-all.png:/ico/16x16/edit-select-all.png - - - - - - - Supprimer l'annotation - - - - :/ico/16x16/edit-delete.png:/ico/16x16/edit-delete.png - - - - - - - Fermer - - - true - - - - - - - - - - - -