diff options
Diffstat (limited to 'GstDebugViewer')
-rw-r--r-- | GstDebugViewer/Data.py | 1 | ||||
-rwxr-xr-x | GstDebugViewer/GUI.py | 16 |
2 files changed, 15 insertions, 2 deletions
diff --git a/GstDebugViewer/Data.py b/GstDebugViewer/Data.py index dc44f56..0a9c3bd 100644 --- a/GstDebugViewer/Data.py +++ b/GstDebugViewer/Data.py @@ -337,6 +337,7 @@ class LogFile (Producer): self.logger = logging.getLogger ("logfile") + self.path = os.path.normpath (os.path.abspath (filename)) self.fileobj = file (filename, "rb") self.line_cache = LineCache (self.fileobj, dispatcher) self.line_cache.consumers.append (self) diff --git a/GstDebugViewer/GUI.py b/GstDebugViewer/GUI.py index 07735eb..0c37226 100755 --- a/GstDebugViewer/GUI.py +++ b/GstDebugViewer/GUI.py @@ -941,11 +941,13 @@ class Window (object): group = gtk.ActionGroup ("WindowActions") group.add_actions ([("new-window", gtk.STOCK_NEW, _("_New Window"), "<Ctrl>N"), ("open-file", gtk.STOCK_OPEN, _("_Open File"), "<Ctrl>O"), + ("reload-file", gtk.STOCK_REFRESH, _("_Reload File"), "<Ctrl>R"), ("close-window", gtk.STOCK_CLOSE, _("Close _Window"), "<Ctrl>W"), ("cancel-load", gtk.STOCK_CANCEL, None,), ("show-about", gtk.STOCK_ABOUT, None)]) ## group.add_toggle_actions ([("show-line-density", None, _("Line _Density"), "<Ctrl>D")]) self.actions.add_group (group) + self.actions.reload_file.props.sensitive = False group = gtk.ActionGroup ("RowActions") group.add_actions ([("edit-copy-line", gtk.STOCK_COPY, _("Copy line"), "<Ctrl>C"), @@ -1001,8 +1003,8 @@ class Window (object): self.clipboard = gtk.Clipboard (self.gtk_window.get_display (), gtk.gdk.SELECTION_CLIPBOARD) - for action_name in ("new-window", "open-file", "close-window", - "cancel-load", + for action_name in ("new-window", "open-file", "reload-file", + "close-window", "cancel-load", "edit-copy-line", "edit-copy-message", "filter-out-higher-levels", "show-about",): @@ -1082,6 +1084,13 @@ class Window (object): self.set_log_file (dialog.get_filename ()) dialog.destroy () + def handle_reload_file_action_activate (self, action): + + if self.log_file is None: + return + + self.set_log_file (self.log_file.path) + def handle_cancel_load_action_activate (self, action): self.logger.debug ("cancelling data load") @@ -1158,6 +1167,7 @@ class Window (object): self.dispatcher.cancel () self.dispatcher = None self.log_file = None + self.actions.reload_file.props.sensitive = False else: self.logger.debug ("setting log file %r", filename) @@ -1255,6 +1265,8 @@ class Window (object): self.log_filter.reset () + self.actions.reload_file.props.sensitive = True + def idle_set (): ##self.log_view.props.model = self.log_model self.log_view.props.model = self.log_filter |