On Wed, Dec 26, 2007 at 3:13 AM, Csaba Halász <[EMAIL PROTECTED]> wrote:
>
> - not sure how to properly handle the case when no transmitter is found
Added a timer to close the dialog.
Anybody interested in this?
--
Csaba/Jester
Index: gui/dialogs/chat-menu.xml
===================================================================
RCS file: /var/cvs/FlightGear-0.9/data/gui/dialogs/chat-menu.xml,v
retrieving revision 1.2
diff -u -r1.2 chat-menu.xml
--- gui/dialogs/chat-menu.xml 11 Dec 2007 15:20:00 -0000 1.2
+++ gui/dialogs/chat-menu.xml 15 Feb 2008 17:51:51 -0000
@@ -160,9 +160,18 @@
# something appropriate, such as "Cessna", "Boeing".
type = split(" ", type)[0];
}
+
+ # Get the tuned-in station
+ var transmitter =
findtransmitter(getprop("/instrumentation/comm/frequencies/selected-mhz"));
+ if (transmitter == nil) {
+ gui.popupTip("No station in range.");
+ settimer(func { fgcommand("dialog-close",
props.Node.new({"dialog-name": "chat-menu"})); }, 0);
+
+ return;
+ }
# Get the nearest airport.
- var airport = airportinfo();
+ var airport = airportinfo(transmitter.lat, transmitter.lon);
# Get the complement of each runway to create a full set.
foreach (var rwy; keys(airport.runways)) {
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel