[Xastir-dev] fix for TrackMe button bug

David Flood davidf4 at mindspring.com
Mon Apr 18 23:36:11 EDT 2005


Ok, I've finally found some ATUs.  Here's a fix for that pesky button.

--- track_gui.c	2005-04-18 20:17:07.839447400 -0700
+++ track_gui.c.fixed	2005-04-18 20:29:52.185249176 -0700
@@ -150,6 +150,10 @@
             xastir_snprintf(temp2, sizeof(temp2), langcode("POPEM00026"),
temp);
             popup_message_always(langcode("POPEM00025"),temp2);
         }
+	if ( track_me & !is_my_call( tracking_station_call, 1) ) {
+		    XmToggleButtonSetState(trackme_button,FALSE,TRUE);
+		    track_me = 0;
+	}
     } else {
         tracking_station_call[0] = '\0';    // Empty it out again
         track_station_on = 0;

-----Original Message-----
From: Curt Mills [mailto:archer at eskimo.com] 
Sent: Monday, December 13, 2004 11:12 PM
To: David Flood
Cc: Xastir-Dev at xastir.org
Subject: Re: [Xastir-dev] Comments requested..best way to fix an issue


On Mon, 13 Dec 2004, David Flood wrote:

> Well, I decided to start what I thought was "small" and fix the issue 
> where if you are in "TrackMe" mode and change the callsign through the 
> Station / Track Station command, the "TrackMe" button stays pressed on 
> the menu bar.

Yes, you're describing the unwanted operation of that button.  Press
TrackMe, then later go to the Track Station dialog and change the callsign.
TrackMe button _should_ get unselected.


> The way I see it, there are two ways to fix this.
>
> The first (and probably the right but more difficult way) is to 
> compare the entered callsign when OK is clicked on and if it isn't 
> ours, then unset the button.

That seems the correct way to me.


> The second way makes it a simple redraw issue.  If anything other than 
> "Cancel" is clicked on, unset the button regardless of what really 
> happened.

I don't like that one, although it is a bit better than the current
implementation.

There are X11 calls to set/reset a togglebutton.  I think there are usually
parameters that you pass to the call which will cause the callback for that
button to be called, or not to be called.  In this case you want to deselect
the button making sure the callback is _not_ called, else you'll immediately
go into TrackMe mode with your callsign again.

You should be able to do a check for my_callsign.  You'll find examples of
that all over in the code.  Check in db.c:is_my_call(), which is designed to
make it easy for you.

-- 
Curt, WE7U.				archer at eskimo dot com
http://www.eskimo.com/~archer
  Lotto:  A tax on people who are bad at math. - unknown
Windows:  Microsoft's tax on computer illiterates. - WE7U.
The world DOES revolve around me:  I picked the coordinate system!"




More information about the Xastir-dev mailing list