change battvolt color if chgmod play-only. thx thomasg

git-svn-id: http://www.neo1973-germany.de/svn@198 46df4e5c-bc4e-4628-a0fc-830ba316316d
main
fgau 16 years ago
parent 2c51e6c632
commit 6716abc54a

@ -28,6 +28,12 @@ color_classes {
color2: 128 128 128 255;
color3: 128 128 128 255;;
}
color_class {
name: "battvolt_active";
color: 255 255 255 128;
color2: 128 128 128 255;
color3: 128 128 128 255;;
}
color_class {
name: "button_active";
color: 0 0 0 255;
@ -237,11 +243,11 @@ collections {
type: TEXT;
mouse_events: 0;
description {
color_class: "button_inactive";
color_class: "battvolt_active";
state: "default" 0.0;
rel1 { relative: 5/6 0; }
rel2 { relative: 1 1/20; }
text { text, "1.41 V"; font: "Sans"; size, 1; align, 1 0.5; fit, 0 1; }
text { text, "batt"; font: "Sans"; size, 1; align, 1 0.5; fit, 0 1; }
}
} /* end battvolt_text */
part {

@ -29,7 +29,11 @@ class DialerScreen(EdjeGroup):
PyneoController.register_callback("gsm_signal_strength_change", self.on_gsm_signal_strength_change)
PyneoController.register_callback("battvolt_change", self.on_battvolt_change)
def on_battvolt_change(self, battvolt):
def on_battvolt_change(self, battvolt, chgmode):
if chgmode == "play-only":
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 V"%str(battvolt)[:4])
def on_sim_key_required(self, key_type):

@ -336,7 +336,7 @@ class PyneoController(object):
status = dedbusmap(status_map)
print "POWER Status: " + str(status)
if status.has_key('battvolt'):
class_.notify_callbacks("battvolt_change", status['battvolt'])
class_.notify_callbacks("battvolt_change", status['battvolt'], status['chgmode'])
class_.notify_callbacks("pwr_status_change", status)
@classmethod

Loading…
Cancel
Save