diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -297,6 +297,7 @@ prj_clean = new QAction(QET::Icons::EditClear, tr("Nettoyer le projet"), this); prj_diagramList = new QAction(QET::Icons::listDrawings, tr("Ajouter un sommaire"), this); prj_nomenclature = new QAction(QET::Icons::DocumentSpreadsheet, tr("Exporter une nomenclature"), this); + prj_terminalBloc = new QAction(QET::Icons::DocumentSpreadsheet, tr("Installer plugin bornier"), this); tabbed_view_mode = new QAction( tr("en utilisant des onglets"), this); windowed_view_mode= new QAction( tr("en utilisant des fenĂȘtres"), this); mode_selection = new QAction(QET::Icons::PartSelect, tr("Mode Selection"), this); @@ -497,6 +498,7 @@ connect(prj_clean, SIGNAL(triggered()), this, SLOT(cleanCurrentProject()) ); connect(prj_diagramList, SIGNAL(triggered()), this, SLOT(addDiagramFolioListToProject())); connect(prj_nomenclature, SIGNAL(triggered()), this, SLOT(nomenclatureProject()) ); + connect(prj_terminalBloc, SIGNAL(triggered()), this, SLOT(slot_generateTerminalBlock())); connect(print, SIGNAL(triggered()), this, SLOT(printDialog()) ); connect(export_diagram, SIGNAL(triggered()), this, SLOT(exportDialog()) ); connect(tile_window, SIGNAL(triggered()), &workspace, SLOT(tileSubWindows()) ); @@ -613,6 +615,7 @@ menu_project -> addSeparator(); menu_project -> addAction(prj_diagramList); menu_project -> addAction(prj_nomenclature); + menu_project -> addAction(prj_terminalBloc); 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")); @@ -2137,3 +2140,22 @@ save_file -> setEnabled(true); } } + + +/** + * @brief QETDiagramEditor::slot_generateTerminalBlock + */ +void QETDiagramEditor::slot_generateTerminalBlock(){ + +QString path,program; +QStringList args; +path=(QDir("/bin/bash").absolutePath()); +program="gksudo"; +args << "pip3 install --upgrade qet_tb_generator"; +QProcess *process = new QProcess(qApp); +process->start(program,args); +process->waitForFinished(); +} + + + diff --git a/sources/qetdiagrameditor.h b/sources/qetdiagrameditor.h --- a/sources/qetdiagrameditor.h +++ b/sources/qetdiagrameditor.h @@ -117,6 +117,7 @@ void editSelectionProperties(); void slot_resetConductors(); void slot_autoConductor(bool ac); + void slot_generateTerminalBlock(); void setWindowedMode(); void setTabbedMode(); void readSettings(); @@ -187,6 +188,7 @@ QAction *prj_clean; ///< Clean the content of the curent project by removing useless items QAction *prj_diagramList; ///< Sommaire des schemas QAction *prj_nomenclature; ///< generate nomenclature + QAction *prj_terminalBloc; ///< generate terminal block QAction *tile_window; ///< Show MDI subwindows as tile QAction *cascade_window; ///< Show MDI subwindows as cascade QAction *prev_window; ///< Switch to the previous document