add pix viewer, contacts etc.
git-svn-id: http://www.neo1973-germany.de/svn@213 46df4e5c-bc4e-4628-a0fc-830ba316316dmain
parent
e102c6baa7
commit
0969b8fc23
@ -0,0 +1,97 @@
|
||||
#!/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 ContactsScreen(EdjeGroup):
|
||||
contact_offset = 0
|
||||
sorted_by = 'lastname'
|
||||
detail = False
|
||||
|
||||
def __init__(self, screen_manager):
|
||||
EdjeGroup.__init__(self, screen_manager, CONTACTS_SCREEN_NAME)
|
||||
self.show_contacts()
|
||||
|
||||
def del_displayed_contacts(self):
|
||||
x=1
|
||||
while x < 5:
|
||||
self.part_text_set("contact_%s" %x, "")
|
||||
x += 1
|
||||
|
||||
def show_contacts(self):
|
||||
x = 1
|
||||
self.detail = False
|
||||
self.del_displayed_contacts()
|
||||
self.part_text_set("sort_by", "sorted by: %s" %self.sorted_by)
|
||||
connection = connect(DB_FILE_PATH)
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("SELECT * FROM contacts ORDER BY %s LIMIT 4 OFFSET %s" %(self.sorted_by, self.contact_offset))
|
||||
for row in cursor:
|
||||
self.part_text_set("contact_%s" %x, "%s, %s" %(row[1], row[0]))
|
||||
x += 1
|
||||
|
||||
def show_contact_detail(self, detail_offset):
|
||||
self.part_text_set("sort_by", "detail view")
|
||||
self.detail = True
|
||||
self.del_displayed_contacts()
|
||||
connection = connect(DB_FILE_PATH)
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("SELECT * FROM contacts ORDER BY %s LIMIT 1 OFFSET %s" %(self.sorted_by, detail_offset))
|
||||
for row in cursor:
|
||||
self.part_text_set("contact_1", "%s, %s" %(row[1], row[0]))
|
||||
self.part_text_set("contact_2", "mobil: %s" %row[2])
|
||||
self.part_text_set("contact_3", "home: %s" %row[3])
|
||||
self.part_text_set("contact_4", "work: %s" %row[4])
|
||||
|
||||
@edje.decorators.signal_callback("mouse,up,1", "*")
|
||||
def on_edje_signal_dialer_status_triggered(self, emission, source):
|
||||
if self.detail == True:
|
||||
if source == "button_10":
|
||||
self.contact_offset = 0
|
||||
self.show_contacts()
|
||||
if source == "button_12":
|
||||
self.contact_offset += 1
|
||||
self.show_contact_detail(self.contact_offset)
|
||||
if source == "button_11":
|
||||
self.contact_offset -= 1
|
||||
self.show_contact_detail(self.contact_offset)
|
||||
if source == "2":
|
||||
PyneoController.gsm_dial(self.part_text_get("contact_2")[7:])
|
||||
if source == "3":
|
||||
PyneoController.gsm_dial(self.part_text_get("contact_3")[6:])
|
||||
if source == "4":
|
||||
PyneoController.gsm_dial(self.part_text_get("contact_4")[6:])
|
||||
elif self.detail == False:
|
||||
if source == "1":
|
||||
self.show_contact_detail(self.contact_offset)
|
||||
if source == "2":
|
||||
self.contact_offset += 1
|
||||
self.show_contact_detail(self.contact_offset)
|
||||
if source == "3":
|
||||
self.contact_offset += 2
|
||||
self.show_contact_detail(self.contact_offset)
|
||||
if source == "4":
|
||||
self.contact_offset += 3
|
||||
self.show_contact_detail(self.contact_offset)
|
||||
if source == "button_10":
|
||||
PyneoController.show_dialer_screen()
|
||||
if source == "button_12":
|
||||
self.contact_offset += 4
|
||||
self.show_contacts()
|
||||
if source == "button_11":
|
||||
self.contact_offset -= 4
|
||||
self.show_contacts()
|
||||
if source == "headline" and self.sorted_by == "lastname":
|
||||
self.sorted_by = 'firstname'
|
||||
self.contact_offset = 0
|
||||
self.show_contacts()
|
||||
elif source == "headline" and self.sorted_by == "firstname":
|
||||
self.sorted_by = 'lastname'
|
||||
self.contact_offset = 0
|
||||
self.show_contacts()
|
||||
print 'source: ', source
|
||||
|
Binary file not shown.
@ -0,0 +1,221 @@
|
||||
// contacts_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/contacts/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: "contacts";
|
||||
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: last name";
|
||||
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, ">");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,215 @@
|
||||
// pix_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 64;
|
||||
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; \
|
||||
}
|
||||
|
||||
collections {
|
||||
group {
|
||||
name: "pyneo/pix/screen";
|
||||
min: 100 100;
|
||||
max: 800 800;
|
||||
parts {
|
||||
part {
|
||||
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: "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: "pix viewer";
|
||||
size: 20;
|
||||
font: "VeraBd";
|
||||
fit: 1 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "filename";
|
||||
type: TEXT;
|
||||
description {
|
||||
state: "default" 0;
|
||||
color_class: "button_inactive";
|
||||
rel1 { relative: 0 1/7;}
|
||||
rel2 { relative: 1 1/5; }
|
||||
text {
|
||||
text: "filename";
|
||||
size: 10;
|
||||
font: "Sans:style=Bold,Edje-Vera";
|
||||
fit: 1 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "rev";
|
||||
type: RECT;
|
||||
description {
|
||||
color: 0 0 0 0;
|
||||
state: "default" 0;
|
||||
rel1 { relative: 0 0; }
|
||||
rel2 { relative: 1/2 57/70; }
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "pre";
|
||||
type: RECT;
|
||||
description {
|
||||
color: 0 0 0 0;
|
||||
state: "default" 0;
|
||||
rel1 { relative: 1/2 0; }
|
||||
rel2 { relative: 1 57/70; }
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "clipper";
|
||||
type: RECT;
|
||||
description {
|
||||
rel1 { relative: 1/2 1/2; offset: -180 -180; }
|
||||
rel2 { relative: 1/2 1/2; offset: 180 180; }
|
||||
}
|
||||
}
|
||||
part {
|
||||
name: "icon";
|
||||
type: SWALLOW;
|
||||
mouse_events: 0;
|
||||
clip_to: "clipper";
|
||||
description {
|
||||
/*fixed: 1 1;*/
|
||||
rel1 { relative: 1/2 1/2; offset: -180 -180; }
|
||||
rel2 { relative: 1/2 1/2; offset: 180 180; }
|
||||
}
|
||||
} /*end icon swallow */
|
||||
BUTTON(10, 0, 58/70 , 1/3, 68/70, "<");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue