[qet] qet/qet: [5388] Improve qet_tb_generator : add the full path of the current project as

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


Revision: 5388
Author:   scorpio810
Date:     2018-06-07 15:48:12 +0200 (Thu, 07 Jun 2018)
Log Message:
-----------
Improve qet_tb_generator : add the full path of the current project as
an argument when calling the plug-in from QET if a project is open. 
If not a file dialog is showed to select the QET project.

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

Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp	2018-06-07 12:22:09 UTC (rev 5387)
+++ trunk/sources/qetdiagrameditor.cpp	2018-06-07 13:48:12 UTC (rev 5388)
@@ -1358,7 +1358,7 @@
 	save_file        -> setEnabled(opened_project);
 	save_file_as     -> setEnabled(opened_project);
 	prj_edit_prop    -> setEnabled(opened_project);
-	prj_terminalBloc -> setEnabled(opened_project);
+	//prj_terminalBloc -> setEnabled(opened_project);
 	prj_add_diagram  -> setEnabled(editable_project);
 	prj_del_diagram  -> setEnabled(editable_project);
 	prj_clean        -> setEnabled(editable_project);
@@ -2225,9 +2225,20 @@
 //process->start("qet_tb_generator");
 
 #ifdef Q_OS_MAC
+if (openedProjects().count()){
 success = process->startDetached("/Library/Frameworks/Python.framework/Versions/3.5/bin/qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
+}
+else  {
+success = process->startDetached("/Library/Frameworks/Python.framework/Versions/3.5/bin/qet_tb_generator");
+}
 #else
+if (openedProjects().count()){
 success = process->startDetached("qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
+}
+else  {
+success = process->startDetached("qet_tb_generator");
+}
+
 #endif
 if ( !success ) {
 QMessageBox::warning(nullptr,


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