From 63a98819a6fe164918633076b263880a24550d7e Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Fri, 19 Feb 2016 03:25:55 -0300 Subject: [PATCH] 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. --- lib/solaar/ui/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/solaar/ui/__init__.py b/lib/solaar/ui/__init__.py index 68a7e08b..3f64e83f 100644 --- a/lib/solaar/ui/__init__.py +++ b/lib/solaar/ui/__init__.py @@ -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)