mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2025-12-24 01:19:40 +01:00
added editing of alternatives
This commit is contained in:
@@ -43,6 +43,7 @@ class Application(Gtk.Application):
|
|||||||
SERVICE_MODEL_NAME = "services_list_store"
|
SERVICE_MODEL_NAME = "services_list_store"
|
||||||
FAV_MODEL_NAME = "fav_list_store"
|
FAV_MODEL_NAME = "fav_list_store"
|
||||||
BQ_MODEL_NAME = "bouquets_tree_store"
|
BQ_MODEL_NAME = "bouquets_tree_store"
|
||||||
|
ALT_MODEL_NAME = "alt_list_store"
|
||||||
DRAG_SEP = "::::"
|
DRAG_SEP = "::::"
|
||||||
|
|
||||||
DEL_FACTOR = 50 # Batch size to delete in one pass.
|
DEL_FACTOR = 50 # Batch size to delete in one pass.
|
||||||
@@ -58,7 +59,7 @@ class Application(Gtk.Application):
|
|||||||
_FAV_ELEMENTS = ("fav_cut_popup_item", "fav_paste_popup_item", "fav_locate_popup_item", "fav_iptv_popup_item",
|
_FAV_ELEMENTS = ("fav_cut_popup_item", "fav_paste_popup_item", "fav_locate_popup_item", "fav_iptv_popup_item",
|
||||||
"fav_insert_marker_popup_item", "fav_insert_space_popup_item", "fav_edit_sub_menu_popup_item",
|
"fav_insert_marker_popup_item", "fav_insert_space_popup_item", "fav_edit_sub_menu_popup_item",
|
||||||
"fav_edit_popup_item", "fav_picon_popup_item", "fav_copy_popup_item",
|
"fav_edit_popup_item", "fav_picon_popup_item", "fav_copy_popup_item",
|
||||||
"fav_epg_configuration_popup_item")
|
"fav_epg_configuration_popup_item", "fav_add_alt_popup_item")
|
||||||
|
|
||||||
_BOUQUET_ELEMENTS = ("bouquets_new_popup_item", "bouquets_edit_popup_item", "bouquets_cut_popup_item",
|
_BOUQUET_ELEMENTS = ("bouquets_new_popup_item", "bouquets_edit_popup_item", "bouquets_cut_popup_item",
|
||||||
"bouquets_copy_popup_item", "bouquets_paste_popup_item", "new_header_button",
|
"bouquets_copy_popup_item", "bouquets_paste_popup_item", "new_header_button",
|
||||||
@@ -116,6 +117,7 @@ class Application(Gtk.Application):
|
|||||||
"on_services_view_drag_data_received": self.on_services_view_drag_data_received,
|
"on_services_view_drag_data_received": self.on_services_view_drag_data_received,
|
||||||
"on_view_drag_data_received": self.on_view_drag_data_received,
|
"on_view_drag_data_received": self.on_view_drag_data_received,
|
||||||
"on_bq_view_drag_data_received": self.on_bq_view_drag_data_received,
|
"on_bq_view_drag_data_received": self.on_bq_view_drag_data_received,
|
||||||
|
"on_alt_view_drag_data_received": self.on_alt_view_drag_data_received,
|
||||||
"on_view_press": self.on_view_press,
|
"on_view_press": self.on_view_press,
|
||||||
"on_view_release": self.on_view_release,
|
"on_view_release": self.on_view_release,
|
||||||
"on_view_popup_menu": self.on_view_popup_menu,
|
"on_view_popup_menu": self.on_view_popup_menu,
|
||||||
@@ -166,7 +168,8 @@ class Application(Gtk.Application):
|
|||||||
"on_create_bouquet_for_current_package": self.on_create_bouquet_for_current_package,
|
"on_create_bouquet_for_current_package": self.on_create_bouquet_for_current_package,
|
||||||
"on_create_bouquet_for_each_package": self.on_create_bouquet_for_each_package,
|
"on_create_bouquet_for_each_package": self.on_create_bouquet_for_each_package,
|
||||||
"on_create_bouquet_for_current_type": self.on_create_bouquet_for_current_type,
|
"on_create_bouquet_for_current_type": self.on_create_bouquet_for_current_type,
|
||||||
"on_create_bouquet_for_each_type": self.on_create_bouquet_for_each_type}
|
"on_create_bouquet_for_each_type": self.on_create_bouquet_for_each_type,
|
||||||
|
"on_add_alternatives": self.on_add_alternatives}
|
||||||
|
|
||||||
self._settings = Settings.get_instance()
|
self._settings = Settings.get_instance()
|
||||||
self._s_type = self._settings.setting_type
|
self._s_type = self._settings.setting_type
|
||||||
@@ -254,6 +257,7 @@ class Application(Gtk.Application):
|
|||||||
self._receiver_info_box.bind_property("visible", self._http_status_image, "visible", 4)
|
self._receiver_info_box.bind_property("visible", self._http_status_image, "visible", 4)
|
||||||
self._receiver_info_box.bind_property("visible", self._signal_box, "visible")
|
self._receiver_info_box.bind_property("visible", self._signal_box, "visible")
|
||||||
# Alternatives
|
# Alternatives
|
||||||
|
self._alt_view = builder.get_object("alt_tree_view")
|
||||||
self._alt_model = builder.get_object("alt_list_store")
|
self._alt_model = builder.get_object("alt_list_store")
|
||||||
self._alt_revealer = builder.get_object("alt_revealer")
|
self._alt_revealer = builder.get_object("alt_revealer")
|
||||||
self._alt_revealer.bind_property("visible", self._alt_revealer, "reveal-child")
|
self._alt_revealer.bind_property("visible", self._alt_revealer, "reveal-child")
|
||||||
@@ -461,6 +465,7 @@ class Application(Gtk.Application):
|
|||||||
self._bouquets_view.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, bq_target,
|
self._bouquets_view.enable_model_drag_source(Gdk.ModifierType.BUTTON1_MASK, bq_target,
|
||||||
Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
|
Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
|
||||||
self._bouquets_view.enable_model_drag_dest(bq_target, Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
|
self._bouquets_view.enable_model_drag_dest(bq_target, Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE)
|
||||||
|
self._alt_view.enable_model_drag_dest(bq_target, Gdk.DragAction.DEFAULT | Gdk.DragAction.COPY)
|
||||||
|
|
||||||
self._fav_view.drag_source_set_target_list(None)
|
self._fav_view.drag_source_set_target_list(None)
|
||||||
self._fav_view.drag_dest_add_text_targets()
|
self._fav_view.drag_dest_add_text_targets()
|
||||||
@@ -477,6 +482,7 @@ class Application(Gtk.Application):
|
|||||||
self._bouquets_view.drag_dest_add_text_targets()
|
self._bouquets_view.drag_dest_add_text_targets()
|
||||||
self._bouquets_view.drag_source_add_text_targets()
|
self._bouquets_view.drag_source_add_text_targets()
|
||||||
|
|
||||||
|
self._alt_view.drag_dest_add_text_targets()
|
||||||
self._app_info_box.drag_dest_set(Gtk.DestDefaults.ALL, [], Gdk.DragAction.COPY)
|
self._app_info_box.drag_dest_set(Gtk.DestDefaults.ALL, [], Gdk.DragAction.COPY)
|
||||||
self._app_info_box.drag_dest_add_text_targets()
|
self._app_info_box.drag_dest_add_text_targets()
|
||||||
# For multiple selection.
|
# For multiple selection.
|
||||||
@@ -679,6 +685,8 @@ class Application(Gtk.Application):
|
|||||||
priority = GLib.PRIORITY_DEFAULT
|
priority = GLib.PRIORITY_DEFAULT
|
||||||
elif model_name == self.SERVICE_MODEL_NAME:
|
elif model_name == self.SERVICE_MODEL_NAME:
|
||||||
gen = self.delete_services(itrs, model, rows)
|
gen = self.delete_services(itrs, model, rows)
|
||||||
|
elif model_name == self.ALT_MODEL_NAME:
|
||||||
|
gen = self.delete_alts(itrs, model, rows)
|
||||||
|
|
||||||
GLib.idle_add(lambda: next(gen, False), priority=priority)
|
GLib.idle_add(lambda: next(gen, False), priority=priority)
|
||||||
self.on_view_focus(view)
|
self.on_view_focus(view)
|
||||||
@@ -1682,13 +1690,15 @@ class Application(Gtk.Application):
|
|||||||
row = model[path][:]
|
row = model[path][:]
|
||||||
if row[Column.FAV_TYPE] == BqServiceType.ALT.name:
|
if row[Column.FAV_TYPE] == BqServiceType.ALT.name:
|
||||||
self._alt_model.clear()
|
self._alt_model.clear()
|
||||||
srv = self._services.get(row[Column.FAV_ID], None)
|
a_id = row[Column.FAV_ID]
|
||||||
|
srv = self._services.get(a_id, None)
|
||||||
if srv:
|
if srv:
|
||||||
for index, s in enumerate(srv[-1] or [], start=1):
|
for i, s in enumerate(srv[-1] or [], start=1):
|
||||||
srv = self._services.get(s.data, None)
|
srv = self._services.get(s.data, None)
|
||||||
if srv:
|
if srv:
|
||||||
picon = self._picons.get(srv.picon_id, None)
|
pic = self._picons.get(srv.picon_id, None)
|
||||||
self._alt_model.append((index, picon, srv.service, srv.service_type, srv.pos))
|
itr = model.get_string_from_iter(model.get_iter(path))
|
||||||
|
self._alt_model.append((i, pic, srv.service, srv.service_type, srv.pos, srv.fav_id, a_id, itr))
|
||||||
self._alt_revealer.set_visible(True)
|
self._alt_revealer.set_visible(True)
|
||||||
else:
|
else:
|
||||||
self._alt_revealer.set_visible(False)
|
self._alt_revealer.set_visible(False)
|
||||||
@@ -2998,7 +3008,7 @@ class Application(Gtk.Application):
|
|||||||
def get_target_view(self, view):
|
def get_target_view(self, view):
|
||||||
return ViewTarget.SERVICES if Gtk.Buildable.get_name(view) == "services_tree_view" else ViewTarget.FAV
|
return ViewTarget.SERVICES if Gtk.Buildable.get_name(view) == "services_tree_view" else ViewTarget.FAV
|
||||||
|
|
||||||
# ***************** Bouquets *********************#
|
# ***************** Bouquets ********************* #
|
||||||
|
|
||||||
def on_create_bouquet_for_current_satellite(self, item):
|
def on_create_bouquet_for_current_satellite(self, item):
|
||||||
self.create_bouquets(BqGenType.SAT)
|
self.create_bouquets(BqGenType.SAT)
|
||||||
@@ -3022,7 +3032,114 @@ class Application(Gtk.Application):
|
|||||||
gen_bouquets(self._services_view, self._bouquets_view, self._main_window, g_type, self._TV_TYPES,
|
gen_bouquets(self._services_view, self._bouquets_view, self._main_window, g_type, self._TV_TYPES,
|
||||||
self._s_type, self.append_bouquet)
|
self._s_type, self.append_bouquet)
|
||||||
|
|
||||||
# ***************** Profile label *********************#
|
# ***************** Alternatives ********************* #
|
||||||
|
|
||||||
|
def on_add_alternatives(self, item):
|
||||||
|
model, paths = self._fav_view.get_selection().get_selected_rows()
|
||||||
|
if not paths:
|
||||||
|
return
|
||||||
|
|
||||||
|
if len(paths) > 1:
|
||||||
|
self.show_error_dialog("Please, select only one item!")
|
||||||
|
return
|
||||||
|
|
||||||
|
row = model[paths][:]
|
||||||
|
if row[Column.FAV_TYPE] in {BqServiceType.MARKER.name, BqServiceType.SPACE.name, BqServiceType.ALT.name}:
|
||||||
|
self.show_error_dialog("Operation not allowed in this context!")
|
||||||
|
return
|
||||||
|
|
||||||
|
srv = self._services.get(row[Column.FAV_ID], None)
|
||||||
|
bq = self._bouquets.get(self._bq_selected, None)
|
||||||
|
if not srv or not bq:
|
||||||
|
return
|
||||||
|
|
||||||
|
fav_id = srv.fav_id
|
||||||
|
alt_id = "alternatives_{}_{}".format(self._bq_selected, fav_id)
|
||||||
|
if alt_id in bq:
|
||||||
|
self.show_error_dialog("A similar service is already in this list!")
|
||||||
|
return
|
||||||
|
|
||||||
|
dt, it = BqServiceType.DEFAULT, BqServiceType.IPTV
|
||||||
|
bq_srv = BouquetService(None, dt if srv.service_type != it.name else it, fav_id, 0)
|
||||||
|
s_type = BqServiceType.ALT.name
|
||||||
|
a_srv = srv._replace(service_type=s_type, pos=None, fav_id=alt_id, data_id=alt_id, transponder=(bq_srv,))
|
||||||
|
try:
|
||||||
|
index = bq.index(fav_id)
|
||||||
|
except ValueError as e:
|
||||||
|
log("[on_add_alternatives] error: {}".format(e))
|
||||||
|
else:
|
||||||
|
bq[index] = alt_id
|
||||||
|
self._services[alt_id] = a_srv
|
||||||
|
data = {Column.FAV_CODED: srv.coded, Column.FAV_SERVICE: srv.service, Column.FAV_LOCKED: srv.locked,
|
||||||
|
Column.FAV_HIDE: srv.hide, Column.FAV_TYPE: s_type, Column.FAV_POS: None,
|
||||||
|
Column.FAV_ID: alt_id, Column.FAV_PICON: self._picons.get(srv.picon_id, None)}
|
||||||
|
model.set(model.get_iter(paths), data)
|
||||||
|
self._fav_view.row_activated(paths[0], self._fav_view.get_column(Column.FAV_NUM))
|
||||||
|
|
||||||
|
def delete_alts(self, itrs, model, rows):
|
||||||
|
list(map(model.remove, itrs))
|
||||||
|
row = rows[0]
|
||||||
|
alt_id = row[Column.ALT_ID]
|
||||||
|
|
||||||
|
if not len(model):
|
||||||
|
bq = self._bouquets.get(self._bq_selected, None)
|
||||||
|
if not bq:
|
||||||
|
return
|
||||||
|
|
||||||
|
fav_id, itr = row[Column.ALT_FAV_ID], row[Column.ALT_ITER]
|
||||||
|
bq[bq.index(alt_id)] = fav_id
|
||||||
|
self._services.pop(alt_id, None)
|
||||||
|
srv = self._services.get(fav_id, None)
|
||||||
|
if srv:
|
||||||
|
itr = self._fav_model.get_iter_from_string(itr)
|
||||||
|
data = {Column.FAV_CODED: srv.coded, Column.FAV_SERVICE: srv.service, Column.FAV_LOCKED: srv.locked,
|
||||||
|
Column.FAV_HIDE: srv.hide, Column.FAV_TYPE: srv.service_type, Column.FAV_POS: srv.pos,
|
||||||
|
Column.FAV_ID: srv.fav_id, Column.FAV_PICON: self._picons.get(srv.picon_id, None)}
|
||||||
|
self._fav_model.set(itr, data)
|
||||||
|
self._alt_revealer.set_visible(False)
|
||||||
|
else:
|
||||||
|
srv = self._services.get(alt_id, None)
|
||||||
|
if srv:
|
||||||
|
alt_services = srv.transponder or ()
|
||||||
|
alt_services = tuple(s for s in alt_services if s.data not in {row[Column.ALT_FAV_ID] for row in rows})
|
||||||
|
self._services[alt_id] = srv._replace(transponder=alt_services)
|
||||||
|
|
||||||
|
yield True
|
||||||
|
|
||||||
|
def on_alt_view_drag_data_received(self, view, drag_context, x, y, data, info, time):
|
||||||
|
txt = data.get_text()
|
||||||
|
if txt:
|
||||||
|
itr_str, sep, source = txt.partition(self.DRAG_SEP)
|
||||||
|
if source == self.SERVICE_MODEL_NAME:
|
||||||
|
model, id_col, t_col = self._services_view.get_model(), Column.SRV_FAV_ID, Column.SRV_TYPE
|
||||||
|
elif source == self.FAV_MODEL_NAME:
|
||||||
|
model, id_col, t_col = self._fav_view.get_model(), Column.FAV_ID, Column.FAV_TYPE
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
||||||
|
srv = self._services.get(self._alt_model.get_value(self._alt_model.get_iter_first(), Column.ALT_ID), None)
|
||||||
|
if not srv:
|
||||||
|
return True
|
||||||
|
|
||||||
|
itrs = tuple(model.get_iter_from_string(itr) for itr in itr_str.split(","))
|
||||||
|
types = {BqServiceType.MARKER.name, BqServiceType.SPACE.name, BqServiceType.ALT.name}
|
||||||
|
ids = tuple(model.get_value(itr, id_col) for itr in itrs if model.get_value(itr, t_col) not in types)
|
||||||
|
srvs = tuple(self._services.get(f_id, None) for f_id in ids)
|
||||||
|
dt, it = BqServiceType.DEFAULT, BqServiceType.IPTV
|
||||||
|
a_srvs = tuple(BouquetService(None, dt if s.service_type != it.name else it, s.fav_id, 0) for s in srvs)
|
||||||
|
alt_services = srv.transponder + a_srvs
|
||||||
|
self._services[srv.fav_id] = srv._replace(transponder=alt_services)
|
||||||
|
|
||||||
|
a_row = self._alt_model[self._alt_model.get_iter_first()][:]
|
||||||
|
alt_id, a_itr = a_row[Column.ALT_ID], a_row[Column.ALT_ITER]
|
||||||
|
|
||||||
|
for i, srv in enumerate(srvs, start=len(self._alt_model) + 1):
|
||||||
|
pic = self._picons.get(srv.picon_id, None)
|
||||||
|
self._alt_model.append((i, pic, srv.service, srv.service_type, srv.pos, srv.fav_id, alt_id, a_itr))
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
# ***************** Profile label ********************* #
|
||||||
|
|
||||||
@run_idle
|
@run_idle
|
||||||
def update_profile_label(self):
|
def update_profile_label(self):
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!-- Generated with glade 3.22.2
|
<!-- Generated with glade 3.22.1
|
||||||
|
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
@@ -34,6 +34,11 @@ Author: Dmitriy Yefremov
|
|||||||
<!-- interface-description Enigma2 channel and satellites list editor for GNU/Linux. -->
|
<!-- interface-description Enigma2 channel and satellites list editor for GNU/Linux. -->
|
||||||
<!-- interface-copyright 2018-2021 Dmitriy Yefremov -->
|
<!-- interface-copyright 2018-2021 Dmitriy Yefremov -->
|
||||||
<!-- interface-authors Dmitriy Yefremov -->
|
<!-- interface-authors Dmitriy Yefremov -->
|
||||||
|
<object class="GtkImage" id="alt_image">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="icon_name">list-add</property>
|
||||||
|
</object>
|
||||||
<object class="GtkListStore" id="alt_list_store">
|
<object class="GtkListStore" id="alt_list_store">
|
||||||
<columns>
|
<columns>
|
||||||
<!-- column-name num -->
|
<!-- column-name num -->
|
||||||
@@ -46,8 +51,28 @@ Author: Dmitriy Yefremov
|
|||||||
<column type="gchararray"/>
|
<column type="gchararray"/>
|
||||||
<!-- column-name pos -->
|
<!-- column-name pos -->
|
||||||
<column type="gchararray"/>
|
<column type="gchararray"/>
|
||||||
|
<!-- column-name fav_id -->
|
||||||
|
<column type="gchararray"/>
|
||||||
|
<!-- column-name alt_id -->
|
||||||
|
<column type="gchararray"/>
|
||||||
|
<!-- column-name fav_iter -->
|
||||||
|
<column type="gchararray"/>
|
||||||
</columns>
|
</columns>
|
||||||
</object>
|
</object>
|
||||||
|
<object class="GtkMenu" id="alt_popup_menu">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImageMenuItem" id="alt_remove_popup_item">
|
||||||
|
<property name="label">gtk-remove</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="use_underline">True</property>
|
||||||
|
<property name="use_stock">True</property>
|
||||||
|
<signal name="activate" handler="on_delete" object="alt_tree_view" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
<object class="GtkTreeStore" id="bouquets_tree_store">
|
<object class="GtkTreeStore" id="bouquets_tree_store">
|
||||||
<columns>
|
<columns>
|
||||||
<!-- column-name bouquet -->
|
<!-- column-name bouquet -->
|
||||||
@@ -2472,10 +2497,14 @@ Author: Dmitriy Yefremov
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn" id="fav_picon_column">
|
<object class="GtkTreeViewColumn" id="fav_service_column">
|
||||||
<property name="min_width">25</property>
|
<property name="resizable">True</property>
|
||||||
<property name="title" translatable="yes">Picon</property>
|
<property name="min_width">50</property>
|
||||||
|
<property name="title" translatable="yes">Service</property>
|
||||||
|
<property name="expand">True</property>
|
||||||
|
<property name="clickable">True</property>
|
||||||
<property name="alignment">0.5</property>
|
<property name="alignment">0.5</property>
|
||||||
|
<signal name="clicked" handler="on_fav_sort" swapped="no"/>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererPixbuf" id="fav_picon_cellrendererpixbuf">
|
<object class="GtkCellRendererPixbuf" id="fav_picon_cellrendererpixbuf">
|
||||||
<property name="xpad">2</property>
|
<property name="xpad">2</property>
|
||||||
@@ -2485,17 +2514,6 @@ Author: Dmitriy Yefremov
|
|||||||
<attribute name="pixbuf">8</attribute>
|
<attribute name="pixbuf">8</attribute>
|
||||||
</attributes>
|
</attributes>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkTreeViewColumn" id="fav_service_column">
|
|
||||||
<property name="resizable">True</property>
|
|
||||||
<property name="min_width">50</property>
|
|
||||||
<property name="title" translatable="yes">Service</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="clickable">True</property>
|
|
||||||
<property name="alignment">0.5</property>
|
|
||||||
<signal name="clicked" handler="on_fav_sort" swapped="no"/>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererPixbuf" id="fav_coded_cellrendererpixbuf">
|
<object class="GtkCellRendererPixbuf" id="fav_coded_cellrendererpixbuf">
|
||||||
<property name="xpad">2</property>
|
<property name="xpad">2</property>
|
||||||
@@ -2647,9 +2665,14 @@ Author: Dmitriy Yefremov
|
|||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="model">alt_list_store</property>
|
<property name="model">alt_list_store</property>
|
||||||
<property name="enable_search">False</property>
|
<property name="enable_search">False</property>
|
||||||
|
<property name="rubber_banding">True</property>
|
||||||
<property name="enable_grid_lines">both</property>
|
<property name="enable_grid_lines">both</property>
|
||||||
|
<signal name="button-press-event" handler="on_view_popup_menu" object="alt_popup_menu" swapped="no"/>
|
||||||
|
<signal name="drag-data-received" handler="on_alt_view_drag_data_received" swapped="no"/>
|
||||||
<child internal-child="selection">
|
<child internal-child="selection">
|
||||||
<object class="GtkTreeSelection" id="alt_selection"/>
|
<object class="GtkTreeSelection" id="alt_selection">
|
||||||
|
<property name="mode">multiple</property>
|
||||||
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn" id="alt_num_column">
|
<object class="GtkTreeViewColumn" id="alt_num_column">
|
||||||
@@ -2669,9 +2692,11 @@ Author: Dmitriy Yefremov
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkTreeViewColumn" id="alt_picon_column">
|
<object class="GtkTreeViewColumn" id="alt_service_column">
|
||||||
<property name="min_width">25</property>
|
<property name="resizable">True</property>
|
||||||
<property name="title" translatable="yes">Picon</property>
|
<property name="min_width">50</property>
|
||||||
|
<property name="title" translatable="yes">Service</property>
|
||||||
|
<property name="expand">True</property>
|
||||||
<property name="alignment">0.5</property>
|
<property name="alignment">0.5</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererPixbuf" id="alt_picon_cellrendererpixbuf">
|
<object class="GtkCellRendererPixbuf" id="alt_picon_cellrendererpixbuf">
|
||||||
@@ -2681,15 +2706,6 @@ Author: Dmitriy Yefremov
|
|||||||
<attribute name="pixbuf">1</attribute>
|
<attribute name="pixbuf">1</attribute>
|
||||||
</attributes>
|
</attributes>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkTreeViewColumn" id="alt_service_column">
|
|
||||||
<property name="resizable">True</property>
|
|
||||||
<property name="min_width">50</property>
|
|
||||||
<property name="title" translatable="yes">Service</property>
|
|
||||||
<property name="expand">True</property>
|
|
||||||
<property name="alignment">0.5</property>
|
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkCellRendererText" id="alt_service_cellrenderertext">
|
<object class="GtkCellRendererText" id="alt_service_cellrenderertext">
|
||||||
<property name="xalign">0.10000000149011612</property>
|
<property name="xalign">0.10000000149011612</property>
|
||||||
@@ -2731,6 +2747,30 @@ Author: Dmitriy Yefremov
|
|||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkTreeViewColumn" id="alt_id_column">
|
||||||
|
<property name="visible">False</property>
|
||||||
|
<property name="title" translatable="yes">ID</property>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCellRendererText" id="alt_fav_id_cellrenderertext"/>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="text">5</attribute>
|
||||||
|
</attributes>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCellRendererText" id="alt_id_cellrenderertext"/>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="text">6</attribute>
|
||||||
|
</attributes>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkCellRendererText" id="alt_iter_cellrenderertext"/>
|
||||||
|
<attributes>
|
||||||
|
<attribute name="text">7</attribute>
|
||||||
|
</attributes>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
@@ -3477,6 +3517,23 @@ Author: Dmitriy Yefremov
|
|||||||
<signal name="activate" handler="on_insert_space" object="fav_tree_view" swapped="no"/>
|
<signal name="activate" handler="on_insert_space" object="fav_tree_view" swapped="no"/>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkSeparatorMenuItem" id="fav_popup_separator">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkImageMenuItem" id="fav_add_alt_popup_item">
|
||||||
|
<property name="label" translatable="yes">Add alternatives</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="sensitive">False</property>
|
||||||
|
<property name="can_focus">False</property>
|
||||||
|
<property name="image">alt_image</property>
|
||||||
|
<property name="use_stock">False</property>
|
||||||
|
<signal name="activate" handler="on_add_alternatives" swapped="no"/>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSeparatorMenuItem" id="fav_popup_separator_4">
|
<object class="GtkSeparatorMenuItem" id="fav_popup_separator_4">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ class BqGenType(Enum):
|
|||||||
|
|
||||||
class Column(IntEnum):
|
class Column(IntEnum):
|
||||||
""" Column nums in the views """
|
""" Column nums in the views """
|
||||||
# main view
|
# Main view
|
||||||
SRV_CAS_FLAGS = 0
|
SRV_CAS_FLAGS = 0
|
||||||
SRV_STANDARD = 1
|
SRV_STANDARD = 1
|
||||||
SRV_CODED = 2
|
SRV_CODED = 2
|
||||||
@@ -180,7 +180,7 @@ class Column(IntEnum):
|
|||||||
SRV_TRANSPONDER = 19
|
SRV_TRANSPONDER = 19
|
||||||
SRV_TOOLTIP = 20
|
SRV_TOOLTIP = 20
|
||||||
SRV_BACKGROUND = 21
|
SRV_BACKGROUND = 21
|
||||||
# fav view
|
# FAV view
|
||||||
FAV_NUM = 0
|
FAV_NUM = 0
|
||||||
FAV_CODED = 1
|
FAV_CODED = 1
|
||||||
FAV_SERVICE = 2
|
FAV_SERVICE = 2
|
||||||
@@ -192,11 +192,20 @@ class Column(IntEnum):
|
|||||||
FAV_PICON = 8
|
FAV_PICON = 8
|
||||||
FAV_TOOLTIP = 9
|
FAV_TOOLTIP = 9
|
||||||
FAV_BACKGROUND = 10
|
FAV_BACKGROUND = 10
|
||||||
# bouquets view
|
# Bouquets view
|
||||||
BQ_NAME = 0
|
BQ_NAME = 0
|
||||||
BQ_LOCKED = 1
|
BQ_LOCKED = 1
|
||||||
BQ_HIDDEN = 2
|
BQ_HIDDEN = 2
|
||||||
BQ_TYPE = 3
|
BQ_TYPE = 3
|
||||||
|
# Alternatives view
|
||||||
|
ALT_NUM = 0
|
||||||
|
ALT_PICON = 1
|
||||||
|
ALT_SERVICE = 2
|
||||||
|
ALT_TYPE = 3
|
||||||
|
ALT_POS = 4
|
||||||
|
ALT_FAV_ID = 5
|
||||||
|
ALT_ID = 6
|
||||||
|
ALT_ITER = 7
|
||||||
|
|
||||||
def __index__(self):
|
def __index__(self):
|
||||||
""" Overridden to get the index in slices directly """
|
""" Overridden to get the index in slices directly """
|
||||||
|
|||||||
Reference in New Issue
Block a user