WareSrcExplorer.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30  */
31 
32 /**
33  @file WareSrcExplorer.hpp
34  @brief Header of ...
35 
36  @author Aline LIBRES <aline.libres@gmail.com>
37  */
38 
39 
40 #ifndef __OPENFLUID_UIWARESDEV_WARESRCEXPLORER_HPP__
41 #define __OPENFLUID_UIWARESDEV_WARESRCEXPLORER_HPP__
42 
43 
44 #include <QTreeView>
45 #include <QContextMenuEvent>
46 
47 #include <openfluid/dllexport.hpp>
49 
50 
51 namespace openfluid { namespace ui { namespace waresdev {
52 
53 
54 class WareSrcExplorerModel;
55 
56 
57 class OPENFLUID_API WareSrcExplorer: public QTreeView
58 {
59  Q_OBJECT
60 
61 
62  private slots:
63 
64  void onDoubleClicked(const QModelIndex& Index);
65 
66  void onClicked(const QModelIndex& Index);
67 
68  void onCurrentChanged(const QModelIndex& Current);
69 
70  void onOpenExplorerAsked();
71 
72  void onOpenTerminalAsked();
73 
74  void scrollToCurrent();
75 
76  void onCustomContextMenuRequested(const QPoint& Point);
77 
78  void onNewFileAsked();
79 
80  void onNewFolderAsked();
81 
82  void onDeleteFileAsked();
83 
84  void onGitStatusAsked();
85 
86  void onGitLogAsked();
87 
88 
89  private:
90 
91  WareSrcExplorerModel* mp_Model;
92 
93  QString m_TopDirectoryPath;
94 
95  QString getCurrentDir();
96 
97 
98  signals:
99 
100  void doubleClicked(const QString& FilePath);
101 
102  void clicked(const QString& FilePath);
103 
104  void currentChanged(const QString& FilePath);
105 
106  void openExplorerAsked(const QString& FilePath);
107 
108  void openTerminalAsked(const QString& FilePath);
109 
110  void openPathAsked(const QString& FilePath);
111 
112  void deleteWareAsked();
113 
114  void fileDeleted(const QString& Path);
115 
116 
117  public:
118 
119  explicit WareSrcExplorer(QWidget* Parent = nullptr);
120 
121  virtual ~WareSrcExplorer();
122 
123  void configure(const QString& TopDirectoryPath, bool WithContextMenu);
124 
125  bool setCurrentPath(const QString& Path);
126 
127  QString getCurrentPath();
128 
129  void updateExplorerModel(const QString& Path);
130 
131 };
132 
133 
134 } } } // namespaces
135 
136 
137 #endif /* __OPENFLUID_UIWARESDEV_WARESRCEXPLORER_HPP__ */
Definition: WareSrcExplorerModel.hpp:56
Definition: ApplicationException.hpp:47
Header of ...
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: WareSrcExplorer.hpp:57