Rename TestView to Dialer
Rename Dialer.groups to Dialer.screens Rename *_GROUP_NAME to *_SCREEN_NAME Add Dialer.show_screen() method git-svn-id: http://www.neo1973-germany.de/svn@108 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
parent
efe7084165
commit
6465961301
1 changed files with 22 additions and 14 deletions
|
@ -14,8 +14,8 @@ WM_INFO = ("epydial", "epydial")
|
|||
|
||||
EDJE_FILE_PATH = "data/themes/"
|
||||
|
||||
MAIN_GROUP_NAME = "pyneo/dialer/main"
|
||||
INCALL_GROUP_NAME = "pyneo/dialer/incall"
|
||||
MAIN_SCREEN_NAME = "pyneo/dialer/main"
|
||||
INCALL_SCREEN_NAME = "pyneo/dialer/incall"
|
||||
|
||||
from datetime import datetime
|
||||
from dbus import SystemBus
|
||||
|
@ -57,11 +57,11 @@ class EdjeGroup(edje.Edje):
|
|||
|
||||
class InCallScreen(EdjeGroup):
|
||||
def __init__(self, main):
|
||||
EdjeGroup.__init__(self, main, INCALL_GROUP_NAME)
|
||||
EdjeGroup.__init__(self, main, INCALL_SCREEN_NAME)
|
||||
|
||||
class MainScreen(EdjeGroup):
|
||||
def __init__(self, main):
|
||||
EdjeGroup.__init__(self, main, MAIN_GROUP_NAME)
|
||||
EdjeGroup.__init__(self, main, MAIN_SCREEN_NAME)
|
||||
self.text = []
|
||||
|
||||
dbus_ml = e_dbus.DBusEcoreMainLoop()
|
||||
|
@ -161,22 +161,30 @@ class MainScreen(EdjeGroup):
|
|||
call = object_by_url(name)
|
||||
call.Hangup(dbus_interface=DIN_CALL)
|
||||
|
||||
class TestView(object):
|
||||
class Dialer(object):
|
||||
def __init__(self):
|
||||
edje.frametime_set(FRAMETIME)
|
||||
self.evas_canvas = EvasCanvas(FULLSCREEN, "x11-16")
|
||||
|
||||
self.groups = {}
|
||||
self.screens = {}
|
||||
|
||||
self.init_group(MAIN_GROUP_NAME, MainScreen(self))
|
||||
self.init_group(INCALL_GROUP_NAME, InCallScreen(self))
|
||||
self.init_screen(MAIN_SCREEN_NAME, MainScreen(self))
|
||||
self.init_screen(INCALL_SCREEN_NAME, InCallScreen(self))
|
||||
|
||||
self.groups[MAIN_GROUP_NAME].part_text_set("numberdisplay_text", "wait ...")
|
||||
self.groups[MAIN_GROUP_NAME].show()
|
||||
self.screens[MAIN_SCREEN_NAME].part_text_set("numberdisplay_text", "wait ...")
|
||||
|
||||
self.show_screen(MAIN_SCREEN_NAME)
|
||||
|
||||
def init_group(self, name, instance):
|
||||
self.groups[name] = instance
|
||||
self.evas_canvas.evas_obj.data[name] = instance
|
||||
def init_screen(self, screen_name, instance):
|
||||
self.screens[screen_name] = instance
|
||||
self.evas_canvas.evas_obj.data[screen_name] = instance
|
||||
|
||||
def show_screen(self, screen_name):
|
||||
for (name, screen) in self.screens.items():
|
||||
if name == screen_name:
|
||||
screen.show()
|
||||
else:
|
||||
screen.hide()
|
||||
|
||||
class EvasCanvas(object):
|
||||
def __init__(self, fullscreen, engine_name):
|
||||
|
@ -209,7 +217,7 @@ class EvasCanvas(object):
|
|||
ecore.main_loop_quit()
|
||||
|
||||
if __name__ == "__main__":
|
||||
TestView()
|
||||
Dialer()
|
||||
ecore.main_loop_begin()
|
||||
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue