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 
91  signals:
92 
98  void SignalPathChanged(const QString&);
99 
104  void SignalSelectedChanged(const QString&);
105 
110  void SignalOpenFile(const QString&);
111 
112  public slots:
113 
118  void SlotGoPath(const QString&);
119 
124  void SlotUpLevel();
125 
130  void SlotShowSystemFile(bool);
131 
137  void SlotShowHiddenFile(bool);
138 
143  auto SlotDeleteSelectedItem() -> void;
144 
149  void SlotMkdir();
150 
155  void SlotMkdirBelowAtSelectedItem();
156 
161  void SlotTouch();
162 
167  void SlotTouchBelowAtSelectedItem();
168 
173  void SlotRenameSelectedItem();
174 
179  void SlotOpenSelectedItemBySystemApplication();
180 
181  private slots:
182 
188  void slot_file_tree_view_item_double_clicked(const QModelIndex& index);
189 
194  void slot_calculate_hash();
195 
200  void slot_compress_files();
201 
207  void slot_show_custom_context_menu(const QPoint& point);
208 
213  void slot_create_popup_menu();
214 
215  private:
216  QFileSystemModel* dir_model_;
217  QString current_path_;
218  QString selected_path_;
219 
220  QMenu* popup_menu_;
221  QAction* action_open_file_;
222  QAction* action_rename_file_;
223  QAction* action_delete_file_;
224  QAction* action_calculate_hash_;
225  QAction* action_create_empty_file_;
226  QAction* action_make_directory_;
227  QAction* action_compress_files_;
228 };
229 } // namespace GpgFrontend::UI
Definition: FileTreeView.h:33
void slot_file_tree_view_item_double_clicked(const QModelIndex &index)
Definition: FileTreeView.cpp:95
void SignalPathChanged(const QString &)
void slot_compress_files()
compress directory into gpg-zip
Definition: FileTreeView.cpp:397
void slot_show_custom_context_menu(const QPoint &point)
Definition: FileTreeView.cpp:355
auto GetSelectedPath() -> QString
Get the Selected Path object.
Definition: FileTreeView.cpp:150
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override
Definition: FileTreeView.cpp:58
auto GetMousePointGlobal(const QPoint &point) -> QPoint
Get the Mouse Point Global object.
Definition: FileTreeView.cpp:288
auto GetCurrentPath() -> QString
Get the Current Path object.
Definition: FileTreeView.cpp:122
void keyPressEvent(QKeyEvent *event) override
Definition: FileTreeView.cpp:244
void slot_create_popup_menu()
Create a popup menu object.
Definition: FileTreeView.cpp:292
auto GetPathByClickPoint(const QPoint &point) -> QString
Get the Path By Click Point object.
Definition: FileTreeView.cpp:138
void SlotShowHiddenFile(bool)
Definition: FileTreeView.cpp:131
Definition: FileReadTask.cpp:31