summaryrefslogtreecommitdiffstats
path: root/src/gui.h
blob: 24b4478c7193d59fc54e2b9ea7d5c9e71ba599c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef _COW_GUI_H_
#define _COW_GUI_H_

#include <QDialog>
#include <QHash>

class QVBoxLayout;
class QNetworkAccessManager;
class QPushButton;
class QTimer;
class QLabel;

class Progress;

class Gui : public QDialog
{
    Q_OBJECT
public:
    explicit Gui(const QString &urlbase, const QString &uuid, int dnbd3pid, QWidget *parent = nullptr);
    ~Gui();

protected:
    virtual void closeEvent(QCloseEvent *event) override;

private slots:
    void pushedCancel(bool pushed);
    void pushedOk(bool pushed);

private:
    void setupUi();
    void updateButtons();

    QNetworkAccessManager *_nam;
    QVBoxLayout *_itemBox;
    QString _remoteState;
    QString _urlStatus, _urlAbort, _urlFinish;
    bool _denyInteraction;
    bool _allowClose;
    QPushButton *_btnAbort, *_btnOk;
    QTimer *_tmrStatus;
    QHash<QString, Progress*> _items;
    QLabel *_status;
    int _dnbd3pid;
};

#endif