GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
FileTreeView.h
1 
29 #pragma once
30 
31 namespace GpgFrontend::UI {
32 
33 class FileTreeView : public QTreeView {
34  Q_OBJECT
35  public:
36  explicit FileTreeView(QWidget* parent, const QString& target_path);
37 
43  auto GetCurrentPath() -> QString;
44 
50  auto GetSelectedPath() -> QString;
51 
58  auto GetPathByClickPoint(const QPoint& point) -> QString;
59 
66  auto GetMousePointGlobal(const QPoint& point) -> QPoint;
67 
68  protected:
75  void selectionChanged(const QItemSelection& selected,
76  const QItemSelection& deselected) override;
77 
83  void keyPressEvent(QKeyEvent* event) override;
84 
89  void paintEvent(QPaintEvent* event) override;
90 
96  void mousePressEvent(QMouseEvent* event) override;
97 
98  signals:
99 
105  void SignalPathChanged(const QString&);
106 
111  void SignalSelectedChanged(const QString&);
112 
117  void SignalOpenFile(const QString&);
118 
119  public slots:
120 
125  void SlotGoPath(const QString&);
126 
131  void SlotUpLevel();
132 
137  void SlotShowSystemFile(bool);
138 
144  void SlotShowHiddenFile(bool);
145 
150  auto SlotDeleteSelectedItem() -> void;
151 
156  void SlotMkdir();
157 
162  void SlotMkdirBelowAtSelectedItem();
163 
168  void SlotTouch();
169 
174  void SlotTouchBelowAtSelectedItem();
175 
180  void SlotRenameSelectedItem();
181 
186  void SlotOpenSelectedItemBySystemApplication();
187 
188  private slots:
189 
195  void slot_file_tree_view_item_double_clicked(const QModelIndex& index);
196 
201  void slot_calculate_hash();
202 
207  void slot_compress_files();
208 
214  void slot_show_custom_context_menu(const QPoint& point);
215 
220  void slot_create_popup_menu();
221 
222  private:
223  QFileSystemModel* dir_model_;
224  QString current_path_;
225  QString selected_path_;
226 
227  QMenu* popup_menu_;
228  QMenu* new_item_action_menu_;
229  QAction* action_open_file_;
230  QAction* action_rename_file_;
231  QAction* action_delete_file_;
232  QAction* action_calculate_hash_;
233  QAction* action_create_empty_file_;
234  QAction* action_make_directory_;
235  QAction* action_compress_files_;
236 };
237 } // namespace GpgFrontend::UI
Definition: FileTreeView.h:33
void mousePressEvent(QMouseEvent *event) override
Definition: FileTreeView.cpp:421
void slot_file_tree_view_item_double_clicked(const QModelIndex &index)
Definition: FileTreeView.cpp:96
void SignalPathChanged(const QString &)
void slot_compress_files()
compress directory into gpg-zip
Definition: FileTreeView.cpp:412
void slot_show_custom_context_menu(const QPoint &point)
Definition: FileTreeView.cpp:352
auto GetSelectedPath() -> QString
Get the Selected Path object.
Definition: FileTreeView.cpp:151
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override
Definition: FileTreeView.cpp:59
auto GetMousePointGlobal(const QPoint &point) -> QPoint
Get the Mouse Point Global object.
Definition: FileTreeView.cpp:285
auto GetCurrentPath() -> QString
Get the Current Path object.
Definition: FileTreeView.cpp:123
void keyPressEvent(QKeyEvent *event) override
Definition: FileTreeView.cpp:241
void slot_create_popup_menu()
Create a popup menu object.
Definition: FileTreeView.cpp:289
auto GetPathByClickPoint(const QPoint &point) -> QString
Get the Path By Click Point object.
Definition: FileTreeView.cpp:139
void SlotShowHiddenFile(bool)
Definition: FileTreeView.cpp:132
Definition: FileReadTask.cpp:31