[qet] qet/qet: [5201] Add message box for launching DXFtoQET plugin

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


Revision: 5201
Author:   scorpio810
Date:     2017-12-31 09:05:48 +0100 (Sun, 31 Dec 2017)
Log Message:
-----------
Add message box for launching DXFtoQET plugin

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

Modified: trunk/sources/editor/qetelementeditor.cpp
===================================================================
--- trunk/sources/editor/qetelementeditor.cpp	2017-12-31 00:57:12 UTC (rev 5200)
+++ trunk/sources/editor/qetelementeditor.cpp	2017-12-31 08:05:48 UTC (rev 5201)
@@ -57,6 +57,7 @@
 #include <QFileDialog>
 #include <QFile>
 #include <QModelIndex>
+#include <QStandardPaths>
 
 /*
 	Nombre maximum de primitives affichees par la "liste des parties"
@@ -1078,19 +1079,32 @@
  * @brief QETElementEditor::slot_openDxf
  */
 void QETElementEditor::slot_openDxf (){
+bool success;
+QProcess *process = new QProcess(qApp);
 
 #if defined(Q_OS_WIN32)
-QString program = (QDir::homePath() + "/Application Data/qet/DXFtoQET.exe");
+success = process->startDetached(QDir::homePath() + "/Application Data/qet/DXFtoQET.exe");
 #elif defined(Q_OS_MAC)
-QString program = (QDir::homePath() + "/.qet/DXFtoQET.app");
+success = process->startDetached(QDir::homePath() + "/.qet/DXFtoQET.app");
 #else
-QString program = (QDir::homePath() + "/.qet/DXFtoQET");
+success = process->startDetached(QDir::homePath() + "/.qet/DXFtoQET");
 #endif
-QStringList arguments;
-QProcess *DXF = new QProcess(qApp);
-DXF->start(program,arguments);
-
+if ( !success ) {
+QMessageBox::warning(nullptr,
+tr("Error launching DXFtoQET plugin"), 
+tr("To install the plugin DXFtoQET\nVisit https://download.tuxfamily.org/qet/builds/dxf_to_elmt/\n";
+					 "\n"
+					 ">> Install on Linux\n"
+					 "Put DXFtoQET binary on your /home/user_name/.qet/ directory\n"
+					 "make it executable : chmod +x ./DXFtoQET\n"
+					 ">> Install on Windows\n"
+					 "Put DXFtoQET.exe binary on C:\\Users\\user_name\\AppData\\Roaming\\qet\\ directory \n" 
+					 "\n"
+					 ">> Install on macOSX\n"
+					 "Put DXFtoQET.app binary on /Users/user_name/.qet/ directory \n"
+					  ));
 }
+}
 
 /**
 	Ouvre un fichier element dans un nouvel editeur

Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp	2017-12-31 00:57:12 UTC (rev 5200)
+++ trunk/sources/qetdiagrameditor.cpp	2017-12-31 08:05:48 UTC (rev 5201)
@@ -2211,7 +2211,7 @@
 #endif
 if ( !success ) {
 QMessageBox::warning(nullptr,
-tr("Error launching plugin"), 
+tr("Error launching qet_tb_generator plugin"), 
 tr("To install the plugin qet_tb_generator\nVisit https://pypi.python.org/pypi/qet-tb-generator/\n";
 					 "\n"
 					 "Requires python 3.5 or above.\n"


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