[qet] [4359] Run dxf converter as a external program

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


Revision: 4359
Author:   scorpio810
Date:     2016-02-28 15:50:14 +0100 (Sun, 28 Feb 2016)
Log Message:
-----------
Run dxf converter as a external program

Modified Paths:
--------------
    trunk/sources/editor/qetelementeditor.cpp
    trunk/sources/editor/qetelementeditor.h

Modified: trunk/sources/editor/qetelementeditor.cpp
===================================================================
--- trunk/sources/editor/qetelementeditor.cpp	2016-02-28 14:10:26 UTC (rev 4358)
+++ trunk/sources/editor/qetelementeditor.cpp	2016-02-28 14:50:14 UTC (rev 4359)
@@ -138,6 +138,7 @@
 	new_element       = new QAction(QET::Icons::DocumentNew,          tr("&Nouveau"),                                  this);
 	open              = new QAction(QET::Icons::DocumentOpen,         tr("&Ouvrir"),                                   this);
 	open_file         = new QAction(QET::Icons::DocumentOpen,         tr("&Ouvrir depuis un fichier"),                 this);
+	open_dxf          = new QAction(QET::Icons::DocumentOpen,         tr("&Ouvrir depuis un fichier dxf"),             this);
 	save              = new QAction(QET::Icons::DocumentSave,         tr("&Enregistrer"),                              this);
 	save_as           = new QAction(QET::Icons::DocumentSaveAs,       tr("Enregistrer sous"),                          this);
 	save_as_file      = new QAction(QET::Icons::DocumentSaveAs,       tr("Enregistrer dans un fichier"),               this);
@@ -189,6 +190,7 @@
 	
 	connect(new_element,     SIGNAL(triggered()), this,     SLOT(slot_new()));
 	connect(open,            SIGNAL(triggered()), this,     SLOT(slot_open()));
+	connect(open_dxf,       SIGNAL(triggered()), this,     SLOT(slot_openDxf()));
 	connect(open_file,       SIGNAL(triggered()), this,     SLOT(slot_openFile()));
 	connect(save,            SIGNAL(triggered()), this,     SLOT(slot_save()));
 	connect(save_as,         SIGNAL(triggered()), this,     SLOT(slot_saveAs()));
@@ -351,6 +353,7 @@
 	file_menu    -> addAction(new_element);
 	file_menu    -> addAction(open);
 	file_menu    -> addAction(open_file);
+	file_menu    -> addAction(open_dxf);
 	QMenu *recentfile = file_menu -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts"));
 	recentfile->addActions(QETApp::elementsRecentFiles()->menu()->actions());
 	connect(QETApp::elementsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), this, SLOT(openRecentFile(const QString &)));
@@ -1055,6 +1058,16 @@
 }
 
 /**
+ * @brief QETElementEditor::slot_openDxf
+ */
+void QETElementEditor::slot_openDxf (){
+QString program = (QDir::homePath() + "/.qet/DXFtoQET");
+QStringList arguments;
+QProcess *myProcess = new QProcess(qApp);
+myProcess->start(program, arguments);
+}
+
+/**
 	Ouvre un fichier element dans un nouvel editeur
 	Cette methode ne controle pas si le fichier est deja ouvert
 	@param filepath Fichier a ouvrir

Modified: trunk/sources/editor/qetelementeditor.h
===================================================================
--- trunk/sources/editor/qetelementeditor.h	2016-02-28 14:10:26 UTC (rev 4358)
+++ trunk/sources/editor/qetelementeditor.h	2016-02-28 14:50:14 UTC (rev 4359)
@@ -71,7 +71,7 @@
 	/// List of primitives
 	QListWidget *parts_list;
 	/// actions for the "file" menu
-	QAction *new_element, *open, *open_file, *save, *save_as, *save_as_file, *reload, *quit;
+	QAction *new_element, *open, *open_dxf, *open_file, *save, *save_as, *save_as_file, *reload, *quit;
 	/// actions for the "edit" menu
 	QAction *selectall, *deselectall, *inv_select;
 	QAction *cut, *copy, *paste, *paste_in_area, *paste_from_file, *paste_from_elmt;
@@ -135,6 +135,7 @@
 
 	void slot_new();
 	void slot_open();
+	void slot_openDxf();
 	void slot_openFile();
 	void openRecentFile(const QString &);
 	void openElement(const QString &);


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