History log of /haiku/src/apps/powerstatus/PowerStatusView.h
Revision Date Author Comments
# 0f293bd7 30-May-2023 Theodore Wang <theodorewang12@gmail.com>

PowerStatus: Implemented sound cues for low battery and charging

* Added two beep events ("Low battery" and "Battery charged") to Sounds
* "Battery charged" is activated when the battery is fully charged to 100 percent
* "Low battery" is activated when the battery is less than 15 percent
or has less than 30 minutes of usage time left, whichever comes first

Change-Id: If95f812be7a0aa15d668a42fdcfaccd2995d2b4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6481
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>


# f6395def 15-Mar-2023 Emir SARI <bitigchi@me.com>

PowerStatus: Use BNumberFormat for percentage value

This provides automatic percentage formatting according to the locale
setting.

Change-Id: I022331866acc2e20d819625c6d070807f476c745
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6209
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: Máximo Castañeda <antiswen@yahoo.es>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>


# 10074df1 08-Dec-2020 Pawan Wadhwani <pawanw17@gmail.com>

PowerStatus: eliminate redundant power notification

patched duplicate low power notifications by adding a flag to
remove redundant notification calls by adding a parameter in
the update function.

Fixes #12277

Change-Id: Iec3859156e745ce0e1c08250151e17b3317847d5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3493
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 66672a5f 21-Nov-2017 Janus <janus2@ymail.com>

Fix broken convention


# d18b272d 21-Nov-2017 Janus <janus2@ymail.com>

[PowerStatus] The menu item quit doesn't close the Tracker

* Fixes #13790


# 830758ad 20-Nov-2017 Kacper Kasper <kacperkasper@gmail.com>

PowerStatus: convert to BTabView.

* Move text inside battery if possible.
* Fix location of the spark.
* Fixes #5422 and #7330.


# e889ce25 08-Jan-2015 Axel Dörfler <axeld@pinc-software.de>

PowerStatus: fixed how the info is retrieved.

* The state was usually 0 once there was more than one battery
slot.
* We now ignore missing batteries completely, instead of taking
eventually bogus data into account.
* Fixed how to determine fOnline, and fHasBattery, and when to ignore
probes.
* Made it more strict when to show the notification, ie. it's now only
shown when actually discharging.
* This fixes all spurious notifications for me.


# f1bfd2df 29-Dec-2014 Axel Dörfler <axeld@pinc-software.de>

PowerStatus: minor cleanup.

* Moved low battery notification code into its own method.
* Slightly changed low battery notification text.


# bf97f54d 15-Oct-2014 Axel Dörfler <axeld@pinc-software.de>

PowerStatus: removed unused uninitialized variable.

* Might help with #11329; I can't test this right now.


# fd19c736 30-Apr-2013 Adrien Destugues <pulkomandy@gmail.com>

Fix BAboutWindow lifecycle

BAboutWindow returned false in QuitRequested in order to hide instead of closing.
Not only this keeps a BLooper running for a rarely used window, but it also
prevents quitting an application in the window was not destroyed first.

* Remove aforementioned QuitRequested method,
* Add a static GetWindow method that returns the existing about window, if there
is one, or creates one if there is not. A boolean can be set to tell the caller
what happened,
* Adjust all callers to use that new method, instead of managing the window themselves.


# 5070e7e2 12-Nov-2012 John Scipione <jscipione@gmail.com>

Init fAboutWindow NULL first


# b31b5233 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* The deskbar replicant now memorizes its settings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32265 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 95ea1dab 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Improved the disabled look (in case there is no battery -- apparently, the
ACPI interface needs some more work, as it currently uses
BATTERY_CRITICAL_STATE to report that there is no battery...).
* Cleanup of many more of Clemens' coding style violations...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32256 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bd767f5a 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Worked over the battery look a bit, looks much better now IMO.
* Made the replicant transparent (for background images).
* Fixed many of Clemen's coding style violations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32255 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b2cdb463 30-Jul-2009 Clemens Zeidler <clemens.zeidler@googlemail.com>

