aboutsummaryrefslogtreecommitdiff
path: root/src/automatictheme.h
blob: 55904e5c81786e7e947477b1dbb5cf0b6ccd4538 (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
#ifndef AUTOMATICTHEME_H
#define AUTOMATICTHEME_H

#include <QWidget>
#include <QGeoPositionInfoSource>
#include <QDebug>
#include <QTimeZone>
#include <QSettings>

namespace Ui {
class AutomaticTheme;
}

class AutomaticTheme : public QWidget
{
    Q_OBJECT

public:
    explicit AutomaticTheme(QWidget *parent = nullptr);
    ~AutomaticTheme();


private slots:
    void on_refresh_clicked();

    void on_save_clicked();

    void on_cancel_clicked();

    void on_sunrise_timeChanged(const QTime &time);

    void on_sunset_timeChanged(const QTime &time);

private:
    Ui::AutomaticTheme *ui;

    QGeoPositionInfoSource *gPosInfoSrc;
    QDateTime sunrise, sunset;

    double hour_offset = 0.0;
    double lon = 0.0;
    double lat = 0.0;

    QSettings settings;
};

#endif // AUTOMATICTHEME_H