itom  3.0.0
workspaceDockWidget.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2016, 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 WORKSPACEDOCKWIDGET_H
24 #define WORKSPACEDOCKWIDGET_H
25 
26 #include "workspaceWidget.h"
27 #include "abstractDockWidget.h"
28 
29 #include <qwidget.h>
30 #include <qaction.h>
31 #include <qtoolbar.h>
32 #include <qevent.h>
33 
34 
35 namespace ito {
36 
37 
39 {
40  Q_OBJECT
41 
42 public:
43  WorkspaceDockWidget(const QString &title, const QString &objName, bool globalNotLocal, QWidget *parent = NULL, bool docked = true, bool isDockAvailable = true, tFloatingStyle floatingStyle = floatingNone, tMovingStyle movingStyle = movingEnabled);
45 
46 protected:
47 
48  //void closeEvent(QCloseEvent *event);
49  void dragEnterEvent(QDragEnterEvent *event);
50  void dropEvent(QDropEvent *event);
51 
52  void createActions();
53  void createMenus();
54  void createToolBars();
55  void createStatusBar(){}
56  void updateActions();
57  void updatePythonActions(){ updateActions(); }
58 
59 private:
60  bool m_globalNotLocal;
61 
62  WorkspaceWidget *m_pWorkspaceWidget;
63  ShortcutAction *m_actDelete;
64  ShortcutAction *m_actRename;
65  ShortcutAction *m_actExport;
66  ShortcutAction *m_actImport;
67  QAction *m_actUnpack;
68 
69  //special actions
70  QAction *m_separatorSpecialActionsToolBar;
71  QAction *m_separatorSpecialActionsContextMenu;
72  ShortcutAction *m_dObjPlot1d;
73  ShortcutAction *m_dObjPlot2d;
74  ShortcutAction *m_dObjPlot25d;
75  ShortcutAction *m_dObjPlot3d;
76 
77  QToolBar *m_pMainToolBar;
78  QMenu* m_pContextMenu;
79  QTreeWidgetItem* m_firstCurrentItem;
80  QString m_firstCurrentItemKey;
81 
82  void mnuPlotGeneric(const QString &plotClass);
83 
84 private slots:
85  void mnuDeleteItem();
86  void mnuExportItem();
87  void mnuImportItem();
88  void mnuRenameItem();
89  void mnuToggleUnpack();
90  void mnuPlot1D();
91  void mnuPlot2D();
92  void mnuPlot25D();
93 
94  void treeWidgetItemSelectionChanged() { updateActions(); };
95  void treeWidgetItemChanged(QTreeWidgetItem * item, int column);
96  void treeViewContextMenuRequested(const QPoint &pos);
97 
98 public slots:
99  void checkToggleUnpack();
100  void propertiesChanged();
101 
102 signals:
103  void setStatusInformation(QString text, int timeout = 0);
104 };
105 
106 } //end namespace ito
107 
108 #endif
void mnuImportItem()
slot invoked if the import button has been clicked
Definition: workspaceDockWidget.cpp:344
void mnuDeleteItem()
slot invoked if the delete button has been clicked
Definition: workspaceDockWidget.cpp:229
void treeWidgetItemChanged(QTreeWidgetItem *item, int column)
slot invoked if name of element in workspaceWidget (TreeView) has been changed.
Definition: workspaceDockWidget.cpp:732
void mnuRenameItem()
slot invoked if the rename button has been clicked in the menu
Definition: workspaceDockWidget.cpp:361
~WorkspaceDockWidget()
destructor
Definition: workspaceDockWidget.cpp:111
Definition: apiFunctionsGraph.cpp:39
void createActions()
implementation for virtual method createActions in AbstractDockWidget.
Definition: workspaceDockWidget.cpp:142
void updateActions()
updates the status of all actions of this widget
Definition: workspaceDockWidget.cpp:608
void mnuToggleUnpack()
slot invoked if the unpack dictionary button has been clicked in the menu
Definition: workspaceDockWidget.cpp:380
docking widget for contents of type workspace widget
Definition: workspaceDockWidget.h:38
the workspaceWidget displays either a global or a local workspace given by a python dictionary...
Definition: workspaceWidget.h:53
abstract dock widget class which inherits QDockWidget. The content of QDockWidget consists of an inst...
Definition: abstractDockWidget.h:45
WorkspaceDockWidget(const QString &title, const QString &objName, bool globalNotLocal, QWidget *parent=NULL, bool docked=true, bool isDockAvailable=true, tFloatingStyle floatingStyle=floatingNone, tMovingStyle movingStyle=movingEnabled)
constructor
Definition: workspaceDockWidget.cpp:60
void createToolBars()
implementation for virtual method createToolBars in AbstractDockWidget.
Definition: workspaceDockWidget.cpp:174
void mnuExportItem()
slot invoked if the import button has been clicked
Definition: workspaceDockWidget.cpp:288
bool docked() const
Definition: abstractDockWidget.h:86