From 3d0bb6ad3c137a1491352f244589b2e63abb20c2 Mon Sep 17 00:00:00 2001 From: DYefremov Date: Mon, 3 Aug 2020 22:41:14 +0300 Subject: [PATCH] added option for experimental features --- app/settings.py | 11 + app/ui/settings_dialog.glade | 583 ++++++++++++++++++++--------------- app/ui/settings_dialog.py | 28 +- 3 files changed, 366 insertions(+), 256 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 b43fa74e..dc95966c 100644 --- a/app/ui/settings_dialog.glade +++ b/app/ui/settings_dialog.glade @@ -2230,7 +2230,6 @@ Author: Dmitriy Yefremov True - False False 5 5 @@ -2469,8 +2468,9 @@ Author: Dmitriy Yefremov 0 in - + True + False False 5 5 @@ -2807,72 +2807,17 @@ Author: Dmitriy Yefremov True False + 5 + 5 + 5 + 5 vertical - - - True - False - 5 - 5 - 5 - 5 - 0.019999999552965164 - in - - - True - False - 5 - 5 - 5 - 5 - 5 - 5 - - - True - False - start - True - Enable ver. 5 support (experimental) - - - 0 - 0 - - - - - True - True - end - - - 1 - 0 - - - - - - - - - - False - True - 0 - - + 10 True False Allows you to name bouquet files using their names. - 5 - 5 - 5 - 5 0.019999999552965164 in @@ -2919,181 +2864,35 @@ Author: Dmitriy Yefremov False True - 1 - - - - - True - False - 5 - 5 - 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. - - - True - False - start - Enable support for - - - False - True - 0 - - - - - youtube-dl - status-bar-button - True - False - True - start - center - none - https://youtube-dl.org/ - - - True - True - 3 - - - - - True - False - center - EXPERIMENTAL! - - - True - True - 3 - - - - - True - True - Enables parsing links using youtube-dl to get direct links to media - end - center - - - False - True - end - 2 - - - - - True - True - 1 - - - - - True - False - False - - - True - False - start - Auto-check for updates - - - True - True - 0 - - - - - True - True - end - center - - - False - True - 1 - - - - - False - True - 2 - - - - - - - - - - False - True - 2 + 0 True False - 5 - 5 - 5 - 5 0.019999999552965164 in - + True False 5 5 5 5 - 5 - 5 - + True False start True - Enable HTTP API (experimental) + Enable HTTP API - 0 - 0 + False + True + 0 @@ -3104,35 +2903,9 @@ Author: Dmitriy Yefremov - 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 + 1 @@ -3144,17 +2917,13 @@ Author: Dmitriy Yefremov False True - 3 + 1 True False - 5 - 5 - 5 - 5 0.019999999552965164 in @@ -3263,12 +3032,328 @@ Author: Dmitriy Yefremov + + False + True + 2 + + + + + True + False + 0.019999999552965164 + in + + + True + False + 5 + 5 + 5 + 5 + 5 + + + True + False + start + Enable experimental features + + + False + True + 0 + + + + + True + True + end + center + + + + False + True + end + 2 + + + + + + + + + + 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 + + + + + + + + + + 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 + 0 + in + + + True + False + False + 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 + + + + + + + + + + False + True + 2 + + + + + False + True + 8 + + extra diff --git a/app/ui/settings_dialog.py b/app/ui/settings_dialog.py index 5a92fc8d..3ad362d8 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, @@ -136,8 +137,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") @@ -158,10 +158,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") @@ -198,8 +206,6 @@ class SettingsDialog: self._neutrino_radio_button.set_active(s_type is SettingsType.NEUTRINO_MP) self.update_header_bar() 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) @@ -285,6 +291,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) @@ -357,6 +364,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() @@ -442,6 +450,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