diff --git a/main/editor_ui.glade b/main/editor_ui.glade index 16c43f13..7af4c6d3 100644 --- a/main/editor_ui.glade +++ b/main/editor_ui.glade @@ -3,43 +3,47 @@ + True False gtk-edit - - - - - - - - - - ntv - ntv+ - - + + True + autosize + Package - + + True + autosize + Service + + - + - + + + + + + + + + + + + + - - - ort - NTV+ - - 560 False - Enigma2ChannelEditor + DemonEditor + accessories-text-editor @@ -61,12 +65,13 @@ True False - + gtk-open True False True True + @@ -82,7 +87,7 @@ False True True - + @@ -238,13 +243,13 @@ True False - + True False - toolbutton1 + Download True gtk-connect - + False @@ -262,10 +267,10 @@ - + True False - toolbutton3 + Save True gtk-floppy @@ -285,10 +290,10 @@ - + True False - toolbutton14 + Up True gtk-go-up @@ -298,10 +303,10 @@ - + True False - toolbutton13 + Down True gtk-go-down @@ -321,10 +326,10 @@ - + True False - toolbutton5 + Cut True gtk-cut @@ -334,10 +339,10 @@ - + True False - toolbutton6 + Copy True gtk-copy @@ -347,10 +352,10 @@ - + True False - toolbutton7 + Paste True gtk-paste @@ -360,10 +365,10 @@ - + True False - toolbutton8 + Remove True gtk-remove @@ -383,10 +388,10 @@ - + True False - toolbutton10 + Preferences True gtk-preferences @@ -407,10 +412,10 @@ - + True False - toolbutton12 + About True gtk-about @@ -429,42 +434,133 @@ - 150 + 250 True True + 2 + 2 True - + True True - liststore1 - both - - - + in - - True - autosize - Service - - - - 0 - + + True + True + 13 + services_liststore + both + + + + multiple + - - - - - True - autosize - Package - - - 1 - + + True + autosize + Service + + + + 0 + + + + + + + True + autosize + Package + + + + 1 + + + + + + + True + autosize + Ssid + + + + 2 + + + + + + + True + autosize + Freq + + + + 3 + + + + + + + True + autosize + Rate + + + + 4 + + + + + + + True + autosize + Pol + + + + 5 + + + + + + + True + autosize + FEC + + + + 6 + + + + + + + True + autosize + System + + + + 7 + + + @@ -475,37 +571,47 @@ - + True True - liststore2 - both - - - + in - - True - autosize - FAV - - - - 0 - + + True + True + fav_liststore + both + + + + multiple + - - - - - True - autosize - Srv - - - 1 - + + True + autosize + FAV + + + + 0 + + + + + + + True + autosize + Srv + + + + 1 + + + @@ -985,14 +1091,4 @@ ok_button - - True - autosize - Package - - - True - autosize - Service - diff --git a/main/properties.py b/main/properties.py index 5b34a0f7..47acfa1e 100644 --- a/main/properties.py +++ b/main/properties.py @@ -31,7 +31,7 @@ def get_default_settings(): "services_path": "/etc/enigma2/", "user_bouquet_path": "/etc/enigma2/", "satellites_xml_path": "/etc/tuxbox/", - "data_dir_path": "/data"} + "data_dir_path": DATA_PATH} if __name__ == "__main__": diff --git a/main/ui.py b/main/ui.py index 1298c78e..8e9f6376 100644 --- a/main/ui.py +++ b/main/ui.py @@ -1,12 +1,15 @@ import gi from ftplib import FTP + from main.properties import get_config, write_config +from main.eparser.lamedb import parse gi.require_version('Gtk', '3.0') -from gi.repository import Gtk +from gi.repository import Gtk, Gdk __status_bar = None __options = get_config() +__services_model = None def on_about_app(item): @@ -22,11 +25,21 @@ def get_handlers(): "on_close_main_window": Gtk.main_quit, "on_about_app": on_about_app, "on_preferences": on_preferences, - "on_connect": on_connect, - "on_data_dir_field_icon_press": on_path_open + "on_download": on_download, + "on_data_dir_field_icon_press": on_path_open, + "on_data_open": on_data_open, + "on_tree_view_key_release": on_tree_view_key_release } +def on_data_open(item): + if isinstance(item, Gtk.ListStore): + channels = parse(get_config()["data_dir_path"] + "lamedb_example") + for ch in channels: + item.append(ch) + # item.append() + + def on_path_open(*args): builder = Gtk.Builder() builder.add_from_file("editor_ui.glade") @@ -72,7 +85,21 @@ def on_preferences(item): dialog.destroy() -def on_connect(item): +def on_tree_view_key_release(widget, event): + key = event.keyval + if key == Gdk.KEY_Tab: + print("Tab") + if key == Gdk.KEY_Delete: + print("Delete") + if key == Gdk.KEY_Up: + print("Up") + if key == Gdk.KEY_Down: + print("Down") + + print(widget.get_name()) + + +def on_download(item): connect(__options)