Debian Codegraph @

src/Gui/Dialogs/DlgRunExternal.h

raw
1 /***************************************************************************
2 * Copyright (c) 2009 Jürgen Riegel <[email protected]> *
3 * *
4 * This file is part of the FreeCAD CAx development system. *
5 * *
6 * This library is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Library General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2 of the License, or (at your option) any later version. *
10 * *
11 * This library is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU Library General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Library General Public *
17 * License along with this library; see the file COPYING.LIB. If not, *
18 * write to the Free Software Foundation, Inc., 59 Temple Place, *
19 * Suite 330, Boston, MA 02111-1307, USA *
20 * *
21 ***************************************************************************/
22
23 #ifndef GUI_DIALOG_DlgRunExternal_H
24 #define GUI_DIALOG_DlgRunExternal_H
25
26 #include <memory>
27 #include <QDialog>
28 #include <QProcess>
29 #include <FCGlobal.h>
30
31 namespace Gui
32 {
33 namespace Dialog
34 {
35 class Ui_DlgRunExternal;
36
37 /**
38 * The DlgRunExternal class implements a dialog to start and control external
39 * programs to edit FreeCAD controlled content.
40 * \author Jürgen Riegel
41 */
42 class GuiExport DlgRunExternal: public QDialog
43 {
44 Q_OBJECT
45
46 public:
47 explicit DlgRunExternal(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
48 ~DlgRunExternal() override;
49
50 void addArgument(const QString&);
51 int runProcess();
52
53 protected Q_SLOTS:
54 void reject() override;
55 void accept() override;
56 virtual void abort();
57 virtual void advanced();
58 void finished(int exitCode, QProcess::ExitStatus exitStatus);
59 void onChooseProgramClicked();
60
61 private:
62 QString ProcName;
63 QStringList arguments;
64 QProcess process;
65 bool advancedHidden;
66 std::unique_ptr<Ui_DlgRunExternal> ui;
67 };
68
69 } // namespace Dialog
70 } // namespace Gui
71
72 #endif // GUI_DIALOG_DlgRunExternal_H