itom  4.1.0
AIManagerWidget.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 ADDINMANAGERWIDGET_H
24 #define ADDINMANAGERWIDGET_H
25 
26 #include "../organizer/uiOrganizer.h"
27 #include "../../common/addInInterface.h"
28 #include "abstractDockWidget.h"
29 #include "../ui/helpTreeDockWidget.h"
30 
31 #include <qdockwidget.h>
32 #include <qtreeview.h>
33 #include <qmenu.h>
34 #include <qaction.h>
35 #include <qsortfilterproxymodel.h>
36 
37 namespace ito
38 {
39  class PlugInModel; //forward declaration
40 
42  {
43  Q_OBJECT
44 
45  Q_PROPERTY(QColor backgroundColorInstancesWithPythonRef READ backgroundColorInstancesWithPythonRef WRITE setBackgroundColorInstancesWithPythonRef)
46 
47  public:
48 // AIManagerWidget();
49  AIManagerWidget(const QString &title, const QString &objName, QWidget *parent = NULL, bool docked = true, bool isDockAvailable = true, tFloatingStyle floatingStyle = floatingNone, tMovingStyle movingStyle = movingEnabled);
51 
53  QColor backgroundColorInstancesWithPythonRef() const;
54  void setBackgroundColorInstancesWithPythonRef(const QColor &bgColor);
55 
56  protected:
57 // QList<QAction*> getAlgoWidgetActions(const ito::AddInInterfaceBase *aib);
58  // void closeEvent(QCloseEvent *event) {};
59  QMenu* m_pContextMenu;
60  QMenu* m_pAIManagerViewSettingMenu;
61 
62  QToolBar* m_pMainToolbar;
63 
64  QAction *m_pShowConfDialog;
65  QAction *m_pActDockWidget;
66  QAction *m_pActDockWidgetToolbar;
67  QAction *m_pActNewInstance;
68  QAction *m_pActCloseInstance;
69  QAction *m_pActCloseAllInstances;
70  QAction *m_pActSendToPython;
71  QAction *m_pActLiveImage;
72  QAction *m_pActSnapDialog;
73  QAction *m_pActAutoGrabbing;
74  QAction *m_pActInfo;
75  QAction *m_pActOpenWidget;
76  QAction *m_pMainToolbarSeparator1;
77  QAction *m_pMainToolbarSeparator2;
78 
79  ShortcutAction* m_pViewList;
80  ShortcutAction* m_pViewDetails;
81 
82  void createActions();
83  void createMenus();
84  void createToolBars();
85  void createStatusBar(){}
86  void updateActions();
87  void updatePythonActions(){ updateActions(); }
88  void CloseInstance(const QModelIndex index);
89 
90  private:
91  QTreeView *m_pAIManagerView;
92  QSortFilterProxyModel *m_pSortFilterProxyModel;
93  int *m_pColumnWidth;
94  PlugInModel *m_pPlugInModel;
95 
96  public slots:
97 
98  private slots:
99  void treeViewContextMenuRequested(const QPoint &pos);
100  void selectionChanged(const QItemSelection& newSelection, const QItemSelection& oldSelection);
101  void mnuShowConfdialog();
102  void mnuToggleDockWidget();
103  void mnuCreateNewInstance();
104  void mnuCloseInstance();
105  void mnuCloseAllInstances();
106  void mnuSendToPython();
107  void mnuShowAlgoWidget(ito::AddInAlgo::AlgoWidgetDef* awd);
108  void mnuOpenWidget();
109  void mnuToggleView();
110  void mnuShowLiveImage();
111  void mnuSnapDialog();
112  void mnuToggleAutoGrabbing();
113  void setTreeViewHideColumns(const bool &hide, const int colCount);
114  void showList();
115  void showDetails();
116  void mnuShowInfo();
117 
118  signals:
119  void showPluginInfo(QString name, HelpTreeDockWidget::HelpItemType type);
120  void showDockWidget();
121  };
122 
123 }; // namespace ito
124 
125 #endif
container for publishing widgets provided by any plugin
Definition: addInInterface.h:1045
Definition: AIManagerWidget.h:41
class for visualizing the available (loaded) plugins
Definition: pluginModel.h:78
Definition: apiFunctionsGraph.cpp:39
Definition: shortcutAction.h:40
abstract dock widget class which inherits QDockWidget. The content of QDockWidget consists of an inst...
Definition: abstractDockWidget.h:54
~AIManagerWidget()
returns the background color for instances, that have been created by Python or which have at least o...
Definition: AIManagerWidget.cpp:205
tFloatingStyle
The floating style of a widget, derived from AbstractDockWidget.
Definition: abstractDockWidget.h:88
Definition: abstractDockWidget.h:90
Definition: abstractDockWidget.h:99
bool docked() const
Definition: abstractDockWidget.h:128
tMovingStyle
The configuration if a docked AbstractDockWidget can be moved from one docking area to another one...
Definition: abstractDockWidget.h:96