diff options
author | René Stadler <mail@renestadler.de> | 2008-01-24 15:18:37 +0200 |
---|---|---|
committer | René Stadler <mail@renestadler.de> | 2008-01-24 15:18:37 +0200 |
commit | 373379cdaf9689167a106f9579e1fdbb10d6ce00 (patch) | |
tree | aecdde2ebe3b48d1abd7c316f347f4f5ed17d19d /GstDebugViewer | |
parent | b1d21c22fa7995d0cf516f7718dfd812cc8c9c9d (diff) |
Add filtering for object name and source code filename
Diffstat (limited to 'GstDebugViewer')
-rw-r--r-- | GstDebugViewer/GUI.py | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/GstDebugViewer/GUI.py b/GstDebugViewer/GUI.py index 96caaa4..f08258a 100644 --- a/GstDebugViewer/GUI.py +++ b/GstDebugViewer/GUI.py @@ -672,6 +672,24 @@ class CategoryFilter (Filter): return row[col_id] != category 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): __slots__ = ("l", "start", "stop",) @@ -1599,12 +1617,11 @@ class Window (object): ("edit-copy-message", gtk.STOCK_COPY, _("Copy message"), ""), ("hide-log-level", None, _("Hide log level")), ("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 self.actions.add_group (group) - self.actions.hide_log_object.props.visible = False - self.actions.add_group (self.column_manager.action_group) self.log_file = None @@ -1667,7 +1684,7 @@ class Window (object): "hide-before-line", "hide-after-line", "show-hidden-lines", "edit-copy-line", "edit-copy-message", "hide-log-level", "hide-log-category", "hide-log-object", - "show-about",): + "hide-filename", "show-about",): name = action_name.replace ("-", "_") action = getattr (self.actions, 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): - 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): |