Bug 235236

Summary: option to show charge information only when on battery power
Product: [Plasma] plasma4 Reporter: Divan Santana <divan>
Component: widget-batteryAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: wishlist CC: niburu1, thiago.bauermann
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In: 4.6.3
Attachments: Patch implementing the feature.

Description Divan Santana 2010-04-24 07:10:40 UTC
Version:            (using KDE 4.4.2)
OS:                Linux
Installed from:    Ubuntu Packages

1) right click power widget in system tray.
2) select battery monitor settings
3) there should be a new option there which gives you the option to show charge information ONLY when on battery power therefore not when connected to the mains. Currently this can only be set for both(either on or off)
Comment 1 Lamarque V. Souza 2011-02-06 00:38:13 UTC
*** Bug 244283 has been marked as a duplicate of this bug. ***
Comment 2 niburu1 2011-03-06 11:40:54 UTC
Still waiting for this beauty of a feature...
Comment 3 Thiago Jung Bauermann 2011-04-11 03:13:42 UTC
Created attachment 58789 [details]
Patch implementing the feature.

This patch changes the battery plasma applet to remain inactive when all batteries are in the "NoCharge" state. Put in another way, if there are no batteries either charging or discharing, then the applet is inactive and thus hidden by default in the systray.

There's no configuration option for two reasons: first, I think this is the behavior that makes more sense and second, should a user want to revert to the old behavior, he/she can simply configure the systray to always show the battery applet.

Tested on KDE 4.6, but the patch applies on master too. What do you think?
Comment 4 Artur Souza (MoRpHeUz) 2011-04-11 14:45:41 UTC
Git commit 2ab62275da1916da97d117fb1b709cd86264a224 by Artur Duque de Souza.
Committed on 11/04/2011 at 14:33.
Pushed by asouza into branch 'master'.

Make the battery applet to remain inactive when batteries are in "NoCharge" state

Fix BUG #235236, making the battery inactive when it's not charging. The systray
will make the work to show/hide the applet when necessary and the user can configure
it's behavior through systray's config options.

Bonus points for not adding a new option to the applet's settings ;)

Tested with kdelibs and kdebase-workspace, both master branches.

Patch by: Thiago Jung Bauermann <thiago.bauermann@gmail.com>
Signed-off-by: Artur Duque de Souza <asouza@kde.org>

BUG:235236
CCMAIL:thiago.bauermann@gmail.com

M  +4    -2    plasma/generic/applets/battery/battery.cpp     

http://commits.kde.org/kde-workspace/2ab62275da1916da97d117fb1b709cd86264a224
Comment 5 Artur Souza (MoRpHeUz) 2011-04-11 19:13:14 UTC
Git commit b38a5b721ff08130acfa5cf27386d5b2c2e665d0 by Artur Duque de Souza.
Committed on 11/04/2011 at 14:33.
Pushed by asouza into branch 'KDE/4.6'.

Make the battery applet to remain inactive when batteries are in "NoCharge" state

Fix BUG #235236, making the battery inactive when it's not charging. The systray
will make the work to show/hide the applet when necessary and the user can configure
it's behavior through systray's config options.

Bonus points for not adding a new option to the applet's settings ;)

Tested with kdelibs and kdebase-workspace, both master branches.

Patch by: Thiago Jung Bauermann <thiago.bauermann@gmail.com>
Signed-off-by: Artur Duque de Souza <asouza@kde.org>

BUG:235236
FIXED-IN:4.6.3
CCMAIL:thiago.bauermann@gmail.com

M  +4    -2    plasma/generic/applets/battery/battery.cpp     

http://commits.kde.org/kde-workspace/b38a5b721ff08130acfa5cf27386d5b2c2e665d0
Comment 6 Divan Santana 2011-04-11 21:44:55 UTC
Brilliant work and thanks. :) Looking forward to testing this with 4.6.3 :)