Don't open a main window when battery is critical

The main window suddenly opening when a battery is critical is very
disruptive. It can pop up on all sort of undesirable scenarios.

Rather than catch users of guard, merely show a notification that the
battery is critical.
This commit is contained in:
Hugo Osvaldo Barrera 2016-02-19 03:25:55 -03:00
parent 27d3d80d30
commit 63a98819a6
1 changed files with 2 additions and 2 deletions

View File

@ -161,10 +161,10 @@ def _status_changed(device, alert, reason):
if alert & ALERT.ATTENTION:
tray.attention(reason)
need_popup = alert & (ALERT.SHOW_WINDOW | ALERT.ATTENTION)
need_popup = alert & ALERT.SHOW_WINDOW
window.update(device, need_popup)
if alert & ALERT.NOTIFICATION:
if alert & (ALERT.NOTIFICATION | ALERT.ATTENTION):
notify.show(device, reason)