diff options
Diffstat (limited to 'src/YalpClients/EflClient')
| -rwxr-xr-x | src/YalpClients/EflClient/main.py | 80 | ||||
| -rw-r--r-- | src/YalpClients/EflClient/medialist.py | 19 | ||||
| -rw-r--r-- | src/YalpClients/EflClient/playlist.py | 49 | ||||
| -rw-r--r-- | src/YalpClients/EflClient/searchframe.py | 29 | ||||
| -rw-r--r-- | src/YalpClients/EflClient/yalp_gui.edc | 131 |
5 files changed, 122 insertions, 186 deletions
diff --git a/src/YalpClients/EflClient/main.py b/src/YalpClients/EflClient/main.py index a7050b8..8483878 100755 --- a/src/YalpClients/EflClient/main.py +++ b/src/YalpClients/EflClient/main.py @@ -9,83 +9,23 @@ import emotion import evas import elementary +#imort own Classes import searchframe import medialist - -#import globals - -# Handle options and create output window - -elementary.init() -win = elementary.Window("Yalp", elementary.ELM_WIN_BASIC) -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() -s = searchframe.Search() - -""" -def huhu(obj, str, x): - print "guck guck" - - -def findbutton_clicked(obj, signal,source): - print "Huhu"; -""" -def fill_playlist(obj, str, x): - playlist = elementary.List(win); - playlist.size_hint_weight_set(1.0, 1.0) - playlist.size_hint_align_set(-1.0, -1.0) - - box1 = elementary.Box(win) - win.resize_object_add(box1) - c.part_swallow("playlist", playlist) - - box1.pack_end(playlist) - playlist.show() - - playlist.item_append(str, None, None, None) - - playlist.go() - box1.show() - -def paint_buttons(): - """ - addbutton = elementary.Button(win) - addbutton.label_set("Add to Playlist") - c.part_swallow("medialist_buttonframe", addbutton) - addbutton.show() - """ - - m.add_button(win, c) - playbutton = elementary.Button(win) - playbutton.label_set("Play") - c.part_swallow("playlist_buttonframe", playbutton) - c.signal_callback_add("mouse,clicked,1","playlist_buttonframe", - playbutton_clicked) - playbutton.show() - -def playbutton_clicked(obj, signal, source): - play_video() - -def play_video(): - vid = emotion.Emotion(win.canvas,module_filename="xine"); - vid.file_set("Lordi.mpg"); - - c.part_swallow("video", vid) - vid.show() - vid.play = True +import playlist def gui(): - global win - global c + elementary.init() + win = elementary.Window("Yalp", elementary.ELM_WIN_BASIC) win.title_set("YALP") + 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) - c.signal_callback_add("mouse,clicked,1","findbutton", s.findbutton_clicked) - paint_buttons() - m.fill_medialist(win, c) - #play_video() - c.show() win.resize(800,600) win.show() diff --git a/src/YalpClients/EflClient/medialist.py b/src/YalpClients/EflClient/medialist.py index e4b29c6..0ea8f5f 100644 --- a/src/YalpClients/EflClient/medialist.py +++ b/src/YalpClients/EflClient/medialist.py @@ -9,13 +9,13 @@ import emotion import evas import elementary -#import globals - -class Medias(): - def _init_(self): - pass +class Medias(object): + def __init__(self, win, c): + self.win = win + self.c = c + self.add_button() - def huhu(obj, str, x): + def huhu(self, obj, str, x): print "guck guck" def fill_medialist(self, win, c): @@ -47,9 +47,8 @@ class Medias(): medialist.go() box0.show() - def add_button(self, win, c): - addbutton = elementary.Button(win) + def add_button(self): + addbutton = elementary.Button(self.win) addbutton.label_set("Add to Playlist") - c.part_swallow("medialist_buttonframe", addbutton) + self.c.part_swallow("medialist_buttonframe", addbutton) addbutton.show() - diff --git a/src/YalpClients/EflClient/playlist.py b/src/YalpClients/EflClient/playlist.py new file mode 100644 index 0000000..69f3ba3 --- /dev/null +++ b/src/YalpClients/EflClient/playlist.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python + +import edje +import ecore.evas +import sys +import os +import ecore +import emotion +import evas +import elementary + +class Selection(object): + def __init__(self, win, c, vid): + self.win = win + self.c = c + self.vid = vid + self.add_button() + + def fill_playlist(self, obj, str, x): + playlist = elementary.List(self.win); + playlist.size_hint_weight_set(1.0, 1.0) + playlist.size_hint_align_set(-1.0, -1.0) + box1 = elementary.Box(self.win) + self.win.resize_object_add(box1) + self.c.part_swallow("playlist", playlist) + box1.pack_end(playlist) + playlist.show() + playlist.item_append(str, None, None, None) + playlist.go() + box1.show() + + def playbutton_clicked(self, obj, signal, source): + self.play_video() + + def play_video(self): + #vid = emotion.Emotion(win.canvas,module_filename="xine"); + self.vid.file_set("Lordi.mpg"); + self.c.part_swallow("video", self.vid) + self.vid.show() + self.vid.play = True + + def add_button(self): + playbutton = elementary.Button(self.win) + playbutton.label_set("Play") + self.c.part_swallow("playlist_buttonframe", playbutton) + self.c.signal_callback_add("mouse,clicked,1","playlist_buttonframe", + self.playbutton_clicked) + playbutton.show() + diff --git a/src/YalpClients/EflClient/searchframe.py b/src/YalpClients/EflClient/searchframe.py new file mode 100644 index 0000000..8fec876 --- /dev/null +++ b/src/YalpClients/EflClient/searchframe.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +import edje +import ecore.evas +import sys +import os +import ecore +import emotion +import evas +import elementary + +class Search(object): + def __init__(self, win, c): + self.win = win + self.c = c + self.add_button() + c.signal_callback_add("mouse,clicked,1","find_buttonframe", + self.findbutton_clicked) + def findbutton_clicked(self, obj, signal,source): + print "Huhu"; + + def add_button(self): + findbutton = elementary.Button(self.win) + findbutton.label_set("Find...") + self.c.part_swallow("find_buttonframe", findbutton) + findbutton.show() + + + diff --git a/src/YalpClients/EflClient/yalp_gui.edc b/src/YalpClients/EflClient/yalp_gui.edc index 59d402f..f15187e 100644 --- a/src/YalpClients/EflClient/yalp_gui.edc +++ b/src/YalpClients/EflClient/yalp_gui.edc @@ -1,3 +1,12 @@ +styles +{ + style + { + name: "searchfield_style"; + base: "font=Edje-Vera font_size=12 valign=bottom color=#000 wrap=word"; + } +} + collections { group @@ -243,8 +252,8 @@ collections } part { - name: "findbutton"; - type: RECT; + name: "find_buttonframe"; + type: SWALLOW; mouse_events: 1; description @@ -274,46 +283,7 @@ collections } rel2 { - relative: 0.95 0.01; - offset: -1 -1; - } - } - } - - part - { - name: "buttontext_find"; - type: TEXT; - mouse_events: 0; - description - { - color: 255 255 255 255; - rel1 - { - relative: 0.83 0.08; - } - rel2 - { - relative: 0.94 0.12; - } - text - { - text: "Find..."; - font:"VeraBd.ttf"; - size: 12; - } - } - description - { - state: "default" 1.0; - rel1 - { - relative: 0.83 0.0; - offset: 0 0; - } - rel2 - { - relative: 0.94 0.01; + relative: 0.95 -0.5; offset: -1 -1; } } @@ -353,43 +323,33 @@ collections } } } - + part { name: "searcharea"; - type: BOX; + type: TEXTBLOCK; mouse_events: 0; + entry_mode: EDITABLE; description { state: "default" 0.0; + color: 255 255 255 255; visible: 1; - align: 0.0 0.0; - color: 255 255 255 50; rel1 { - relative: 0.15 0.07; + to: "searchframe"; + relative: 0.0 0.00; } rel2 { - relative: 0.65 0.13; - } - box - { - layout: "vertical"; - padding: 0 2; - align: 0.5 0.5; + to: "searchframe"; + relative: 1.0 1.0; } - } - box - { - items + text { - item - { - type: GROUP; - min: 100 100; - source: "text_group"; - } + text: "Suchbegriff eingeben"; + style: "searchfield_style"; + min: 0 0; } } } @@ -405,8 +365,7 @@ collections target: "searchframe"; target: "medialist_buttonframe"; target: "playlist_buttonframe"; - target: "findbutton"; - target: "buttontext_find"; + target: "find_buttonframe"; target: "medialist"; target: "playlist"; target: "controlframe"; @@ -414,44 +373,4 @@ collections } } } - - group - { - name: "text_group"; - parts - { - part - { - name: "searchfield"; - type: TEXTBLOCK; - mouse_events: 0; - entry_mode: EDITABLE; - description - { - state: "default" 0.0; - visible: 1; - align: 0.1 0.1; - text - { - text: "Huhu"; - style: "style"; - min: 0 1; - } - rel1 - { - relative: 0.15 0.07; - } - rel2 - { - relative: 0.65 0.13; - } - } - } - } - } } - - - - - |
