aboutsummaryrefslogtreecommitdiff
path: root/src/rateapp.h
blob: 50d5b98c00c9a8ea17de469d7f94938f82caa978 (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
47
48
49
50
51
52
53
54
55
#ifndef RATEAPP_H
#define RATEAPP_H

#include <QWidget>
#include <QSettings>
#include <QDateTime>
#include <QUrl>
#include <QDesktopServices>
#include <QTimer>

namespace Ui {
class RateApp;
}

class RateApp : public QWidget
{
    Q_OBJECT

signals:
    void showRateDialog();

public:
    explicit RateApp(QWidget *parent = nullptr , QString app_rating_url = "",
                     int app_launch_count = 5, int app_install_days = 5, int present_delay = 5000);
    ~RateApp();

public slots:
    void delayShowEvent();

private slots:
    void on_rateNowBtn_clicked();

    void on_alreadyDoneBtn_clicked();

    void on_laterBtn_clicked();

    bool shouldShow();
    void reset();
    void on_rateOnGithub_clicked();

    void on_donate_clicked();

    void on_donate_2_clicked();

private:
    Ui::RateApp *ui;
    QString app_rating_url;
    int app_launch_count;
    int app_install_days;
    int present_delay;
    QSettings settings;
    QTimer *showTimer;
};

#endif // RATEAPP_H