diff --git a/main/editor_ui.glade b/main/editor_ui.glade index 874ca12b..ba1b0a69 100644 --- a/main/editor_ui.glade +++ b/main/editor_ui.glade @@ -2,8 +2,12 @@ - - + + + + + + @@ -322,10 +326,14 @@ + + + + - 560 + 640 False DemonEditor accessories-text-editor @@ -356,7 +364,8 @@ False True True - + + @@ -538,7 +547,8 @@ Open True gtk-open - + + False @@ -760,6 +770,18 @@ False True + 1 + + + + + True + False + + + False + True + 2 2 @@ -777,10 +799,9 @@ True in - + True True - 13 services_liststore both @@ -917,6 +938,30 @@ + + + False + data_id + + + + 10 + + + + + + + False + fav_id + + + + 11 + + + + @@ -926,71 +971,116 @@ - + True True - in + True - + True True - fav_liststore - both - - - - multiple - - + in - - True - autosize - Num - - - - 0 - + + True + True + fav_liststore + both + + + + multiple + - - - - - True - autosize - Service - - - 1 - + + True + autosize + Num + + + + 0 + + + - - - - - Type - - - 2 - + + True + autosize + Service + + + + 1 + + + - - - - - Pos - - - 3 - + + Type + + + + 2 + + + + + + + Pos + + + + 3 + + + + + True + False + + + + + True + True + in + + + True + True + bouquets_treestore + + + + + + True + Bouquets + True + + + + 0 + + + + + + + + + True + True + @@ -1002,9 +1092,23 @@ True True + 1 3 + + + True + False + 2 + + + False + True + 2 + 4 + + True @@ -1019,7 +1123,7 @@ False True - 3 + 5 diff --git a/main/ui.py b/main/ui.py index 4236bbd6..796485c5 100644 --- a/main/ui.py +++ b/main/ui.py @@ -10,6 +10,7 @@ from gi.repository import Gtk, Gdk __status_bar = None __options = get_config() __services_model = None +__bouquets_model = None __DATA_FILES_LIST = ("tv", "radio", "lamedb") @@ -29,22 +30,30 @@ def get_handlers(): "on_download": on_download, "on_upload": on_upload, "on_data_dir_field_icon_press": on_path_open, - "on_data_open": on_data_open, + "on_data_open_services": on_data_open_services, + "on_data_open_bouquets": on_data_open_bouquets, "on_tree_view_key_release": on_tree_view_key_release } -def on_data_open(item): +def on_data_open_services(items): try: data_path = get_config()["data_dir_path"] - channels = get_channels(data_path + "lamedb") - for ch in channels: - item.append(ch[:-2]) - bouquets = get_bouquets(data_path) + for ch in get_channels(data_path + "lamedb"): + items.append(ch) except Exception as e: __status_bar.push(1, getattr(e, "message", repr(e))) +def on_data_open_bouquets(item): + data_path = get_config()["data_dir_path"] + data = get_bouquets(data_path) + for name, bouquets in data: + parent = item.append(None, [name]) + for bouquet in bouquets: + item.append(parent, [bouquet]) + + def on_path_open(*args): builder = Gtk.Builder() builder.add_from_file("editor_ui.glade")