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"
This commit is contained in:
Andrey Butirsky 2020-11-23 16:56:18 +03:00
parent bdfb946267
commit 1755b0fd8b
2 changed files with 14 additions and 2 deletions

View file

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

View file

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