Add PID column

This commit is contained in:
René Stadler 2007-11-14 13:34:53 +02:00 committed by Stefan Sauer
parent 6eb37ebc3c
commit eea7c6687b
2 changed files with 20 additions and 1 deletions

View file

@ -498,6 +498,24 @@ class LevelColumn (TextColumn):
return values return values
class PidColumn (TextColumn):
name = "pid"
label_header = _("PID")
id = LazyLogModel.COL_PID
@staticmethod
def get_modify_func ():
return str
def get_values_for_size (self):
# TODO: Same as for TimeColumn. There is no guarantee that 999999 is
# the widest string; use fixed font or come up with something better.
return ["999999"]
class ThreadColumn (TextColumn): class ThreadColumn (TextColumn):
name = "thread" name = "thread"
@ -756,7 +774,7 @@ class ColumnManager (Common.GUI.Manager):
class ViewColumnManager (ColumnManager): class ViewColumnManager (ColumnManager):
column_classes = (TimeColumn, LevelColumn, ThreadColumn, CategoryColumn, column_classes = (TimeColumn, LevelColumn, PidColumn, ThreadColumn, CategoryColumn,
FilenameColumn, FunctionColumn, ObjectColumn, MessageColumn,) FilenameColumn, FunctionColumn, ObjectColumn, MessageColumn,)
def __init__ (self, state): def __init__ (self, state):

View file

@ -13,6 +13,7 @@
<menu name="ViewColumnsMenu" action="ViewColumnsMenuAction"> <menu name="ViewColumnsMenu" action="ViewColumnsMenuAction">
<menuitem name="ViewColumnsTime" action="show-time-column"/> <menuitem name="ViewColumnsTime" action="show-time-column"/>
<menuitem name="ViewColumnsLevel" action="show-level-column"/> <menuitem name="ViewColumnsLevel" action="show-level-column"/>
<menuitem name="ViewColumnsPid" action="show-pid-column"/>
<menuitem name="ViewColumnsThread" action="show-thread-column"/> <menuitem name="ViewColumnsThread" action="show-thread-column"/>
<menuitem name="ViewColumnsFilename" action="show-filename-column"/> <menuitem name="ViewColumnsFilename" action="show-filename-column"/>
<menuitem name="ViewColumnsCategory" action="show-category-column"/> <menuitem name="ViewColumnsCategory" action="show-category-column"/>