/* * brightnessosdwidget.cpp * adapted from kdemultimedia/kmix/osdwidget.cpp * SPDX-FileCopyrightText: 2009 Aurélien Gâteau * SPDX-FileCopyrightText: 2009 Dario Andres Rodriguez * SPDX-FileCopyrightText: 2009 Christian Esken * SPDX-FileCopyrightText: 2010 Felix Geyer * SPDX-FileCopyrightText: 2015 Kai Uwe Broulik * * SPDX-License-Identifier: GPL-2.0-or-later * */ #include "brightnessosdwidget.h" #include #include namespace BrightnessOSDWidget { void show(int percentage, PowerDevil::BrightnessControlType type) { QString method; if (type == PowerDevil::BrightnessControlType::Keyboard) { method = QLatin1String("keyboardBrightnessChanged"); } else { method = QLatin1String("brightnessChanged"); } QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.plasmashell"), QStringLiteral("/org/kde/osdService"), QStringLiteral("org.kde.osdService"), method); msg << percentage; QDBusConnection::sessionBus().asyncCall(msg); } }