fix some sms handling bugs
git-svn-id: http://www.neo1973-germany.de/svn@219 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
parent
abbb956fbf
commit
ef2c1a7312
4 changed files with 40 additions and 10 deletions
|
@ -156,20 +156,21 @@ collections {
|
||||||
}
|
}
|
||||||
part {
|
part {
|
||||||
name: "hon_caption";
|
name: "hon_caption";
|
||||||
type: TEXTBLOCK;
|
type: TEXT;
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
description {
|
description {
|
||||||
|
state: "default" 0;
|
||||||
color_class: "button_inactive";
|
color_class: "button_inactive";
|
||||||
align: 0.5 0.5;
|
rel1 { relative: 1/20 3/20;}
|
||||||
fixed: 1 1;
|
rel2 { relative: 19/20 4/20; }
|
||||||
rel1 { relative: 0 3/20; }
|
|
||||||
rel2 { relative: 1 10/20; }
|
|
||||||
text {
|
text {
|
||||||
text: "file:";
|
text: "nick: ???";
|
||||||
style: "textblock_style";
|
size: 10;
|
||||||
|
font: "Vera";
|
||||||
|
fit: 1 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} /* end hon_caption */
|
|
||||||
part {
|
part {
|
||||||
name: "icon";
|
name: "icon";
|
||||||
mouse_events: 0;
|
mouse_events: 0;
|
||||||
|
|
|
@ -502,6 +502,14 @@ class PyneoController(object):
|
||||||
def show_sms_screen_detail(class_):
|
def show_sms_screen_detail(class_):
|
||||||
class_.notify_callbacks("show_sms_screen_detail")
|
class_.notify_callbacks("show_sms_screen_detail")
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def vibrate_start(class_):
|
||||||
|
class_.pwr.Vibrate(10, 3, 1, dbus_interface=DIN_POWER)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def vibrate_stop(class_):
|
||||||
|
class_.pwr.Vibrate(0, 0, 0, dbus_interface=DIN_POWER)
|
||||||
|
|
||||||
|
|
||||||
from dialer_screen import *
|
from dialer_screen import *
|
||||||
from incall_screen import *
|
from incall_screen import *
|
||||||
|
|
|
@ -15,12 +15,21 @@ class SmsDetail(EdjeGroup):
|
||||||
def register_pyneo_callbacks(self):
|
def register_pyneo_callbacks(self):
|
||||||
PyneoController.register_callback("show_sms_detail", self.on_show_sms_detail)
|
PyneoController.register_callback("show_sms_detail", self.on_show_sms_detail)
|
||||||
|
|
||||||
|
def mark_sms_read(self, sms_time):
|
||||||
|
connection = connect(DB_FILE_PATH)
|
||||||
|
cursor = connection.cursor()
|
||||||
|
cursor.execute("UPDATE sms SET status='REC READ' WHERE time='%s'" %(sms_time))
|
||||||
|
connection.commit()
|
||||||
|
|
||||||
def on_show_sms_detail(self, sms_number):
|
def on_show_sms_detail(self, sms_number):
|
||||||
connection = connect(DB_FILE_PATH)
|
connection = connect(DB_FILE_PATH)
|
||||||
cursor = connection.cursor()
|
cursor = connection.cursor()
|
||||||
cursor.execute("SELECT * FROM sms WHERE status='%s' ORDER BY time DESC LIMIT 1 OFFSET %s" %('REC UNREAD', sms_number))
|
cursor.execute("SELECT * FROM sms WHERE status='%s' ORDER BY time DESC LIMIT 1 OFFSET %s" %('REC UNREAD', sms_number))
|
||||||
for row in cursor:
|
for row in cursor:
|
||||||
self.part_text_set("sms_text_1", row[3])
|
self.part_text_set("sms_text_1", row[2] + '<br>' + row[1] + '<br>' + row[3])
|
||||||
|
|
||||||
|
if row[0] == 'REC UNREAD':
|
||||||
|
self.mark_sms_read(row[2])
|
||||||
|
|
||||||
@edje.decorators.signal_callback("mouse,up,1", "*")
|
@edje.decorators.signal_callback("mouse,up,1", "*")
|
||||||
def on_edje_signal_dialer_status_triggered(self, emission, source):
|
def on_edje_signal_dialer_status_triggered(self, emission, source):
|
||||||
|
|
|
@ -14,6 +14,10 @@ class SmsScreen(EdjeGroup):
|
||||||
|
|
||||||
def __init__(self, screen_manager):
|
def __init__(self, screen_manager):
|
||||||
EdjeGroup.__init__(self, screen_manager, SMS_SCREEN_NAME)
|
EdjeGroup.__init__(self, screen_manager, SMS_SCREEN_NAME)
|
||||||
|
if self.check_for_unread() == 0:
|
||||||
|
self.sorted_by = 'REC READ'
|
||||||
|
elif self.check_for_unread() <> 0:
|
||||||
|
self.sorted_by = 'REC UNREAD'
|
||||||
self.show_sms()
|
self.show_sms()
|
||||||
|
|
||||||
def del_displayed_sms(self):
|
def del_displayed_sms(self):
|
||||||
|
@ -24,6 +28,14 @@ class SmsScreen(EdjeGroup):
|
||||||
self.part_text_set("sms_text_%s" %x, "")
|
self.part_text_set("sms_text_%s" %x, "")
|
||||||
x += 1
|
x += 1
|
||||||
|
|
||||||
|
def check_for_unread(self):
|
||||||
|
connection = connect(DB_FILE_PATH)
|
||||||
|
cursor = connection.cursor()
|
||||||
|
cursor.execute("SELECT COUNT(*) FROM sms WHERE status='REC UNREAD'")
|
||||||
|
for row in cursor:
|
||||||
|
print 'Count: ', row[0]
|
||||||
|
return row[0]
|
||||||
|
|
||||||
def show_sms(self):
|
def show_sms(self):
|
||||||
x = 1
|
x = 1
|
||||||
self.detail = False
|
self.detail = False
|
||||||
|
|
Loading…
Reference in a new issue