mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2026-01-28 10:20:05 +01:00
base implementation of "hide"
This commit is contained in:
@@ -4,7 +4,7 @@ Focused on the convenience of working in lists from the keyboard.
|
||||
The mouse is also fully supported (Drag and Drop etc)
|
||||
|
||||
Keyboard shortcuts:
|
||||
Ctrl + X, C, V, Up, Down, PageUp, PageDown, S, T, E, Space; Insert, Delete, F2.
|
||||
Ctrl + X, C, V, Up, Down, PageUp, PageDown, S, T, E, L, H, Space; Insert, Delete, F2.
|
||||
Insert - copies the selected channels from the main list to the bouquet or inserts (creates) a new bouquet.
|
||||
Ctrl + X - only in bouquet list.
|
||||
Ctrl + C - only in services list. Clipboard is "rubber". There is an accumulation before the insertion!
|
||||
|
||||
@@ -6,7 +6,7 @@ from app.eparser import get_blacklist, write_blacklist, to_bouquet_id
|
||||
from app.eparser import get_channels, get_bouquets, write_bouquets, write_channels, Bouquets, Bouquet, Channel
|
||||
from app.eparser.__constants import CAS, FLAG
|
||||
from app.properties import get_config, write_config
|
||||
from . import Gtk, Gdk, LOCKED_ICON
|
||||
from . import Gtk, Gdk, LOCKED_ICON, HIDE_ICON
|
||||
from .dialogs import show_dialog
|
||||
from .download_dialog import show_download_dialog
|
||||
from .satellites_dialog import show_satellites_dialog
|
||||
@@ -495,13 +495,6 @@ class MainAppWindow:
|
||||
def_val = "Unknown"
|
||||
values = model.get_value(model.get_iter(path), 0).split(",")
|
||||
cas_values = list(filter(lambda val: val.startswith("C:"), values))
|
||||
flags_values = list(filter(lambda val: val.startswith("f:"), values))
|
||||
|
||||
if FLAG.HIDE in flags_values:
|
||||
self.__hide_check_button.set_active(True)
|
||||
if FLAG.LOCK in flags_values:
|
||||
self.__lock_check_button.set_active(True)
|
||||
|
||||
self.__cas_label.set_text(",".join(map(str, [CAS.get(val, def_val) for val in cas_values])))
|
||||
|
||||
def on_fav_selection(self, model, path, column):
|
||||
@@ -588,6 +581,10 @@ class MainAppWindow:
|
||||
self.on_paste(view)
|
||||
elif ctrl and key == Gdk.KEY_s or key == Gdk.KEY_S:
|
||||
self.on_data_save()
|
||||
elif ctrl and key == Gdk.KEY_l or key == Gdk.KEY_L:
|
||||
self.on_locked(None)
|
||||
elif ctrl and key == Gdk.KEY_h or key == Gdk.KEY_H:
|
||||
self.on_hide(None)
|
||||
elif key == Gdk.KEY_space and model_name == self._FAV_LIST_NAME:
|
||||
pass
|
||||
|
||||
@@ -634,20 +631,28 @@ class MainAppWindow:
|
||||
return
|
||||
|
||||
if flag is FLAG.HIDE:
|
||||
pass
|
||||
col_num = 5
|
||||
hide = self.has_locked_hide(model, paths, col_num)
|
||||
for path in paths:
|
||||
itr = model.get_iter(path)
|
||||
model.set_value(itr, col_num, None) if hide else model.set_value(itr, col_num, HIDE_ICON)
|
||||
flags = {*model.get_value(itr, 0).split(",")}
|
||||
flags.discard(FLAG.HIDE.value) if hide else flags.add(FLAG.HIDE.value)
|
||||
model.set_value(itr, 0, (",".join(reversed(sorted(flags)))))
|
||||
elif flag is FLAG.LOCK:
|
||||
locked = self.has_locked(model, paths)
|
||||
col_num = 4
|
||||
locked = self.has_locked_hide(model, paths, col_num)
|
||||
for path in paths:
|
||||
itr = model.get_iter(path)
|
||||
channel = self.__channels.get(model.get_value(itr, 16), None)
|
||||
if channel:
|
||||
bq_id = to_bouquet_id(channel)
|
||||
self.__blacklist.discard(bq_id) if locked else self.__blacklist.add(bq_id)
|
||||
model.set_value(itr, 4, None) if locked else model.set_value(itr, 4, LOCKED_ICON)
|
||||
model.set_value(itr, col_num, None) if locked else model.set_value(itr, col_num, LOCKED_ICON)
|
||||
|
||||
def has_locked(self, model, paths):
|
||||
def has_locked_hide(self, model, paths, col_num):
|
||||
for path in paths:
|
||||
if model.get_value(model.get_iter(path), 4):
|
||||
if model.get_value(model.get_iter(path), col_num):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -377,7 +377,7 @@
|
||||
<object class="GtkToolButton" id="download_tool_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Download data from receiver</property>
|
||||
<property name="tooltip_text" translatable="yes">FTP-transfer</property>
|
||||
<property name="label" translatable="yes">Download</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="icon_name">mail-send-receive</property>
|
||||
@@ -547,6 +547,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Parent lock On/Off Ctrl + L</property>
|
||||
<property name="label" translatable="yes">Locked</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="icon_name">system-lock-screen</property>
|
||||
@@ -562,6 +563,7 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="tooltip_text" translatable="yes">Hide/Skip On/Off Ctrl + H</property>
|
||||
<property name="label" translatable="yes">Hide</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="icon_name">go-jump</property>
|
||||
|
||||
Reference in New Issue
Block a user