fix(notification): dbus interface

pull/39/head
kate 4 years ago
parent adbe437e61
commit fae9c3bdc1

@ -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();
}

@ -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;

@ -5,7 +5,7 @@
<method name="setDoNotDisturb">
<arg name="enabled" type="b" direction="in"/>
</method>
<signal name="doNotDisturbChanged">
</signal>
<signal name="doNotDisturbChanged"></signal>
<property name="doNotDisturb" type="b" access="read"/>
</interface>
</node>

Loading…
Cancel
Save