GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
InfoBoardWidget.h
1 
29 #ifndef __VERIFYNOTIFICATION_H__
30 #define __VERIFYNOTIFICATION_H__
31 
32 #include "PlainTextEditorPage.h"
33 #include "core/function/result_analyse/GpgVerifyResultAnalyse.h"
34 #include "ui/dialog/details/VerifyDetailsDialog.h"
35 
36 class Ui_InfoBoard;
37 
38 namespace GpgFrontend::UI {
39 
43 typedef enum {
44  INFO_ERROR_OK = 0,
45  INFO_ERROR_WARN = 1,
46  INFO_ERROR_CRITICAL = 2,
47  INFO_ERROR_NEUTRAL = 3,
49 
53 class InfoBoardWidget : public QWidget {
54  Q_OBJECT
55  public:
62  explicit InfoBoardWidget(QWidget* parent);
63 
69  void AssociateTextEdit(QTextEdit* edit);
70 
76  void AssociateTabWidget(QTabWidget* tab);
77 
84  void AddOptionalAction(const QString& name,
85  const std::function<void()>& action);
86 
92 
99  void SetInfoBoard(const QString& text,
100  GpgFrontend::UI::InfoBoardStatus verify_label_status);
101 
102  public slots:
103 
108  void SlotReset();
109 
113  void SlotRefresh(const QString& text,
115 
116  private slots:
117 
122  void slot_copy();
123 
128  void slot_save();
129 
130  private:
131  std::shared_ptr<Ui_InfoBoard> ui_;
132 
133  QTextEdit* m_text_page_{
134  nullptr};
135  QTabWidget* m_tab_widget_{nullptr};
136 
143  void delete_widgets_in_layout(QLayout* layout, int start_index = 0);
144 };
145 
146 } // namespace GpgFrontend::UI
147 
148 #endif // __VERIFYNOTIFICATION_H__
Class for handling the verify label shown at bottom of a textedit-page.
Definition: InfoBoardWidget.h:53
void AddOptionalAction(const QString &name, const std::function< void()> &action)
Definition: InfoBoardWidget.cpp:114
void AssociateTextEdit(QTextEdit *edit)
Definition: InfoBoardWidget.cpp:96
QTextEdit * m_text_page_
TextEdit associated to the notification.
Definition: InfoBoardWidget.h:133
void SlotRefresh(const QString &text, GpgFrontend::UI::InfoBoardStatus status)
Definition: InfoBoardWidget.cpp:90
void ResetOptionActionsMenu()
Definition: InfoBoardWidget.cpp:130
void delete_widgets_in_layout(QLayout *layout, int start_index=0)
Definition: InfoBoardWidget.cpp:144
void SetInfoBoard(const QString &text, GpgFrontend::UI::InfoBoardStatus verify_label_status)
Definition: InfoBoardWidget.cpp:58
InfoBoardWidget(QWidget *parent)
Definition: InfoBoardWidget.cpp:38
void AssociateTabWidget(QTabWidget *tab)
Definition: InfoBoardWidget.cpp:104
Definition: FileReadTask.cpp:29
InfoBoardStatus
Definition: InfoBoardWidget.h:43