[pkg-fso-commits] [SCM] freesmartphone.org demo GUI branch, master, updated. milestone4-28-g19ac3e4

Jan Luebbe jluebbe at debian.org
Mon Feb 2 18:44:24 UTC 2009


The following commit has been merged in the master branch:
commit 2f497ca84417ed98878fec16cab42fa1fc1797bd
Author: Peter Strapp <peter at strapp.co.uk>
Date:   Thu Jan 22 14:57:03 2009 +0100

    rename error page to alert

diff --git a/data/themes/toby/zhone.edc b/data/themes/toby/zhone.edc
index b97c5ba..92edc93 100644
--- a/data/themes/toby/zhone.edc
+++ b/data/themes/toby/zhone.edc
@@ -80,10 +80,12 @@ styles {
       tag:  "tab" "  \t";
    }
    style {
-      name: "error_style";
-      base: "font="FONT_NAME" font_size=36 align=center valign=center color=#fff wrap=word outline_color=#000 style=soft_outline";
+      name: "alert_style";
+      base: "font="FONT_NAME" font_size=24 align=center valign=center color=#fff wrap=word outline_color=#000 style=soft_outline";
       tag:  "br" "  \n";
       tag:  "tab" "  \t";
+      tag:  "title"  "+ font_size=36";
+      tag:  "/title" "- \n";
    }
 }
 
