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

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()
QDBusConnection::sessionBus().unregisterService(s_keyboardService);
}
void KeyboardLayoutDBusInterface::switchToNextLayout()
{
m_keyboardLayout->switchToNextLayout();
}
void KeyboardLayoutDBusInterface::switchToPreviousLayout()
{
m_keyboardLayout->switchToPreviousLayout();
}
bool KeyboardLayoutDBusInterface::setLayout(const QString &layout)
{
const auto layouts = m_xkb->layoutNames();
......
......@@ -43,6 +43,8 @@ public:
void init();
void checkLayoutChange(quint32 previousLayout);
void switchToNextLayout();
void switchToPreviousLayout();
void resetLayout();
void updateNotifier();
......@@ -57,8 +59,6 @@ private:
void initDBusInterface();
void notifyLayoutChange();
void initNotifierItem();
void switchToNextLayout();
void switchToPreviousLayout();
void switchToLayout(xkb_layout_index_t index);
void reinitNotifierMenu();
void loadShortcuts();
......@@ -81,6 +81,8 @@ public:
~KeyboardLayoutDBusInterface() override;
public Q_SLOTS:
void switchToNextLayout();
void switchToPreviousLayout();
bool setLayout(const QString &layout);
QString getCurrentLayout();
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