itom  4.1.0
dialogOpenFileWithFilter.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef DIALOGOPENFILEWITHFILTER_H
24 #define DIALOGOPENFILEWITHFILTER_H
25 
26 #include "../global.h"
27 
28 #include "../../common/addInInterface.h"
29 #include "abstractFilterDialog.h"
30 #include <qfuture.h>
31 #include <qevent.h>
32 
33 #include "paramInputParser.h"
34 
35 #include "ui_dialogOpenFileWithFilter.h"
36 
37 namespace ito {
38 
40 {
41  Q_OBJECT
42 
43 public:
44  enum CheckVarname { CheckNo, CheckGlobalWorkspace, CheckLocalWorkspace };
46  DialogOpenFileWithFilter(const QString &filename, const ito::AddInAlgo::FilterDef *filter, QVector<ito::ParamBase> &autoMand, QVector<ito::ParamBase> &autoOut, QVector<ito::Param> &userMand, QVector<ito::Param> &userOpt, ito::RetVal &retValue, CheckVarname varnameCheck = CheckNo, QWidget *parent = NULL);
47  ~DialogOpenFileWithFilter() { delete m_previewMovie; }
48 
49  QString getPythonVariable() const { return ui.txtPythonVariable->text(); }
50 
51 protected:
52 
53  void closeEvent(QCloseEvent *e);
54 
55  ParamInputParser *m_pMandParser;
56  ParamInputParser *m_pOptParser;
57  QString m_filename;
58  const ito::AddInAlgo::FilterDef *m_filter;
59  bool m_filterExecuted;
60 
61  ito::RetVal executeFilter();
62 
63  QFuture<ito::RetVal> filterCall;
64  QFutureWatcher<ito::RetVal> filterCallWatcher;
65 
66 private:
67 
68  Ui::DialogOpenFileWithFilter ui;
69  QMovie *m_previewMovie;
70  bool m_acceptedClicked;
71  CheckVarname m_checkVarname;
72 
73  QVector<ito::ParamBase> m_paramsMand;
74  QVector<ito::ParamBase> m_paramsOpt;
75 
76 private slots:
77  void on_buttonBox_accepted();
78  void on_tabWidget_currentChanged(int index);
79  void on_cmdReload_clicked();
80 
81  void filterCallFinished();
82 
83 };
84 
85 } //end namespace ito
86 
87 #endif
Class for managing status values (like errors or warning)
Definition: retVal.h:54
Definition: apiFunctionsGraph.cpp:39
Definition: dialogOpenFileWithFilter.h:39
Definition: abstractFilterDialog.h:33
Definition: paramInputParser.h:38
container for publishing filters provided by any plugin
Definition: addInInterface.h:973