From 803b26ea02bdbf1ac4ba805907174f3c3d9d907c Mon Sep 17 00:00:00 2001 From: DYefremov Date: Sat, 1 Dec 2018 00:13:19 +0300 Subject: [PATCH] added creation of empty configuration --- app/ui/main_app_window.py | 17 +++ app/ui/main_window.glade | 291 +++++++++++++++++++------------------- 2 files changed, 161 insertions(+), 147 deletions(-) diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index 5eb64ce4..97a980cb 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -71,6 +71,7 @@ class MainAppWindow: "on_download": self.on_download, "on_data_open": self.on_data_open, "on_data_save": self.on_data_save, + "on_new_configuration": self.on_new_configuration, "on_tree_view_key_press": self.on_tree_view_key_press, "on_tree_view_key_release": self.on_tree_view_key_release, "on_bouquets_selection": self.on_bouquets_selection, @@ -854,6 +855,22 @@ class MainAppWindow: # blacklist write_blacklist(path, self._blacklist) + def on_new_configuration(self, item): + """ Creates new empty configuration """ + if show_dialog(DialogType.QUESTION, self._main_window) == Gtk.ResponseType.CANCEL: + return + + self.clear_current_data() + + profile = Profile(self._profile) + if profile is Profile.ENIGMA_2: + self._bouquets_model.append(None, ["Favourites (TV)", None, None, BqType.TV.value]) + self._bouquets_model.append(None, ["Favourites (Radio)", None, None, BqType.RADIO.value]) + elif profile is Profile.NEUTRINO_MP: + self._bouquets_model.append(None, ["Providers", None, None, BqType.BOUQUET.value]) + self._bouquets_model.append(None, ["FAV", None, None, BqType.TV.value]) + self._bouquets_model.append(None, ["WEBTV", None, None, BqType.WEBTV.value]) + def on_services_selection(self, model, path, column): self.update_service_bar(model, path) diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index 9c0c16cb..4daa57be 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -284,96 +284,106 @@ Author: Dmitriy Yefremov False - + True False - 5 - 5 - 0 - in + 10 + 10 + 5 + 5 + vertical + 2 - + + gtk-new + True + True + True + New empty configuration + none + True + True + + + + False + True + 0 + + + + True False - 5 - 5 - 5 - 5 - vertical - 2 - - - gtk-open - True - True - True - none - True - True - - - - False - True - 0 - - - - - gtk-save - True - True - True - none - True - True - - - - False - True - 1 - - - - - - - - - - - True - False - - - False - True - 2 - 4 - - - - - gtk-quit - True - True - True - none - True - True - - - - False - True - 5 - - + + False + True + 1 + - - + + + gtk-open + True + True + True + none + True + True + + + + False + True + 2 + + + + + gtk-save + True + True + True + none + True + True + + + + False + True + 3 + + + + + True + False + + + False + True + 2 + 4 + + + + + gtk-quit + True + True + True + none + True + True + + + + False + True + 5 + @@ -701,81 +711,68 @@ Author: Dmitriy Yefremov False - + True False - 5 - 5 - 0 - in + 10 + 10 + 5 + 5 + vertical + 2 - + + gtk-preferences + True + True + True + none + True + True + + + + False + True + 0 + + + + True False - 5 - 5 5 5 - vertical - 2 - - - gtk-preferences - True - True - True - none - True - True - - - - False - True - 0 - - - - - True - False - 5 - 5 - - - False - True - 1 - - - - - - - - - - - gtk-about - True - True - True - none - True - True - - - - False - True - 4 - - + + False + True + 1 + - + + + + + + + gtk-about + True + True + True + none + True + True + + + + False + True + 4 + + main