From 927d9f24a2d9560d5cc58945008f8f092c8321ce Mon Sep 17 00:00:00 2001 From: Nicole Vreden Date: Sun, 7 Feb 2010 11:52:39 +0100 Subject: Python-EFL GUI: new editable Textfield Signed-off-by: Nicole Vreden --- src/YalpClients/EflClient/searchframe.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/YalpClients/EflClient/searchframe.py') diff --git a/src/YalpClients/EflClient/searchframe.py b/src/YalpClients/EflClient/searchframe.py index 8fec876..79e3fc6 100644 --- a/src/YalpClients/EflClient/searchframe.py +++ b/src/YalpClients/EflClient/searchframe.py @@ -13,11 +13,14 @@ class Search(object): def __init__(self, win, c): self.win = win self.c = c + self.searchfield() self.add_button() c.signal_callback_add("mouse,clicked,1","find_buttonframe", self.findbutton_clicked) def findbutton_clicked(self, obj, signal,source): - print "Huhu"; + print "Huhu" + searchentry = textfield.entry_get() + print searchentry def add_button(self): findbutton = elementary.Button(self.win) @@ -25,5 +28,10 @@ class Search(object): self.c.part_swallow("find_buttonframe", findbutton) findbutton.show() - - + def searchfield(self): + global textfield + textfield = elementary.Entry(self.win) + textfield.entry_set("Enter Title") + self.c.part_swallow("searcharea", textfield) + textfield.editable_set(True) + textfield.show() -- cgit v1.2.3 From 65eee8eacb08fe6c2aa08a8cd87fce4aa2034d9b Mon Sep 17 00:00:00 2001 From: Nicole Vreden Date: Sun, 14 Feb 2010 23:09:07 +0100 Subject: Python-EFL-GUI: added Streaming Functions - prepared files for streaming - changed medialist to dynamic list Signed-off-by: Nicole Vreden --- src/YalpClients/EflClient/main.py | 8 ++++---- src/YalpClients/EflClient/medialist.py | 34 ++++++++------------------------ src/YalpClients/EflClient/playlist.py | 9 +++++++-- src/YalpClients/EflClient/searchframe.py | 6 +++++- 4 files changed, 24 insertions(+), 33 deletions(-) (limited to 'src/YalpClients/EflClient/searchframe.py') diff --git a/src/YalpClients/EflClient/main.py b/src/YalpClients/EflClient/main.py index 790e49d..dadbc53 100755 --- a/src/YalpClients/EflClient/main.py +++ b/src/YalpClients/EflClient/main.py @@ -13,6 +13,7 @@ import elementary import searchframe import medialist import playlist +import YalpInterfaces def destroy(obj, event, data): print "Bye bye" @@ -27,14 +28,13 @@ def gui(): win.autodel_set(True) #win.destroy = destroy - vid = emotion.Emotion(win.canvas,module_filename="xine"); + #vid = emotion.Emotion(win.canvas,module_filename="xine"); edje_file = os.path.join(os.path.dirname(sys.argv[0]),"yalp_gui.edj") c = edje.Edje(win.canvas, file=edje_file, group = "yalp") - m = medialist.Medias(win, c) s = searchframe.Search(win, c) - video = playlist.Selection(win, c, vid) + + #video = playlist.Selection(win, c, vid) - m.fill_medialist(win, c) c.show() win.resize(800,600) win.show() diff --git a/src/YalpClients/EflClient/medialist.py b/src/YalpClients/EflClient/medialist.py index c3a3e70..13132d2 100644 --- a/src/YalpClients/EflClient/medialist.py +++ b/src/YalpClients/EflClient/medialist.py @@ -14,34 +14,16 @@ class Medias(object): self.win = win self.c = c self.add_button() - - def huhu(self, obj, str, x): - print "guck guck" + self.medialist = elementary.List(self.win); + self.medialist.size_hint_weight_set(1.0, 1.0) + self.medialist.size_hint_align_set(-1.0, -1.0) + self.c.part_swallow("medialist", self.medialist) - def fill_medialist(self, win, c): - items = [("huhu", self.huhu), - ("haha", self.huhu), - ("hoho", self.huhu), - ("hehe", self.huhu), - ("hihi", self.huhu), - ("12345", self.huhu), - ("abcde", self.huhu), - ("fghij", self.huhu), - ("klmno", self.huhu), - ("pqrst", self.huhu), - ("uvwxyz", self.huhu)] + def add_media(self, media): + self.medialist.item_append(media.result.name, None, None, media.callback) + self.medialist.show() + self.medialist.go() - medialist = elementary.List(win); - medialist.size_hint_weight_set(1.0, 1.0) - medialist.size_hint_align_set(-1.0, -1.0) - c.part_swallow("medialist", medialist) - - for item in items: - #print item[0] - medialist.item_append(item[0], None, None, item[1]) - - medialist.show() - medialist.go() def add_button(self): addbutton = elementary.Button(self.win) diff --git a/src/YalpClients/EflClient/playlist.py b/src/YalpClients/EflClient/playlist.py index 69f3ba3..7352a67 100644 --- a/src/YalpClients/EflClient/playlist.py +++ b/src/YalpClients/EflClient/playlist.py @@ -9,12 +9,15 @@ import emotion import evas import elementary +import media + class Selection(object): - def __init__(self, win, c, vid): + def __init__(self, win, c, vid, stream): self.win = win self.c = c self.vid = vid self.add_button() + self.stream = stream def fill_playlist(self, obj, str, x): playlist = elementary.List(self.win); @@ -34,7 +37,9 @@ class Selection(object): def play_video(self): #vid = emotion.Emotion(win.canvas,module_filename="xine"); - self.vid.file_set("Lordi.mpg"); + print self.stream + #self.vid.file_set("Lordi.mpg"); + self.vid.file_set(self.stream); self.c.part_swallow("video", self.vid) self.vid.show() self.vid.play = True diff --git a/src/YalpClients/EflClient/searchframe.py b/src/YalpClients/EflClient/searchframe.py index 79e3fc6..8f97923 100644 --- a/src/YalpClients/EflClient/searchframe.py +++ b/src/YalpClients/EflClient/searchframe.py @@ -9,6 +9,8 @@ import emotion import evas import elementary +import client + class Search(object): def __init__(self, win, c): self.win = win @@ -18,9 +20,11 @@ class Search(object): c.signal_callback_add("mouse,clicked,1","find_buttonframe", self.findbutton_clicked) def findbutton_clicked(self, obj, signal,source): - print "Huhu" searchentry = textfield.entry_get() print searchentry + co = client.Corba(self.win, self.c) + co.corba_search(searchentry) + def add_button(self): findbutton = elementary.Button(self.win) -- cgit v1.2.3 From ed22fce7a9f4332037bf0e9fd97a96b1876acba8 Mon Sep 17 00:00:00 2001 From: Nicole Vreden Date: Thu, 18 Feb 2010 23:16:36 +0100 Subject: Python-EFL-GUI: Bugfixing - Textfield now single-line - tried to hide frames by clicking on media-list-element - tried to draw frame around textfield Signed-off-by: Nicole Vreden --- src/YalpClients/EflClient/media.py | 8 ++ src/YalpClients/EflClient/medialist.py | 6 ++ src/YalpClients/EflClient/playlist.py | 5 +- src/YalpClients/EflClient/searchframe.py | 2 + src/YalpClients/EflClient/yalp_gui.edc | 173 ++++++++----------------------- 5 files changed, 62 insertions(+), 132 deletions(-) (limited to 'src/YalpClients/EflClient/searchframe.py') diff --git a/src/YalpClients/EflClient/media.py b/src/YalpClients/EflClient/media.py index daf6d52..4ab5448 100644 --- a/src/YalpClients/EflClient/media.py +++ b/src/YalpClients/EflClient/media.py @@ -11,12 +11,16 @@ class Media(object): self.servercon = servercon self.win = win self.c = c + #self.c.signal_callback_add("hide_frames", "medialist",self.hide_frames) def callback(self, obj, str): songlist = [] songlist.append(self.result) ip = socket.gethostbyname(socket.gethostname()) + #self.c.signal_callback_add("hide_frames", "medialist",self.hide_frames) + + info = YalpInterfaces.AccessInfo("huhu", "huhu", "xine", "openmoko", YalpInterfaces.STREAM) stream = YalpInterfaces.Output(0, info, songlist, YalpInterfaces.CREATE, ip) @@ -26,3 +30,7 @@ class Media(object): print "stream.info:", stream.info #video = playlist.Selection(self.win, self.c, vid, startstream) video = playlist.Selection(self.win, self.c, stream) + + #def hide_frames(self, obj, signal, source): + #self.c.signal_emit("signal_from_python", "") + diff --git a/src/YalpClients/EflClient/medialist.py b/src/YalpClients/EflClient/medialist.py index 13132d2..ac54a69 100644 --- a/src/YalpClients/EflClient/medialist.py +++ b/src/YalpClients/EflClient/medialist.py @@ -18,6 +18,8 @@ class Medias(object): self.medialist.size_hint_weight_set(1.0, 1.0) self.medialist.size_hint_align_set(-1.0, -1.0) self.c.part_swallow("medialist", self.medialist) + # ???: + self.c.signal_callback_add("hide_frames", self.medialist.item,self.hide_frames) def add_media(self, media): self.medialist.item_append(media.result.name, None, None, media.callback) @@ -30,3 +32,7 @@ class Medias(object): addbutton.label_set("Add to Playlist") self.c.part_swallow("medialist_buttonframe", addbutton) addbutton.show() + + def hide_frames(self, obj, signal, source): + self.c.signal_emit("signal_from_python", "") + diff --git a/src/YalpClients/EflClient/playlist.py b/src/YalpClients/EflClient/playlist.py index 059a04d..242aa76 100644 --- a/src/YalpClients/EflClient/playlist.py +++ b/src/YalpClients/EflClient/playlist.py @@ -18,10 +18,10 @@ class Selection(object): self.vid = emotion.Emotion(win.canvas, module_filename="gstreamer") self.stream = stream self.play_video () - + def play_video(self): print self.stream - # ip = self.stream[0][0].destIp THIS CHRASHES!!! + # ip = self.stream[0][0].destIp THIS CHRASHES!!! -> I know :-) ip = "127.0.0.1" port = 9993 print "stream from", ip, port @@ -29,3 +29,4 @@ class Selection(object): self.c.part_swallow("video", self.vid) self.vid.show() self.vid.play = True + diff --git a/src/YalpClients/EflClient/searchframe.py b/src/YalpClients/EflClient/searchframe.py index 8f97923..574315a 100644 --- a/src/YalpClients/EflClient/searchframe.py +++ b/src/YalpClients/EflClient/searchframe.py @@ -35,6 +35,8 @@ class Search(object): def searchfield(self): global textfield textfield = elementary.Entry(self.win) + #textfield.color(95,95,95,95) + textfield.single_line_set(True) textfield.entry_set("Enter Title") self.c.part_swallow("searcharea", textfield) textfield.editable_set(True) diff --git a/src/YalpClients/EflClient/yalp_gui.edc b/src/YalpClients/EflClient/yalp_gui.edc index eb76edc..24c593f 100644 --- a/src/YalpClients/EflClient/yalp_gui.edc +++ b/src/YalpClients/EflClient/yalp_gui.edc @@ -1,12 +1,3 @@ -styles -{ - style - { - name: "searchfield_style"; - base: "font=Edje-Vera font_size=12 valign=bottom color=#000 wrap=word"; - } -} - collections { group @@ -19,7 +10,7 @@ collections { name: "main"; type: RECT; - mouse_events: 0; + mouse_events: 1; description { state: "default" 0.0; @@ -40,6 +31,7 @@ collections { name: "video"; type: SWALLOW; + mouse_events: 1; description { state: "default" 0.0; aspect: 1.7 1.8; @@ -138,118 +130,7 @@ collections } } } - - part - { - name: "playlist_buttonframe"; - type: SWALLOW; - mouse_events: 1; - description - { - state: "default" 0.0; - align: 0 0; - color: 30 89 114 150; - rel1 - { - relative: 0.66 0.85; - } - rel2 - { - relative: 0.86 0.9; - } - } - description - { - state: "default" 1.0; - align: 0 0; - color: 0 0 0 0; - rel1 - { - relative: 1.0 0.85; - } - rel2 - { - relative: 1.0 0.9; - } - } - } - part - { - name: "playlist"; - type: SWALLOW; - mouse_events: 1; - description - { - state: "default" 0.0; - align: 0 0; - color: 30 89 114 150; - rel1 - { - relative: 0.51 0.2; - offset: 0 0; - } - rel2 - { - relative: 1.0 0.8; - offset: 0 0; - } - } - description - { - state: "default" 1.0; - align: 0 0; - color: 0 0 0 0; - rel1 - { - relative: 1.0 0.01; - offset: 0 0; - } - rel2 - { - relative: 1.0 0.8; - offset: 0 0; - } - } - } - - part - { - name: "controlframe"; - type: RECT; - mouse_events: 1; - - description - { - state: "default" 0.0; - align: 0 0; - color: 30 89 114 175; - - rel1 - { - relative: 0.0 0.97; - offset: 0 0; - } - rel2 - { - relative: 1.0 1.0; - offset: 0 0; - } - } - description - { - state: "default" 1.0; - color: 30 89 114 175; - rel1 - { - relative: 0.0 0.8; - } - rel2 - { - relative: 1.0 1.0; - } - } - } part { name: "find_buttonframe"; @@ -275,7 +156,7 @@ collections description { state: "default" 1.0; - color: 0 0 0 0; + color: 211 168 234 255; rel1 { relative: 0.8 0.0; @@ -288,7 +169,7 @@ collections } } } - + /* part { name: "medialist_buttonframe"; @@ -324,6 +205,8 @@ collections } } + */ + part { name: "searcharea"; @@ -332,7 +215,7 @@ collections description { state: "default" 0.0; - color: 255 255 255 255; + color: 0 0 0 0; rel1 { relative: 0.15 0.07; @@ -360,22 +243,52 @@ collections } programs { + /* program { name: "hide_searchframe"; - source: "playlist_buttonframe"; + source: "medialist"; signal: "mouse,clicked,1"; action: STATE_SET "default" 1.0; - // target: "searchframe"; - target: "medialist_buttonframe"; - target: "playlist_buttonframe"; + target: "searchframe"; target: "find_buttonframe"; target: "medialist"; - target: "playlist"; target: "searcharea"; - target: "controlframe"; transition:SINUSOIDAL 1; } + program + { + name: "show_frames"; + //source: "video"; + source: "main"; + signal: "mouse,clicked,1"; + action: STATE_SET "default" 0.0; + target: "find_buttonframe"; + target: "medialist"; + target: "searcharea"; + transition:SINUSOIDAL 1; + } + */ + program + { + name: "button_clicked_signal_program"; + signal: "mouse,clicked,1"; + source: "medialist"; + + action: SIGNAL_EMIT "hide_frames" "medialist"; + } + + program + { + name: "handle_python_signal_hide"; + signal: "signal_from_python"; + + action: STATE_SET "default" 1.0; + target: "searchframe"; + target: "find_buttonframe"; + target: "medialist"; + target: "searcharea"; + } } } } -- cgit v1.2.3