Manual for OpenFLUID 2.1.10

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 onOpenExternalToolAsked();
75 
76  void onCopyFullPathAsked();
77 
78  void onCopyRelativePathAsked();
79 
80  void scrollToCurrent();
81 
82  void onCustomContextMenuRequested(const QPoint& Point);
83 
84  void onNewFileAsked();
85 
86  void onNewFolderAsked();
87 
88  void onDeleteFileAsked();
89 
90  void onGitStatusAsked();
91 
92  void onGitLogAsked();
93 
94 
95  private:
96 
97  WareSrcExplorerModel* mp_Model;
98 
99  QString m_TopDirectoryPath;
100 
101  QString getCurrentDir();
102 
103 
104  signals:
105 
106  void doubleClicked(const QString& FilePath);
107 
108  void clicked(const QString& FilePath);
109 
110  void currentChanged(const QString& FilePath);
111 
112  void openExplorerAsked(const QString& FilePath);
113 
114  void openTerminalAsked(const QString& FilePath);
115 
116  void openExternalToolAsked(const QString& FilePath, const QString& Command);
117 
118  void openPathAsked(const QString& FilePath);
119 
120  void deleteWareAsked();
121 
122  void fileDeleted(const QString& Path);
123 
124 
125  public:
126 
127  explicit WareSrcExplorer(QWidget* Parent = nullptr);
128 
129  virtual ~WareSrcExplorer();
130 
131  void configure(const QString& TopDirectoryPath, bool WithContextMenu);
132 
133  bool setCurrentPath(const QString& Path);
134 
135  QString getCurrentPath();
136 
137  void updateExplorerModel(const QString& Path);
138 
139 };
140 
141 
142 } } } // namespaces
143 
144 
145 #endif /* __OPENFLUID_UIWARESDEV_WARESRCEXPLORER_HPP__ */
Definition: ApplicationException.hpp:47
Header of ...
Definition: WareSrcExplorerModel.hpp:56
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: WareSrcExplorer.hpp:57