diff options
Diffstat (limited to 'include/ui/widgets')
-rw-r--r-- | include/ui/widgets/FilePage.h | 31 | ||||
-rw-r--r-- | include/ui/widgets/InfoBoardWidget.h | 11 | ||||
-rw-r--r-- | include/ui/widgets/TextEdit.h | 21 |
3 files changed, 56 insertions, 7 deletions
diff --git a/include/ui/widgets/FilePage.h b/include/ui/widgets/FilePage.h index 6585bed9..3d2c8e72 100644 --- a/include/ui/widgets/FilePage.h +++ b/include/ui/widgets/FilePage.h @@ -25,7 +25,7 @@ #ifndef GPGFRONTEND_FILEPAGE_H #define GPGFRONTEND_FILEPAGE_H -#include <GpgFrontend.h> +#include "GpgFrontend.h" class FilePage : public QWidget { Q_OBJECT @@ -33,8 +33,12 @@ public: explicit FilePage(QWidget* parent = nullptr); - void getSelected(QString &path); + [[nodiscard]] QString getSelected() const; + void createPopupMenu(); + +signals: + void pathChanged(const QString &path); private slots: @@ -42,13 +46,36 @@ private slots: void fileTreeViewItemDoubleClicked(const QModelIndex &index); void slotUpLevel(); + void slotGoPath(); + + void slotOpenItem(); + void slotDeleteItem(); + void slotEncryptItem(); + void slotDecryptItem(); + void slotSignItem(); + void slotVerifyItem(); + + void onCustomContextMenu(const QPoint &point); + private: + QFileSystemModel *dirModel; QTreeView *dirTreeView; + QLineEdit *pathEdit; QString mPath; QPushButton *upLevelButton; + QPushButton *goPathButton; + QPushButton *refreshButton; + + QMenu *popUpMenu{}; + QAction *encryptItemAct{}; + QAction *decryptItemAct{}; + QAction *signItemAct{}; + QAction *verifyItemAct{}; + + QWidget *firstParent; }; diff --git a/include/ui/widgets/InfoBoardWidget.h b/include/ui/widgets/InfoBoardWidget.h index 9d3dbd16..f487b72c 100644 --- a/include/ui/widgets/InfoBoardWidget.h +++ b/include/ui/widgets/InfoBoardWidget.h @@ -26,6 +26,7 @@ #define __VERIFYNOTIFICATION_H__ #include "EditorPage.h" +#include "FilePage.h" #include "ui/VerifyDetailsDialog.h" #include "gpg/result_analyse/VerifyResultAnalyse.h" @@ -56,6 +57,10 @@ public: void associateTextEdit(QTextEdit *edit); + void associateFileTreeView(FilePage *treeView); + + void associateTabWidget(QTabWidget *tab); + void addOptionalAction(const QString& name, const std::function<void()>& action); void resetOptionActionsMenu(); @@ -95,7 +100,11 @@ private: QTextEdit *infoBoard; GpgME::GpgContext *mCtx; /** GpgME Context */ KeyList *mKeyList; /** Table holding the keys */ - QTextEdit *mTextPage{ nullptr }; /** Textedit associated to the notification */ + + QTextEdit *mTextPage{ nullptr }; /** TextEdit associated to the notification */ + FilePage *mFileTreeView{nullptr }; /** TreeView associated to the notification */ + QTabWidget *mTabWidget{ nullptr }; /** TreeView associated to the notification */ + QHBoxLayout *actionButtonLayout; diff --git a/include/ui/widgets/TextEdit.h b/include/ui/widgets/TextEdit.h index f98da145..b807d6c6 100644 --- a/include/ui/widgets/TextEdit.h +++ b/include/ui/widgets/TextEdit.h @@ -40,7 +40,7 @@ public: /** * @brief */ - TextEdit(); + TextEdit(QWidget *parent); /** * @details Load the content of file into the current textpage @@ -69,7 +69,7 @@ public: */ [[nodiscard]] QTextEdit *curTextPage() const; - [[nodiscard]] QTextBrowser *curHelpPage() const; + [[nodiscard]] FilePage * curFilePage() const; /** * @details List of currently unsaved tabs. @@ -82,10 +82,16 @@ public: public slots: /** - * @details Return pointer to the currently activated tabpage. + * @details Return pointer to the currently activated text edit tab page. * */ - [[nodiscard]] EditorPage *slotCurPage() const; + [[nodiscard]] EditorPage *slotCurPageTextEdit() const; + + /** + * @details Return pointer to the currently activated file treeview tab page. + * + */ + [[nodiscard]] FilePage *slotCurPageFileTreeView() const; /** * @details Insert a ">" at the begining of every line of current textedit. @@ -130,6 +136,11 @@ public slots: void slotNewTab(); /** + * @details Adds a new tab with opening file by path + */ + void slotOpenFile(QString &path); + + /** * @details Adds a new tab with the given title and opens given html file. * Increase Tab-Count by one * @param title title for the tab @@ -189,6 +200,8 @@ private: private slots: + void slotFilePagePathChanged(const QString& path); + /** * @details Remove the tab with given index * |