diff --git a/sources/editor/qetelementeditor.cpp b/sources/editor/qetelementeditor.cpp index d8e273d03..89edc2309 100644 --- a/sources/editor/qetelementeditor.cpp +++ b/sources/editor/qetelementeditor.cpp @@ -138,6 +138,7 @@ void QETElementEditor::setupActions() { 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 @@ void QETElementEditor::setupActions() { 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 @@ void QETElementEditor::setupMenus() { 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 &))); @@ -1054,6 +1057,16 @@ void QETElementEditor::openRecentFile(const QString &filepath) { openElement(filepath); } +/** + * @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 diff --git a/sources/editor/qetelementeditor.h b/sources/editor/qetelementeditor.h index 7bd4ff03a..085ebdfc0 100644 --- a/sources/editor/qetelementeditor.h +++ b/sources/editor/qetelementeditor.h @@ -71,7 +71,7 @@ class QETElementEditor : public QETMainWindow { /// 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 @@ class QETElementEditor : public QETMainWindow { void slot_new(); void slot_open(); + void slot_openDxf(); void slot_openFile(); void openRecentFile(const QString &); void openElement(const QString &);