diff --git a/gui/dialogs/gps.xml b/gui/dialogs/gps.xml index 1a95b2453..7e8edc0bf 100644 --- a/gui/dialogs/gps.xml +++ b/gui/dialogs/gps.xml @@ -6,6 +6,10 @@ 1); + dlg.getNode("scratch-has-next", 1).setValue(size(globals._gps_dialog_search_results) > 1); updateScratch(); } var doScratchNext = func { var index = dlg.getNode("scratch-index").getValue(); - var lastIndex = size(searchResults) - 1; + var lastIndex = size(globals._gps_dialog_search_results) - 1; if (index == lastIndex) return; dlg.getNode("scratch-has-next", 1).setValue((index + 1) < lastIndex); @@ -130,8 +136,8 @@ updateScratch(); } - var searchResults = []; - updateSearchResults(0); + # restore state from previous time the dialog was open + updateSearchResults(0, dlg.getNode("scratch-index", 1).getValue()); var slaved = props.globals.getNode("/instrumentation/nav[0]/slaved-to-gps", 1); ]]>