Use property BatteryState instead of OnBattery which does not update
when the battery is plugged into a power source (tried on a Matebook D
14).
Battery is considered charging if BatteryState is 1 (charging) or
4 (fully charged).
Change-Id: I5a0cf7bf8ee4cd313af885322d1edb67868c555a
Add a QDBusConnection to org.freedesktop.UPower to DBusPower in
dbuspower.cpp.
Add a QDBusInterface (m_uPowerInter) to PowerPlugin in powerplugin.h to
retrieve the correct battery device (calling 'EnumerateDevices'). Add a
QDBusInterface (m_uBatteryDeviceInter) to PowerPlugin in powerplugin.h
to gather battery time to empty and to fully recharged, and display it
in the power widget tip.
Add BatteryState enum in powerplugin.h to replace BATTERY_DISCHARED and
BATTERY_FULL macros, and add support for all the battery states provided
by UPower.
Change-Id: Ia4677298a1d13cab1e1a03035dbe4a2e660f994b
Note:
1. add a new function in PluginProxyInterface for set applet widget
visible from a plugin.
2. remove requestContextMenu function from PluginProxyInterface,
cause's the context menu should be handled in Dock, it is enough for
a plugin to simply provide menu data and handle callbacks with
functions itemContextMenu and invokedMenuItem in PluginsItemInterface
https://github.com/linuxdeepin/internal-discussion/issues/646
Change-Id: Ic4af4eee138e87911ff5b18ccbbb0c3f7187ac4d
- tray plugin support load dock plugin as system trays
- move network,sound,power plugins out of tray plugin, keepin them still be plugins
Change-Id: I03463ef55a9abc9823c1b9f7d9c95b00158e63ed