diff --git a/app/properties.py b/app/properties.py index e5bd8f26..f0503c47 100644 --- a/app/properties.py +++ b/app/properties.py @@ -44,14 +44,18 @@ def get_default_settings(): "services_path": "/etc/enigma2/", "user_bouquet_path": "/etc/enigma2/", "satellites_xml_path": "/etc/tuxbox/", - "data_dir_path": DATA_PATH + "enigma2/"}, + "picons_path": "/usr/share/enigma2/picon", + "data_dir_path": DATA_PATH + "enigma2/", + "picons_dir_path": DATA_PATH + "enigma2/picons"}, Profile.NEUTRINO_MP.value: { "host": "127.0.0.1", "port": "21", "user": "root", "password": "root", "services_path": "/var/tuxbox/config/zapit/", "user_bouquet_path": "/var/tuxbox/config/zapit/", "satellites_xml_path": "/var/tuxbox/config/", - "data_dir_path": DATA_PATH + "neutrino/"}, + "picons_path": "/usr/share/tuxbox/neutrino/icons/logo/", + "data_dir_path": DATA_PATH + "neutrino/", + "picons_dir_path": DATA_PATH + "neutrino/picons"}, "profile": Profile.ENIGMA_2.value} diff --git a/app/ui/dialogs.glade b/app/ui/dialogs.glade index a5c70ae2..ac674061 100644 --- a/app/ui/dialogs.glade +++ b/app/ui/dialogs.glade @@ -926,7 +926,7 @@ dmitry.v.yefremov@gmail.com True False Services and Bouquets files: - 0.10000000149011612 + 0 0 @@ -949,7 +949,7 @@ dmitry.v.yefremov@gmail.com True False User bouquet files: - 0.10000000149011612 + 2.2351741291171123e-10 0 @@ -972,7 +972,7 @@ dmitry.v.yefremov@gmail.com True False Satellites.xml file: - 0.10000000149011612 + 0.019999999552965164 0 @@ -991,11 +991,11 @@ dmitry.v.yefremov@gmail.com - + True False - Picons directory: - 0.10000000149011612 + Picons: + 2.2351741291171123e-10 0 @@ -1003,10 +1003,9 @@ dmitry.v.yefremov@gmail.com - + True True - False /usr/share/enigma2/picon @@ -1136,8 +1135,9 @@ dmitry.v.yefremov@gmail.com True False - Data directory: + Data dir: 0 + 0.019999999552965164 False @@ -1185,6 +1185,31 @@ dmitry.v.yefremov@gmail.com 6 + + + True + False + Picons dir: + 0.019999999552965164 + + + False + True + 8 + + + + + True + True + /data/picons + + + False + True + 9 + + diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index 5ed7035b..7d3f277e 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -129,9 +129,6 @@ class MainAppWindow: self.__radio_count_label = builder.get_object("radio_count_label") self.__data_count_label = builder.get_object("data_count_label") self.__fav_edit_marker_popup_item = builder.get_object("fav_edit_marker_popup_item") - # Adding custom image for tools menu button - add_menu_tool_button = builder.get_object("toolbar_tools_menu_button") - add_menu_tool_button.set_image(builder.get_object("tools_menu_butoon_image")) self.init_drag_and_drop() # drag and drop self.__main_window.show() @@ -805,7 +802,7 @@ class MainAppWindow: locate_in_services(view, self.__services_view, self.__main_window) def on_picons_loader_show(self, item): - dialog = PiconsDialog(self.__main_window, self.__options.get(self.__profile).get("data_dir_path") + "picons") + dialog = PiconsDialog(self.__main_window, self.__options.get(self.__profile)) dialog.show() diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index 7c7954c3..e34a33d7 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -80,15 +80,10 @@ False emblem-downloads - - True - False - emblem-shared - True False - emblem-shared + edit-select-all True @@ -227,36 +222,7 @@ True False - emblem-photos - - - True - False - emblem-photos - - - True - False - - - Satellites editor - True - False - image10 - False - - - - - - Picons loader - True - False - image9 - False - - - + insert-image True @@ -785,6 +751,21 @@ True + + + True + False + False + Remove + True + gtk-remove + + + + False + True + + True @@ -796,16 +777,14 @@ - + True - False False - Import m3u file - 0.93999999999999995 - IPTV + Settings + Preferences True - emblem-downloads - + gtk-preferences + False @@ -823,66 +802,52 @@ - + + True + False + Satellites editor + Satellites editor + True + edit-select-all + + + + False + True + + + + + True + False + Picons + Picons loader + True + insert-image + + + + False + True + + + + True False False - Remove + Import m3u file + 0.93999999999999995 + IPTV True - gtk-remove - + emblem-downloads + False True - - - True - False - - - False - True - - - - - True - False - Preferences - True - gtk-preferences - - - - False - True - - - - - True - False - - - True - True - True - tools_popup_menu - none - - - - - - - - False - False - - True @@ -1855,10 +1820,4 @@ - - True - False - applications-utilities - 3 - diff --git a/app/ui/picons_dialog.glade b/app/ui/picons_dialog.glade index 60d32017..e526b4d1 100644 --- a/app/ui/picons_dialog.glade +++ b/app/ui/picons_dialog.glade @@ -7,6 +7,7 @@ Picons download tool False True + True emblem-photos dialog @@ -53,6 +54,72 @@ False vertical 2 + + + True + False + 2 + True + + + True + True + + + 0 + 1 + + + + + True + True + + + 1 + 1 + + + + + True + False + Receiver IP: + + + 0 + 0 + + + + + True + False + Receiver picons path: + + + 1 + 0 + + + + + False + True + 0 + + + + + True + False + + + False + True + 1 + + True @@ -63,7 +130,7 @@ False True - 0 + 2 @@ -71,25 +138,27 @@ True True gtk-edit + False + https://www.lyngsat.com/packages/'your-provider'.html url False True - 1 + 3 True False - Data directory: + Current picons path: 0.019999999552965164 False True - 2 + 4 @@ -97,11 +166,12 @@ True True emblem-photos + False False True - 3 + 5 @@ -113,7 +183,7 @@ False True 2 - 4 + 6 @@ -182,7 +252,7 @@ False True - 5 + 7 @@ -208,7 +278,7 @@ False True - 7 + 8 @@ -216,6 +286,7 @@ True True False + True False @@ -264,7 +335,7 @@ False True - 8 + 9 diff --git a/app/ui/picons_dialog.py b/app/ui/picons_dialog.py index afb51815..b57ec99a 100644 --- a/app/ui/picons_dialog.py +++ b/app/ui/picons_dialog.py @@ -8,8 +8,9 @@ from . import Gtk, UI_RESOURCES_PATH class PiconsDialog: - def __init__(self, transient, path): + def __init__(self, transient, options): self._current_process = None + self._picons_path = options.get("picons_dir_path", "") handlers = {"on_receive": self.on_receive, "on_cancel": self.on_cancel, @@ -17,14 +18,21 @@ class PiconsDialog: "on_send": self.on_send} builder = Gtk.Builder() - builder.add_objects_from_file(UI_RESOURCES_PATH + "picons_dialog.glade", - ("picons_dialog", "receive_image", "text_buffer")) + builder.add_objects_from_file(UI_RESOURCES_PATH + "picons_dialog.glade", ("picons_dialog", "receive_image")) builder.connect_signals(handlers) self._dialog = builder.get_object("picons_dialog") self._dialog.set_transient_for(transient) self._expander = builder.get_object("expander") self._text_view = builder.get_object("text_view") self._info_bar = builder.get_object("info_bar") + self._ip_entry = builder.get_object("ip_entry") + self._picons_entry = builder.get_object("picons_entry") + self._url_entry = builder.get_object("url_entry") + self._picons_dir_entry = builder.get_object("picons_dir_entry") + + self._ip_entry.set_text(options.get("host", "")) + self._picons_entry.set_text(options.get("picons_path", "")) + self._picons_dir_entry.set_text(self._picons_path) def show(self): self._dialog.run() @@ -32,14 +40,11 @@ class PiconsDialog: def on_receive(self, item): self._current_process = subprocess.Popen("ls", stdout=subprocess.PIPE) - GLib.io_add_watch(self._current_process.stdout, # file descriptor - GLib.IO_IN, # condition - self.write_to_buffer) # callback + GLib.io_add_watch(self._current_process.stdout, GLib.IO_IN, self.write_to_buffer) def write_to_buffer(self, fd, condition): - """https://pygabriel.wordpress.com/2009/07/27/redirecting-the-stdout-on-a-gtk-textview/""" if condition == GLib.IO_IN: - char = fd.read(1) # we read one byte per time, to avoid blocking + char = fd.read(1) buf = self._text_view.get_buffer() buf.insert_at_cursor(str(char)) return True @@ -56,7 +61,7 @@ class PiconsDialog: def on_close(self, item): self.on_cancel(item) self._dialog.destroy() - + def on_send(self, item): pass diff --git a/app/ui/settings_dialog.py b/app/ui/settings_dialog.py index eb06cf73..ec4d4cdf 100644 --- a/app/ui/settings_dialog.py +++ b/app/ui/settings_dialog.py @@ -26,6 +26,7 @@ class SettingsDialog: self._user_bouquet_field = builder.get_object("user_bouquet_field") self._satellites_xml_field = builder.get_object("satellites_xml_field") self._data_dir_field = builder.get_object("data_dir_field") + self._picons_field = builder.get_object("picons_field") self._picons_dir_field = builder.get_object("picons_dir_field") self._enigma_radio_button = builder.get_object("enigma_radio_button") self._neutrino_radio_button = builder.get_object("neutrino_radio_button") @@ -70,15 +71,16 @@ class SettingsDialog: def set_settings(self): options = self._options.get(self._active_profile) - self._host_field.set_text(options.get("host")) - self._port_field.set_text(options.get("port")) - self._login_field.set_text(options.get("user")) - self._password_field.set_text(options.get("password")) - self._services_field.set_text(options.get("services_path")) - self._user_bouquet_field.set_text(options.get("user_bouquet_path")) - self._satellites_xml_field.set_text(options.get("satellites_xml_path")) - self._data_dir_field.set_text(options.get("data_dir_path")) - self._picons_dir_field.set_text(options.get("data_dir_path") + "picons") + self._host_field.set_text(options.get("host", "")) + self._port_field.set_text(options.get("port", "")) + self._login_field.set_text(options.get("user", "")) + self._password_field.set_text(options.get("password", "")) + self._services_field.set_text(options.get("services_path", "")) + self._user_bouquet_field.set_text(options.get("user_bouquet_path", "")) + self._satellites_xml_field.set_text(options.get("satellites_xml_path", "")) + self._picons_field.set_text(options.get("picons_path", "")) + self._data_dir_field.set_text(options.get("data_dir_path", "")) + self._picons_dir_field.set_text(options.get("picons_dir_path", "")) def apply_settings(self): profile = Profile.ENIGMA_2.value if self._enigma_radio_button.get_active() else Profile.NEUTRINO_MP.value @@ -92,7 +94,9 @@ class SettingsDialog: options["services_path"] = self._services_field.get_text() options["user_bouquet_path"] = self._user_bouquet_field.get_text() options["satellites_xml_path"] = self._satellites_xml_field.get_text() + options["picons_path"] = self._picons_field.get_text() options["data_dir_path"] = self._data_dir_field.get_text() + options["picons_dir_path"] = self._picons_dir_field.get_text() if __name__ == "__main__":