From 0140fb4eb4ee76c48f70435fdea59efff716bb2c Mon Sep 17 00:00:00 2001 From: DYefremov Date: Tue, 31 May 2022 18:27:11 +0300 Subject: [PATCH] added epg path option --- app/settings.py | 32 +- app/ui/settings_dialog.glade | 1470 +++++++++++++++++----------------- app/ui/settings_dialog.py | 6 +- 3 files changed, 778 insertions(+), 730 deletions(-) diff --git a/app/settings.py b/app/settings.py index c834cb10..af6c02de 100644 --- a/app/settings.py +++ b/app/settings.py @@ -39,9 +39,9 @@ from textwrap import dedent SEP = os.sep HOME_PATH = str(Path.home()) -CONFIG_PATH = HOME_PATH + "{}.config{}demon-editor{}".format(SEP, SEP, SEP) +CONFIG_PATH = HOME_PATH + f"{SEP}.config{SEP}demon-editor{SEP}" CONFIG_FILE = CONFIG_PATH + "config.json" -DATA_PATH = HOME_PATH + "{}DemonEditor{}".format(SEP, SEP) +DATA_PATH = HOME_PATH + f"{SEP}DemonEditor{SEP}" GTK_PATH = os.environ.get("GTK_PATH", None) IS_DARWIN = sys.platform == "darwin" @@ -61,6 +61,7 @@ class Defaults(Enum): # Enigma2. BOX_SERVICES_PATH = "/etc/enigma2/" BOX_SATELLITE_PATH = "/etc/tuxbox/" + BOX_EPG_PATH = "/etc/enigma2/" BOX_PICON_PATH = "/usr/share/enigma2/picon/" BOX_PICON_PATHS = ("/usr/share/enigma2/picon/", "/media/hdd/picon/", @@ -73,8 +74,8 @@ class Defaults(Enum): NEUTRINO_BOX_PICON_PATH = "/usr/share/tuxbox/neutrino/icons/logo/" NEUTRINO_BOX_PICON_PATHS = ("/usr/share/tuxbox/neutrino/icons/logo/",) # Paths. - BACKUP_PATH = "{}backup{}".format(DATA_PATH, SEP) - PICON_PATH = "{}picons{}".format(DATA_PATH, SEP) + BACKUP_PATH = f"{DATA_PATH}backup{SEP}" + PICON_PATH = f"{DATA_PATH}picons{SEP}" DEFAULT_PROFILE = "default" BACKUP_BEFORE_DOWNLOADING = True @@ -94,9 +95,9 @@ class Defaults(Enum): STREAM_LIB = "mpv" if IS_WIN else "vlc" MAIN_LIST_PLAYBACK = False PROFILE_FOLDER_DEFAULT = False - RECORDS_PATH = DATA_PATH + "records{}".format(SEP) + RECORDS_PATH = f"{DATA_PATH}records{SEP}" ACTIVATE_TRANSCODING = False - ACTIVE_TRANSCODING_PRESET = "720p TV{}device".format(SEP) + ACTIVE_TRANSCODING_PRESET = f"720p TV{SEP}device" class SettingsType(IntEnum): @@ -110,12 +111,14 @@ class SettingsType(IntEnum): srv_path = Defaults.BOX_SERVICES_PATH.value sat_path = Defaults.BOX_SATELLITE_PATH.value picons_path = Defaults.BOX_PICON_PATH.value + epg_path = Defaults.BOX_EPG_PATH.value http_timeout = 5 telnet_timeout = 5 else: srv_path = Defaults.NEUTRINO_BOX_SERVICES_PATH.value sat_path = Defaults.NEUTRINO_BOX_SATELLITE_PATH.value picons_path = Defaults.NEUTRINO_BOX_PICON_PATH.value + epg_path = "" http_timeout = 2 telnet_timeout = 1 @@ -133,6 +136,7 @@ class SettingsType(IntEnum): "services_path": srv_path, "user_bouquet_path": srv_path, "satellites_xml_path": sat_path, + "epg_dat_path": epg_path, "picons_path": picons_path} @@ -359,6 +363,14 @@ class Settings: def satellites_xml_path(self, value): self._cp_settings["satellites_xml_path"] = value + @property + def epg_dat_path(self): + return self._cp_settings.get("epg_dat_path", self.get_default("epg_dat_path")) + + @epg_dat_path.setter + def epg_dat_path(self, value): + self._cp_settings["epg_dat_path"] = value + @property def picons_path(self): return self._cp_settings.get("picons_path", self.get_default("picons_path")) @@ -703,6 +715,14 @@ class Settings: def display_picons(self, value): self._settings["display_picons"] = value + @property + def display_epg(self): + return self._settings.get("display_epg", False) + + @display_epg.setter + def display_epg(self, value): + self._settings["display_epg"] = value + @property def alternate_layout(self): return self._settings.get("alternate_layout", IS_DARWIN) diff --git a/app/ui/settings_dialog.glade b/app/ui/settings_dialog.glade index e2541abc..38580717 100644 --- a/app/ui/settings_dialog.glade +++ b/app/ui/settings_dialog.glade @@ -50,6 +50,636 @@ Author: Dmitriy Yefremov + + True + False + emblem-default + + + True + False + + + gtk-add + True + False + True + True + + + + + + + gtk-edit + True + False + True + True + + + + + + + True + False + + + + + Set default + True + False + set_default_image + False + + + + + + + True + False + + + + + gtk-remove + True + False + True + True + + + + + + + 1 + 10 + 1 + 10 + + + True + False + 10 + 10 + 5 + 5 + 5 + 5 + + + True + False + Satellites.xml file: + 0.019999999552965164 + + + 0 + 11 + + + + + True + True + start + /etc/tuxbox/ + document-edit-symbolic + + + 1 + 11 + + + + + False + User bouquet files: + 2.2351741291171123e-10 + + + 0 + 10 + + + + + True + start + /etc/enigma2/ + document-edit-symbolic + + + 1 + 10 + + + + + True + False + Services and Bouquets files: + 0 + + + 0 + 9 + + + + + True + True + start + /etc/enigma2/ + document-edit-symbolic + + + 1 + 9 + + + + + True + False + start + STB file paths: + + + 1 + 8 + + + + + True + False + start + Telnet: + 1 + + + 0 + 7 + + + + + True + False + 5 + + + True + True + Default 23 + start + 6 + 6 + 23 + network-workgroup-symbolic + + + False + True + 0 + + + + + True + False + 5 + Timeout: + + + False + True + 1 + + + + + True + True + Timeout between commands in seconds + start + center + 2 + 6 + 6 + 1 + alarm-symbolic + number + telnet_timeout_adjustment + True + 1 + + + False + True + 2 + + + + + 1 + 7 + + + + + True + False + start + HTTP: + 1 + + + 0 + 6 + + + + + True + False + 5 + + + True + True + Default 80 + start + 5 + 6 + 6 + 80 + network-workgroup-symbolic + + + False + True + 0 + + + + + SSL/TSL + True + True + False + start + center + True + + + + False + True + 1 + + + + + + + + 1 + 6 + + + + + True + False + start + FTP: + 1 + + + 0 + 5 + + + + + True + True + Default 21 + start + 6 + 6 + 21 + network-workgroup-symbolic + + + 1 + 5 + + + + + True + False + start + Port: + + + 1 + 4 + + + + + True + False + Password: + 0.019999999552965164 + + + 0 + 3 + + + + + True + True + start + center + False + False + + root + emblem-readonly + False + password + + + 1 + 3 + + + + + True + False + Login: + 0.019999999552965164 + + + 0 + 2 + + + + + True + True + start + center + root + avatar-default-symbolic + False + + + 1 + 2 + + + + + True + False + Host: + 0.019999999552965164 + + + 0 + 1 + + + + + True + True + start + center + 127.0.0.1 + network-transmit-receive-symbolic + + + 1 + 1 + + + + + True + False + 5 + + + Enigma2 + True + True + False + True + neutrino_radio_button + + + + False + True + 1 + + + + + Neutrino-MP + True + True + False + True + enigma_radio_button + + + False + True + 4 + + + + + 1 + 0 + + + + + True + False + Settings type: + 0 + + + 0 + 0 + + + + + True + False + Picons: + 2.2351741291171123e-10 + + + 0 + 13 + + + + + True + False + 2 + + + True + False + start + 0 + True + + + False + + + + + False + True + 0 + + + + + True + False + expand + + + True + True + True + Remove + + + + True + False + list-remove-symbolic + + + + + False + True + 0 + + + + + True + True + True + Add + + + + True + False + list-add-symbolic + + + + + False + True + 1 + + + + + False + True + 3 + + + + + 1 + 13 + + + + + True + False + EPG *.dat file: + 0.02 + + + + 0 + 12 + + + + + True + False + start + 0 + True + + + /etc/enigma2/ + /media/hdd/ + /media/usb/ + /media/mmc/ + /media/cf/ + + + + True + + + + + 1 + 12 + + + + + + + + + + + True + False + gtk-connect + 680 False @@ -71,8 +701,8 @@ Author: Dmitriy Yefremov False center - 15 - 15 + 10 + 10 5 5 start @@ -126,6 +756,120 @@ Author: Dmitriy Yefremov True + + + True + False + center + 5 + + + + Test + 120 + True + True + True + Test connection + test_button_image + True + + + + False + True + 0 + + + + + True + False + 0.30000001192092896 + 0.30000001192092896 + + + True + False + + + + + True + True + 2 + + + + + True + False + True + expand + + + FTP + 75 + True + True + False + False + telnet_radio_button + + + True + True + 0 + + + + + HTTP + 75 + True + True + False + False + telnet_radio_button + + + True + True + 1 + + + + + Telnet + 75 + True + True + False + False + ftp_radio_button + + + True + True + 2 + + + + + False + True + end + 3 + + + + + False + True + end + 3 + + True @@ -2487,7 +3231,7 @@ Author: Dmitriy Yefremov True False - Enables upload as an archive if a large number of picon (> 1000) is selected. + Enables upload as an archive if a large number of picon (> 1000) is selected. Recommended only if you have external storage. start Enable picons compression @@ -2501,7 +3245,7 @@ Author: Dmitriy Yefremov True True - Enables upload as an archive if a large number of picon (> 1000) is selected. + Enables upload as an archive if a large number of picon (> 1000) is selected. Recommended only if you have external storage. @@ -2872,722 +3616,4 @@ Author: Dmitriy Yefremov save_button - - True - False - emblem-default - - - True - False - - - gtk-add - True - False - True - True - - - - - - - gtk-edit - True - False - True - True - - - - - - - True - False - - - - - Set default - True - False - set_default_image - False - - - - - - - True - False - - - - - gtk-remove - True - False - True - True - - - - - - - 1 - 10 - 1 - 10 - - - True - False - gtk-connect - - - True - False - 10 - 10 - 5 - 5 - vertical - 5 - - - True - False - 5 - 5 - - - True - False - Picons: - 2.2351741291171123e-10 - - - 0 - 12 - - - - - True - False - 2 - - - True - False - start - 0 - True - - - False - - - - - False - True - 0 - - - - - True - False - expand - - - True - True - True - Remove - - - - True - False - list-remove-symbolic - - - - - False - True - 0 - - - - - True - True - True - Add - - - - True - False - list-add-symbolic - - - - - False - True - 1 - - - - - False - True - 3 - - - - - 1 - 12 - - - - - True - False - Satellites.xml file: - 0.019999999552965164 - - - 0 - 11 - - - - - True - True - start - /etc/tuxbox/ - document-edit-symbolic - - - 1 - 11 - - - - - False - User bouquet files: - 2.2351741291171123e-10 - - - 0 - 10 - - - - - True - start - /etc/enigma2/ - document-edit-symbolic - - - 1 - 10 - - - - - True - False - Services and Bouquets files: - 0 - - - 0 - 9 - - - - - True - True - start - /etc/enigma2/ - document-edit-symbolic - - - 1 - 9 - - - - - True - False - start - STB file paths: - - - 1 - 8 - - - - - True - False - start - Telnet: - 1 - - - 0 - 7 - - - - - True - False - 5 - - - True - True - Default 23 - start - 6 - 6 - 23 - network-workgroup-symbolic - - - False - True - 0 - - - - - True - False - 5 - Timeout: - - - False - True - 1 - - - - - True - True - Timeout between commands in seconds - start - center - 2 - 6 - 6 - 1 - alarm-symbolic - number - telnet_timeout_adjustment - True - 1 - - - False - True - 2 - - - - - 1 - 7 - - - - - True - False - start - HTTP: - 1 - - - 0 - 6 - - - - - True - False - 5 - - - True - True - Default 80 - start - 5 - 6 - 6 - 80 - network-workgroup-symbolic - - - False - True - 0 - - - - - SSL/TSL - True - True - False - start - center - True - - - - False - True - 1 - - - - - - - - 1 - 6 - - - - - True - False - start - FTP: - 1 - - - 0 - 5 - - - - - True - True - Default 21 - start - 6 - 6 - 21 - network-workgroup-symbolic - - - 1 - 5 - - - - - True - False - start - Port: - - - 1 - 4 - - - - - True - False - Password: - 0.019999999552965164 - - - 0 - 3 - - - - - True - True - start - center - False - False - - root - emblem-readonly - False - password - - - 1 - 3 - - - - - True - False - Login: - 0.019999999552965164 - - - 0 - 2 - - - - - True - True - start - center - root - avatar-default-symbolic - False - - - 1 - 2 - - - - - True - False - Host: - 0.019999999552965164 - - - 0 - 1 - - - - - True - True - start - center - 127.0.0.1 - network-transmit-receive-symbolic - - - 1 - 1 - - - - - True - False - 5 - - - Enigma2 - True - True - False - True - neutrino_radio_button - - - - False - True - 1 - - - - - Neutrino-MP - True - True - False - True - enigma_radio_button - - - False - True - 4 - - - - - 1 - 0 - - - - - True - False - Settings type: - 0 - - - 0 - 0 - - - - - - - - - - - False - True - 0 - - - - - True - False - center - 5 - 5 - - - Test - 120 - True - True - True - Test connection - test_button_image - True - - - - False - True - 0 - - - - - True - False - 0.30000001192092896 - 0.30000001192092896 - - - True - False - - - - - True - True - 2 - - - - - True - False - True - expand - - - FTP - 75 - True - True - False - False - telnet_radio_button - - - True - True - 0 - - - - - HTTP - 75 - True - True - False - False - telnet_radio_button - - - True - True - 1 - - - - - Telnet - 75 - True - True - False - False - ftp_radio_button - - - True - True - 2 - - - - - False - True - end - 3 - - - - - False - True - end - 1 - - - diff --git a/app/ui/settings_dialog.py b/app/ui/settings_dialog.py index 5581dc34..d6d5b300 100644 --- a/app/ui/settings_dialog.py +++ b/app/ui/settings_dialog.py @@ -112,6 +112,7 @@ class SettingsDialog: self._services_field = builder.get_object("services_field") self._user_bouquet_field = builder.get_object("user_bouquet_field") self._satellites_xml_field = builder.get_object("satellites_xml_field") + self._epg_dat_box = builder.get_object("epg_dat_box") self._picons_paths_box = builder.get_object("picons_paths_box") self._remove_picon_path_button = builder.get_object("remove_picon_path_button") # Paths. @@ -191,7 +192,7 @@ class SettingsDialog: self._profile_remove_button = builder.get_object("profile_remove_button") # Network. # Separated due to a bug with response (presumably in the builder) in ubuntu 18.04 and derivatives. - builder.get_object("network_settings_frame").add(builder.get_object("network_box")) + builder.get_object("network_settings_frame").add(builder.get_object("network_grid")) # Style. self._style_provider = Gtk.CssProvider() self._style_provider.load_from_path(UI_RESOURCES_PATH + "style.css") @@ -305,6 +306,7 @@ class SettingsDialog: self._services_field.set_text(self._settings.services_path) self._user_bouquet_field.set_text(self._settings.user_bouquet_path) self._satellites_xml_field.set_text(self._settings.satellites_xml_path) + self._epg_dat_box.set_active_id(self._settings.epg_dat_path) self._picons_paths_box.set_active_id(self._settings.picons_path) self._data_path_field.set_text(self._settings.default_data_path) self._picons_path_field.set_text(self._settings.default_picon_path) @@ -368,7 +370,7 @@ class SettingsDialog: self._settings.telnet_timeout = int(self._telnet_timeout_spin_button.get_value()) self._settings.services_path = self._services_field.get_text() self._settings.user_bouquet_path = self._user_bouquet_field.get_text() - self._settings.satellites_xml_path = self._satellites_xml_field.get_text() + self._settings.epg_dat_path = self._epg_dat_box.get_active_id() self._settings.picons_path = self._picons_paths_box.get_active_id() def on_save_settings(self, item=None):