diff --git a/app/ui/dialogs.glade b/app/ui/dialogs.glade index e18b4186..15f0d3a1 100644 --- a/app/ui/dialogs.glade +++ b/app/ui/dialogs.glade @@ -39,7 +39,7 @@ Author: Dmitriy Yefremov system-help normal DemonEditor - 0.3.2 Pre-alpha + 0.4.0 Pre-alpha 2018 Dmitriy Yefremov Enigma2 channel and satellites list editor for GNU/Linux diff --git a/app/ui/main_app_window.py b/app/ui/main_app_window.py index 8790c6f2..745b63a1 100644 --- a/app/ui/main_app_window.py +++ b/app/ui/main_app_window.py @@ -36,41 +36,36 @@ class MainAppWindow: _BOUQUETS_LIST_NAME = "bouquets_tree_store" # dynamically active elements depending on the selected view - _SERVICE_ELEMENTS = ("copy_tool_button", "to_fav_tool_button", "copy_menu_item", "services_to_fav_move_popup_item", - "services_edit_popup_item", "services_copy_popup_item", "services_picon_popup_item", - "services_create_bouquet_popup_item") + _SERVICE_ELEMENTS = ("services_to_fav_move_popup_item", "services_edit_popup_item", "services_copy_popup_item", + "services_picon_popup_item", "services_create_bouquet_popup_item") - _BOUQUET_ELEMENTS = ("edit_tool_button", "new_tool_button", - "bouquets_new_popup_item", "bouquets_edit_popup_item") + _BOUQUET_ELEMENTS = ("edit_tool_button", "new_tool_button", "bouquets_new_popup_item", "bouquets_edit_popup_item") - _COMMONS_ELEMENTS = ("edit_tool_button", "remove_tool_button", "delete_menu_item", "services_remove_popup_item", - "bouquets_remove_popup_item", "fav_remove_popup_item", "up_tool_button", "down_tool_button") + _COMMONS_ELEMENTS = ("edit_tool_button", "services_remove_popup_item", "bouquets_remove_popup_item", + "fav_remove_popup_item") - _FAV_ELEMENTS = ("cut_tool_button", "paste_tool_button", "cut_menu_item", - "paste_menu_item", "fav_cut_popup_item", "fav_paste_popup_item", "import_m3u_tool_button", - "fav_import_m3u_popup_item", "fav_insert_marker_popup_item", "fav_edit_popup_item", - "fav_locate_popup_item", "fav_picon_popup_item", "fav_add_iptv_popup_item") + _FAV_ELEMENTS = ("fav_cut_popup_item", "fav_paste_popup_item", "fav_import_m3u_popup_item", "fav_locate_popup_item", + "fav_insert_marker_popup_item", "fav_edit_popup_item", "fav_picon_popup_item", + "fav_add_iptv_popup_item") _FAV_ENIGMA_ELEMENTS = ("fav_insert_marker_popup_item",) - _FAV_M3U_ELEMENTS = ("import_m3u_tool_button", "fav_import_m3u_popup_item", "fav_add_iptv_popup_item") + _FAV_M3U_ELEMENTS = ("fav_import_m3u_popup_item", "fav_add_iptv_popup_item") _LOCK_HIDE_ELEMENTS = ("locked_tool_button", "hide_tool_button") - _DYNAMIC_ELEMENTS = ("up_tool_button", "down_tool_button", "cut_tool_button", "services_create_bouquet_popup_item", - "paste_tool_button", "to_fav_tool_button", "new_tool_button", "remove_tool_button", - "cut_menu_item", "copy_menu_item", "paste_menu_item", "delete_menu_item", "edit_tool_button", - "services_to_fav_move_popup_item", "services_edit_popup_item", "locked_tool_button", - "services_remove_popup_item", "fav_cut_popup_item", "fav_paste_popup_item", - "bouquets_new_popup_item", "bouquets_edit_popup_item", "services_remove_popup_item", - "bouquets_remove_popup_item", "fav_remove_popup_item", "hide_tool_button", - "import_m3u_tool_button", "fav_import_m3u_popup_item", "fav_insert_marker_popup_item", + _DYNAMIC_ELEMENTS = ("services_create_bouquet_popup_item", "new_tool_button", + "edit_tool_button", "services_to_fav_move_popup_item", "services_edit_popup_item", + "locked_tool_button", "services_remove_popup_item", "fav_cut_popup_item", + "fav_paste_popup_item", "bouquets_new_popup_item", "bouquets_edit_popup_item", + "services_remove_popup_item", "bouquets_remove_popup_item", "fav_remove_popup_item", + "hide_tool_button", "fav_import_m3u_popup_item", "fav_insert_marker_popup_item", "fav_edit_popup_item", "fav_locate_popup_item", "services_copy_popup_item", "services_picon_popup_item", "fav_picon_popup_item", "services_add_new_popup_item", - "fav_add_iptv_popup_item", "copy_tool_button") + "fav_add_iptv_popup_item") def __init__(self): - handlers = {"on_close_main_window": self.on_quit, + handlers = {"on_close_app": self.on_close_app, "on_resize": self.on_resize, "on_about_app": self.on_about_app, "on_preferences": self.on_preferences, @@ -177,7 +172,6 @@ class MainAppWindow: self.update_profile_label() # dynamically active elements depending on the selected view self._tool_elements = {k: builder.get_object(k) for k in self._DYNAMIC_ELEMENTS} - self._picons_download_tool_button = builder.get_object("picons_download_tool_button") self._cas_label = builder.get_object("cas_label") self._fav_count_label = builder.get_object("fav_count_label") self._bouquets_count_label = builder.get_object("bouquets_count_label") @@ -196,9 +190,9 @@ class MainAppWindow: self._services_model_filter = builder.get_object("services_model_filter") self._services_model_filter.set_visible_func(self.services_filter_function) self._filter_entry = builder.get_object("filter_entry") - self._filter_info_bar = builder.get_object("filter_info_bar") + self._filter_bar = builder.get_object("filter_bar") # Search - self._search_info_bar = builder.get_object("search_info_bar") + self._search_bar = builder.get_object("search_bar") self._search_provider = SearchProvider((self._services_view, self._fav_view, self._bouquets_view), builder.get_object("search_down_button"), builder.get_object("search_up_button")) @@ -223,7 +217,7 @@ class MainAppWindow: event.state |= Gdk.ModifierType.CONTROL_MASK @run_idle - def on_quit(self, *args): + def on_close_app(self, *args): """ Called before app quit """ write_config(self._options) # storing current config if self._player: @@ -828,7 +822,7 @@ class MainAppWindow: bq_selected = BqType(bq_type) is BqType.WEBTV for elem in self._FAV_ELEMENTS: - if elem in ("paste_tool_button", "paste_menu_item", "fav_paste_popup_item"): + if elem in ("paste_tool_button", "fav_paste_popup_item"): self._tool_elements[elem].set_sensitive(not is_service and self._rows_buffer) elif elem in self._FAV_ENIGMA_ELEMENTS: if profile is Profile.ENIGMA_2: @@ -858,17 +852,18 @@ class MainAppWindow: def set_service_flags(self, flag): profile = Profile(self._profile) bq_selected = self.get_selected_bouquet() + if not bq_selected: + return + if profile is Profile.ENIGMA_2: if set_flags(flag, self._services_view, self._fav_view, self._services, self._blacklist): - if bq_selected: - self._fav_model.clear() - self.update_bouquet_services(self._fav_model, None, bq_selected) + self._fav_model.clear() + self.update_bouquet_services(self._fav_model, None, bq_selected) elif profile is Profile.NEUTRINO_MP: - if bq_selected: - model, path = self._bouquets_view.get_selection().get_selected() - value = model.get_value(path, 1 if flag is Flag.LOCK else 2) - value = None if value else LOCKED_ICON if flag is Flag.LOCK else HIDE_ICON - model.set_value(path, 1 if flag is Flag.LOCK else 2, value) + model, path = self._bouquets_view.get_selection().get_selected() + value = model.get_value(path, 1 if flag is Flag.LOCK else 2) + value = None if value else LOCKED_ICON if flag is Flag.LOCK else HIDE_ICON + model.set_value(path, 1 if flag is Flag.LOCK else 2, value) @run_idle def on_model_changed(self, model, path, itr=None): @@ -1043,7 +1038,9 @@ class MainAppWindow: @run_idle def on_filter_toggled(self, toggle_button: Gtk.ToggleToolButton): - self._filter_info_bar.set_visible(toggle_button.get_active()) + active = toggle_button.get_active() + self._filter_bar.set_search_mode(active) + self._filter_bar.set_visible(active) @run_idle def on_filter_changed(self, entry): @@ -1056,7 +1053,7 @@ class MainAppWindow: return self._filter_entry.get_text() in str(model.get(iter, 3, 6, 7, 10, 11, 12, 13, 14, 15, 16)) def on_search_toggled(self, toggle_button: Gtk.ToggleToolButton): - self._search_info_bar.set_visible(toggle_button.get_active()) + self._search_bar.set_search_mode(toggle_button.get_active()) def on_search_down(self, item): self._search_provider.on_search_down() diff --git a/app/ui/main_window.glade b/app/ui/main_window.glade index 09c283e9..864adb95 100644 --- a/app/ui/main_window.glade +++ b/app/ui/main_window.glade @@ -1,7 +1,38 @@ - + - + + + + + + True False @@ -76,12 +107,7 @@ True False - emblem-downloads - - - True - False - edit-select-all + insert-link @@ -127,11 +153,6 @@ False insert-image - - True - False - insert-image - True False @@ -147,6 +168,115 @@ False insert-text + + False + + + True + False + 5 + 5 + 0 + in + + + 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 + 2 + + + + + + + + True + False + + + False + True + 2 + 4 + + + + + gtk-quit + True + True + True + none + True + True + + + + False + True + 5 + + + + + + + + + + main + 1 + + + True False @@ -371,6 +501,91 @@ False gtk-new + + False + + + True + False + 5 + 5 + 0 + in + + + 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 + + + + + + + + + + main + 1 + + + True False @@ -396,11 +611,6 @@ False gtk-select-all - - True - False - network-transmit-receive - @@ -455,495 +665,273 @@ 640 False - DemonEditor accessories-text-editor + DemonEditor - + - - + + True False - vertical + 1 + True - + True False - + True - False - _Файл - True - - + True + True + left_header_popover_menu + + True False - - - gtk-open - True - False - True - True - - - - - - Download - True - False - FTP-transfer - True - send_recive_image - False - - - - - - True - False - - - - - gtk-quit - True - False - True - True - - - + find-location-symbolic + + False + True + 0 + - + True False - _Правка - True - - - True - False - - - gtk-cut - True - False - False - True - True - - - - - - gtk-copy - True - False - False - True - True - - - - - - gtk-paste - True - False - False - True - True - - - - - - gtk-delete - True - False - False - True - True - - - - - + + False + True + 2 + 1 + - + True - False - _Инструменты - True - - + True + True + FTP-transfer + + + True False - - - Satellites editor - True - False - edit_select_all_image - False - - - - - - Picons downloader - True - False - True - insert_image_3 - False - - - - - - True - False - - - - - gtk-preferences - True - False - True - True - - - + network-transmit-receive + + False + True + 2 + - + True - False - _Справка - True - - + True + True + Save + + + True False - - - gtk-about - True - False - True - True - - - + gtk-save + + False + True + 3 + + + + + True + False + + + False + True + 2 + 4 + + + + + True + True + True + + + + True + False + gtk-spell-check + + + + + False + True + 5 + + + + + True + True + True + + + + True + False + gtk-find + + + + + False + True + 6 + + + + + True + False + + + False + True + 1 + 7 + + + + + True + True + True + Parent lock On/Off Ctrl + L + + + + True + False + dialog-password-symbolic + + + + + False + True + 10 + + + + + True + True + True + Hide/Skip On/Off Ctrl + H + + + + True + False + go-jump + + + + + False + True + 11 + - - False - True - 0 - - - + + True False + vertical - + True False - Open - Open - True - gtk-open - + DemonEditor + + + False - True + True + 0 - + True False + 2 + + + True + False + Profile: + + + + + + + False + True + 0 + + + + + True + False + Enigma 2 v.4 + + + + + + + False + True + 1 + + False - False - - - - - True - False - FTP-transfer - Download - True - network-transmit-receive - - - - False - True - - - - - True - False - - - False - True - - - - - True - False - Save - Save - True - gtk-floppy - - - - False - True - - - - - True - False - - - False - False - - - - - True - False - Services filter - Services filter - True - tools-check-spelling - - - - False - True - - - - - True - False - Global search - Search - True - gtk-find - - - - False - True - - - - - True - False - - - False - True - - - - - True - False - False - Move - True - gtk-go-forward - - - - False - True - - - - - True - False - - - False - False - - - - - True - False - False - Up - Up - True - gtk-go-up - - - - False - True - - - - - True - False - False - Down - Down - True - gtk-go-down - - - - False - True - - - - - True - False - - - False - False - - - - - True - False - False - Cut - True - gtk-cut - - - - False - True - - - - - True - False - False - Copy - True - gtk-copy - - - - False - True - - - - - True - False - False - Paste - True - gtk-paste - - - - False - True - - - - - True - False - - - False - False - - - - - True - False - False - Parent lock On/Off Ctrl + L - Locked - True - system-lock-screen - - - - False - True - - - - - True - False - False - Hide/Skip On/Off Ctrl + H - Hide - True - go-jump - - - - False - True - - - - - True - False - - - False - False + False + 1 + + + + + True + False True @@ -957,7 +945,8 @@ False - True + True + 2 @@ -973,172 +962,133 @@ False - True + True + 3 - - True - False - False - Remove - True - gtk-remove - - - - False - True - - - - + True False False - False + True + 2 + 4 - + True - False - Settings - Preferences - True - gtk-preferences - - - - False - True - - - - - True - False - - - False - False - - - - - True - False + True + True Satellites editor - Satellites editor - True - edit-select-all + + + True + False + gtk-select-all + + False - True + True + 5 - + True - False - Picons - Picons loader - True - insert-image + True + True + Picons downloader + + + True + False + insert-image + + False - True + True + 6 - + True - False - False + True + True Import m3u file - 0.93999999999999995 - IPTV - True - emblem-downloads + + + True + False + insert-link + + False - True + True + 7 - + True - False - - - False - True - - - - - True - False - About - True - gtk-about - - - - False - True - - - - - - False - True - 1 - - - - - True - False - - - False - 5 - True - end + True + True + none + False + right_header_popover_menu False - False - 1 + True + 9 - - + + + end + 1 + + + + + + + True + False + 1 + vertical + + + True + False + + + True False - 2 - True - + True - False - - - + True + edit-find-symbolic + False + False + False @@ -1147,66 +1097,20 @@ - + True - False + False + True + True + half + - - 200 + True - True - edit-find-symbolic - False - False - + False + center + down - - False - True - 0 - - - - - True - False - True - True - - - - True - False - down - - - - - False - False - 1 - - - - - True - False - True - True - - - - True - False - up - - - - - False - False - 2 - @@ -1216,43 +1120,35 @@ - + True - False + False + True + True + half + - + + True + False + center + up + False - True + False 2 - - False - False - 1 - - - False - False - 2 - - - - - True - False - False True - 2 - 3 + 0 @@ -1287,7 +1183,6 @@ True True - 2 in @@ -1598,77 +1493,28 @@ - - True + False - 2 - 2 - - - False - 6 - end - - - - - - - - - - - - False - False - 0 - - - - - False - 16 - - - True - True - tools-check-spelling - False - False - - - - False - True - 0 - - - - - - - - - - - False - False - 0 - - - + + True + True + tools-check-spelling + False + False + + False - False + True 2 - 20 + 22 True False queue @@ -2236,12 +2082,18 @@ True False + center 2 True False + center Current IP: + + + + False @@ -2254,6 +2106,10 @@ True False 127.0.0.1 + + + + False @@ -2266,66 +2122,16 @@ False True 5 - 0 - - - - - True - False - 2 - - - True - False - Profile: - - - False - True - 0 - - - - - True - False - Enigma 2 v.4 - - - False - True - 1 - - - - - False - False 1 - - - True - False - Ver. 0.3.2 Pre-alpha - 0.94999998807907104 - - - False - True - end - 2 - - False - True + False 6 diff --git a/app/ui/uicommons.py b/app/ui/uicommons.py index 978b9a89..31564783 100644 --- a/app/ui/uicommons.py +++ b/app/ui/uicommons.py @@ -20,7 +20,7 @@ theme = Gtk.IconTheme.get_default() _IMAGE_MISSING = theme.load_icon("image-missing", 16, 0) if theme.lookup_icon("image-missing", 16, 0) else None CODED_ICON = theme.load_icon("emblem-readonly", 16, 0) if theme.lookup_icon( "emblem-readonly", 16, 0) else _IMAGE_MISSING -LOCKED_ICON = theme.load_icon("system-lock-screen", 16, 0) if theme.lookup_icon( +LOCKED_ICON = theme.load_icon("dialog-password-symbolic", 16, 0) if theme.lookup_icon( "system-lock-screen", 16, 0) else _IMAGE_MISSING HIDE_ICON = theme.load_icon("go-jump", 16, 0) if theme.lookup_icon("go-jump", 16, 0) else _IMAGE_MISSING TV_ICON = theme.load_icon("tv-symbolic", 16, 0) if theme.lookup_icon("tv-symbolic", 16, 0) else _IMAGE_MISSING