@@ -1013,7 +1015,7 @@ collections {
                 }
             }
             part {
-                name: "error";
+                name: "alert";
                 type: SWALLOW;
                 description {
                     state: "default" 0.0;
@@ -1179,8 +1181,8 @@ collections {
         #include "zhone_menu.edc"
     }
     group {
-        name: "error";
-        #include "zhone_error.edc"
+        name: "alert";
+        #include "zhone_alert.edc"
     }
     group {
         name: "lock";
diff --git a/data/themes/old/zhone_error.edc b/data/themes/toby/zhone_alert.edc
similarity index 97%
copy from data/themes/old/zhone_error.edc
copy to data/themes/toby/zhone_alert.edc
index f0a6402..eaa9c17 100644
--- a/data/themes/old/zhone_error.edc
+++ b/data/themes/toby/zhone_alert.edc
@@ -2,7 +2,7 @@ parts {
     SWALLOWCLIP();
 
     part {
-        name: "error_background";
+        name: "alert_background";
         type: RECT;
         repeat_events: 0;
         clip_to: "swallow_clip";
@@ -36,7 +36,7 @@ parts {
                 offset: -1 -1;
             }
             text {
-                style: "error_style";
+                style: "alert_style";
             }
         }
     }
@@ -60,7 +60,7 @@ parts {
         }
     }
     
-    #define ERROR_BUTTON(part_name, xpos, ypos, xcount, ycount, label)  \
+    #define ALERT_BUTTON(part_name, xpos, ypos, xcount, ycount, label)  \
     part {                                                              \
         name: "border_"part_name;                                       \
         type: RECT;                                                     \
@@ -171,9 +171,9 @@ parts {
         target: "button_"part_name;                                     \
     }
 
-    ERROR_BUTTON("0", 0, 0, 3, 1, "");
-    ERROR_BUTTON("1", 1, 0, 3, 1, "");
-    ERROR_BUTTON("2", 2, 0, 3, 1, "");
+    ALERT_BUTTON("0", 0, 0, 3, 1, "");
+    ALERT_BUTTON("1", 1, 0, 3, 1, "");
+    ALERT_BUTTON("2", 2, 0, 3, 1, "");
 
     TRANSITION();
 }
diff --git a/data/themes/toby/zhone_error.edc b/data/themes/toby/zhone_error.edc
index f0a6402..e69de29 100644
--- a/data/themes/toby/zhone_error.edc
+++ b/data/themes/toby/zhone_error.edc
@@ -1,184 +0,0 @@
-parts {
-    SWALLOWCLIP();
-
-    part {
-        name: "error_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: "description";
-        type: TEXTBLOCK;
-        mouse_events: 0;
-        clip_to: "swallow_clip";
-        description {
-            state: "default" 0.0;
-            rel1 {
-                relative: 0.1 0.05;
-                offset: 0 0;
-            }
-            rel2 {
-                relative: 0.9 0.65;
-                offset: -1 -1;
-            }
-            text {
-                style: "error_style";
-            }
-        }
-    }
-
-    part {
-        name: "button_box";
-        type: RECT;
-        mouse_events: 0;
-        clip_to: "swallow_clip";
-        description {
-            state: "default" 0.0;
-            rel1 {
-                relative: 0.0 0.7;
-                offset: 0 0;
-            }
-            rel2 {
-                relative: 1.0 0.9;
-                offset: -1 -1;
-            }
-            color: 0 0 0 0;
-        }
-    }
-    
-    #define ERROR_BUTTON(part_name, xpos, ypos, xcount, ycount, label)  \
-    part {                                                              \
-        name: "border_"part_name;                                       \
-        type: RECT;                                                     \
-        mouse_events: 0;                                                \
-        clip_to: "swallow_clip";                                        \
-        description {                                                   \
-            state: "default" 0.0;                                       \
-            visible: 1;                                                 \
-            rel1 {                                                      \
-                relative: 1/xcount*xpos 1/ycount*ypos;                  \
-                offset: 0 0;                                            \
-                to: "button_box";                                       \
-            }                                                           \
-            rel2 {                                                      \
-                relative: (1/xcount+(1/xcount*xpos))                    \
-                          (1/ycount+(1/ycount*ypos));                   \
-                offset: -1 -1;                                          \
-                to: "button_box";                                       \
-            }                                                           \
-            color: 255 255 255 255;                                     \
-        }                                                               \
-        description {                                                   \
-            state: "invisible" 0.0;                                     \
-            inherit: "default" 0.0;                                     \
-            visible: 0;                                                 \
-        }                                                               \
-    }                                                                   \
-    part {                                                              \
-        name: "button_"part_name;                                       \
-        type: IMAGE;                                                    \
-        mouse_events: 1;                                                \
-        clip_to: "swallow_clip";                                        \
-        description {                                                   \
-            state: "default" 0.0;                                       \
-            visible: 1;                                                 \
-            rel1 {                                                      \
-                relative: 0.0 0.0;                                      \
-                offset: 1 1;                                            \
-                to: "border_"part_name;                                 \
-            }                                                           \
-            rel2 {                                                      \
-                relative: 1.0 1.0;                                      \
-                offset: -2 -2;                                          \
-                to: "border_"part_name;                                 \
-            }                                                           \
-            image { normal: "button_background.png"; }                  \
-        }                                                               \
-        description {                                                   \
-            state: "active" 0.0;                                        \
-            inherit: "default" 0.0;                                     \
-            image { normal: "button_background_active.png"; }           \
-        }                                                               \
-        description {                                                   \
-            state: "invisible" 0.0;                                     \
-            inherit: "default" 0.0;                                     \
-            visible: 0;                                                 \
-        }                                                               \
-    }                                                                   \
-    part {                                                              \
-        name: "label_"part_name;                                        \
-        type: TEXT;                                                     \
-        effect: SOFT_OUTLINE;                                           \
-        mouse_events: 0;                                                \
-        clip_to: "swallow_clip";                                        \
-        description {                                                   \
-            state: "default" 0.0;                                       \
-            align: 0.5 0.5;                                             \
-            rel1 {                                                      \
-                relative: 0.1 0.3;                                      \
-                offset: 0 0;                                            \
-                to: "button_"part_name;                                 \
-            }                                                           \
-            rel2 {                                                      \
-                relative: 0.9 0.7;                                      \
-                offset: -1 -1;                                          \
-                to: "button_"part_name;                                 \
-            }                                                           \
-            text {                                                      \
-                font: FONT_NAME;                                        \
-                text: label;                                            \
-                size: 1;                                                \
-                fit: 1 1;                                               \
-            }                                                           \
-        }                                                               \
-    }                                                                   \
-    program {                                                           \
-        name: "show_border_"part_name;                                  \
-        signal: "show_"part_name;                                       \
-        action: STATE_SET "default" 0.0;                                \
-        target: "border_"part_name;                                     \
-    }                                                                   \
-    program {                                                           \
-        name: "show_button_"part_name;                                  \
-        signal: "show_"part_name;                                       \
-        action: STATE_SET "default" 0.0;                                \
-        target: "button_"part_name;                                     \
-    }                                                                   \
-    program {                                                           \
-        name: "hide_border_"part_name;                                  \
-        signal: "hide_"part_name;                                       \
-        action: STATE_SET "invisible" 0.0;                              \
-        target: "border_"part_name;                                     \
-    }                                                                   \
-    program {                                                           \
-        name: "hide_button_"part_name;                                  \
-        signal: "hide_"part_name;                                       \
-        action: STATE_SET "invisible" 0.0;                              \
-        target: "button_"part_name;                                     \
-    }
-
-    ERROR_BUTTON("0", 0, 0, 3, 1, "");
-    ERROR_BUTTON("1", 1, 0, 3, 1, "");
-    ERROR_BUTTON("2", 2, 0, 3, 1, "");
-
-    TRANSITION();
-}
-programs {
-    ACTIVATE("button_0");
-    ACTIVATE("button_1");
-    ACTIVATE("button_2");
-}
diff --git a/src/zhone b/src/zhone
index 6ac5fa1..8bd1710 100755
--- a/src/zhone
+++ b/src/zhone
@@ -443,7 +443,7 @@ class pyphone_sms(edje_group):
                     self.cbSend1
                 )
         elif result == _("delete"):
-            self.main.groups["error"].activate(
+            self.main.groups["alert"].activate(
                 _("delete?"),
                 (_("abort"), _("delete")),
                 self.current[self.selected][0], # reference
@@ -785,7 +785,7 @@ class pyphone_contacts(edje_group):
                 self.cbNew1
             )
         elif result == _("delete"):
-            self.main.groups["error"].activate(
+            self.main.groups["alert"].activate(
                 _("delete '%s'?") % self.current[self.selected][1],
                 (_("abort"), _("delete")),
                 self.current[self.selected][0], # reference
@@ -1963,10 +1963,10 @@ class pyphone_lock( edje_group ):
         self.signal_emit( "invisible", "" )
 
 #----------------------------------------------------------------------------#
-class pyphone_error( edje_group ):
+class pyphone_alert( edje_group ):
 #----------------------------------------------------------------------------#
     def __init__( self, main ):
-        edje_group.__init__( self, main, "error" )
+        edje_group.__init__( self, main, "alert" )
         self.buttons = None
         self.cb_data = None
         self.cb = None
@@ -1976,9 +1976,10 @@ class pyphone_error( edje_group ):
     def on_edje_signal_button_pressed( self, emission, source ):
         id = int( source.split( "_", 1 )[1] )
         self.deactivate()
-        self.cb( self.part_text_get( "label_%i" % id ), self.cb_data )
+        if self.cb_data is not None:
+            self.cb( self.part_text_get( "label_%i" % id ), self.cb_data )
 
-    def activate( self, description, buttons, cb_data, cb ):
+    def activate( self, description, buttons, cb_data = None, cb = None ):
         self.buttons = buttons
         self.cb_data = cb_data
         self.cb = cb
@@ -2322,7 +2323,7 @@ class GUI(object):
                 self.groups[page] = ctor( self )
                 self.evas_canvas.evas_obj.data[page] = self.groups[page]
 
-        for overlay in ("main_menu", "menu", "lock", "error"):
+        for overlay in ("main_menu", "menu", "lock", "alert"):
             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