From 54cee09b7367eff594fb373d5378ca7bda927452 Mon Sep 17 00:00:00 2001 From: fgau Date: Wed, 10 Dec 2008 18:58:28 +0000 Subject: [PATCH] initial sms support git-svn-id: http://www.neo1973-germany.de/svn@214 46df4e5c-bc4e-4628-a0fc-830ba316316d --- epydial/data/db/my.sqlite | Bin 18432 -> 18432 bytes epydial/data/themes/blackwhite/sms_screen.edc | 221 ++++++++++++++++++ epydial/dialer_screen.py | 5 + epydial/epydial.py | 11 + epydial/sms_screen.py | 20 ++ 5 files changed, 257 insertions(+) create mode 100755 epydial/data/themes/blackwhite/sms_screen.edc create mode 100644 epydial/sms_screen.py diff --git a/epydial/data/db/my.sqlite b/epydial/data/db/my.sqlite index 7d51fb1e12cd63e1c2f3460640259449cd3f2294..c34a1fdea5f88f2390df68cb0fa0aff69e515597 100755 GIT binary patch delta 286 zcmZpez}PT>ae_2&4g(U{sBwc|fE6gf#QY5;%+36p`P*heotMn)9ELzXo5Ug!9%KbV z2n9^MKm}avi&R)7Kr9ZXxdP1hnD;QxX3k``XXanV6DB<3m@8e5qfWhj&u=qRM; wmnc{&Bq!$N6e}d=r6?4q0tpL+;#?p%2dFotQm@fVh>>lwx$?=)|6LiG05%*)GXMYp delta 524 zcmZpez}PT>ae_2&E&~K`11YwR8aMb&ctHXz3=GVNiH8##_lk;0^78VA<`iXSrv@iy zl;%_cjWL?6DW?ZC3&{8`t0xU)h${kBg(T)>Cc0)6rRJ3sC6<-|h22#W(vam-6k%}I0unve$+(wHnNt6~R| zlLpEKm!;-8=OmUEr-J0bX1U}SW#%RNCgxS8X2OgJPE5+oOZ6^I%>XIWp1eUuT?NQc z5as1n_D(FxNCau|$S+9KHnB7@Ft#u@GPVTDD^5P3EyoOU^?YqvCZMx&we=V^COd1Z zF)`>)7S`5bG@5)*%aGA_@7{ diff --git a/epydial/data/themes/blackwhite/sms_screen.edc b/epydial/data/themes/blackwhite/sms_screen.edc new file mode 100755 index 0000000..9f797f0 --- /dev/null +++ b/epydial/data/themes/blackwhite/sms_screen.edc @@ -0,0 +1,221 @@ +// sms_screen.edc +// this is a theme for epydial, a pyneo dialer + +data { + item: "author" "thomasg [thomas (a) gstaedtner (.) net] , fgau (fgau@gau-net.de)"; + item: "version" "prototype"; + item: "name" "epydial_blackwhite"; +} + +fonts { + font: "Vera.ttf" "Vera"; + font: "VeraBd.ttf" "VeraBd"; +} + +images { + image: "bg.png" COMP; +} + +color_classes { + color_class { + name: "unvisible"; + color: 0 0 0 0; + color2: 128 128 128 255; + color3: 128 128 128 255; + } + color_class { + name: "button_inactive"; + color: 255 255 255 128; + color2: 128 128 128 255; + color3: 128 128 128 255;; + } + color_class { + name: "scale"; + color: 255 255 255 56; + color2: 0 0 0 255; + color3: 0 0 0 255; + } +} + +styles { + style { + name: "textblock_style"; + base: "font=Vera font_size=20 align=left valign=top color=#fff"; + tag: "h1" "+ font_size=28"; + tag: "/h1" "- \n"; + tag: "p" "+"; + tag: "/p" "- \n"; + tag: "em" "+ style=underline underline_color=#000A underline2_color=#0005"; + tag: "/em" "-"; + tag: "br" "\n"; + tag: "c1" "+ color=#fff"; + tag: "/c1" "-"; + tag: "c2" "+ color=#f3f"; + tag: "/c2" "-"; + } +} + +#define BUTTON(button_number, rel1x, rel1y, rel2x, rel2y, button_caption) \ +part { \ + name: "button_"button_number; \ + type: RECT; \ + description { \ + state: "default" 0; \ + color_class: "unvisible"; \ + rel1 { relative: rel1x rel1y; offset: 0 0; }; \ + rel2 { relative: rel2x rel2y; offset: 0 0; }; \ + } \ + description { \ + state: "default" 0.5; \ + inherit: "default" 0; \ + color_class: "unvisible"; \ + rel1.offset: 0 -5; \ + rel2.offset: 0 5; \ + } \ + description { \ + state: "default" 1; \ + inherit: "default" 0; \ + } \ +} \ +part { \ + name: "button_"button_number"_caption"; \ + type: TEXT; \ + mouse_events: 0; \ + description { \ + state: "default" 0; \ + color_class: "button_inactive"; \ + rel1 { \ + to: "button_"button_number; \ + relative: 0 0; \ + } \ + rel2 { \ + to: "button_"button_number; \ + relative: 1 1; \ + } \ + text { \ + text: button_caption; \ + size: 18; \ + font: "Sans:style=Bold,Edje-Vera"; \ + fit: 1 1; \ + } \ + } \ +} \ +program { \ + name: "button_"button_number"_signal_emit"; \ + signal: "mouse,down,*"; \ + source: "button_"button_number; \ + action: SIGNAL_EMIT "hon_send" button_caption; \ +} \ +program { \ + name: "button_"button_number"_animation"; \ + signal: "mouse,down,*"; \ + source: "button_"button_number; \ + action: STATE_SET "default" 0.5; \ + target: "button_"button_number; \ +} \ +program { \ + name: "button_"button_number"_animation_end"; \ + signal: "mouse,up,*"; \ + source: "button_"button_number; \ + action: STATE_SET "default" 1; \ + target: "button_"button_number; \ + transition: DECELERATE 0.1; \ +} + +#define ITEM(item_number, rel1x, rel1y, rel2x, rel2y) \ +part { \ + name: item_number; \ + type: RECT; \ + description { \ + state: "default" 0; \ + color_class: "scale"; \ + rel1 { relative: rel1x rel1y;}; \ + rel2 { relative: rel2x rel2y;}; \ + } \ +} \ +part { \ + name: "contact_"item_number; \ + type: TEXT; \ + mouse_events: 0; \ + description { \ + state: "default" 0; \ + color_class: "button_inactive"; \ + rel1 { \ + to: item_number; \ + relative: 1/20 0; \ + } \ + rel2 { \ + to: item_number; \ + relative: 19/20 1; \ + } \ + text { \ + text: ""; \ + size: 26; \ + font: "Sans:style=Bold,Edje-Vera"; \ + /*fit: 1 1; */\ + align: 0 0.5; \ + } \ + } \ +} \ + + +collections { + group { + name: "pyneo/sms/screen"; + min: 100 100; + max: 800 800; + parts { + part { + name: "background"; + type: IMAGE; + mouse_events: 0; + description { + state: "default" 0; + rel1 { relative: 0 0; offset: 0 0; } + rel2 { relative: 1 1; offset: 0 0; } + image { normal: "bg.png"; } + } + } + part { + name: "headline"; + type: TEXT; + description { + state: "default" 0; + color_class: "button_inactive"; + rel1 { relative: 1/20 1/20; } + rel2 { relative: 19/20 3/20; } + text { + text: "sms"; + size: 20; + font: "VeraBd"; + fit: 1 1; + } + } + } + part { + name: "sort_by"; + type: TEXT; + mouse_events: 0; + description { + state: "default" 0; + color_class: "button_inactive"; + rel1 { relative: 1/20 3/20;} + rel2 { relative: 19/20 4/20; } + text { + text: "sorted by: date"; + size: 10; + font: "Vera"; + fit: 1 1; + } + } + } + ITEM(1, 1/20, 9/40, 19/20, 14/40); + ITEM(2, 1/20, 15/40, 19/20, 20/40); + ITEM(3, 1/20, 21/40, 19/20, 26/40); + ITEM(4, 1/20, 27/40, 19/20, 32/40); + BUTTON(10, 0, 58/70 , 1/3, 68/70, "<"); + BUTTON(11, 1/3, 58/70, 2/3, 68/70, "<"); + BUTTON(12, 2/3, 58/70, 3/3, 68/70, ">"); + } + } +} diff --git a/epydial/dialer_screen.py b/epydial/dialer_screen.py index b44ea46..c07dfd2 100644 --- a/epydial/dialer_screen.py +++ b/epydial/dialer_screen.py @@ -142,6 +142,11 @@ class DialerScreen(EdjeGroup): self.text = [] self.part_text_set("numberdisplay_text", "".join(self.text)) PyneoController.show_contacts_screen() + elif source == "dial" and ''.join(self.text) == "8": + print '--- Sms Screen' + self.text = [] + self.part_text_set("numberdisplay_text", "".join(self.text)) + PyneoController.show_sms_screen() elif source == "dial": PyneoController.show_incall_screen('outgoing') PyneoController.gsm_dial("".join(self.text)) diff --git a/epydial/epydial.py b/epydial/epydial.py index 0d1acda..5c3a795 100755 --- a/epydial/epydial.py +++ b/epydial/epydial.py @@ -29,6 +29,7 @@ HON_SCREEN_NAME = "pyneo/hon/screen" CALC_SCREEN_NAME = "pyneo/calc/screen" PIX_SCREEN_NAME = "pyneo/pix/screen" CONTACTS_SCREEN_NAME = "pyneo/contacts/screen" +SMS_SCREEN_NAME = "pyneo/sms/screen" from datetime import datetime from dbus import SystemBus @@ -444,6 +445,10 @@ class PyneoController(object): print '--- NULL new sms' class_.gsm_sms.DeleteAll() + @classmethod + def show_sms_screen(class_): + class_.notify_callbacks("show_sms_screen") + from dialer_screen import * from incall_screen import * @@ -453,6 +458,7 @@ from hon_screen import * from calc_screen import * from pix_screen import * from contacts_screen import * +from sms_screen import * class Dialer(object): screens = None @@ -477,6 +483,7 @@ class Dialer(object): PyneoController.register_callback("show_calc_screen", self.on_calc_screen) PyneoController.register_callback("show_pix_screen", self.on_pix_screen) PyneoController.register_callback("show_contacts_screen", self.on_contacts_screen) + PyneoController.register_callback("show_sms_screen", self.on_sms_screen) # Initialize the D-Bus interface to pyneo dbus_ml = e_dbus.DBusEcoreMainLoop() @@ -543,6 +550,10 @@ class Dialer(object): self.init_screen(CONTACTS_SCREEN_NAME, ContactsScreen(self)) self.show_screen(CONTACTS_SCREEN_NAME) + def on_sms_screen(self): + self.init_screen(SMS_SCREEN_NAME, SmsScreen(self)) + self.show_screen(SMS_SCREEN_NAME) + class EvasCanvas(object): def __init__(self, fullscreen, engine_name): diff --git a/epydial/sms_screen.py b/epydial/sms_screen.py new file mode 100644 index 0000000..689967b --- /dev/null +++ b/epydial/sms_screen.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python2.5 +# -*- coding: utf-8 -*- +__author__ = "Soeren Apel (abraxa@dar-clan.de), Frank Gau (fgau@gau-net.de), Thomas Gstaedtner (thomas (a) gstaedtner (.) net)" +__version__ = "prototype" +__copyright__ = "Copyright (c) 2008" +__license__ = "GPL3" + +from epydial import * + +class SmsScreen(EdjeGroup): + + def __init__(self, screen_manager): + EdjeGroup.__init__(self, screen_manager, SMS_SCREEN_NAME) + + @edje.decorators.signal_callback("mouse,up,1", "*") + def on_edje_signal_dialer_status_triggered(self, emission, source): + if source == "button_10": + PyneoController.show_dialer_screen() + print 'source: ', source +