add screenlock/unlock. press # for 2 sec
git-svn-id: http://www.neo1973-germany.de/svn@148 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
parent
6964213a2b
commit
5b8c60044b
7 changed files with 262 additions and 43 deletions
|
@ -17,6 +17,7 @@ images {
|
||||||
image: "yes.png" COMP;
|
image: "yes.png" COMP;
|
||||||
image: "no.png" COMP;
|
image: "no.png" COMP;
|
||||||
image: "caller.png" COMP;
|
image: "caller.png" COMP;
|
||||||
|
image: "bg.png" COMP;
|
||||||
}
|
}
|
||||||
|
|
||||||
color_classes {
|
color_classes {
|
||||||
|
@ -48,6 +49,16 @@ collections {
|
||||||
parts {
|
parts {
|
||||||
part {
|
part {
|
||||||
name: "background";
|
name: "background";
|
||||||
|
type: IMAGE;
|
||||||
|
description {
|
||||||
|
state: "default" 0;
|
||||||
|
rel1 { relative: 0 0; offset: 0 0; };
|
||||||
|
rel2 { relative: 1 1; offset: 0 0; };
|
||||||
|
image { normal: "bg.png"; };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part {
|
||||||
|
name: "background_rect";
|
||||||
type: RECT;
|
type: RECT;
|
||||||
description {
|
description {
|
||||||
color_class: "active";
|
color_class: "active";
|
||||||
|
|
Binary file not shown.
|
@ -8,6 +8,8 @@
|
||||||
// Parameter1.2: "backspace"
|
// Parameter1.2: "backspace"
|
||||||
// Parameter1.3: "clear"
|
// Parameter1.3: "clear"
|
||||||
// Parameter1.4: "dial"
|
// Parameter1.4: "dial"
|
||||||
|
// Parameter1.5: "#"
|
||||||
|
// Parameter1.6: "screen_locked"
|
||||||
|
|
||||||
data {
|
data {
|
||||||
item: "author" "thomasg [thomas (a) gstaedtner (.) net]";
|
item: "author" "thomasg [thomas (a) gstaedtner (.) net]";
|
||||||
|
@ -67,16 +69,6 @@ part { \
|
||||||
description { \
|
description { \
|
||||||
state: "default" 0; \
|
state: "default" 0; \
|
||||||
color_class: "unvisible"; \
|
color_class: "unvisible"; \
|
||||||
/*gradient { \
|
|
||||||
spectrum: "button"; \
|
|
||||||
rel1 { relative: 0 0; offset: 0 0; }; \
|
|
||||||
rel2 { relative: 0 0.75; offset: 0 0; }; \
|
|
||||||
} \
|
|
||||||
fill { \
|
|
||||||
spread: 1; \
|
|
||||||
angle: 1; \
|
|
||||||
size { relative: 1 0; offset: 0 0; }; \
|
|
||||||
} */\
|
|
||||||
rel1 { relative: rel1x rel1y; offset: 0 0; }; \
|
rel1 { relative: rel1x rel1y; offset: 0 0; }; \
|
||||||
rel2 { relative: rel2x rel2y; offset: 0 0; }; \
|
rel2 { relative: rel2x rel2y; offset: 0 0; }; \
|
||||||
} \
|
} \
|
||||||
|
@ -96,7 +88,6 @@ part { \
|
||||||
name: "button_"button_number"_caption"; \
|
name: "button_"button_number"_caption"; \
|
||||||
type: TEXT; \
|
type: TEXT; \
|
||||||
mouse_events: 0; \
|
mouse_events: 0; \
|
||||||
/* effect: GLOW;*/ \
|
|
||||||
description { \
|
description { \
|
||||||
state: "default" 0; \
|
state: "default" 0; \
|
||||||
color_class: "button_inactive"; \
|
color_class: "button_inactive"; \
|
||||||
|
@ -138,18 +129,6 @@ program { \
|
||||||
transition: DECELERATE 0.1; \
|
transition: DECELERATE 0.1; \
|
||||||
}
|
}
|
||||||
|
|
||||||
/*#define DESIGN_SEPERATOR(seperator_number, rel1x, rel1y, rel2x, rel2y) \
|
|
||||||
part { \
|
|
||||||
name: "design_seperator_"seperator_number; \
|
|
||||||
type: RECT; \
|
|
||||||
description { \
|
|
||||||
state: "defeault" 0; \
|
|
||||||
color: 255 255 255 100; \
|
|
||||||
rel1 { relative: rel1x rel1y; offset: -0.5 7; }; \
|
|
||||||
rel2 { relative: rel2x rel2y; offset: 0.5 -9; }; \
|
|
||||||
} \
|
|
||||||
}*/
|
|
||||||
|
|
||||||
collections {
|
collections {
|
||||||
group {
|
group {
|
||||||
name: "pyneo/dialer/main";
|
name: "pyneo/dialer/main";
|
||||||
|
@ -180,6 +159,30 @@ collections {
|
||||||
run_program(PROGRAM:"numberdisplay_backspace_emit_signal_backspace");
|
run_program(PROGRAM:"numberdisplay_backspace_emit_signal_backspace");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public flag_timer_running_hash_key;
|
||||||
|
public flag_hash_key_sent;
|
||||||
|
public timer_id_hash_key;
|
||||||
|
|
||||||
|
public clear_timer_hash_key() {
|
||||||
|
set_int(flag_hash_key_sent, 0);
|
||||||
|
set_int(flag_timer_running_hash_key, 1);
|
||||||
|
timer_id_hash_key = timer(2, "clear_send_hash_key", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public clear_send_hash_key() {
|
||||||
|
if (get_int(flag_hash_key_sent) == 0) {
|
||||||
|
set_int(flag_timer_running_hash_key, 0);
|
||||||
|
run_program(PROGRAM:"hash_key_emit_signal_screen_locked");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public hash_key_send() {
|
||||||
|
if (get_int(flag_timer_running_hash_key) == 1) {
|
||||||
|
cancel_timer(get_int(timer_id_hash_key));
|
||||||
|
set_int(flag_hash_key_sent, 1);
|
||||||
|
run_program(PROGRAM:"hash_key_emit_signal_#");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parts {
|
parts {
|
||||||
|
@ -433,7 +436,91 @@ collections {
|
||||||
/* row 4 */
|
/* row 4 */
|
||||||
BUTTON(10, 0, 58/70 , 1/3, 68/70, "*");
|
BUTTON(10, 0, 58/70 , 1/3, 68/70, "*");
|
||||||
BUTTON(11, 1/3, 58/70, 2/3, 68/70, 0);
|
BUTTON(11, 1/3, 58/70, 2/3, 68/70, 0);
|
||||||
BUTTON(12, 2/3, 58/70, 3/3, 68/70, "#");
|
/*#define BUTTON(button_number, rel1x, rel1y, rel2x, rel2y, button_caption)*/
|
||||||
|
/*BUTTON(12, 2/3, 58/70, 3/3, 68/70, "#");*/
|
||||||
|
part {
|
||||||
|
name: "button_12";
|
||||||
|
type: RECT;
|
||||||
|
description {
|
||||||
|
state: "default" 0;
|
||||||
|
color_class: "unvisible";
|
||||||
|
rel1 { relative: 2/3 58/70; offset: 0 0; };
|
||||||
|
rel2 { relative: 3/3 68/70; offset: 0 0; };
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "default" 0.5;
|
||||||
|
inherit: "default" 0;
|
||||||
|
color_class: "button_active";
|
||||||
|
rel1.offset: 0 -5;
|
||||||
|
rel2.offset: 0 5;
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "default" 1;
|
||||||
|
inherit: "default" 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part {
|
||||||
|
name: "button_12_caption";
|
||||||
|
type: TEXT;
|
||||||
|
mouse_events: 0;
|
||||||
|
description { \
|
||||||
|
state: "default" 0;
|
||||||
|
color_class: "button_inactive";
|
||||||
|
rel1 {
|
||||||
|
to: "button_12";
|
||||||
|
relative: 0 0;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
to: "button_12";
|
||||||
|
relative: 1 1;
|
||||||
|
}
|
||||||
|
text {
|
||||||
|
text: "#";
|
||||||
|
size: 18;
|
||||||
|
font: "Sans:style=Bold,Edje-Vera";
|
||||||
|
fit: 1 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "button_12_animation";
|
||||||
|
signal: "mouse,down,*";
|
||||||
|
source: "button_12";
|
||||||
|
action: STATE_SET "default" 0.5;
|
||||||
|
target: "button_12";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "button_12_animation_end";
|
||||||
|
signal: "mouse,up,*";
|
||||||
|
source: "button_12";
|
||||||
|
action: STATE_SET "default" 1;
|
||||||
|
target: "button_12";
|
||||||
|
transition: DECELERATE 0.1;
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "hash_key_signal_emit";
|
||||||
|
signal: "mouse,down,*";
|
||||||
|
source: "button_12";
|
||||||
|
script {
|
||||||
|
clear_timer_hash_key();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "hash_key_signal_stop";
|
||||||
|
signal: "mouse,up,*";
|
||||||
|
source: "button_12";
|
||||||
|
script {
|
||||||
|
hash_key_send();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "hash_key_emit_signal_#";
|
||||||
|
action: SIGNAL_EMIT "dialer_send" "#";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "hash_key_emit_signal_screen_locked";
|
||||||
|
action: SIGNAL_EMIT "dialer_send" "screen_locked";
|
||||||
|
}
|
||||||
/*DESIGN_SEPERATOR(10, 1/3, 58/70, 1/3, 68/70);
|
/*DESIGN_SEPERATOR(10, 1/3, 58/70, 1/3, 68/70);
|
||||||
DESIGN_SEPERATOR(11, 2/3, 58/70, 2/3, 68/70);*/
|
DESIGN_SEPERATOR(11, 2/3, 58/70, 2/3, 68/70);*/
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -8,6 +8,8 @@
|
||||||
// Parameter1.2: "backspace"
|
// Parameter1.2: "backspace"
|
||||||
// Parameter1.3: "clear"
|
// Parameter1.3: "clear"
|
||||||
// Parameter1.4: "dial"
|
// Parameter1.4: "dial"
|
||||||
|
// Parameter1.5: "#"
|
||||||
|
// Parameter1.6: "screen_locked"
|
||||||
|
|
||||||
data {
|
data {
|
||||||
item: "author" "thomasg [thomas (a) gstaedtner (.) net]";
|
item: "author" "thomasg [thomas (a) gstaedtner (.) net]";
|
||||||
|
@ -194,6 +196,30 @@ collections {
|
||||||
run_program(PROGRAM:"numberdisplay_backspace_emit_signal_backspace");
|
run_program(PROGRAM:"numberdisplay_backspace_emit_signal_backspace");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public flag_timer_running_hash_key;
|
||||||
|
public flag_hash_key_sent;
|
||||||
|
public timer_id_hash_key;
|
||||||
|
|
||||||
|
public clear_timer_hash_key() {
|
||||||
|
set_int(flag_hash_key_sent, 0);
|
||||||
|
set_int(flag_timer_running_hash_key, 1);
|
||||||
|
timer_id_hash_key = timer(2, "clear_send_hash_key", 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public clear_send_hash_key() {
|
||||||
|
if (get_int(flag_hash_key_sent) == 0) {
|
||||||
|
set_int(flag_timer_running_hash_key, 0);
|
||||||
|
run_program(PROGRAM:"hash_key_emit_signal_screen_locked");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public hash_key_send() {
|
||||||
|
if (get_int(flag_timer_running_hash_key) == 1) {
|
||||||
|
cancel_timer(get_int(timer_id_hash_key));
|
||||||
|
set_int(flag_hash_key_sent, 1);
|
||||||
|
run_program(PROGRAM:"hash_key_emit_signal_#");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
parts {
|
parts {
|
||||||
|
@ -461,7 +487,90 @@ collections {
|
||||||
/* row 4 */
|
/* row 4 */
|
||||||
BUTTON(10, 0, 58/70 , 1/3, 68/70, "*");
|
BUTTON(10, 0, 58/70 , 1/3, 68/70, "*");
|
||||||
BUTTON(11, 1/3, 58/70, 2/3, 68/70, 0);
|
BUTTON(11, 1/3, 58/70, 2/3, 68/70, 0);
|
||||||
BUTTON(12, 2/3, 58/70, 3/3, 68/70, "#");
|
/*BUTTON(12, 2/3, 58/70, 3/3, 68/70, "#");*/
|
||||||
|
part {
|
||||||
|
name: "button_12";
|
||||||
|
type: RECT;
|
||||||
|
description {
|
||||||
|
state: "default" 0;
|
||||||
|
color_class: "unvisible";
|
||||||
|
rel1 { relative: 2/3 58/70; offset: 0 0; };
|
||||||
|
rel2 { relative: 3/3 68/70; offset: 0 0; };
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "default" 0.5;
|
||||||
|
inherit: "default" 0;
|
||||||
|
color_class: "button_active";
|
||||||
|
rel1.offset: 0 -5;
|
||||||
|
rel2.offset: 0 5;
|
||||||
|
}
|
||||||
|
description {
|
||||||
|
state: "default" 1;
|
||||||
|
inherit: "default" 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
part {
|
||||||
|
name: "button_12_caption";
|
||||||
|
type: TEXT;
|
||||||
|
mouse_events: 0;
|
||||||
|
description { \
|
||||||
|
state: "default" 0;
|
||||||
|
color_class: "button_inactive";
|
||||||
|
rel1 {
|
||||||
|
to: "button_12";
|
||||||
|
relative: 0 0;
|
||||||
|
}
|
||||||
|
rel2 {
|
||||||
|
to: "button_12";
|
||||||
|
relative: 1 1;
|
||||||
|
}
|
||||||
|
text {
|
||||||
|
text: "#";
|
||||||
|
size: 18;
|
||||||
|
font: "Sans:style=Bold,Edje-Vera";
|
||||||
|
fit: 1 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "button_12_animation";
|
||||||
|
signal: "mouse,down,*";
|
||||||
|
source: "button_12";
|
||||||
|
action: STATE_SET "default" 0.5;
|
||||||
|
target: "button_12";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "button_12_animation_end";
|
||||||
|
signal: "mouse,up,*";
|
||||||
|
source: "button_12";
|
||||||
|
action: STATE_SET "default" 1;
|
||||||
|
target: "button_12";
|
||||||
|
transition: DECELERATE 0.1;
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "hash_key_signal_emit";
|
||||||
|
signal: "mouse,down,*";
|
||||||
|
source: "button_12";
|
||||||
|
script {
|
||||||
|
clear_timer_hash_key();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "hash_key_signal_stop";
|
||||||
|
signal: "mouse,up,*";
|
||||||
|
source: "button_12";
|
||||||
|
script {
|
||||||
|
hash_key_send();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "hash_key_emit_signal_#";
|
||||||
|
action: SIGNAL_EMIT "dialer_send" "#";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
name: "hash_key_emit_signal_screen_locked";
|
||||||
|
action: SIGNAL_EMIT "dialer_send" "screen_locked";
|
||||||
|
}
|
||||||
DESIGN_SEPERATOR(10, 1/3, 58/70, 1/3, 68/70);
|
DESIGN_SEPERATOR(10, 1/3, 58/70, 1/3, 68/70);
|
||||||
DESIGN_SEPERATOR(11, 2/3, 58/70, 2/3, 68/70);
|
DESIGN_SEPERATOR(11, 2/3, 58/70, 2/3, 68/70);
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
|
@ -16,7 +16,7 @@ FULLSCREEN = True
|
||||||
APP_TITLE = "epydial"
|
APP_TITLE = "epydial"
|
||||||
WM_INFO = ("epydial", "epydial")
|
WM_INFO = ("epydial", "epydial")
|
||||||
|
|
||||||
EDJE_FILE_PATH = "data/themes/blackwhite/"
|
EDJE_FILE_PATH = "data/themes/default/"
|
||||||
|
|
||||||
MAIN_SCREEN_NAME = "pyneo/dialer/main"
|
MAIN_SCREEN_NAME = "pyneo/dialer/main"
|
||||||
INCALL_SCREEN_NAME = "pyneo/dialer/incall"
|
INCALL_SCREEN_NAME = "pyneo/dialer/incall"
|
||||||
|
@ -81,10 +81,11 @@ class InCallScreen(EdjeGroup):
|
||||||
|
|
||||||
class MainScreen(EdjeGroup):
|
class MainScreen(EdjeGroup):
|
||||||
text = None
|
text = None
|
||||||
|
|
||||||
def __init__(self, screen_manager):
|
def __init__(self, screen_manager):
|
||||||
EdjeGroup.__init__(self, screen_manager, MAIN_SCREEN_NAME)
|
EdjeGroup.__init__(self, screen_manager, MAIN_SCREEN_NAME)
|
||||||
self.text = []
|
self.text = []
|
||||||
|
self.look_screen = False
|
||||||
ecore.timer_add(60.0, self.display_time)
|
ecore.timer_add(60.0, self.display_time)
|
||||||
self.display_time()
|
self.display_time()
|
||||||
|
|
||||||
|
@ -133,7 +134,7 @@ class MainScreen(EdjeGroup):
|
||||||
self.text.append(source)
|
self.text.append(source)
|
||||||
print ''.join(self.text)
|
print ''.join(self.text)
|
||||||
self.part_text_set("numberdisplay_text", '*' * len(self.text))
|
self.part_text_set("numberdisplay_text", '*' * len(self.text))
|
||||||
elif source == "backspace_down":
|
elif source == "backspace":
|
||||||
self.text = self.text[:-1]
|
self.text = self.text[:-1]
|
||||||
print ''.join(self.text)
|
print ''.join(self.text)
|
||||||
self.part_text_set("numberdisplay_text", '*' * len(self.text))
|
self.part_text_set("numberdisplay_text", '*' * len(self.text))
|
||||||
|
@ -142,20 +143,31 @@ class MainScreen(EdjeGroup):
|
||||||
self.part_text_set("numberdisplay_text", "Verifying ...")
|
self.part_text_set("numberdisplay_text", "Verifying ...")
|
||||||
PyneoController.gsm_unlock_sim(''.join(self.text))
|
PyneoController.gsm_unlock_sim(''.join(self.text))
|
||||||
else:
|
else:
|
||||||
if source.isdigit() or source in ('*', '#'):
|
if self.look_screen:
|
||||||
self.text.append(source)
|
self.part_text_set("numberdisplay_text", "Screen locked")
|
||||||
print ''.join(self.text)
|
if source == "screen_locked":
|
||||||
self.part_text_set("numberdisplay_text", "".join(self.text))
|
self.text = []
|
||||||
elif source == "backspace":
|
self.look_screen = False
|
||||||
self.text = self.text[:-1]
|
self.part_text_set("numberdisplay_text", "Dial when ready")
|
||||||
print ''.join(self.text)
|
else:
|
||||||
self.part_text_set("numberdisplay_text", "".join(self.text))
|
if source.isdigit() or source in ('*', '#'):
|
||||||
elif source == "clear":
|
self.text.append(source)
|
||||||
self.text = []
|
print ''.join(self.text)
|
||||||
print ''.join(self.text)
|
self.part_text_set("numberdisplay_text", "".join(self.text))
|
||||||
self.part_text_set("numberdisplay_text", "".join(self.text))
|
elif source == "backspace":
|
||||||
elif source == "dial":
|
self.text = self.text[:-1]
|
||||||
PyneoController.gsm_dial("".join(self.text))
|
print ''.join(self.text)
|
||||||
|
self.part_text_set("numberdisplay_text", "".join(self.text))
|
||||||
|
elif source == "clear":
|
||||||
|
self.text = []
|
||||||
|
print ''.join(self.text)
|
||||||
|
self.part_text_set("numberdisplay_text", "".join(self.text))
|
||||||
|
elif source == "screen_locked":
|
||||||
|
self.text = []
|
||||||
|
self.look_screen = True
|
||||||
|
self.part_text_set("numberdisplay_text", "Screen locked")
|
||||||
|
elif source == "dial":
|
||||||
|
PyneoController.gsm_dial("".join(self.text))
|
||||||
|
|
||||||
|
|
||||||
class PyneoController(object):
|
class PyneoController(object):
|
||||||
|
@ -432,7 +444,7 @@ class EvasCanvas(object):
|
||||||
self.evas_obj.evas.image_cache_set(IMAGE_CACHE_SIZE*1024*1024)
|
self.evas_obj.evas.image_cache_set(IMAGE_CACHE_SIZE*1024*1024)
|
||||||
self.evas_obj.evas.font_cache_set(FONT_CACHE_SIZE*1024*1024)
|
self.evas_obj.evas.font_cache_set(FONT_CACHE_SIZE*1024*1024)
|
||||||
self.evas_obj.show()
|
self.evas_obj.show()
|
||||||
|
|
||||||
def on_resize(self, evas_obj):
|
def on_resize(self, evas_obj):
|
||||||
x, y, w, h = evas_obj.evas.viewport
|
x, y, w, h = evas_obj.evas.viewport
|
||||||
size = (w, h)
|
size = (w, h)
|
||||||
|
|
Loading…
Reference in a new issue