From cad41649dc745eedbd1b5bc10e7b24e3de4a445b Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 25 Oct 2018 16:23:19 +0100 Subject: [PATCH] Fix property browser #0 not working on second open Since we mutate the (cached) definition properties on each call to clone(), we need to reset these values back, or the non-clone()-ed instance gets confused paths to its input and list widgets. https://sourceforge.net/p/flightgear/codetickets/2044/ --- gui/dialogs/property-browser.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gui/dialogs/property-browser.xml b/gui/dialogs/property-browser.xml index f61289beb..707a09ae0 100644 --- a/gui/dialogs/property-browser.xml +++ b/gui/dialogs/property-browser.xml @@ -197,6 +197,19 @@ }); fgcommand("dialog-new", self); fgcommand("dialog-show", self); + + var originalPath = '/sim/gui/dialogs/property-browser'; + # reset the values, so we don't use incorrect paths + # when the last browser is closed and then re-opened + # bug: https://sourceforge.net/p/flightgear/codetickets/2044/ + self.setValues({ + "name": "property-browser", + "dialog-name": "property-browser", + "group[0]/text/property": originalPath ~ "/title", + "property-list/property": originalPath ~ "/list", + "group[1]/text/property": originalPath ~ "/label", + "group[1]/input/property": originalPath ~ "/input", + }); } var auto_update = func {