change battvolt color if chgmod play-only. thx thomasg
git-svn-id: http://www.neo1973-germany.de/svn@198 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
parent
2c51e6c632
commit
6716abc54a
3 changed files with 14 additions and 4 deletions
|
@ -28,6 +28,12 @@ color_classes {
|
||||||
color2: 128 128 128 255;
|
color2: 128 128 128 255;
|
||||||
color3: 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 {
|
color_class {
|
||||||
name: "button_active";
|
name: "button_active";
|
||||||
color: 0 0 0 255;
|
color: 0 0 0 255;
|
||||||
|
@ -237,11 +243,11 @@ collections {
|
||||||
type: TEXT;
|
type: TEXT;
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
description {
|
description {
|
||||||
color_class: "button_inactive";
|
color_class: "battvolt_active";
|
||||||
state: "default" 0.0;
|
state: "default" 0.0;
|
||||||
rel1 { relative: 5/6 0; }
|
rel1 { relative: 5/6 0; }
|
||||||
rel2 { relative: 1 1/20; }
|
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 */
|
} /* end battvolt_text */
|
||||||
part {
|
part {
|
||||||
|
|
|
@ -29,7 +29,11 @@ class DialerScreen(EdjeGroup):
|
||||||
PyneoController.register_callback("gsm_signal_strength_change", self.on_gsm_signal_strength_change)
|
PyneoController.register_callback("gsm_signal_strength_change", self.on_gsm_signal_strength_change)
|
||||||
PyneoController.register_callback("battvolt_change", self.on_battvolt_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])
|
self.part_text_set("battvolt_text", "%s V"%str(battvolt)[:4])
|
||||||
|
|
||||||
def on_sim_key_required(self, key_type):
|
def on_sim_key_required(self, key_type):
|
||||||
|
|
|
@ -336,7 +336,7 @@ class PyneoController(object):
|
||||||
status = dedbusmap(status_map)
|
status = dedbusmap(status_map)
|
||||||
print "POWER Status: " + str(status)
|
print "POWER Status: " + str(status)
|
||||||
if status.has_key('battvolt'):
|
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)
|
class_.notify_callbacks("pwr_status_change", status)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue