changing profile on data download

This commit is contained in:
DYefremov
2020-02-10 17:00:46 +03:00
parent 2723d255fe
commit de49179dd2
3 changed files with 10 additions and 5 deletions

View File

@@ -140,6 +140,7 @@ class DownloadDialog:
if active in self._settings.profiles: if active in self._settings.profiles:
self._settings.current_profile = active self._settings.current_profile = active
self._profile_combo_box.set_active_id(active) self._profile_combo_box.set_active_id(active)
self._s_type = self._settings.setting_type
self.init_ui_settings() self.init_ui_settings()
def on_info_bar_close(self, bar=None, resp=None): def on_info_bar_close(self, bar=None, resp=None):

View File

@@ -895,6 +895,10 @@ class Application(Gtk.Application):
yield from self.clear_current_data() yield from self.clear_current_data()
try: try:
current_profile = self._profile_combo_box.get_active_text()
if current_profile != self._settings.current_profile:
self.init_profiles(self._settings.current_profile)
prf = self._s_type prf = self._s_type
black_list = get_blacklist(data_path) black_list = get_blacklist(data_path)
bouquets = get_bouquets(data_path, prf) bouquets = get_bouquets(data_path, prf)

View File

@@ -175,12 +175,12 @@ class SettingsDialog:
update_entry_data(entry, self._dialog, self._settings) update_entry_data(entry, self._dialog, self._settings)
def on_settings_type_changed(self, item): def on_settings_type_changed(self, item):
profile = SettingsType.ENIGMA_2 if self._enigma_radio_button.get_active() else SettingsType.NEUTRINO_MP s_type = SettingsType.ENIGMA_2 if self._enigma_radio_button.get_active() else SettingsType.NEUTRINO_MP
self._s_type = profile if s_type is not self._s_type:
self._settings.setting_type = profile self._settings.setting_type = s_type
if profile is not self._s_type: self._s_type = s_type
self.on_reset() self.on_reset()
self.init_ui_elements(profile) self.init_ui_elements(s_type)
def on_reset(self, item=None): def on_reset(self, item=None):
self._settings.reset() self._settings.reset()