mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
Add filtering for object name and source code filename
This commit is contained in:
parent
35c11f13ab
commit
53becaa72c
2 changed files with 32 additions and 5 deletions
|
@ -672,6 +672,24 @@ class CategoryFilter (Filter):
|
||||||
return row[col_id] != category
|
return row[col_id] != category
|
||||||
self.filter_func = category_filter_func
|
self.filter_func = category_filter_func
|
||||||
|
|
||||||
|
class ObjectFilter (Filter):
|
||||||
|
|
||||||
|
def __init__ (self, object_):
|
||||||
|
|
||||||
|
col_id = LogModelBase.COL_OBJECT
|
||||||
|
def object_filter_func (row):
|
||||||
|
return row[col_id] != object_
|
||||||
|
self.filter_func = object_filter_func
|
||||||
|
|
||||||
|
class FilenameFilter (Filter):
|
||||||
|
|
||||||
|
def __init__ (self, filename):
|
||||||
|
|
||||||
|
col_id = LogModelBase.COL_FILENAME
|
||||||
|
def filename_filter_func (row):
|
||||||
|
return row[col_id] != filename
|
||||||
|
self.filter_func = filename_filter_func
|
||||||
|
|
||||||
class SubRange (object):
|
class SubRange (object):
|
||||||
|
|
||||||
__slots__ = ("l", "start", "stop",)
|
__slots__ = ("l", "start", "stop",)
|
||||||
|
@ -1599,12 +1617,11 @@ class Window (object):
|
||||||
("edit-copy-message", gtk.STOCK_COPY, _("Copy message"), ""),
|
("edit-copy-message", gtk.STOCK_COPY, _("Copy message"), ""),
|
||||||
("hide-log-level", None, _("Hide log level")),
|
("hide-log-level", None, _("Hide log level")),
|
||||||
("hide-log-category", None, _("Hide log category")),
|
("hide-log-category", None, _("Hide log category")),
|
||||||
("hide-log-object", None, _("Hide object"))])
|
("hide-log-object", None, _("Hide object")),
|
||||||
|
("hide-filename", None, _("Hide filename"))])
|
||||||
group.props.sensitive = False
|
group.props.sensitive = False
|
||||||
self.actions.add_group (group)
|
self.actions.add_group (group)
|
||||||
|
|
||||||
self.actions.hide_log_object.props.visible = False
|
|
||||||
|
|
||||||
self.actions.add_group (self.column_manager.action_group)
|
self.actions.add_group (self.column_manager.action_group)
|
||||||
|
|
||||||
self.log_file = None
|
self.log_file = None
|
||||||
|
@ -1667,7 +1684,7 @@ class Window (object):
|
||||||
"hide-before-line", "hide-after-line", "show-hidden-lines",
|
"hide-before-line", "hide-after-line", "show-hidden-lines",
|
||||||
"edit-copy-line", "edit-copy-message",
|
"edit-copy-line", "edit-copy-message",
|
||||||
"hide-log-level", "hide-log-category", "hide-log-object",
|
"hide-log-level", "hide-log-category", "hide-log-object",
|
||||||
"show-about",):
|
"hide-filename", "show-about",):
|
||||||
name = action_name.replace ("-", "_")
|
name = action_name.replace ("-", "_")
|
||||||
action = getattr (self.actions, name)
|
action = getattr (self.actions, name)
|
||||||
handler = getattr (self, "handle_%s_action_activate" % (name,))
|
handler = getattr (self, "handle_%s_action_activate" % (name,))
|
||||||
|
@ -2009,7 +2026,15 @@ class Window (object):
|
||||||
|
|
||||||
def handle_hide_log_object_action_activate (self, action):
|
def handle_hide_log_object_action_activate (self, action):
|
||||||
|
|
||||||
pass
|
row = self.get_active_line ()
|
||||||
|
object_ = row[LogModelBase.COL_OBJECT]
|
||||||
|
self.add_model_filter (ObjectFilter (object_))
|
||||||
|
|
||||||
|
def handle_hide_filename_action_activate (self, action):
|
||||||
|
|
||||||
|
row = self.get_active_line ()
|
||||||
|
filename = row[LogModelBase.COL_FILENAME]
|
||||||
|
self.add_model_filter (FilenameFilter (filename))
|
||||||
|
|
||||||
def handle_show_about_action_activate (self, action):
|
def handle_show_about_action_activate (self, action):
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
<menuitem name="ViewContextMenuHideLevel" action="hide-log-level"/>
|
<menuitem name="ViewContextMenuHideLevel" action="hide-log-level"/>
|
||||||
<menuitem name="ViewContextMenuHideCategory" action="hide-log-category"/>
|
<menuitem name="ViewContextMenuHideCategory" action="hide-log-category"/>
|
||||||
<menuitem name="ViewContextMenuHideObject" action="hide-log-object"/>
|
<menuitem name="ViewContextMenuHideObject" action="hide-log-object"/>
|
||||||
|
<menuitem name="ViewContextMenuHideFilename" action="hide-filename"/>
|
||||||
<menuitem name="ViewContextMenuHideBefore" action="hide-before-line"/>
|
<menuitem name="ViewContextMenuHideBefore" action="hide-before-line"/>
|
||||||
<menuitem name="ViewContextMenuHideAfter" action="hide-after-line"/>
|
<menuitem name="ViewContextMenuHideAfter" action="hide-after-line"/>
|
||||||
<menuitem name="ViewContextMenuShowHidden" action="show-hidden-lines"/>
|
<menuitem name="ViewContextMenuShowHidden" action="show-hidden-lines"/>
|
||||||
|
@ -57,6 +58,7 @@
|
||||||
<menuitem name="ViewContextMenuHideLevel" action="hide-log-level"/>
|
<menuitem name="ViewContextMenuHideLevel" action="hide-log-level"/>
|
||||||
<menuitem name="ViewContextMenuHideCategory" action="hide-log-category"/>
|
<menuitem name="ViewContextMenuHideCategory" action="hide-log-category"/>
|
||||||
<menuitem name="ViewContextMenuHideObject" action="hide-log-object"/>
|
<menuitem name="ViewContextMenuHideObject" action="hide-log-object"/>
|
||||||
|
<menuitem name="ViewContextMenuHideFilename" action="hide-filename"/>
|
||||||
<menuitem name="ViewContextMenuHideBefore" action="hide-before-line"/>
|
<menuitem name="ViewContextMenuHideBefore" action="hide-before-line"/>
|
||||||
<menuitem name="ViewContextMenuHideAfter" action="hide-after-line"/>
|
<menuitem name="ViewContextMenuHideAfter" action="hide-after-line"/>
|
||||||
<menuitem name="ViewContextMenuShowHidden" action="show-hidden-lines"/>
|
<menuitem name="ViewContextMenuShowHidden" action="show-hidden-lines"/>
|
||||||
|
|
Loading…
Reference in a new issue