Commit 1755b0fd authored by Andrey Butirsky's avatar Andrey Butirsky
Browse files

impr: Keyboard Layout DBus API: expose switchToNextLayout() method

switchToPreviousLayout() is also added

P-W part:
"Keyboard Layout plugin: passthrough DBus switchToNextLayout() method
to QML applet"
parent bdfb9462
...@@ -291,6 +291,16 @@ KeyboardLayoutDBusInterface::~KeyboardLayoutDBusInterface() ...@@ -291,6 +291,16 @@ KeyboardLayoutDBusInterface::~KeyboardLayoutDBusInterface()
QDBusConnection::sessionBus().unregisterService(s_keyboardService); QDBusConnection::sessionBus().unregisterService(s_keyboardService);
} }
void KeyboardLayoutDBusInterface::switchToNextLayout()
{
m_keyboardLayout->switchToNextLayout();
}
void KeyboardLayoutDBusInterface::switchToPreviousLayout()
{
m_keyboardLayout->switchToPreviousLayout();
}
bool KeyboardLayoutDBusInterface::setLayout(const QString &layout) bool KeyboardLayoutDBusInterface::setLayout(const QString &layout)
{ {
const auto layouts = m_xkb->layoutNames(); const auto layouts = m_xkb->layoutNames();
......
...@@ -43,6 +43,8 @@ public: ...@@ -43,6 +43,8 @@ public:
void init(); void init();
void checkLayoutChange(quint32 previousLayout); void checkLayoutChange(quint32 previousLayout);
void switchToNextLayout();
void switchToPreviousLayout();
void resetLayout(); void resetLayout();
void updateNotifier(); void updateNotifier();
...@@ -57,8 +59,6 @@ private: ...@@ -57,8 +59,6 @@ private:
void initDBusInterface(); void initDBusInterface();
void notifyLayoutChange(); void notifyLayoutChange();
void initNotifierItem(); void initNotifierItem();
void switchToNextLayout();
void switchToPreviousLayout();
void switchToLayout(xkb_layout_index_t index); void switchToLayout(xkb_layout_index_t index);
void reinitNotifierMenu(); void reinitNotifierMenu();
void loadShortcuts(); void loadShortcuts();
...@@ -81,6 +81,8 @@ public: ...@@ -81,6 +81,8 @@ public:
~KeyboardLayoutDBusInterface() override; ~KeyboardLayoutDBusInterface() override;
public Q_SLOTS: public Q_SLOTS:
void switchToNextLayout();
void switchToPreviousLayout();
bool setLayout(const QString &layout); bool setLayout(const QString &layout);
QString getCurrentLayout(); QString getCurrentLayout();
QString getCurrentLayoutLongName() const; QString getCurrentLayoutLongName() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment