[qet] [2104] (BETA) only available in debug mode: Add dialogconductorautonum and call to nomenclature

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2104
Author:   cfdev
Date:     2013-04-11 11:35:10 +0200 (Thu, 11 Apr 2013)
Log Message:
-----------
(BETA) only available in debug mode: Add dialogconductorautonum and call to nomenclature

Modified Paths:
--------------
    trunk/sources/nomenclature.cpp
    trunk/sources/nomenclature.h
    trunk/sources/qetdiagrameditor.cpp
    trunk/sources/qetdiagrameditor.h

Added Paths:
-----------
    trunk/sources/ui/dialogconductorautonum.cpp
    trunk/sources/ui/dialogconductorautonum.h
    trunk/sources/ui/dialogconductorautonum.ui

Modified: trunk/sources/nomenclature.cpp
===================================================================
--- trunk/sources/nomenclature.cpp	2013-04-11 07:51:15 UTC (rev 2103)
+++ trunk/sources/nomenclature.cpp	2013-04-11 09:35:10 UTC (rev 2104)
@@ -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

Modified: trunk/sources/nomenclature.h
===================================================================
--- trunk/sources/nomenclature.h	2013-04-11 07:51:15 UTC (rev 2103)
+++ trunk/sources/nomenclature.h	2013-04-11 09:35:10 UTC (rev 2104)
@@ -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

Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp	2013-04-11 07:51:15 UTC (rev 2103)
+++ trunk/sources/qetdiagrameditor.cpp	2013-04-11 09:35:10 UTC (rev 2104)
@@ -32,7 +32,10 @@
 #include "qetmessagebox.h"
 #include "qetresult.h"
 #include "genericpanel.h"
+#include "nomenclature.h"
 
+#include "ui/dialogconductorautonum.h"
+
 #include <QMessageBox>
 
 /**
@@ -221,6 +224,8 @@
 	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 @@
 	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 @@
 	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 @@
 		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 @@
 	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 @@
 	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) {
@@ -1693,6 +1711,29 @@
 }
 
 /**
+ * @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
 */
 void QETDiagramEditor::removeDiagramFromProject() {

Modified: trunk/sources/qetdiagrameditor.h
===================================================================
--- trunk/sources/qetdiagrameditor.h	2013-04-11 07:51:15 UTC (rev 2103)
+++ trunk/sources/qetdiagrameditor.h	2013-04-11 09:35:10 UTC (rev 2104)
@@ -146,6 +146,8 @@
 	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 @@
 	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

Added: trunk/sources/ui/dialogconductorautonum.cpp
===================================================================
--- trunk/sources/ui/dialogconductorautonum.cpp	                        (rev 0)
+++ trunk/sources/ui/dialogconductorautonum.cpp	2013-04-11 09:35:10 UTC (rev 2104)
@@ -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;
+}

Added: trunk/sources/ui/dialogconductorautonum.h
===================================================================
--- trunk/sources/ui/dialogconductorautonum.h	                        (rev 0)
+++ trunk/sources/ui/dialogconductorautonum.h	2013-04-11 09:35:10 UTC (rev 2104)
@@ -0,0 +1,22 @@
+#ifndef DIALOGCONDUCTORAUTONUM_H
+#define DIALOGCONDUCTORAUTONUM_H
+
+#include <QDialog>
+
+namespace Ui {
+	class DialogConductorAutoNum;
+}
+
+class DialogConductorAutoNum : public QDialog
+{
+	Q_OBJECT
+	
+	public:
+	explicit DialogConductorAutoNum(QWidget *parent = 0);
+	~DialogConductorAutoNum();
+	
+	private:
+	Ui::DialogConductorAutoNum *ui;
+};
+
+#endif // DIALOGCONDUCTORAUTONUM_H

Added: trunk/sources/ui/dialogconductorautonum.ui
===================================================================
--- trunk/sources/ui/dialogconductorautonum.ui	                        (rev 0)
+++ trunk/sources/ui/dialogconductorautonum.ui	2013-04-11 09:35:10 UTC (rev 2104)
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>DialogConductorAutoNum</class>
+ <widget class="QDialog" name="DialogConductorAutoNum">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>523</width>
+    <height>313</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Annotation des conducteurs</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="../../qelectrotech.qrc">
+    <normaloff>:/ico/oxygen-icons/32x32/apps/qelectrotech.png</normaloff>:/ico/oxygen-icons/32x32/apps/qelectrotech.png</iconset>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <layout class="QVBoxLayout" name="verticalLayout">
+     <item>
+      <widget class="QGroupBox" name="groupBox_Selection">
+       <property name="title">
+        <string>Sélection</string>
+       </property>
+       <layout class="QVBoxLayout" name="verticalLayout_4">
+        <item>
+         <layout class="QVBoxLayout" name="verticalLayout_3">
+          <item>
+           <widget class="QRadioButton" name="radioButton">
+            <property name="text">
+             <string>RadioButton</string>
+            </property>
+           </widget>
+          </item>
+          <item>
+           <widget class="QRadioButton" name="radioButton_2">
+            <property name="text">
+             <string>RadioButton</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+     </item>
+     <item>
+      <widget class="QGroupBox" name="groupBox_Annotation">
+       <property name="title">
+        <string>Annotation</string>
+       </property>
+       <layout class="QVBoxLayout" name="verticalLayout_6">
+        <item>
+         <layout class="QVBoxLayout" name="verticalLayout_5">
+          <item>
+           <widget class="QCheckBox" name="checkBox">
+            <property name="text">
+             <string>CheckBox</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QPushButton" name="pushButton_annotation">
+       <property name="text">
+        <string>Annotation</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushButton_delete">
+       <property name="text">
+        <string>Supprimer l'annotation</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="pushButton_close">
+       <property name="text">
+        <string>Fermer</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="../../qelectrotech.qrc"/>
+ </resources>
+ <connections/>
+</ui>


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/