mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
Improve : Try to launch qet_tb_generator portable version of the plugin
if user put binary on QDir::homePath()
This commit is contained in:
@@ -2239,8 +2239,28 @@ void QETDiagramEditor::generateTerminalBlock()
|
|||||||
// If launched under control:
|
// If launched under control:
|
||||||
//connect(process, SIGNAL(errorOcurred(int error)), this, SLOT(slot_generateTerminalBlock_error()));
|
//connect(process, SIGNAL(errorOcurred(int error)), this, SLOT(slot_generateTerminalBlock_error()));
|
||||||
//process->start("qet_tb_generator");
|
//process->start("qet_tb_generator");
|
||||||
|
|
||||||
#ifdef Q_OS_MACOS
|
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
|
||||||
|
if (openedProjects().count()){
|
||||||
|
success = process->startDetached("qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
success = process->startDetached("qet_tb_generator");
|
||||||
|
}
|
||||||
|
if (openedProjects().count()){
|
||||||
|
success = process->startDetached(QDir::homePath() + "/Application Data/qet/qet_tb_generator.exe", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
success = process->startDetached(QDir::homePath() + "/Application Data/qet/qet_tb_generator.exe");
|
||||||
|
}
|
||||||
|
if (openedProjects().count()){
|
||||||
|
success = process->startDetached(QDir::homePath() + "/qet_tb_generator.exe", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
success = process->startDetached(QDir::homePath() + "/qet_tb_generator.exe");
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif Q_OS_MACOS
|
||||||
if (openedProjects().count()){
|
if (openedProjects().count()){
|
||||||
success = process->startDetached("/Library/Frameworks/Python.framework/Versions/3.8/bin/qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
success = process->startDetached("/Library/Frameworks/Python.framework/Versions/3.8/bin/qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
||||||
}
|
}
|
||||||
@@ -2253,6 +2273,7 @@ void QETDiagramEditor::generateTerminalBlock()
|
|||||||
else {
|
else {
|
||||||
success = process->startDetached(QDir::homePath() + "/.qet/qet_tb_generator.app");
|
success = process->startDetached(QDir::homePath() + "/.qet/qet_tb_generator.app");
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
if (openedProjects().count()){
|
if (openedProjects().count()){
|
||||||
success = process->startDetached("qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
success = process->startDetached("qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
||||||
@@ -2269,22 +2290,6 @@ void QETDiagramEditor::generateTerminalBlock()
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
|
|
||||||
if (openedProjects().count()){
|
|
||||||
success = process->startDetached("qet_tb_generator", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
success = process->startDetached("qet_tb_generator");
|
|
||||||
}
|
|
||||||
if (openedProjects().count()){
|
|
||||||
success = process->startDetached(QDir::homePath() + "/Application Data/qet/qet_tb_generator.exe", {(QETDiagramEditor::currentProjectView()->project()->filePath())});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
success = process->startDetached(QDir::homePath() + "/Application Data/qet/qet_tb_generator.exe");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
if ( !success ) {
|
if ( !success ) {
|
||||||
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
|
#if defined(Q_OS_WIN32) || defined(Q_OS_WIN64)
|
||||||
QMessageBox::warning(nullptr,
|
QMessageBox::warning(nullptr,
|
||||||
|
|||||||
Reference in New Issue
Block a user