summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Stadler <mail@renestadler.de>2008-01-24 16:19:15 +0200
committerRené Stadler <mail@renestadler.de>2008-01-24 16:19:15 +0200
commit08537195a8ef386c368e0efdafed5e956aa6d9ed (patch)
tree71dfaf05c974c66dba5d56868777de7ab71c31db
parent373379cdaf9689167a106f9579e1fdbb10d6ce00 (diff)
Make hide before/after action insensitive when first/last line is selected
-rw-r--r--GstDebugViewer/GUI.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/GstDebugViewer/GUI.py b/GstDebugViewer/GUI.py
index f08258a..28a83dd 100644
--- a/GstDebugViewer/GUI.py
+++ b/GstDebugViewer/GUI.py
@@ -1644,6 +1644,8 @@ class Window (object):
self.log_view = self.widgets.log_view
self.log_view.drag_dest_unset ()
self.log_view.set_search_column (-1)
+ sel = self.log_view.get_selection ()
+ sel.connect ("changed", self.handle_log_view_selection_changed)
self.view_popup = ui.get_widget ("/ui/context/LogViewContextMenu").get_submenu ()
Common.GUI.widget_add_popup_menu (self.log_view, self.view_popup)
@@ -1839,6 +1841,20 @@ class Window (object):
tree_iter = model.get_iter (path)
model.row_changed (path, tree_iter)
+ def handle_log_view_selection_changed (self, selection):
+
+ try:
+ line_index = self.get_active_line_index ()
+ except ValueError:
+ first_selected = True
+ last_selected = True
+ else:
+ first_selected = (line_index == 0)
+ last_selected = (line_index == len (self.log_view.props.model) - 1)
+
+ self.actions.hide_before_line.props.sensitive = not first_selected
+ self.actions.hide_after_line.props.sensitive = not last_selected
+
def handle_window_delete_event (self, window, event):
self.actions.close_window.activate ()