From 9cef0f8eb44a49b24d7139c8538085f3b7b4663d Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Mon, 8 Sep 2003 12:35:28 +0000 Subject: [PATCH] When recording in an empty program, don't ask where. git-svn-id: http://dom-editor.googlecode.com/svn/branches/Gtk2@515 ef21e15d-ca94-4315-9c45-0d95b1b2e117 --- Dome/GUIView.py | 6 +++--- Dome/List.py | 3 +++ Dome/Window.py | 7 +++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Dome/GUIView.py b/Dome/GUIView.py index 0ba34b0..aac8813 100644 --- a/Dome/GUIView.py +++ b/Dome/GUIView.py @@ -359,9 +359,9 @@ class GUIView(Display, XDSLoader): ('.//img', 'all descendant elements'), ('//img[@src]', 'all elements with "src" attributes'), ('//chapter[title="Intro"]', - 'Any with a Intro child.'), - ('img[0]', 'the first child element'), - ('text()', 'the first child text node'), + 'Any with a Intro child'), + ('img[1]', 'the first child element'), + ('text()', 'all child text nodes'), ('//img[@src="@CURRENT@"]', "all s whose src is the current node's value"), )) diff --git a/Dome/List.py b/Dome/List.py index 2430473..8939132 100644 --- a/Dome/List.py +++ b/Dome/List.py @@ -337,6 +337,9 @@ class List(g.VBox): self.tree.expand_row(tuple(partial), FALSE) iter = self.prog_model.get_iter(path) self.tree.get_selection().select_iter(iter) + + def selected_program(self): + return self.chains.prog class ChainDummy(g.TreeView): def __init__(self, view, prog = None): diff --git a/Dome/Window.py b/Dome/Window.py index d09997f..4eba9ea 100644 --- a/Dome/Window.py +++ b/Dome/Window.py @@ -254,6 +254,13 @@ class Window(rox.Window, saving.Saveable): if self.view.rec_point: self.view.stop_recording() else: + if not self.view.rec_point: + prog = self.list.selected_program() + if prog: + start = prog.code.start + if start.next == None: + self.view.set_rec((start, 'next')) + return self.view.record_at_point() def tool_help(self, button = None): -- 2.11.4.GIT