summaryrefslogtreecommitdiffstats
path: root/src/timeoutdialog.h
blob: b70f753d7eaea08da73b8064bf4bb42f59248903 (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
// Copyright 2013, University of Freiburg,
// Author: Manuel Schneider <ms1144>

#ifndef TIMEOUTDIALOG_H
#define TIMEOUTDIALOG_H

#include <QProgressDialog>
#include <QTimer>

namespace Ui {
class TimeOutDialog;
}

class TimeOutDialog : public QDialog
{
	Q_OBJECT

public:
	TimeOutDialog(int time, QWidget *parent = nullptr);
	bool isActive() const { return _timer.isActive(); }
	bool wasCanceled() const { return _time > 0; }

private:
	Ui::TimeOutDialog *_ui;
	int             _time;
	QTimer          _timer;

protected:
	void hideEvent(QHideEvent *event) override;

private slots:
	void update();
};

#endif // TIMEOUTDIALOG_H