GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
InfoBoardWidget.h
1 
29 #pragma once
30 
31 #include "PlainTextEditorPage.h"
32 #include "core/function/result_analyse/GpgVerifyResultAnalyse.h"
33 #include "ui/dialog/details/VerifyDetailsDialog.h"
34 
35 class Ui_InfoBoard;
36 
37 namespace GpgFrontend::UI {
38 
42 typedef enum {
43  INFO_ERROR_OK = 0,
44  INFO_ERROR_WARN = 1,
45  INFO_ERROR_CRITICAL = 2,
46  INFO_ERROR_NEUTRAL = 3,
48 
52 class InfoBoardWidget : public QWidget {
53  Q_OBJECT
54  public:
61  explicit InfoBoardWidget(QWidget* parent);
62 
68  void AssociateTextEdit(QTextEdit* edit);
69 
75  void AssociateTabWidget(QTabWidget* tab);
76 
83  void AddOptionalAction(const QString& name,
84  const std::function<void()>& action);
85 
91 
98  void SetInfoBoard(const QString& text,
99  GpgFrontend::UI::InfoBoardStatus verify_label_status);
100 
101  public slots:
102 
107  void SlotReset();
108 
112  void SlotRefresh(const QString& text,
114 
115  private slots:
116 
121  void slot_copy();
122 
127  void slot_save();
128 
129  private:
130  std::shared_ptr<Ui_InfoBoard> ui_;
131 
132  QTextEdit* m_text_page_{
133  nullptr};
134  QTabWidget* m_tab_widget_{nullptr};
135 
142  void delete_widgets_in_layout(QLayout* layout, int start_index = 0);
143 };
144 
145 } // namespace GpgFrontend::UI
Class for handling the verify label shown at bottom of a textedit-page.
Definition: InfoBoardWidget.h:52
void AddOptionalAction(const QString &name, const std::function< void()> &action)
Definition: InfoBoardWidget.cpp:116
void AssociateTextEdit(QTextEdit *edit)
Definition: InfoBoardWidget.cpp:97
QTextEdit * m_text_page_
TextEdit associated to the notification.
Definition: InfoBoardWidget.h:132
void SlotRefresh(const QString &text, GpgFrontend::UI::InfoBoardStatus status)
Definition: InfoBoardWidget.cpp:91
void ResetOptionActionsMenu()
Definition: InfoBoardWidget.cpp:132
void delete_widgets_in_layout(QLayout *layout, int start_index=0)
Definition: InfoBoardWidget.cpp:146
void SetInfoBoard(const QString &text, GpgFrontend::UI::InfoBoardStatus verify_label_status)
Definition: InfoBoardWidget.cpp:61
InfoBoardWidget(QWidget *parent)
Definition: InfoBoardWidget.cpp:39
void AssociateTabWidget(QTabWidget *tab)
Definition: InfoBoardWidget.cpp:106
Definition: FileReadTask.cpp:31
InfoBoardStatus
Definition: InfoBoardWidget.h:42