Add setTheme D-Bus API
Signed-off-by: weeman <weeman@frankfurt.ccc.de>
This commit is contained in:
parent
398cef5f8f
commit
ffaa12cc19
4 changed files with 20 additions and 0 deletions
|
|
@ -170,6 +170,14 @@ setStatusMessage(const QString &message)
|
||||||
interface.call(QDBus::NoBlock, QStringLiteral("setStatusMessage"), message);
|
interface.call(QDBus::NoBlock, QStringLiteral("setStatusMessage"), message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
setTheme(const QString &theme)
|
||||||
|
{
|
||||||
|
if (QDBusInterface interface{QStringLiteral(NHEKO_DBUS_SERVICE_NAME), QStringLiteral("/")};
|
||||||
|
interface.isValid())
|
||||||
|
interface.call(QDBus::NoBlock, QStringLiteral("setTheme"), theme);
|
||||||
|
}
|
||||||
|
|
||||||
} // nheko::dbus
|
} // nheko::dbus
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,9 @@ statusMessage();
|
||||||
//! Sets the user's status message (if supported by the homeserver).
|
//! Sets the user's status message (if supported by the homeserver).
|
||||||
void
|
void
|
||||||
setStatusMessage(const QString &message);
|
setStatusMessage(const QString &message);
|
||||||
|
//! Sets the current theme (supported values: "light", "dark" or "system")
|
||||||
|
void
|
||||||
|
setTheme(const QString &theme);
|
||||||
|
|
||||||
QDBusArgument &
|
QDBusArgument &
|
||||||
operator<<(QDBusArgument &arg, const RoomInfoItem &item);
|
operator<<(QDBusArgument &arg, const RoomInfoItem &item);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include "Logging.h"
|
#include "Logging.h"
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "MxcImageProvider.h"
|
#include "MxcImageProvider.h"
|
||||||
|
#include "UserSettingsPage.h"
|
||||||
#include "timeline/RoomlistModel.h"
|
#include "timeline/RoomlistModel.h"
|
||||||
#include "timeline/TimelineModel.h"
|
#include "timeline/TimelineModel.h"
|
||||||
|
|
||||||
|
|
@ -112,6 +113,12 @@ NhekoDBusBackend::setStatusMessage(const QString &message)
|
||||||
ChatPage::instance()->setStatus(message);
|
ChatPage::instance()->setStatus(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NhekoDBusBackend::setTheme(const QString &theme)
|
||||||
|
{
|
||||||
|
UserSettings::instance()->setTheme(theme);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NhekoDBusBackend::bringWindowToTop() const
|
NhekoDBusBackend::bringWindowToTop() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ public slots:
|
||||||
Q_SCRIPTABLE QString statusMessage() const;
|
Q_SCRIPTABLE QString statusMessage() const;
|
||||||
//! Sets the user's status message.
|
//! Sets the user's status message.
|
||||||
Q_SCRIPTABLE void setStatusMessage(const QString &message);
|
Q_SCRIPTABLE void setStatusMessage(const QString &message);
|
||||||
|
//! Sets the current theme (supported values: "light", "dark" or "system")
|
||||||
|
Q_SCRIPTABLE void setTheme(const QString &theme);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void bringWindowToTop() const;
|
void bringWindowToTop() const;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue