diff options
author | René Stadler <mail@renestadler.de> | 2011-11-06 13:35:26 +0100 |
---|---|---|
committer | René Stadler <mail@renestadler.de> | 2011-11-06 13:35:26 +0100 |
commit | f9a9ce508e472a2cdb9b2bfb950a43e8d429ca0b (patch) | |
tree | 4f2f219ea0d02620802a1bfaabd6ebd5e2a441eb /GstDebugViewer | |
parent | 89b26236547ca3e234295019b3433a548a3b6ea3 (diff) |
columns: auto size time column when setting base time
Base time formatting adds + or - in front of the timestamp, so the column has
to grow a little to not hide the last digit.
Also fixes a crash when setting the base time while the time column is hidden.
Diffstat (limited to 'GstDebugViewer')
-rw-r--r-- | GstDebugViewer/GUI/columns.py | 10 | ||||
-rw-r--r-- | GstDebugViewer/GUI/window.py | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/GstDebugViewer/GUI/columns.py b/GstDebugViewer/GUI/columns.py index f0f7f3c..96ea98c 100644 --- a/GstDebugViewer/GUI/columns.py +++ b/GstDebugViewer/GUI/columns.py @@ -457,6 +457,16 @@ class ColumnManager (Common.GUI.Manager): self.zoom = scale + def set_base_time (self, base_time): + + try: + time_column = self.find_item (name = TimeColumn.name) + except KeyError: + return + + time_column.set_base_time (base_time) + self.size_column (time_column) + def get_toggle_action (self, column_class): action_name = "show-%s-column" % (column_class.name,) diff --git a/GstDebugViewer/GUI/window.py b/GstDebugViewer/GUI/window.py index 6372492..2a82aa9 100644 --- a/GstDebugViewer/GUI/window.py +++ b/GstDebugViewer/GUI/window.py @@ -674,8 +674,7 @@ class Window (object): def handle_set_base_time_action_activate (self, action): row = self.get_active_line () - time_column = self.column_manager.find_item (name = "time") - time_column.set_base_time (row[LogModelBase.COL_TIME]) + self.column_manager.set_base_time (row[LogModelBase.COL_TIME]) def handle_hide_log_level_action_activate (self, action): |