diff --git a/notificationd/application.cpp b/notificationd/application.cpp index 7b9335b..0c2d64e 100644 --- a/notificationd/application.cpp +++ b/notificationd/application.cpp @@ -85,6 +85,11 @@ void Application::setDoNotDisturb(bool enabled) m_settings->setDoNotDisturb(enabled); } +bool Application::doNotDisturb() const +{ + return m_settings->doNotDisturb(); +} + int Application::run() { if (!parseCommandLineArgs()) @@ -97,6 +102,8 @@ int Application::run() m_window = new NotificationWindow; + connect(m_settings, &Settings::doNotDisturbChanged, this, &Application::doNotDisturbChanged); + return QApplication::exec(); } diff --git a/notificationd/application.h b/notificationd/application.h index 0aa941b..3e6b37c 100644 --- a/notificationd/application.h +++ b/notificationd/application.h @@ -29,16 +29,21 @@ class NotificationsModel; class Application : public QApplication { Q_OBJECT + Q_PROPERTY(bool doNotDisturb READ doNotDisturb WRITE setDoNotDisturb NOTIFY doNotDisturbChanged) public: explicit Application(int& argc, char** argv); void showWindow(); void setDoNotDisturb(bool enabled); + bool doNotDisturb() const; int run(); bool parseCommandLineArgs(); +signals: + void doNotDisturbChanged(); + private: NotificationServer *m_notificationServer; NotificationsModel *m_model; diff --git a/notificationd/com.cutefish.Notification.xml b/notificationd/com.cutefish.Notification.xml index 66bebe0..0e9ce23 100644 --- a/notificationd/com.cutefish.Notification.xml +++ b/notificationd/com.cutefish.Notification.xml @@ -5,7 +5,7 @@ - - + +