Documentation for OpenFLUID 2.2.0
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>
48 
49 
50 namespace openfluid { namespace ui { namespace waresdev {
51 
52 
53 class WareSrcExplorerModel;
54 
55 
56 class OPENFLUID_API WareSrcExplorer: public QTreeView
57 {
58  Q_OBJECT
59 
60 
61  private slots:
62 
63  void onDoubleClicked(const QModelIndex& Index);
64 
65  void onClicked(const QModelIndex& Index);
66 
67  void onCurrentChanged(const QModelIndex& Current);
68 
69  void createFragment(std::string WarePath, std::string FragmentID, bool IsFileCreation);
70 
71  void onOpenExplorerAsked();
72 
73  void onOpenTerminalAsked();
74 
75  void onOpenExternalToolAsked();
76 
77  void onCopyFullPathAsked();
78 
79  void onCopyRelativePathAsked();
80 
81  void scrollToCurrent();
82 
83  void onCustomContextMenuRequested(const QPoint& Point);
84 
85  void onNewFileAsked();
86 
87  void onNewFolderAsked();
88 
89  void onNewFragmentAsked();
90 
91  void onRemoteFragmentAsked();
92 
93  void onFragmentRemovalAsked();
94 
95  void onDeleteFolderAsked();
96 
97  void onDeleteFileAsked();
98 
99  void onGitInitAsked();
100 
101  void onGitStatusAsked();
102 
103  void onGitLogAsked();
104 
105 
106  private:
107 
108  WareSrcExplorerModel* mp_Model;
109 
110  QString m_TopDirectoryPath;
111 
112  QString getCurrentDir();
113 
114 
115  signals:
116 
117  void doubleClicked(const QString& FilePath);
118 
119  void clicked(const QString& FilePath);
120 
121  void fileOpeningAsked(const QString& FilePath);
122 
123  void currentChanged(const QString& FilePath);
124 
125  void openExplorerAsked(const QString& FilePath);
126 
127  void openTerminalAsked(const QString& FilePath);
128 
129  void openExternalToolAsked(const QString& FilePath, const QString& Command);
130 
131  void openPathAsked(const QString& FilePath);
132 
134 
135  void fileDeleted(const QString& Path);
136 
137  void folderDeleted(const QString& WarePath, const QString& FolderPath, const bool Confirm);
138 
139  void wareChanged(const QString& WarePath);
140 
141 
142  public:
143 
144  explicit WareSrcExplorer(QWidget* Parent = nullptr);
145 
146  virtual ~WareSrcExplorer();
147 
148  void configure(const QString& TopDirectoryPath, bool WithContextMenu);
149 
150  bool setCurrentPath(const QString& Path);
151 
152  QString getCurrentPath();
153 
154  QString getWarePath();
155 
156  void updateExplorerModel(const QString& Path);
157 
158 };
159 
160 
161 } } } // namespaces
162 
163 
164 #endif /* __OPENFLUID_UIWARESDEV_WARESRCEXPLORER_HPP__ */
Definition: WareSrcExplorerModel.hpp:57
Definition: WareSrcExplorer.hpp:57
void openExternalToolAsked(const QString &FilePath, const QString &Command)
void clicked(const QString &FilePath)
void updateExplorerModel(const QString &Path)
void configure(const QString &TopDirectoryPath, bool WithContextMenu)
void fileOpeningAsked(const QString &FilePath)
bool setCurrentPath(const QString &Path)
WareSrcExplorer(QWidget *Parent=nullptr)
void openExplorerAsked(const QString &FilePath)
void folderDeleted(const QString &WarePath, const QString &FolderPath, const bool Confirm)
void wareChanged(const QString &WarePath)
void currentChanged(const QString &FilePath)
void openTerminalAsked(const QString &FilePath)
void fileDeleted(const QString &Path)
void doubleClicked(const QString &FilePath)
void openPathAsked(const QString &FilePath)
#define OPENFLUID_API
Definition: dllexport.hpp:86
FilesystemPath Path
Definition: FilesystemPath.hpp:308
Definition: ApplicationException.hpp:47