| 1 |
/*************************************************************************** |
| 2 |
* Copyright (c) 2002 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 |
|
| 24 |
#ifndef GUI_DIALOG_DLGMACROEXECUTEIMP_H |
| 25 |
#define GUI_DIALOG_DLGMACROEXECUTEIMP_H |
| 26 |
|
| 27 |
#include <QDialog> |
| 28 |
#include <memory> |
| 29 |
#include "PythonTracing.h" |
| 30 |
#include "Window.h" |
| 31 |
|
| 32 |
class QTreeWidgetItem; |
| 33 |
|
| 34 |
namespace Gui |
| 35 |
{ |
| 36 |
namespace Dialog |
| 37 |
{ |
| 38 |
class Ui_DlgMacroExecute; |
| 39 |
|
| 40 |
/** |
| 41 |
* The DlgMacroExecuteImp class implements a dialog to execute or edit a |
| 42 |
* recorded macro. |
| 43 |
* \author Jürgen Riegel |
| 44 |
*/ |
| 45 |
class DlgMacroExecuteImp: public QDialog, public Gui::WindowParameter |
| 46 |
{ |
| 47 |
Q_OBJECT |
| 48 |
|
| 49 |
public: |
| 50 |
explicit DlgMacroExecuteImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); |
| 51 |
~DlgMacroExecuteImp() override; |
| 52 |
|
| 53 |
void accept() override; |
| 54 |
|
| 55 |
private: |
| 56 |
void setupConnections(); |
| 57 |
void onFileChooserFileNameChanged(const QString&); |
| 58 |
void onCreateButtonClicked(); |
| 59 |
void onDeleteButtonClicked(); |
| 60 |
void onEditButtonClicked(); |
| 61 |
void onRenameButtonClicked(); |
| 62 |
void onDuplicateButtonClicked(); |
| 63 |
void onToolbarButtonClicked(); |
| 64 |
void onAddonsButtonClicked(); |
| 65 |
void onFolderButtonClicked(); |
| 66 |
|
| 67 |
void onUserMacroListBoxCurrentItemChanged(QTreeWidgetItem*); |
| 68 |
void onSystemMacroListBoxCurrentItemChanged(QTreeWidgetItem*); |
| 69 |
void onTabMacroWidgetCurrentChanged(int index); |
| 70 |
void onLineEditFindTextChanged(const QString&); |
| 71 |
void onLineEditFindInFilesTextChanged(const QString&); |
| 72 |
|
| 73 |
protected: |
| 74 |
void fillUpList(); |
| 75 |
void fillUpListForDir(const QString& dirPath, bool systemWide); |
| 76 |
QStringList filterFiles(const QString&); |
| 77 |
|
| 78 |
protected: |
| 79 |
QString macroPath; |
| 80 |
|
| 81 |
private: |
| 82 |
std::unique_ptr<PythonTracingWatcher> watcher; |
| 83 |
std::unique_ptr<Ui_DlgMacroExecute> ui; |
| 84 |
}; |
| 85 |
|
| 86 |
} // namespace Dialog |
| 87 |
} // namespace Gui |
| 88 |
|
| 89 |
#endif // GUI_DIALOG_DLGMACROEXECUTEIMP_H |