From aad61698ff7d9ece64115bd8d5452bf2ebe01fc8 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sun, 27 Aug 2006 19:27:21 +0000 Subject: [PATCH] fix property_browser() --- Nasal/gui.nas | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Nasal/gui.nas b/Nasal/gui.nas index 67b1f94a9..2866f8491 100644 --- a/Nasal/gui.nas +++ b/Nasal/gui.nas @@ -196,26 +196,23 @@ Dialog = { }, }; + ## # Open property browser with given target path. # property_browser = func(dir = "/") { var dlgname = "property-browser"; - var need_create = 1; foreach (var module; keys(globals)) { if (find("__dlg:" ~ dlgname, module) == 0) { globals[module].clone(dir); - need_create = 0; + return; } } - if(need_create) { - setprop("/sim/gui/dialogs/" ~ dlgname ~ "/last", dir); - fgcommand("dialog-show", props.Node.new({"dialog-name": dlgname})); - } + setprop("/sim/gui/dialogs/" ~ dlgname ~ "/last", dir); + fgcommand("dialog-show", props.Node.new({"dialog-name": dlgname})); } - ## # Open one property browser per /browser[] property, where each contains # the target path. On the command line use --prop:browser=orientation