Run dxf converter as a external program

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4359 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810
2016-02-28 14:50:14 +00:00
parent bb840a3aa9
commit 78720fb2b4
2 changed files with 15 additions and 1 deletions

View File

@@ -138,6 +138,7 @@ void QETElementEditor::setupActions() {
new_element = new QAction(QET::Icons::DocumentNew, tr("&Nouveau"), this); new_element = new QAction(QET::Icons::DocumentNew, tr("&Nouveau"), this);
open = new QAction(QET::Icons::DocumentOpen, tr("&Ouvrir"), this); open = new QAction(QET::Icons::DocumentOpen, tr("&Ouvrir"), this);
open_file = new QAction(QET::Icons::DocumentOpen, tr("&Ouvrir depuis un fichier"), 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 = new QAction(QET::Icons::DocumentSave, tr("&Enregistrer"), this);
save_as = new QAction(QET::Icons::DocumentSaveAs, tr("Enregistrer sous"), 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); 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(new_element, SIGNAL(triggered()), this, SLOT(slot_new()));
connect(open, SIGNAL(triggered()), this, SLOT(slot_open())); 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(open_file, SIGNAL(triggered()), this, SLOT(slot_openFile()));
connect(save, SIGNAL(triggered()), this, SLOT(slot_save())); connect(save, SIGNAL(triggered()), this, SLOT(slot_save()));
connect(save_as, SIGNAL(triggered()), this, SLOT(slot_saveAs())); connect(save_as, SIGNAL(triggered()), this, SLOT(slot_saveAs()));
@@ -351,6 +353,7 @@ void QETElementEditor::setupMenus() {
file_menu -> addAction(new_element); file_menu -> addAction(new_element);
file_menu -> addAction(open); file_menu -> addAction(open);
file_menu -> addAction(open_file); file_menu -> addAction(open_file);
file_menu -> addAction(open_dxf);
QMenu *recentfile = file_menu -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts")); QMenu *recentfile = file_menu -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts"));
recentfile->addActions(QETApp::elementsRecentFiles()->menu()->actions()); recentfile->addActions(QETApp::elementsRecentFiles()->menu()->actions());
connect(QETApp::elementsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), this, SLOT(openRecentFile(const QString &))); connect(QETApp::elementsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), this, SLOT(openRecentFile(const QString &)));
@@ -1054,6 +1057,16 @@ void QETElementEditor::openRecentFile(const QString &filepath) {
openElement(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 Ouvre un fichier element dans un nouvel editeur
Cette methode ne controle pas si le fichier est deja ouvert Cette methode ne controle pas si le fichier est deja ouvert

View File

@@ -71,7 +71,7 @@ class QETElementEditor : public QETMainWindow {
/// List of primitives /// List of primitives
QListWidget *parts_list; QListWidget *parts_list;
/// actions for the "file" menu /// 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 /// actions for the "edit" menu
QAction *selectall, *deselectall, *inv_select; QAction *selectall, *deselectall, *inv_select;
QAction *cut, *copy, *paste, *paste_in_area, *paste_from_file, *paste_from_elmt; 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_new();
void slot_open(); void slot_open();
void slot_openDxf();
void slot_openFile(); void slot_openFile();
void openRecentFile(const QString &); void openRecentFile(const QString &);
void openElement(const QString &); void openElement(const QString &);