mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2026-01-15 12:03:15 +01:00
hiding some items for neutrino mode
This commit is contained in:
@@ -100,14 +100,17 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">EPG</attribute>
|
||||
<attribute name="action">app.show_epg</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Timers</attribute>
|
||||
<attribute name="action">app.show_timers</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Recordings</attribute>
|
||||
<attribute name="action">app.show_recordings</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">FTP</attribute>
|
||||
@@ -116,6 +119,7 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Control</attribute>
|
||||
<attribute name="action">app.show_control</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
@@ -259,14 +263,17 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">EPG</attribute>
|
||||
<attribute name="action">app.show_epg</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Timers</attribute>
|
||||
<attribute name="action">app.show_timers</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Recordings</attribute>
|
||||
<attribute name="action">app.show_recordings</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">FTP</attribute>
|
||||
@@ -275,6 +282,7 @@
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Control</attribute>
|
||||
<attribute name="action">app.show_control</attribute>
|
||||
<attribute name="hidden-when">action-disabled</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</submenu>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.2
|
||||
<!-- Generated with glade 3.22.2
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -1546,42 +1546,54 @@ Author: Dmitriy Yefremov
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="hide_tool_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Hide/Skip On/Off Ctrl + H</property>
|
||||
<property name="action_name">app.on_hide</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">go-jump-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="locked_tool_button">
|
||||
<property name="visible">True</property>
|
||||
<object class="GtkBox" id="enigma_lock_hide_box">
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Parent lock On/Off Ctrl + L</property>
|
||||
<property name="action_name">app.on_locked</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="locked_tool_button_image">
|
||||
<object class="GtkButton" id="enigma_locked_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">changes-prevent-symbolic</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Parent lock On/Off Ctrl + L</property>
|
||||
<property name="action_name">app.on_locked</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="enigma_locked_button_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">changes-prevent-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="enigma_hide_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Hide/Skip On/Off Ctrl + H</property>
|
||||
<property name="action_name">app.on_hide</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="enigma_hide_button_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">go-jump-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
@@ -2510,6 +2522,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Import m3u file</property>
|
||||
<signal name="clicked" handler="on_import_m3u" swapped="no"/>
|
||||
@@ -2532,6 +2545,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Export to m3u</property>
|
||||
<signal name="clicked" handler="on_export_to_m3u" swapped="no"/>
|
||||
@@ -3066,6 +3080,7 @@ Author: Dmitriy Yefremov
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">New bouquet</property>
|
||||
<signal name="clicked" handler="on_new_bouquet" object="bouquets_tree_view" swapped="no"/>
|
||||
@@ -3084,7 +3099,62 @@ Author: Dmitriy Yefremov
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkBox" id="bouquet_lock_hide_box">
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">5</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="bouquet_locked_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Parent lock On/Off Ctrl + L</property>
|
||||
<property name="action_name">app.on_locked</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="bouquet_locked_button_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">changes-prevent-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="bouquet_hide_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="focus_on_click">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="tooltip_text" translatable="yes">Hide/Skip On/Off Ctrl + H</property>
|
||||
<property name="action_name">app.on_hide</property>
|
||||
<child>
|
||||
<object class="GtkImage" id="bouquet_hide_button_image">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="icon_name">go-jump-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
|
||||
@@ -103,7 +103,7 @@ class Application(Gtk.Application):
|
||||
_FAV_IPTV_ELEMENTS = ("fav_iptv_popup_item", "import_m3u_header_button", "export_to_m3u_header_button",
|
||||
"iptv_menu_button")
|
||||
|
||||
_LOCK_HIDE_ELEMENTS = ("locked_tool_button", "hide_tool_button")
|
||||
_LOCK_HIDE_ELEMENTS = ("enigma_lock_hide_box", "bouquet_lock_hide_box")
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE, **kwargs)
|
||||
@@ -207,6 +207,7 @@ class Application(Gtk.Application):
|
||||
|
||||
self._settings = Settings.get_instance()
|
||||
self._s_type = self._settings.setting_type
|
||||
self._is_enigma = self._s_type is SettingsType.ENIGMA_2
|
||||
# Used for copy/paste. When adding the previous data will not be deleted.
|
||||
# Clearing only after the insertion!
|
||||
self._rows_buffer = []
|
||||
@@ -366,23 +367,18 @@ 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))}
|
||||
# Lock, Hide.
|
||||
self.bind_property("is-enigma", self._tool_elements.get(self._LOCK_HIDE_ELEMENTS[0]), "visible")
|
||||
self.bind_property("is-enigma", self._tool_elements.get(self._LOCK_HIDE_ELEMENTS[1]), "visible", 4)
|
||||
# Stack page widgets.
|
||||
self._stack_services_frame = builder.get_object("services_frame")
|
||||
self._stack_services_frame.set_visible(self._settings.get("show_bouquets", True))
|
||||
self._stack_satellite_box = builder.get_object("satellite_box")
|
||||
self._stack_satellite_box.set_visible(self._settings.get("show_satellites", True))
|
||||
self._stack_picon_box = builder.get_object("picon_box")
|
||||
self._stack_picon_box.set_visible(self._settings.get("show_picons", True))
|
||||
self._stack_epg_box = builder.get_object("epg_box")
|
||||
self._stack_epg_box.set_visible(self._settings.get("show_epg", True))
|
||||
self._stack_timers_box = builder.get_object("timers_box")
|
||||
self._stack_timers_box.set_visible(self._settings.get("show_timers", True))
|
||||
self._stack_recordings_box = builder.get_object("recordings_box")
|
||||
self._stack_timers_box.set_visible(self._settings.get("show_recordings", True))
|
||||
self._stack_ftp_box = builder.get_object("ftp_box")
|
||||
self._stack_ftp_box.set_visible(self._settings.get("show_ftp", True))
|
||||
self._stack_control_box = builder.get_object("control_box")
|
||||
self._stack_control_box.set_visible(self._settings.get("show_control", True))
|
||||
# Header bar.
|
||||
if IS_GNOME_SESSION:
|
||||
header_bar = Gtk.HeaderBar(visible=True, show_close_button=True)
|
||||
@@ -491,14 +487,18 @@ class Application(Gtk.Application):
|
||||
sa.connect("change-state", lambda a, v: self._stack_picon_box.set_visible(v))
|
||||
sa = self.set_state_action("show_epg", self.on_page_show, self._settings.get("show_epg", True))
|
||||
sa.connect("change-state", lambda a, v: self._stack_epg_box.set_visible(v))
|
||||
self.bind_property("is-enigma", sa, "enabled")
|
||||
sa = self.set_state_action("show_timers", self.on_page_show, self._settings.get("show_timers", True))
|
||||
sa.connect("change-state", lambda a, v: self._stack_timers_box.set_visible(v))
|
||||
self.bind_property("is-enigma", sa, "enabled")
|
||||
sa = self.set_state_action("show_recordings", self.on_page_show, self._settings.get("show_recordings", True))
|
||||
sa.connect("change-state", lambda a, v: self._stack_recordings_box.set_visible(v))
|
||||
self.bind_property("is-enigma", sa, "enabled")
|
||||
sa = self.set_state_action("show_ftp", self.on_page_show, self._settings.get("show_ftp", True))
|
||||
sa.connect("change-state", lambda a, v: self._stack_ftp_box.set_visible(v))
|
||||
sa = self.set_state_action("show_control", self.on_page_show, self._settings.get("show_control", True))
|
||||
sa.connect("change-state", lambda a, v: self._stack_control_box.set_visible(v))
|
||||
self.bind_property("is-enigma", sa, "enabled")
|
||||
# Menu bar.
|
||||
if not IS_GNOME_SESSION:
|
||||
# We are working with the "hidden-when" submenu attribute. See 'app_menu_.ui' file.
|
||||
@@ -2156,12 +2156,26 @@ class Application(Gtk.Application):
|
||||
self._settings.current_profile = active
|
||||
self._s_type = self._settings.setting_type
|
||||
self.update_profile_label()
|
||||
is_enigma = self._s_type is SettingsType.ENIGMA_2
|
||||
self.set_property("is-enigma", is_enigma)
|
||||
self.update_stack_elements_visibility(is_enigma)
|
||||
|
||||
def update_profiles(self):
|
||||
self._profile_combo_box.remove_all()
|
||||
for p in self._settings.profiles:
|
||||
self._profile_combo_box.append(p, p)
|
||||
|
||||
@run_idle
|
||||
def update_stack_elements_visibility(self, is_enigma=False):
|
||||
self._stack_services_frame.set_visible(self._settings.get("show_bouquets", True))
|
||||
self._stack_satellite_box.set_visible(self._settings.get("show_satellites", True))
|
||||
self._stack_picon_box.set_visible(self._settings.get("show_picons", True))
|
||||
self._stack_ftp_box.set_visible(self._settings.get("show_ftp", True))
|
||||
self._stack_epg_box.set_visible(is_enigma and self._settings.get("show_epg", True))
|
||||
self._stack_timers_box.set_visible(is_enigma and self._settings.get("show_timers", True))
|
||||
self._stack_recordings_box.set_visible(is_enigma and self._settings.get("show_recordings", True))
|
||||
self._stack_control_box.set_visible(is_enigma and self._settings.get("show_control", True))
|
||||
|
||||
def on_tree_view_key_press(self, view, event):
|
||||
""" Handling keystrokes on press """
|
||||
key_code = event.hardware_keycode
|
||||
@@ -3646,6 +3660,18 @@ class Application(Gtk.Application):
|
||||
def app_window(self):
|
||||
return self._main_window
|
||||
|
||||
@property
|
||||
def app_settings(self):
|
||||
return self._settings
|
||||
|
||||
@GObject.Property(type=bool, default=True)
|
||||
def is_enigma(self):
|
||||
return self._is_enigma
|
||||
|
||||
@is_enigma.setter
|
||||
def is_enigma(self, value):
|
||||
self._is_enigma = value
|
||||
|
||||
|
||||
def start_app():
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user