From 293dd139859aeef09ad4042a6ad4028c5e062dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Stadler?= Date: Wed, 28 Nov 2007 10:57:02 +0200 Subject: [PATCH] Add a (pretty limited) context menu to the timeline widget --- debug-viewer/GstDebugViewer/Plugins/Timeline.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/debug-viewer/GstDebugViewer/Plugins/Timeline.py b/debug-viewer/GstDebugViewer/Plugins/Timeline.py index 373147a80c..f5b7de6764 100644 --- a/debug-viewer/GstDebugViewer/Plugins/Timeline.py +++ b/debug-viewer/GstDebugViewer/Plugins/Timeline.py @@ -624,6 +624,19 @@ class TimelineFeature (FeatureBase): "ViewTimeline", "show-timeline", gtk.UI_MANAGER_MENUITEM, False) + ui.add_ui (self.merge_id, "/", "TimelineContextMenu", None, + gtk.UI_MANAGER_POPUP, False) + # TODO: Makes sense to have these here too, but we need to add logic to + # the actions to associate the correct line with the activation. + ## ui.add_ui (self.merge_id, "/TimelineContextMenu", "TimelineOmitLinesBefore", + ## "omit-before-line", gtk.UI_MANAGER_MENUITEM, False) + ## ui.add_ui (self.merge_id, "/TimelineContextMenu", "TimelineOmitLinesAfter", + ## "omit-after-line", gtk.UI_MANAGER_MENUITEM, False) + ui.add_ui (self.merge_id, "/TimelineContextMenu", "TimelineShowOmittedLines", + "show-hidden-lines", gtk.UI_MANAGER_MENUITEM, False) + + self.popup = ui.get_widget ("/TimelineContextMenu") + box = window.get_top_attach_point () self.timeline = TimelineWidget () @@ -758,6 +771,10 @@ class TimelineFeature (FeatureBase): def handle_timeline_button_press_event (self, widget, event): + if event.button == 3: + self.popup.popup (None, None, None, event.button, event.get_time ()) + return True + if event.button != 1: return True