[pkg-fso-commits] [SCM] freesmartphone.org demo GUI branch, master, updated. milestone2-25-gf72c138
Jan Luebbe
jluebbe at debian.org
Tue Sep 2 10:26:30 UTC 2008
The following commit has been merged in the master branch:
commit c78809baf07f47752bd44fe0f01fe2a942055518
Author: Alasal <info at alasal.be>
Date: Mon Aug 25 13:00:25 2008 +0200
Inserted a new menu on the bottom left icon. There you can find the exit button, where you can shutdown the system.
diff --git a/data/themes/zhone.edc b/data/themes/zhone.edc
index 918a8f6..8bc5819 100644
--- a/data/themes/zhone.edc
+++ b/data/themes/zhone.edc
@@ -1245,6 +1245,11 @@ collections {
}
group {
+ name: "main_menu";
+ #include "zhone_main_menu.edc"
+ }
+
+ group {
name: "menu";
#include "zhone_menu.edc"
}
diff --git a/data/themes/zhone_list_choose.edc b/data/themes/zhone_main_menu.edc
similarity index 69%
copy from data/themes/zhone_list_choose.edc
copy to data/themes/zhone_main_menu.edc
index 5542204..3b5da63 100644
--- a/data/themes/zhone_list_choose.edc
+++ b/data/themes/zhone_main_menu.edc
@@ -2,72 +2,78 @@ parts {
SWALLOWCLIP();
part {
- name: "list_button_box";
+ name: "menu_background";
+ type: RECT;
+ repeat_events: 0;
+ clip_to: "swallow_clip";
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ color: 0 0 0 192;
+ }
+ }
+
+ part {
+ name: "menu_target_box";
type: RECT;
mouse_events: 0;
clip_to: "swallow_clip";
description {
state: "default" 0.0;
rel1 {
- relative: 0.0 0.02;
+ relative: 0.05 0.05;
offset: 0 0;
}
rel2 {
- relative: 1.0 0.67;
+ relative: 0.95 0.95;
offset: -1 -1;
}
color: 0 0 0 0;
}
}
-
- PAGER(0.65, 0.75);
-
+
part {
- name: "action_button_box";
+ name: "list_button_box";
type: RECT;
mouse_events: 0;
clip_to: "swallow_clip";
description {
state: "default" 0.0;
rel1 {
- relative: 0.0 0.75;
+ relative: 0.0 0.02;
offset: 0 0;
}
rel2 {
- relative: 1.0 0.9;
+ relative: 1.0 0.67;
offset: -1 -1;
}
color: 0 0 0 0;
}
}
-
+
GRID_TARGET_2LINE("list_button_box", "list_0", 0, 0, 1, 6, "", "");
GRID_TARGET_2LINE("list_button_box", "list_1", 0, 1, 1, 6, "", "");
GRID_TARGET_2LINE("list_button_box", "list_2", 0, 2, 1, 6, "", "");
GRID_TARGET_2LINE("list_button_box", "list_3", 0, 3, 1, 6, "", "");
GRID_TARGET_2LINE("list_button_box", "list_4", 0, 4, 1, 6, "", "");
GRID_TARGET_2LINE("list_button_box", "list_5", 0, 5, 1, 6, "", "");
+ TARGET("menu_target_box", "cancel", 0, 2, 1, 3, "cancel");
- GRID_BUTTON_SYMBOL("action_button_box", "action_left", 0, 0, 3, 1, SYMBOL_LEFT);
- GRID_BUTTON_SYMBOL("action_button_box", "action_right", 2, 0, 3, 1, SYMBOL_RIGHT);
-
- BUTTONS_BOTTOM();
- BUTTON_OPTIONS();
- BUTTON_MENU();
- BUTTON_CLOSE();
+ TRANSITION();
}
programs {
- ACTIVATE("button_bottom_right");
-
ACTIVATE("target_list_0");
ACTIVATE("target_list_1");
ACTIVATE("target_list_2");
ACTIVATE("target_list_3");
ACTIVATE("target_list_4");
ACTIVATE("target_list_5");
-
- ACTIVATE("button_action_left");
- ACTIVATE("button_action_right");
-
- TRANSITION();
+ ACTIVATE("target_cancel");
}
diff --git a/src/zhone b/src/zhone
index e7c9fe4..53529e5 100755
--- a/src/zhone
+++ b/src/zhone
@@ -68,6 +68,7 @@ class edje_group(edje.Edje):
def __init__(self, main, group, parent_name="main"):
self.main = main
self.parent_name = parent_name
+ self.group = group
global edjepath
f = edjepath
try:
@@ -86,6 +87,11 @@ class edje_group(edje.Edje):
def on_edje_signal_button_bottom_right_pressed(self, emission, source):
self.main.transition_to(self.parent_name)
+ @edje.decorators.signal_callback("mouse,clicked,1", "button_bottom_left")
+ def on_edje_signal_button_bottom_left_pressed(self, emission, source):
+ self.main.groups["main_menu"].activate( self.group )
+ self.main.transition_to("main_menu")
+
#----------------------------------------------------------------------------#
class pyphone_main(edje_group):
#----------------------------------------------------------------------------#
@@ -1471,6 +1477,37 @@ class pyphone_menu( edje_group ):
#----------------------------------------------------------------------------#
+class pyphone_main_menu( edje_group ):
+#----------------------------------------------------------------------------#
+ def __init__( self, main ):
+ edje_group.__init__( self, main, "main_menu" )
+ self.signal_emit( "invisible", "" )
+
+ @edje.decorators.signal_callback( "mouse,clicked,1", "target_list_*" )
+ def on_edje_signal_button_list_pressed( self, emission, source ):
+ id = int( source.split( "_" )[-1] )
+ if( id == 5 ):
+ os.system("halt")
+
+ @edje.decorators.signal_callback( "mouse,clicked,1", "target_cancel" )
+ def on_edje_signal_button_bottom_middle_pressed( self, emission, source ):
+ self.deactivate()
+
+ def activate( self, group ):
+ self.group = group
+ self.signal_emit( "visible", "" )
+ for i in range( 0, 5 ):
+ self.part_text_set( "label_main_list_%i" % i, u"" )
+ self.part_text_set( "label_sub_list_%i" % i, u"" )
+ self.part_text_set( "label_main_list_5", u"Exit" )
+ self.part_text_set( "label_sub_list_5", u"Stop and exit Zhone" )
+
+ def deactivate( self ):
+ self.signal_emit( "invisible", "" )
+ self.main.transition_to(self.group)
+
+
+#----------------------------------------------------------------------------#
class pyphone_lock( edje_group ):
#----------------------------------------------------------------------------#
def __init__( self, main ):
@@ -1583,7 +1620,7 @@ class GUI(object):
self.groups[page] = ctor( self )
self.evas_canvas.evas_obj.data[page] = self.groups[page]
- for overlay in ( "menu", "lock", "error" ):
+ for overlay in ("main_menu", "menu", "lock", "error" ):
ctor = globals().get( "pyphone_%s" % overlay, None )
if ctor:
self.groups[overlay] = ctor( self )
--
freesmartphone.org demo GUI
More information about the pkg-fso-commits
mailing list