From 89b304cd1fe4a94c0e6229fb5ab4fe29f120bdba Mon Sep 17 00:00:00 2001 From: Torsten Dreyer Date: Mon, 30 Mar 2015 17:13:40 +0200 Subject: [PATCH] Airports dialog: Don't implement backend logic in UI Now that request-metar/clear-metar commands work properly, use those instead of direct manipulation of metar properties. Also, don't write to properties intended for read-only use. --- gui/dialogs/airports.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gui/dialogs/airports.xml b/gui/dialogs/airports.xml index fa1437d53..a80d6d94d 100644 --- a/gui/dialogs/airports.xml +++ b/gui/dialogs/airports.xml @@ -121,13 +121,11 @@ if (info.has_metar) { # Retrieve an updated METAR, and indicate that we've not got one currently. - setprop("/sim/gui/dialogs/airports/selected-airport/metar/station-id", airport_id); - setprop("/sim/gui/dialogs/airports/selected-airport/metar/time-to-live", 0); - setprop("/sim/gui/dialogs/airports/selected-airport/metar/data", "Retrieving METAR, please wait."); + fgcommand("request-metar", var n = props.Node.new({ "path": "/sim/gui/dialogs/airports/selected-airport/metar", + "station": airport_id})); } else { # This airport has no METAR. Rather than cancelling the retrieve-metar command, simply set the TTL # to a very long time so it won't over-ride our message. - setprop("/sim/gui/dialogs/airports/selected-airport/metar/data", "No METAR available from this airport"); setprop("/sim/gui/dialogs/airports/selected-airport/metar/time-to-live", 9999); }