From 37a70c0dca59d331ac254734a45df63df3f5b9ce Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 27 Apr 2016 19:34:43 +0200 Subject: [PATCH] Add WiFi, Mobile Broadband, Bluetooth, and Touchpad OSD infos Differential Revision: https://phabricator.kde.org/D1222 --- shell/osd.cpp | 36 ++++++++++++++++++++++++++++++++++++ shell/osd.h | 4 ++++ 2 files changed, 40 insertions(+) diff --git a/shell/osd.cpp b/shell/osd.cpp index 290a661ce..b2996d5b3 100644 --- a/shell/osd.cpp +++ b/shell/osd.cpp @@ -88,6 +88,42 @@ void Osd::virtualDesktopChanged(const QString ¤tVirtualDesktopName) showText(QString(), currentVirtualDesktopName); } +void Osd::touchpadEnabledChanged(bool touchpadEnabled) +{ + if (touchpadEnabled) { + showText(QStringLiteral("input-touchpad-on"), i18nc("touchpad was enabled, keep short", "Touchpad On")); + } else { + showText(QStringLiteral("input-touchpad-off"), i18nc("touchpad was disabled, keep short", "Touchpad Off")); + } +} + +void Osd::wifiEnabledChanged(bool wifiEnabled) +{ + if (wifiEnabled) { + showText(QStringLiteral("network-wireless-on"), i18nc("wireless lan was enabled, keep short", "Wifi On")); + } else { + showText(QStringLiteral("network-wireless-off"), i18nc("wireless lan was disabled, keep short", "Wifi Off")); + } +} + +void Osd::bluetoothEnabledChanged(bool bluetoothEnabled) +{ + if (bluetoothEnabled) { + showText(QStringLiteral("preferences-system-bluetooth"), i18nc("Bluetooth was enabled, keep short", "Bluetooth On")); + } else { + showText(QStringLiteral("preferences-system-bluetooth-inactive"), i18nc("Bluetooth was disabled, keep short", "Bluetooth Off")); + } +} + +void Osd::wwanEnabledChanged(bool wwanEnabled) +{ + if (wwanEnabled) { + showText(QStringLiteral("network-mobile-on"), i18nc("mobile internet was enabled, keep short", "Mobile Internet On")); + } else { + showText(QStringLiteral("network-mobile-off"), i18nc("mobile internet was disabled, keep short", "Mobile Internet Off")); + } +} + bool Osd::init() { if (m_osdObject && m_osdObject->rootObject()) { diff --git a/shell/osd.h b/shell/osd.h index 9cc54acd7..120d87c64 100644 --- a/shell/osd.h +++ b/shell/osd.h @@ -45,6 +45,10 @@ public Q_SLOTS: void mediaPlayerVolumeChanged(int percent, const QString &playerName, const QString &playerIconName); void kbdLayoutChanged(const QString &layoutName); void virtualDesktopChanged(const QString ¤tVirtualDesktopName); + void touchpadEnabledChanged(bool touchpadEnabled); + void wifiEnabledChanged(bool wifiEnabled); + void bluetoothEnabledChanged(bool bluetoothEnabled); + void wwanEnabledChanged(bool wwanEnabled); Q_SIGNALS: void osdProgress(const QString &icon, const int percent, const QString &additionalText);