The monitor watcher list was not locked when broadcast a message.
Probably it caused #4151



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31982 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6aed176c 09-Jul-2009 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add a ACPI battery driver interface to the PowerStatus app. If there is anyone with a working APM please test if its still working!
TODO:
- Get along with the Layout engine, the extended info window looks "no very nice".
- Reading the battery status takes too long so put it into a thread or cache it.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31484 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d493e695 29-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Wrote a small application to show the power status in a window, replicant, or the
Deskbar tray. Currently only works under BeOS, and has rather ugly graphics; Haiku
doesn't have an APM kernel interface yet, and I was too lazy to make any nice
icons/drawings :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19145 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e889ce25192fe68ce2415018895bf53150bccdb2 08-Jan-2015 Axel Dörfler <axeld@pinc-software.de>

PowerStatus: fixed how the info is retrieved.

* The state was usually 0 once there was more than one battery
slot.
* We now ignore missing batteries completely, instead of taking
eventually bogus data into account.
* Fixed how to determine fOnline, and fHasBattery, and when to ignore
probes.
* Made it more strict when to show the notification, ie. it's now only
shown when actually discharging.
* This fixes all spurious notifications for me.


# f1bfd2dff3c1d50f2f1cf199ab4b175c8ddaa694 29-Dec-2014 Axel Dörfler <axeld@pinc-software.de>

PowerStatus: minor cleanup.

* Moved low battery notification code into its own method.
* Slightly changed low battery notification text.


# bf97f54d1769f791546b2a9bbcf2350e0226659b 15-Oct-2014 Axel Dörfler <axeld@pinc-software.de>

PowerStatus: removed unused uninitialized variable.

* Might help with #11329; I can't test this right now.


# fd19c7366df2134106131c370c99c3ed7f38757f 30-Apr-2013 Adrien Destugues <pulkomandy@gmail.com>

Fix BAboutWindow lifecycle

BAboutWindow returned false in QuitRequested in order to hide instead of closing.
Not only this keeps a BLooper running for a rarely used window, but it also
prevents quitting an application in the window was not destroyed first.

* Remove aforementioned QuitRequested method,
* Add a static GetWindow method that returns the existing about window, if there
is one, or creates one if there is not. A boolean can be set to tell the caller
what happened,
* Adjust all callers to use that new method, instead of managing the window themselves.


# 5070e7e2228b34caae7f8d99846059672bb86b69 12-Nov-2012 John Scipione <jscipione@gmail.com>

Init fAboutWindow NULL first


# b31b52339c574717cbd352c2b294aa831d35bee8 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* The deskbar replicant now memorizes its settings.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32265 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 95ea1dab5af35be055bf55b19937dfc9bf55caae 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Improved the disabled look (in case there is no battery -- apparently, the
ACPI interface needs some more work, as it currently uses
BATTERY_CRITICAL_STATE to report that there is no battery...).
* Cleanup of many more of Clemens' coding style violations...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32256 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bd767f5a4e51e6fb6ee3d4f81085052dfb6ee11c 11-Aug-2009 Axel Dörfler <axeld@pinc-software.de>

* Worked over the battery look a bit, looks much better now IMO.
* Made the replicant transparent (for background images).
* Fixed many of Clemen's coding style violations.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32255 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b2cdb463b3c335901edabaab244e80431418b028 30-Jul-2009 Clemens Zeidler <clemens.zeidler@googlemail.com>

The monitor watcher list was not locked when broadcast a message.
Probably it caused #4151



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31982 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6aed176c0988537d716a89e11130b4253179f607 09-Jul-2009 Clemens Zeidler <clemens.zeidler@googlemail.com>

Add a ACPI battery driver interface to the PowerStatus app. If there is anyone with a working APM please test if its still working!
TODO:
- Get along with the Layout engine, the extended info window looks "no very nice".
- Reading the battery status takes too long so put it into a thread or cache it.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31484 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d493e695274d0c429af354899cfdef575d23569a 29-Oct-2006 Axel Dörfler <axeld@pinc-software.de>

Wrote a small application to show the power status in a window, replicant, or the
Deskbar tray. Currently only works under BeOS, and has rather ugly graphics; Haiku
doesn't have an APM kernel interface yet, and I was too lazy to make any nice
icons/drawings :)


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19145 a95241bf-73f2-0310-859d-f6bbb57e9c96