From 5bcac35deb7995cbb035da9c1a104b16175f9e0c Mon Sep 17 00:00:00 2001 From: DYefremov Date: Mon, 3 Aug 2020 22:23:44 +0300 Subject: [PATCH] added option for experimental features --- app/settings.py | 11 + app/ui/settings_dialog.glade | 862 +++++++++++++++++++---------------- app/ui/settings_dialog.py | 28 +- 3 files changed, 508 insertions(+), 393 deletions(-) diff --git a/app/settings.py b/app/settings.py index 0cbb79e4..d3a53300 100644 --- a/app/settings.py +++ b/app/settings.py @@ -678,6 +678,17 @@ class Settings: def debug_mode(self, value): self._settings["debug_mode"] = value + # **************** Experimental **************** # + + @property + def is_enable_experimental(self): + """ Allows experimental functionality. """ + return self._settings.get("enable_experimental", False) + + @is_enable_experimental.setter + def is_enable_experimental(self, value): + self._settings["enable_experimental"] = value + if __name__ == "__main__": pass diff --git a/app/ui/settings_dialog.glade b/app/ui/settings_dialog.glade index 6feec6ce..98941fee 100644 --- a/app/ui/settings_dialog.glade +++ b/app/ui/settings_dialog.glade @@ -2255,7 +2255,7 @@ Author: Dmitriy Yefremov True - False + True False 5 5 @@ -2839,148 +2839,89 @@ Author: Dmitriy Yefremov - True - False - vertical - - True False + 5 + 5 5 5 - 0.019999999552965164 - in + vertical + 10 - + True False - 5 - 5 - 5 - 5 - 5 - 5 + Allows you to name bouquet files using their names. + 0.019999999552965164 + in - + True False - start - True - Enable ver. 5 support (experimental) - - - 0 - 0 - - - - - True - True - end - - - 1 - 0 - - - - - - - - - - False - True - 0 - - - - - True - False - Allows you to name bouquet files using their names. - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - - - True - False - start - True - Enable alternate bouquet file naming - - - 0 - 0 - - - - - True - True - end - - - - 1 - 0 - - - - - - - - - - False - True - 1 - - - - - True - False - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - 5 - vertical - 5 - - - True - False - Enables parsing links using youtube-dl to get direct media links. + 5 + 5 + 5 + 5 + 5 + 5 - + True False start - Enable support for + True + Enable alternate bouquet file naming + + + 0 + 0 + + + + + True + True + end + + + + 1 + 0 + + + + + + + + + + False + True + 0 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + 5 + + + True + False + start + True + Enable HTTP API False @@ -2989,43 +2930,183 @@ Author: Dmitriy Yefremov - - youtube-dl - status-bar-button + True True - True - start - center - none - https://youtube-dl.org/ + end + - True + False True - 3 + 1 - - + + + + + + + + False + True + 1 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 12 + + True False center - EXPERIMENTAL! + 5 + 5 + + + Zap + True + False + True + False + Switch(zap) the channel(Ctrl + Z) + True + click_mode_play_button + + + 0 + 0 + + + + + Disabled + True + True + False + Disabled + True + click_mode_zap_button + + + 4 + 0 + + + + + Play stream + True + True + False + Play IPTV or other stream in the program(Ctrl + P) + True + click_mode_disabled_button + + + 3 + 0 + + + + + Zap and Play + True + False + True + False + Switch the channel and watch in the program(Ctrl + W) + True + click_mode_stream_button + + + 2 + 0 + + + + + Play + True + False + True + False + Watch the channel in the program + True + True + click_mode_zap_and_play_button + + + + 1 + 0 + + + + + + + + + True + False + Double click on the service in the bouquet list: + + + + + False + True + 2 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + 5 + 5 + + + True + False + start + Enable experimental features - True + False True - 3 + 0 - + True True - Enables parsing links using youtube-dl to get direct links to media end center + False @@ -3035,42 +3116,263 @@ Author: Dmitriy Yefremov + + + + + + + False + True + 3 + + + + + True + False + 15 + EXPERIMENTAL! + + + False + True + 4 + + + + + True + False + vertical + 10 + + + True + False + 0.019999999552965164 + in + + + True + False + False + 5 + 5 + 5 + 5 + + + True + False + start + True + Enable lamedb ver. 5 support + + + False + True + 0 + + + + + True + True + end + + + False + True + end + 1 + + + + + + + + - True + False + True + 0 + + + + + True + False + 0.019999999552965164 + in + + + True + False + False + 5 + 5 + 5 + 5 + vertical + 5 + + + True + False + Enables parsing links using youtube-dl to get direct media links. + + + True + False + start + Enable support for + + + False + True + 0 + + + + + True + True + Enables parsing links using youtube-dl to get direct links to media + end + center + + + False + True + end + 2 + + + + + youtube-dl + status-bar-button + True + False + True + start + center + none + https://youtube-dl.org/ + + + True + True + 3 + + + + + True + True + 1 + + + + + True + False + False + + + True + False + start + Auto-check for updates + + + True + True + 0 + + + + + True + True + end + center + + + False + True + end + 1 + + + + + False + True + 2 + + + + + + + + + + False True 1 - + True - False False + 0 + in - + True + False False - start - Auto-check for updates + 5 + 5 + 5 + 5 + + + True + False + start + True + Enable direct playback bar + + + False + True + 0 + + + + + True + True + Enables direct sending and playback of media links on the receiver + end + + + False + True + end + 1 + + - - True - True - 0 - - - - True - True - end - center - - - False - True - 1 - + + @@ -3080,225 +3382,13 @@ Author: Dmitriy Yefremov - - - + + False + True + 8 + - - False - True - 2 - - - - - True - False - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - - - True - False - start - True - Enable HTTP API (experimental) - - - 0 - 0 - - - - - True - True - end - - - - 1 - 0 - - - - - True - False - False - start - True - Enable direct playback bar (experimental) - - - 0 - 1 - - - - - True - False - True - Enables direct sending and playback of media links on the receiver - end - - - 1 - 1 - - - - - - - - - - False - True - 3 - - - - - True - False - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - 5 - 12 - - - True - False - center - 5 - 5 - 5 - 5 - 5 - - - Zap - True - False - True - False - Switch(zap) the channel(Ctrl + Z) - True - click_mode_play_button - - - 0 - 0 - - - - - Disabled - True - True - False - Disabled - True - click_mode_zap_button - - - 4 - 0 - - - - - Play stream - True - True - False - Play IPTV or other stream in the program(Ctrl + P) - True - True - click_mode_disabled_button - - - 3 - 0 - - - - - Zap and Play - True - False - True - False - Switch the channel and watch in the program(Ctrl + W) - True - True - click_mode_stream_button - - - 2 - 0 - - - - - Play - True - False - True - False - Watch the channel in the program - True - True - click_mode_zap_and_play_button - - - - 1 - 0 - - - - - - - - - True - False - Double click on the service in the bouquet list: - - - - - False - True - 4 - - - extra Extra diff --git a/app/ui/settings_dialog.py b/app/ui/settings_dialog.py index de966927..12a89925 100644 --- a/app/ui/settings_dialog.py +++ b/app/ui/settings_dialog.py @@ -36,6 +36,7 @@ class SettingsDialog: "on_set_color_switch": self.on_set_color_switch, "on_force_bq_name": self.on_force_bq_name, "on_http_mode_switch": self.on_http_mode_switch, + "on_experimental_switch": self.on_experimental_switch, "on_yt_dl_switch": self.on_yt_dl_switch, "on_default_path_mode_switch": self.on_default_path_mode_switch, "on_default_data_path_changed": self.on_default_data_path_changed, @@ -134,8 +135,7 @@ class SettingsDialog: # Program self._before_save_switch = builder.get_object("before_save_switch") self._before_downloading_switch = builder.get_object("before_downloading_switch") - self._program_frame = builder.get_object("program_frame") - self._extra_support_grid = builder.get_object("extra_support_grid") + self._enable_experimental_box = builder.get_object("enable_experimental_box") self._colors_grid = builder.get_object("colors_grid") self._set_color_switch = builder.get_object("set_color_switch") self._new_color_button = builder.get_object("new_color_button") @@ -156,10 +156,18 @@ class SettingsDialog: self._click_mode_zap_and_play_button = builder.get_object("click_mode_zap_and_play_button") self._click_mode_zap_button.bind_property("sensitive", self._click_mode_play_button, "sensitive") self._click_mode_zap_button.bind_property("sensitive", self._click_mode_zap_and_play_button, "sensitive") - self._click_mode_zap_button.bind_property("sensitive", self._enable_send_to_switch, "sensitive") - self._enable_send_to_switch.bind_property("sensitive", builder.get_object("enable_send_to_label"), "sensitive") - self._extra_support_grid.bind_property("sensitive", builder.get_object("v5_support_grid"), "sensitive") + # EXPERIMENTAL + self._enable_exp_switch = builder.get_object("enable_experimental_switch") + self._enable_exp_switch.bind_property("active", builder.get_object("yt_dl_box"), "sensitive") self._enable_yt_dl_switch.bind_property("active", builder.get_object("yt_dl_update_box"), "sensitive") + self._enable_exp_switch.bind_property("active", builder.get_object("v5_support_box"), "sensitive") + self._enable_exp_switch.bind_property("active", builder.get_object("enable_direct_playback_box"), "sensitive") + # Enigma2 only + self._enigma_radio_button.bind_property("active", builder.get_object("bq_naming_grid"), "sensitive") + self._enigma_radio_button.bind_property("active", builder.get_object("enable_http_box"), "sensitive") + self._enigma_radio_button.bind_property("active", builder.get_object("enable_experimental_box"), "sensitive") + self._enigma_radio_button.bind_property("active", builder.get_object("program_frame"), "sensitive") + self._enigma_radio_button.bind_property("active", builder.get_object("experimental_box"), "sensitive") # Profiles self._profile_view = builder.get_object("profile_tree_view") self._profile_add_button = builder.get_object("profile_add_button") @@ -195,8 +203,6 @@ class SettingsDialog: self._neutrino_radio_button.set_active(s_type is SettingsType.NEUTRINO_MP) self.update_title() self._settings_stack.get_child_by_name(Property.HTTP.value).set_visible(is_enigma_profile) - self._program_frame.set_sensitive(is_enigma_profile) - self._extra_support_grid.set_sensitive(is_enigma_profile) http_active = self._support_http_api_switch.get_active() self._click_mode_zap_button.set_sensitive(is_enigma_profile and http_active) self._lang_combo_box.set_active_id(self._ext_settings.language) @@ -282,6 +288,7 @@ class SettingsDialog: self.on_transcoding_preset_changed(self._presets_combo_box) if self._s_type is SettingsType.ENIGMA_2: + self._enable_exp_switch.set_active(self._settings.is_enable_experimental) self._support_ver5_switch.set_active(self._settings.v5_support) self._force_bq_name_switch.set_active(self._settings.force_bq_names) self._support_http_api_switch.set_active(self._settings.http_api_support) @@ -354,6 +361,7 @@ class SettingsDialog: self._ext_settings.icon_theme = self._icon_theme_combo_box.get_active_id() if self._s_type is SettingsType.ENIGMA_2: + self._ext_settings.is_enable_experimental = self._enable_exp_switch.get_active() self._ext_settings.use_colors = self._set_color_switch.get_active() self._ext_settings.new_color = self._new_color_button.get_rgba().to_string() self._ext_settings.extra_color = self._extra_color_button.get_rgba().to_string() @@ -439,6 +447,12 @@ class SettingsDialog: self._click_mode_zap_and_play_button.get_active())): self._click_mode_disabled_button.set_active(True) + def on_experimental_switch(self, switch, state): + if not state: + self._support_ver5_switch.set_active(state) + self._enable_send_to_switch.set_active(state) + self._enable_yt_dl_switch.set_active(state) + def on_force_bq_name(self, switch, state): if self._main_stack.get_visible_child_name() != "extra": return