GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
FilePage.h
1 
29 #ifndef GPGFRONTEND_FILEPAGE_H
30 #define GPGFRONTEND_FILEPAGE_H
31 
32 
33 
34 #include "ui/GpgFrontendUI.h"
35 #include "ui/widgets/InfoBoardWidget.h"
36 
37 class Ui_FilePage;
38 
39 namespace GpgFrontend::UI {
40 
45 class FilePage : public QWidget {
46  Q_OBJECT
47  public:
53  explicit FilePage(QWidget* parent = nullptr);
54 
60  [[nodiscard]] QString GetSelected() const;
61 
62  public slots:
67  void SlotGoPath();
68 
69  signals:
70 
76  void SignalPathChanged(const QString& path);
77 
84  void SignalRefreshInfoBoard(const QString& text,
85  InfoBoardStatus verify_label_status);
86 
87  private slots:
88 
94  void slot_file_tree_view_item_clicked(const QModelIndex& index);
95 
101  void slot_file_tree_view_item_double_clicked(const QModelIndex& index);
102 
107  void slot_up_level();
108 
113  void slot_open_item();
114 
119  void slot_rename_item();
120 
125  void slot_delete_item();
126 
131  void slot_calculate_hash();
132 
137  void slot_mkdir();
138 
143  void slot_create_empty_file();
144 
149  void slot_compress_files();
150 
151  protected:
157  void keyPressEvent(QKeyEvent* event) override;
158 
164  void onCustomContextMenu(const QPoint& point);
165 
166  private:
171  void create_popup_menu();
172 
173  std::shared_ptr<Ui_FilePage> ui_;
174 
175  QFileSystemModel* dir_model_;
176  QCompleter* path_edit_completer_;
177  QStringListModel* path_complete_model_;
178 
179  std::filesystem::path m_path_;
180  std::filesystem::path selected_path_;
181 
182  QMenu* popup_menu_{};
183  QMenu* option_popup_menu_{};
184  QWidget* first_parent_{};
185 };
186 
187 } // namespace GpgFrontend::UI
188 
189 #endif // GPGFRONTEND_FILEPAGE_H
GpgFrontend::UI::FilePage::slot_file_tree_view_item_double_clicked
void slot_file_tree_view_item_double_clicked(const QModelIndex &index)
Definition: FilePage.cpp:173
GpgFrontend::UI::FilePage::slot_file_tree_view_item_clicked
void slot_file_tree_view_item_clicked(const QModelIndex &index)
Definition: FilePage.cpp:101
GpgFrontend::UI
Definition: VerifyDetailsDialog.cpp:33
GpgFrontend::UI::FilePage::SignalPathChanged
void SignalPathChanged(const QString &path)
GpgFrontend::UI::FilePage::onCustomContextMenu
void onCustomContextMenu(const QPoint &point)
Definition: FilePage.cpp:289
GpgFrontend::FileOperator::CalculateHash
static std::string CalculateHash(const std::filesystem::path &file_path)
Definition: FileOperator.cpp:72
GpgFrontend::UI::FilePage::keyPressEvent
void keyPressEvent(QKeyEvent *event) override
Definition: FilePage.cpp:438
GpgFrontend::UI::FilePage
Definition: FilePage.h:45
GpgFrontend::UI::InfoBoardStatus
InfoBoardStatus
Definition: InfoBoardWidget.h:43
GpgFrontend::UI::FilePage::slot_compress_files
void slot_compress_files()
compress directory into gpg-zip
Definition: FilePage.cpp:452
GpgFrontend::UI::SignalStation::SignalRefreshInfoBoard
void SignalRefreshInfoBoard(const QString &text, InfoBoardStatus verify_label_status)
GpgFrontend::UI::FilePage::FilePage
FilePage(QWidget *parent=nullptr)
Construct a new File Page object.
Definition: FilePage.cpp:41
GpgFrontend::UI::FilePage::GetSelected
QString GetSelected() const
Get the Selected object.
Definition: FilePage.cpp:184
GpgFrontend::UI::SignalStation::GetInstance
static SignalStation * GetInstance()
Get the Instance object.
Definition: SignalStation.cpp:35
GpgFrontend::UI::FilePage::SignalRefreshInfoBoard
void SignalRefreshInfoBoard(const QString &text, InfoBoardStatus verify_label_status)
GpgFrontend::UI::FilePage::create_popup_menu
void create_popup_menu()
Create a popup menu object.
Definition: FilePage.cpp:219