diff options
author | René Stadler <mail@renestadler.de> | 2007-11-22 16:27:34 +0200 |
---|---|---|
committer | René Stadler <mail@renestadler.de> | 2007-11-22 16:27:34 +0200 |
commit | a038ca740e897daef62a9a4ea785bb6e0e35aa1e (patch) | |
tree | 54813ab4def74970d407acc36ca653723e0d773b | |
parent | 3697b4a8427ca66e380f65897ba1aa6cd8c9f856 (diff) |
Replace filename column with code column, listing filename and line number
-rwxr-xr-x | GstDebugViewer/GUI.py | 40 | ||||
-rw-r--r-- | data/gst-debug-viewer.ui | 2 |
2 files changed, 23 insertions, 19 deletions
diff --git a/GstDebugViewer/GUI.py b/GstDebugViewer/GUI.py index 4cc70c0..c3e29bd 100755 --- a/GstDebugViewer/GUI.py +++ b/GstDebugViewer/GUI.py @@ -356,8 +356,11 @@ class TextColumn (SizedColumn): if self.get_data_func: data_func = self.get_data_func () id_ = self.id - def cell_data_func (column, cell, model, tree_iter): - data_func (cell.props, model.get_value (tree_iter, id_), model.get_path (tree_iter)) + if id_ is not None: + def cell_data_func (column, cell, model, tree_iter): + data_func (cell.props, model.get_value (tree_iter, id_), model.get_path (tree_iter)) + else: + cell_data_func = data_func column.set_cell_data_func (cell, cell_data_func) elif not self.get_modify_func: column.add_attribute (cell, "text", self.id) @@ -521,15 +524,26 @@ class CategoryColumn (TextColumn): return ["GST_LONG_CATEGORY", "somelongelement"] -class FilenameColumn (TextColumn): +class CodeColumn (TextColumn): + + name = "code" + label_header = _("Code") + id = None + + @staticmethod + def get_data_func (): + + filename_id = LogModelBase.COL_FILENAME + line_number_id = LogModelBase.COL_LINE_NUMBER + def filename_data_func (column, cell, model, tree_iter): + args = model.get (tree_iter, filename_id, line_number_id) + cell.props.text = "%s:%i" % args - name = "filename" - label_header = _("Filename") - id = LazyLogModel.COL_FILENAME + return filename_data_func def get_values_for_size (self): - return ["gstsomefilename.c"] + return ["gstsomefilename.c:1234"] class FunctionColumn (TextColumn): @@ -541,16 +555,6 @@ class FunctionColumn (TextColumn): return ["gst_this_should_be_enough"] -## class FullCodeLocation (TextColumn): - -## name = "code-location" -## label_header = _("Code Location") -## id = LazyLogModel.COL_FILENAME - -## def get_values_for_size (self): - -## return ["gstwhateverfile.c:1234"] - class ObjectColumn (TextColumn): name = "object" @@ -749,7 +753,7 @@ class ColumnManager (Common.GUI.Manager): class ViewColumnManager (ColumnManager): column_classes = (TimeColumn, LevelColumn, PidColumn, ThreadColumn, CategoryColumn, - FilenameColumn, FunctionColumn, ObjectColumn, MessageColumn,) + CodeColumn, FunctionColumn, ObjectColumn, MessageColumn,) def __init__ (self, state): diff --git a/data/gst-debug-viewer.ui b/data/gst-debug-viewer.ui index a6e33c6..d8a1b5b 100644 --- a/data/gst-debug-viewer.ui +++ b/data/gst-debug-viewer.ui @@ -15,7 +15,7 @@ <menuitem name="ViewColumnsLevel" action="show-level-column"/> <menuitem name="ViewColumnsPid" action="show-pid-column"/> <menuitem name="ViewColumnsThread" action="show-thread-column"/> - <menuitem name="ViewColumnsFilename" action="show-filename-column"/> + <menuitem name="ViewColumnsCode" action="show-code-column"/> <menuitem name="ViewColumnsCategory" action="show-category-column"/> <menuitem name="ViewColumnsFunction" action="show-function-column"/> <menuitem name="ViewColumnsObject" action="show-object-column"/> |