Wireshark  4.3.0
The Wireshark network protocol analyzer
progress_frame.h
Go to the documentation of this file.
1 
10 #ifndef PROGRESS_FRAME_H
11 #define PROGRESS_FRAME_H
12 
13 #include <glib.h>
14 
15 #include <QFrame>
16 
17 namespace Ui {
18 class ProgressFrame;
19 }
20 
21 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) && defined(Q_OS_WIN)
22 #include <QWinTaskbarButton>
23 #include <QWinTaskbarProgress>
24 #endif
25 
26 class ProgressFrame;
27 class QDialogButtonBox;
28 class QElapsedTimer;
29 class QGraphicsOpacityEffect;
30 class QPropertyAnimation;
31 
32 // Define the structure describing a progress dialog.
33 struct progdlg {
34  ProgressFrame *progress_frame; // This progress frame
35  QWidget *top_level_window; // Progress frame's main window
36 };
37 
38 class ProgressFrame : public QFrame
39 {
40  Q_OBJECT
41 
42 public:
43  explicit ProgressFrame(QWidget *parent = 0);
44  ~ProgressFrame();
45 
46 #ifdef QWINTASKBARPROGRESS_H
47  void enableTaskbarUpdates(bool enable = true) { update_taskbar_ = enable; }
48 #endif
49  static void addToButtonBox(QDialogButtonBox *button_box, QObject *main_window);
50  void captureFileClosing();
51 
52 public slots:
53  struct progdlg *showProgress(const QString &title, bool animate, bool terminate_is_stop, gboolean *stop_flag, int value = 0);
54  struct progdlg *showBusy(bool animate, bool terminate_is_stop, gboolean *stop_flag);
55  void setValue(int value);
56  void hide();
57 
58 signals:
59  void showRequested(bool animate, bool terminate_is_stop, gboolean *stop_flag);
60  void valueChanged(int value);
61  void maximumValueChanged(int value);
62  void setHidden();
63  void stopLoading();
64 
65 protected:
66  void timerEvent(QTimerEvent *event);
67 
68 private:
69  Ui::ProgressFrame *ui;
70 
71  struct progdlg progress_dialog_;
72  QString message_;
73  QString status_;
74  bool terminate_is_stop_;
75  gboolean *stop_flag_;
76  int show_timer_;
77  QGraphicsOpacityEffect *effect_;
78  QPropertyAnimation *animation_;
79 #ifdef QWINTASKBARPROGRESS_H
80  bool update_taskbar_;
81  QWinTaskbarProgress *taskbar_progress_;
82 #endif
83 
84 private slots:
85  void on_stopButton_clicked();
86 
87  void show(bool animate, bool terminate_is_stop, gboolean *stop_flag);
88  void setMaximumValue(int value);
89 };
90 
91 #endif // PROGRESS_FRAME_H
Definition: progress_frame.h:39
Definition: progress_frame.h:33