2021-03-16 00:02:20 -07:00
|
|
|
#ifndef SETTINGS_H
|
|
|
|
#define SETTINGS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QDBusInterface>
|
|
|
|
|
|
|
|
class DesktopSettings : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString wallpaper READ wallpaper NOTIFY wallpaperChanged)
|
|
|
|
Q_PROPERTY(bool dimsWallpaper READ dimsWallpaper NOTIFY dimsWallpaperChanged)
|
|
|
|
|
2021-03-21 02:00:14 -07:00
|
|
|
Q_PROPERTY(int backgroundType READ backgroundType NOTIFY backgroundTypeChanged)
|
|
|
|
Q_PROPERTY(QString backgroundColor READ backgroundColor NOTIFY backgroundColorChanged)
|
|
|
|
|
2021-03-16 00:02:20 -07:00
|
|
|
public:
|
|
|
|
explicit DesktopSettings(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
QString wallpaper() const;
|
|
|
|
bool dimsWallpaper() const;
|
|
|
|
|
2021-03-21 02:00:14 -07:00
|
|
|
int backgroundType() const;
|
|
|
|
QString backgroundColor() const;
|
|
|
|
|
2021-03-16 00:02:20 -07:00
|
|
|
Q_INVOKABLE void launch(const QString &command, const QStringList &args);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void wallpaperChanged();
|
|
|
|
void dimsWallpaperChanged();
|
2021-03-21 02:00:14 -07:00
|
|
|
void backgroundColorChanged();
|
|
|
|
void backgroundTypeChanged();
|
2021-03-16 00:02:20 -07:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void init();
|
|
|
|
void onWallpaperChanged(QString);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QDBusInterface m_interface;
|
|
|
|
QString m_wallpaper;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SETTINGS_H
|