diff --git a/app/ui/app_menu.ui b/app/ui/app_menu.ui index 1a71df63..d5e46a5a 100644 --- a/app/ui/app_menu.ui +++ b/app/ui/app_menu.ui @@ -1,5 +1,177 @@ + + + File + app.hide_menu_bar + action-disabled +
+ + Import +
+ + Bouquet + app.on_import_bouquet + + + Bouquets and services + app.on_import_bouquets + +
+
+ + Import from Web + app.on_import_from_web + + + New empty configuration + app.on_new_configuration + +
+
+ + Open + app.on_data_open + + + Extract... + app.on_archive_open + + + Save + app.on_data_save + + + Save as + app.on_data_save_as + +
+
+ + FTP-transfer + app.on_download + +
+
+ + Settings + app.on_settings + +
+
+ + Exit + app.on_close_app + +
+
+ + Edit + app.hide_menu_bar + action-disabled +
+ + Lock + app.on_locked + + + Hide + app.on_hide + +
+
+ + View + app.hide_menu_bar + action-disabled +
+ + Search + win.search + + + Filter + win.filter + +
+
+ + Tools + app.hide_menu_bar + action-disabled +
+ + Satellites editor + app.on_satellite_editor_show + + + Picons manager + app.on_picons_manager_show + + + Backups + app.on_backup_tool_show + +
+
+
+
+ + IPTV + app.hide_menu_bar + action-disabled + + Add IPTV or stream service + app.on_iptv + + + Import YouTube playlist + app.on_import_yt_list + + + Import m3u + app.on_import_m3u + + + Export to m3u + app.on_export_to_m3u + +
+ + EPG configuration + app.on_epg_list_configuration + + + List configuration + app.on_iptv_list_configuration + +
+
+ + Remove all unavailable + app.on_remove_all_unavailable + +
+
+ + FTP client + app.show_ftp_menu + action-disabled + + Close + app.on_ftp_client_close + + + + Help +
+ + About + app.on_about_app + +
+
+
diff --git a/app/ui/mac_style.css b/app/ui/mac_style.css index 742951d0..27f2b7c3 100644 --- a/app/ui/mac_style.css +++ b/app/ui/mac_style.css @@ -43,3 +43,11 @@ combobox { min-height: 1em; padding: 0.2em; } + +buttonbox { + padding: 0.2em; +} + +stackswitcher { + padding: 0.2em; +} diff --git a/app/ui/main.glade b/app/ui/main.glade index 8db0dadc..d44c4f51 100644 --- a/app/ui/main.glade +++ b/app/ui/main.glade @@ -73,6 +73,13 @@ Author: Dmitriy Yefremov + + True + False + 5 + document-revert-symbolic + 1 + @@ -313,6 +320,13 @@ Author: Dmitriy Yefremov False gtk-find + + True + False + 5 + network-transmit-receive-symbolic + 1 + True False @@ -341,7 +355,6 @@ Author: Dmitriy Yefremov False import_bouquet_image False - @@ -488,7 +501,7 @@ Author: Dmitriy Yefremov - + True False 10 @@ -502,8 +515,8 @@ Author: Dmitriy Yefremov False True True + app.on_import_bouquet Bouquet - False @@ -516,8 +529,8 @@ Author: Dmitriy Yefremov True True True + app.on_import_bouquets Bouquets and services - False @@ -585,8 +598,8 @@ Author: Dmitriy Yefremov True True True + app.on_new_configuration New empty configuration - False @@ -639,7 +652,6 @@ Author: Dmitriy Yefremov True app.on_data_save Save - False @@ -703,8 +715,8 @@ Author: Dmitriy Yefremov True True 2 + app.on_settings Settings - True @@ -766,8 +778,8 @@ Author: Dmitriy Yefremov True True True + app.on_about_app About - True @@ -803,6 +815,19 @@ Author: Dmitriy Yefremov + + True + False + True + left_header_popover_menu + + + True + False + find-location-symbolic + + + True False @@ -823,11 +848,25 @@ Author: Dmitriy Yefremov False gtk-new + + True + False + 5 + folder-open-symbolic + 1 + 100 1 10 + + True + False + False + 0 + + True False @@ -858,6 +897,13 @@ Author: Dmitriy Yefremov False gtk-save-as + + True + False + 5 + document-save-symbolic + 1 + True False @@ -1173,131 +1219,10 @@ Author: Dmitriy Yefremov center 720 demon-editor - center DemonEditor - False + - - True - False - True - - - True - False - True - left_header_popover_menu - - - True - False - find-location-symbolic - - - - - - - True - False - - - 1 - - - - - True - False - False - 0 - - - - 2 - - - - - True - False - 2 - - - True - False - True - FTP-transfer - app.on_download - - - True - False - network-wired - - - - - False - True - 1 - - - - - False - True - Save - app.on_data_save - - - True - False - gtk-save - - - - - - False - True - 2 - - - - - True - True - True - Backup - - - - True - False - gtk-revert-to-saved - - - - - False - True - 3 - - - - - 3 - - - - - True - False - stack - - - + @@ -1305,6 +1230,182 @@ Author: Dmitriy Yefremov False vertical 5 + + + True + False + 10 + 10 + 5 + 10 + + + False + center + + + Only free + True + True + True + + + + False + False + 0 + + + + + True + True + False + False + + + + False + True + 1 + + + + + 75 + True + True + False + True + filter_type_popover + + + True + False + Type + + + + + False + True + 2 + + + + + 75 + True + True + False + True + filter_satellite_popover + + + True + False + Pos + + + + + False + True + 3 + + + + + + False + False + 0 + + + + + False + center + 10 + 10 + + + True + True + False + False + + + + False + True + 0 + + + + + True + False + True + True + + + + True + False + down + + + + + False + False + 1 + + + + + True + False + True + True + + + + True + False + up + + + + + False + False + 2 + + + + + + False + False + 1 + + + + + + + + False + True + 0 + + True @@ -1379,7 +1480,6 @@ Author: Dmitriy Yefremov True False 5 - 5 5 5 0.49000000953674316 @@ -1409,13 +1509,12 @@ Author: Dmitriy Yefremov False True Filter - center win.filter True False - gtk-spell-check + edit-find-replace-symbolic @@ -1425,92 +1524,6 @@ Author: Dmitriy Yefremov 0 - - - False - - - Only free - True - True - True - - - - False - False - 0 - - - - - 32 - True - True - False - False - - - - False - True - 1 - - - - - 75 - True - True - False - True - filter_type_popover - - - True - False - Type - - - - - False - True - 2 - - - - - 75 - True - True - False - True - filter_satellite_popover - - - True - False - Pos - - - - - False - True - 3 - - - - - - False - True - 1 - - True @@ -1518,13 +1531,12 @@ Author: Dmitriy Yefremov False True Search - center win.search True False - gtk-find + edit-find-symbolic @@ -1534,78 +1546,6 @@ Author: Dmitriy Yefremov 2 - - - False - - - 32 - True - True - False - False - - - - False - True - 0 - - - - - True - False - True - True - - - - True - False - center - down - - - - - False - False - 1 - - - - - True - False - True - True - - - - True - False - center - up - - - - - False - False - 2 - - - - - - False - True - 3 - - True @@ -1613,13 +1553,12 @@ Author: Dmitriy Yefremov True True Hide/Skip On/Off Ctrl + H - center app.on_hide True False - gtk-jump-to + go-jump-symbolic @@ -1637,7 +1576,6 @@ Author: Dmitriy Yefremov False True Parent lock On/Off Ctrl + L - center app.on_locked @@ -1657,7 +1595,7 @@ Author: Dmitriy Yefremov False - True + False 0 @@ -2241,7 +2179,6 @@ Author: Dmitriy Yefremov True False 5 - 5 5 5 vertical @@ -2491,7 +2428,6 @@ Author: Dmitriy Yefremov False - 5 5 5 5 @@ -2532,7 +2468,7 @@ Author: Dmitriy Yefremov True False - insert-link + insert-link-symbolic @@ -2554,7 +2490,7 @@ Author: Dmitriy Yefremov True False - gtk-save-as + document-save-as-symbolic @@ -2576,7 +2512,7 @@ Author: Dmitriy Yefremov True False - gtk-index + insert-text-symbolic @@ -3088,7 +3024,7 @@ Author: Dmitriy Yefremov True False - gtk-new + bookmark-new-symbolic @@ -3265,7 +3201,7 @@ Author: Dmitriy Yefremov True True - 0 + 1 @@ -3313,7 +3249,7 @@ Author: Dmitriy Yefremov False True - 1 + 2 @@ -3515,12 +3451,111 @@ Author: Dmitriy Yefremov False True - 2 + 3 + + True + False + stack + + + True + False + network-workgroup-symbolic + + + True + False + center + expand + + + True + False + True + Open + app.on_data_open + open_image + True + + + True + True + 0 + + + + + + 48 + True + False + True + FTP-transfer + app.on_download + ftp_image + True + + + True + True + 1 + + + + + + True + True + Telnet + app.on_telnet_client_show + telnet_image + True + + + True + True + 2 + + + + + + False + True + Save + app.on_data_save + save_image + True + + + True + True + 3 + + + + + + True + False + True + Backups + app.on_backup_tool_show + backups_image + True + + + True + True + 4 + + + True False diff --git a/app/ui/main.py b/app/ui/main.py index 1d2f241c..120dba84 100644 --- a/app/ui/main.py +++ b/app/ui/main.py @@ -46,7 +46,7 @@ from app.eparser.enigma.bouquets import BqServiceType from app.eparser.iptv import export_to_m3u from app.eparser.neutrino.bouquets import BqType from app.settings import (SettingsType, Settings, SettingsException, PlayStreamsMode, SettingsReadException, - IS_DARWIN, IS_LINUX) + IS_DARWIN) from app.tools.media import Player, Recorder from app.ui.control import ControlBox from app.ui.epg_dialog import EpgDialog @@ -67,7 +67,7 @@ from .search import SearchProvider from .service_details_dialog import ServiceDetailsDialog, Action from .settings_dialog import show_settings_dialog from .uicommons import (Gtk, Gdk, UI_RESOURCES_PATH, LOCKED_ICON, HIDE_ICON, IPTV_ICON, MOVE_KEYS, KeyboardKey, Column, - FavClickMode, MOD_MASK, APP_FONT, Page) + FavClickMode, MOD_MASK, APP_FONT, Page, IS_GNOME_SESSION) class Application(Gtk.Application): @@ -114,11 +114,8 @@ class Application(Gtk.Application): self.add_main_option("debug", ord("d"), GLib.OptionFlags.NONE, GLib.OptionArg.STRING, "", None) handlers = {"on_close_app": self.on_close_app, - "on_about_app": self.on_about_app, "on_info_bar_close": self.on_info_bar_close, - "on_settings": self.on_settings, "on_profile_changed": self.on_profile_changed, - "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, @@ -159,9 +156,6 @@ class Application(Gtk.Application): "on_import_m3u": self.on_import_m3u, "on_bouquet_export": self.on_bouquet_export, "on_export_to_m3u": self.on_export_to_m3u, - "on_import_bouquet": self.on_import_bouquet, - "on_import_bouquets": self.on_import_bouquets, - "on_backup_tool_show": self.on_backup_tool_show, "on_insert_marker": self.on_insert_marker, "on_insert_space": self.on_insert_space, "on_fav_press": self.on_fav_press, @@ -302,7 +296,7 @@ class Application(Gtk.Application): self._radio_count_label = builder.get_object("radio_count_label") self._data_count_label = builder.get_object("data_count_label") self._services_load_spinner = builder.get_object("services_load_spinner") - self._save_header_button = builder.get_object("save_header_button") + self._save_tool_button = builder.get_object("save_tool_button") self._signal_level_bar.bind_property("visible", builder.get_object("play_current_service_button"), "visible") self._signal_level_bar.bind_property("visible", builder.get_object("record_button"), "visible") self._receiver_info_box.bind_property("visible", self._http_status_image, "visible", 4) @@ -358,22 +352,45 @@ class Application(Gtk.Application): d_elements = (self._SERVICE_ELEMENTS, self._BOUQUET_ELEMENTS, self._COMMONS_ELEMENTS, self._FAV_ELEMENTS, self._FAV_ENIGMA_ELEMENTS, self._FAV_IPTV_ELEMENTS, self._LOCK_HIDE_ELEMENTS) self._tool_elements = {k: builder.get_object(k) for k in set(chain.from_iterable(d_elements))} + + # Header bar. + if IS_GNOME_SESSION: + header_bar = Gtk.HeaderBar(visible=True, show_close_button=True) + header_bar.pack_start(builder.get_object("file_header_button")) + header_bar.pack_start(Gtk.Separator(visible=True)) + header_bar.pack_start(builder.get_object("profile_combo_box")) + header_bar.pack_start(builder.get_object("toolbar_main_box")) + header_bar.set_custom_title(builder.get_object("stack_switcher")) + self._main_window.set_titlebar(header_bar) + else: + tool_bar = Gtk.Box(visible=True, spacing=6, margin=6, valign=Gtk.Align.CENTER) + tool_bar.add(builder.get_object("profile_combo_box")) + tool_bar.add(builder.get_object("toolbar_main_box")) + tool_bar.set_center_widget(builder.get_object("stack_switcher")) + + main_header_box = Gtk.Box(visible=True, spacing=6) + main_header_box.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR) + main_header_box.pack_start(tool_bar, True, True, 0) + main_box = builder.get_object("main_window_box") + main_box.add(main_header_box) + main_box.reorder_child(main_header_box, 0) + # Style style_provider = Gtk.CssProvider() style_provider.load_from_path(UI_RESOURCES_PATH + "style.css") self._status_bar_box.get_style_context().add_provider_for_screen(Gdk.Screen.get_default(), style_provider, Gtk.STYLE_PROVIDER_PRIORITY_USER) - # Header bar. - builder.get_object("file_header_button").set_visible(not IS_DARWIN) - builder.get_object("left_header_separator").set_visible(not IS_DARWIN) def do_startup(self): Gtk.Application.do_startup(self) # App menu. - if IS_DARWIN: + if not IS_GNOME_SESSION: builder = get_builder(UI_RESOURCES_PATH + "app_menu.ui") - self.set_app_menu(builder.get_object("mac_app_menu")) - self.set_menubar(builder.get_object("mac_menu_bar")) + if IS_DARWIN: + self.set_app_menu(builder.get_object("mac_app_menu")) + self.set_menubar(builder.get_object("mac_menu_bar")) + else: + self.set_menubar(builder.get_object("menu_bar")) self.init_actions() self.set_accels() @@ -398,6 +415,8 @@ class Application(Gtk.Application): self.set_action("on_new_configuration", self.on_new_configuration) self.set_action("on_import_from_web", self.on_import_from_web) self.set_action("on_settings", self.on_settings) + self.set_action("on_backup_tool_show", self.on_backup_tool_show) + self.set_action("on_about_app", self.on_about_app) self.set_action("on_close_app", self.on_close_app) # Search, Filter. search_action = Gio.SimpleAction.new_stateful("search", None, GLib.Variant.new_boolean(False)) @@ -422,7 +441,7 @@ class Application(Gtk.Application): # Edit. self.set_action("on_edit", self.on_edit) # Menu bar. - if not IS_LINUX: + if not IS_GNOME_SESSION: # We are working with the "hidden-when" submenu attribute. See 'app_menu_.ui' file. hide_bar_action = Gio.SimpleAction.new("hide_menu_bar", None) self.add_action(hide_bar_action) @@ -666,7 +685,7 @@ class Application(Gtk.Application): def on_visible_page(self, stack, param): page = Page(stack.get_visible_child_name()) self._fav_paned.set_visible(page in (Page.SERVICES, Page.PICONS, Page.PLAYBACK)) - self._save_header_button.set_visible(page in (Page.SERVICES, Page.SATELLITE)) + self._save_tool_button.set_visible(page in (Page.SERVICES, Page.SATELLITE)) # ***************** Copy - Cut - Paste ********************* # @@ -1762,7 +1781,7 @@ class Application(Gtk.Application): GLib.idle_add(lambda: next(gen, False), priority=GLib.PRIORITY_LOW) def save_data(self, callback=None, ext_path=None): - self._save_header_button.set_sensitive(False) + self._save_tool_button.set_sensitive(False) profile = self._s_type path = ext_path or self._settings.data_local_path backup_path = self._settings.backup_local_path @@ -1796,7 +1815,7 @@ class Application(Gtk.Application): # blacklist write_blacklist(path, self._blacklist) - self._save_header_button.set_sensitive(True) + self._save_tool_button.set_sensitive(True) yield True self._data_hash = self.get_data_hash() yield True @@ -3449,9 +3468,10 @@ class Application(Gtk.Application): msg = get_message("Profile:") if self._s_type is SettingsType.ENIGMA_2: - self._header_bar.set_subtitle("{} {} [Enigma2 v.{}]".format(msg, profile_name, self.get_format_version())) + title = "DemonEditor [{} {} - Enigma2 v.{}]".format(msg, profile_name, self.get_format_version()) + self._main_window.set_title(title) elif self._s_type is SettingsType.NEUTRINO_MP: - self._header_bar.set_subtitle("{} {} [Neutrino-MP]".format(msg, profile_name)) + self._main_window.set_title("DemonEditor [{} {} - Neutrino-MP]".format(msg, profile_name)) def get_format_version(self): return 5 if self._settings.v5_support else 4