From b190d0a5dcf184f908bb53b2745bfefefbaf9ca9 Mon Sep 17 00:00:00 2001 From: fgau Date: Thu, 12 Feb 2009 21:50:35 +0000 Subject: [PATCH] show capacity in dialer screen git-svn-id: http://www.neo1973-germany.de/svn@244 46df4e5c-bc4e-4628-a0fc-830ba316316d --- epydial/dialer_screen.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/epydial/dialer_screen.py b/epydial/dialer_screen.py index 1124b95..b395ab9 100644 --- a/epydial/dialer_screen.py +++ b/epydial/dialer_screen.py @@ -24,17 +24,16 @@ class DialerScreen(EdjeGroup): PyneoController.register_callback("sim_ready", self.on_sim_ready) PyneoController.register_callback("gsm_registering", self.on_gsm_registering) PyneoController.register_callback("gsm_registered", self.on_gsm_registered) -# PyneoController.register_callback("gsm_dialing", self.on_gsm_dialing) PyneoController.register_callback("gsm_operator_change", self.on_gsm_operator_change) PyneoController.register_callback("gsm_signal_strength_change", self.on_gsm_signal_strength_change) PyneoController.register_callback("capacity_change", self.on_capacity_change) def on_capacity_change(self, status): -# if chgmode == "play-only" or chgmode == "idle": -# EdjeGroup.color_class_set(self, "battvolt_active", 255, 255, 255, 64, 0, 0, 0, 0, 0, 0, 0, 0) -# else: -# EdjeGroup.color_class_set(self, "battvolt_active", 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0) - self.part_text_set("battvolt_text", "%s" % status['capacity']) + if status['status'] != "Charging": + EdjeGroup.color_class_set(self, "battvolt_active", 255, 255, 255, 64, 0, 0, 0, 0, 0, 0, 0, 0) + else: + EdjeGroup.color_class_set(self, "battvolt_active", 255, 255, 255, 128, 0, 0, 0, 0, 0, 0, 0, 0) + self.part_text_set("battvolt_text", "%s%%" % status['capacity']) def on_sim_key_required(self, key_type): print '---', 'opening keyring'