~bilalakhtar/ubuntu/maverick/gpsdrive/gpsdrive-fix-325288

« back to all changes in this revision

Viewing changes to src/gpsdrive.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Putzo
  • Date: 2007-07-29 12:27:49 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070729122749-ypnd8prr97kulmrg
Tags: 2.10~pre2-2
* Removed libfly.so, libnautic.so, because they weren't used.
* Removed gpsfetchmap wrapper from debian/.
* Fixed mistake in debian/rules which caused gpsdrive to configure twice.
* Documentation were installed twice in different dirs. 
* Added missing perl dependencies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    *********************************************************************
24
24
 
25
25
$Log: gpsdrive.c,v $
 
26
Revision 1.526  2004/04/05 18:45:40  ganter
 
27
added patch for kismet hangs and Mac-OS mouse
 
28
patches provided by Ulrich Hecht from SUSE.
 
29
 
26
30
Revision 1.525  2004/03/03 20:46:47  ganter
27
31
fixed big bug in waypoint list if format not set to decimal display
28
32
 
1964
1968
gint maploaded, simmode, zoom, iszoomed;
1965
1969
gchar homedir[500], mapdir[500];
1966
1970
static gchar const rcsid[] =
1967
 
  "$Id: gpsdrive.c,v 1.525 2004/03/03 20:46:47 ganter Exp $";
 
1971
  "$Id: gpsdrive.c,v 1.526 2004/04/05 18:45:40 ganter Exp $";
1968
1972
gint thisline, thisrouteline = 0, routeitems = 0, routepointer = 0;
1969
1973
gint maxwp, maxfriends = 0;
1970
1974
GtkStyle *style = NULL;
2003
2007
GtkWidget *l1, *l2, *l3, *l4, *l5, *l6, *l7, *l8, *mutebt, *sqlbt;
2004
2008
GtkWidget *trackbt, *wpbt;
2005
2009
GtkWidget *bestmapbt, *maptogglebt, *topotogglebt, *savetrackbt;
2006
 
GtkWidget *loadtrackbt, *radio1, *radio2, *radio3, *scalerlbt, *scalerrbt;
 
2010
GtkWidget *loadtrackbt, *radio1, *radio2, *scalerlbt, *scalerrbt;
2007
2011
GtkWidget *setupbt;
2008
2012
gint savetrack = 0, havespeechout, hours, minutes, speechcount = 0;
2009
2013
gint muteflag = 0, sqlflag = 0, trackflag = 1, wpflag = TRUE;
2023
2027
glong tracknr;
2024
2028
trackcoordstruct *trackcoord;
2025
2029
glong trackcoordnr, tracklimit, trackcoordlimit;
2026
 
gint extrawinmenu = FALSE, expedia = TRUE, topozone = FALSE;
 
2030
gint extrawinmenu = FALSE, expedia = TRUE;
2027
2031
typedef struct
2028
2032
{
2029
2033
  gdouble lon;
2041
2045
gint real_screen_x, real_screen_y, real_psize, real_smallmenu, int_padding;
2042
2046
gint SCREEN_X_2, SCREEN_Y_2;
2043
2047
gint havefriends = 0;
2044
 
time_t waytxtstamp = 0;
 
2048
time_t waytxtstamp = 0, maptxtstamp = 0;
2045
2049
gint showallmaps = TRUE;
2046
2050
/* guint selwptimeout; */
2047
2051
gint dontsetwp = FALSE;
4050
4054
#if PREFER_MinDec
4051
4055
  /* Hack alert: there should be a 3-way lat/lon format selection in the GUI */
4052
4056
  if (islat)
4053
 
    g_snprintf (text,100, "%d%s%.3f'%c", grad, gradsym, minf,
 
4057
    g_snprintf (text, 100, "%d%s%.3f'%c", grad, gradsym, minf,
4054
4058
                (minus) ? 'S' : 'N');
4055
4059
  else
4056
4060
    g_snprintf (text, 100, "%d%s%.3f'%c", grad, gradsym, minf,
4420
4424
 
4421
4425
  if (needtosave)
4422
4426
    writeconfig ();
 
4427
 
 
4428
 
 
4429
/* Check for changed map_koord.txt and reload if changed */
 
4430
  g_strlcpy (mappath, mapdir, sizeof (mappath));
 
4431
  g_strlcat (mappath, "map_koord.txt", sizeof (mappath));
 
4432
 
 
4433
  f = stat (mappath, &buf);
 
4434
  if (buf.st_mtime != maptxtstamp)
 
4435
    {
 
4436
      loadmapconfig ();
 
4437
      g_print ("\n%s reloaded\n", "map_koord.txt");
 
4438
      maptxtstamp = buf.st_mtime;
 
4439
 
 
4440
    }
 
4441
 
4423
4442
  if (needreloadmapconfig)
4424
4443
    loadmapconfig ();
4425
4444
 
5104
5123
}
5105
5124
 
5106
5125
void
 
5126
drawloadedmaps ()
 
5127
{
 
5128
  /* Robins hacking 
 
5129
     Show (in yellow) any downloaded maps with in +/-20% of the currently requested map download
 
5130
     also show bounds of map with a black border
 
5131
     This is currently hooked in to the drawdownloadrectangle() function but may be better else where as
 
5132
     a seperate function that can be turned on and off as requried.
 
5133
     Due to RGB bit masks the map to be downloaded will now be green so that the new download area will be visible
 
5134
     over the top of the previous downloaded maps.
 
5135
   */
 
5136
  int i;
 
5137
  gdouble x, y, la, lo;
 
5138
  gint scale, xo, yo;
 
5139
  gchar sc[20];
 
5140
 
 
5141
  for (i = 0; i < nrmaps; i++)
 
5142
    {
 
5143
      g_strlcpy (sc, newmapsc, sizeof (sc));
 
5144
      g_strdelimit (sc, ",", '.');
 
5145
      scale = g_strtod (sc, NULL);
 
5146
 
 
5147
      if (maps[i].scale <= scale * 1.2 && maps[i].scale >= scale * 0.8)
 
5148
        {
 
5149
          //printf("Selected map at long %lf lat %lf\n",maps[i].lat,maps[i].longitude);
 
5150
          la = maps[i].lat;
 
5151
          lo = maps[i].longitude;
 
5152
          //              scale=maps[i].scale;
 
5153
          calcxy (&x, &y, lo, la, zoom);
 
5154
          xo = 1280.0 * zoom * scale / mapscale;
 
5155
          yo = 1024.0 * zoom * scale / mapscale;
 
5156
          // yellow background
 
5157
          gdk_gc_set_foreground (kontext, &yellow);
 
5158
          gdk_gc_set_function (kontext, GDK_AND);
 
5159
          gdk_gc_set_line_attributes (kontext, 2, 0, 0, 0);
 
5160
          gdk_draw_rectangle (drawable, kontext, 1, x - xo / 2, y - yo / 2,
 
5161
                              xo, yo);
 
5162
          // solid border
 
5163
          gdk_gc_set_foreground (kontext, &black);
 
5164
          gdk_gc_set_function (kontext, GDK_SOLID);
 
5165
          gdk_gc_set_line_attributes (kontext, 2, 0, 0, 0);
 
5166
          gdk_draw_rectangle (drawable, kontext, 0, x - xo / 2, y - yo / 2,
 
5167
                              xo, yo);
 
5168
 
 
5169
        }
 
5170
    }
 
5171
}
 
5172
 
 
5173
 
 
5174
void
5107
5175
drawdownloadrectangle (gint big)
5108
5176
{
5109
5177
/*   draw downloadrectangle */
5113
5181
      gchar longi[100], lat[100], sc[20];
5114
5182
      gint scale, xo, yo;
5115
5183
 
 
5184
      drawloadedmaps ();
 
5185
 
5116
5186
      g_strlcpy (lat, newmaplat, sizeof (lat));
5117
5187
      g_strdelimit (lat, ",", '.');
5118
5188
      la = g_strtod (lat, NULL);
5125
5195
      g_strdelimit (sc, ",", '.');
5126
5196
      scale = g_strtod (sc, NULL);
5127
5197
 
5128
 
      gdk_gc_set_foreground (kontext, &yellow);
 
5198
      gdk_gc_set_foreground (kontext, &green2);
5129
5199
      gdk_gc_set_function (kontext, GDK_AND);
5130
5200
      gdk_gc_set_line_attributes (kontext, 2, 0, 0, 0);
5131
5201
      if (big)
6768
6838
  return TRUE;
6769
6839
}
6770
6840
 
6771
 
gint
6772
 
topoz_select_cb (GtkWidget * widget, guint datum)
6773
 
{
6774
 
  gint i, e;
6775
 
  gchar buff[300], mappath[500];
6776
 
  struct stat buf;
6777
 
 
6778
 
  i = 0;
6779
 
  do
6780
 
    {
6781
 
      if (mapdir[strlen (mapdir) - 1] != '/')
6782
 
        g_strlcat (mapdir, "/", sizeof (mapdir));
6783
 
 
6784
 
      g_strlcpy (mappath, mapdir, sizeof (mappath));
6785
 
 
6786
 
      g_snprintf (downloadfilename, sizeof (downloadfilename),
6787
 
                  "%stop_file%04d.png", mappath, i++);
6788
 
      e = stat (downloadfilename, &buf);
6789
 
    }
6790
 
  while (e == 0);
6791
 
  g_snprintf (buff, sizeof (buff), "top_file%04d.png", i - 1);
6792
 
  gtk_entry_set_text (GTK_ENTRY (dltext4), buff);
6793
 
 
6794
 
  return TRUE;
6795
 
}
 
6841
 
 
6842
 
 
6843
 
6796
6844
 
6797
6845
gint
6798
6846
dlscale_cb (GtkWidget * widget, guint datum)
6915
6963
  gtk_signal_connect (GTK_OBJECT (dltext4), "changed",
6916
6964
                      GTK_SIGNAL_FUNC (dlscale_cb), 0);
6917
6965
 
6918
 
  table2 = gtk_table_new (3, 1, FALSE); //nested table w/ three columns
 
6966
  table2 = gtk_table_new (2, 1, FALSE); //nested table w/ three columns
6919
6967
  gtk_table_attach_defaults (GTK_TABLE (table), table2, 0, 3, 5, 6);
6920
6968
  gtk_widget_show (table2);
6921
6969
 
6931
6979
  gtk_signal_connect (GTK_OBJECT (radio2), "clicked",
6932
6980
                      GTK_SIGNAL_FUNC (other_select_cb), 0);
6933
6981
 
6934
 
  radio3 = gtk_radio_button_new_with_label (gr, _("TopoZone(US Only)"));
6935
 
  gtk_table_attach_defaults (GTK_TABLE (table2), radio3, 2, 3, 0, 1);
6936
 
  gr = gtk_radio_button_group (GTK_RADIO_BUTTON (radio3));
6937
 
  gtk_signal_connect (GTK_OBJECT (radio3), "clicked",
6938
 
                      GTK_SIGNAL_FUNC (topoz_select_cb), 0);
 
6982
 
6939
6983
 
6940
6984
  tooltips = gtk_tooltips_new ();
6941
6985
  gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), radio1,
6946
6990
                        _
6947
6991
                        ("If selected, you download the map from the U.S. expedia server (expedia.com)"),
6948
6992
                        NULL);
6949
 
  gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), radio3,
6950
 
                        _
6951
 
                        ("If selected, you download the map from the TopoZone Server (US maps only)"),
6952
 
                        NULL);
6953
6993
 
6954
6994
/* disable mapblast */
6955
6995
/*   gtk_widget_set_sensitive (radio1, FALSE); */
6956
6996
/*   defaultserver = 1; */
6957
6997
 
6958
6998
/*   gtk_table_attach_defaults (GTK_TABLE (table), radio2, 1, 2, 5, 6); */
 
6999
  if ((defaultserver < 0) && (defaultserver > 1))
 
7000
    defaultserver = 0;
6959
7001
  switch (defaultserver)
6960
7002
    {
6961
7003
    case 0:
6966
7008
      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio2), TRUE);
6967
7009
      other_select_cb (NULL, 0);
6968
7010
      break;
6969
 
    case 2:
6970
 
      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio3), TRUE);
6971
 
      topoz_select_cb (NULL, 0);
6972
 
      break;
6973
7011
    }
6974
7012
 
6975
7013
  if (!haveproxy)
7029
7067
  gdouble f, nlongi;
7030
7068
  gint ns;
7031
7069
 
7032
 
  float Lat1, Long1, Lat2, Long2, Lat, Long, scale_f;
7033
 
  float *UTMNorthing, *UTMEasting;
7034
 
  int *UTMZone;
7035
 
  char s_zone[6], typ[8], sctext[40];
7036
 
  char Lat1S[20], Long1S[20], Lat2S[20], Long2S[20];
 
7070
  float Lat, Long;
 
7071
  char sctext[40];
7037
7072
 
7038
7073
  if (!downloadwindowactive)
7039
7074
    return TRUE;
7050
7085
      expedia_de = TRUE;
7051
7086
    }
7052
7087
 
7053
 
  if (GTK_TOGGLE_BUTTON (radio3)->active)
7054
 
    topozone = TRUE;
7055
 
  else
7056
 
    topozone = FALSE;
7057
7088
 
7058
7089
 
7059
7090
  s = gtk_entry_get_text (GTK_ENTRY (dltext1));
7086
7117
      else
7087
7118
        g_snprintf (hostname, sizeof (hostname), "%s", WEBSERVER2);
7088
7119
    }
7089
 
  if (topozone)
7090
 
    g_snprintf (hostname, sizeof (hostname), "%s", WEBSERVER3);
7091
 
  if (!expedia && !topozone)
 
7120
 
 
7121
  if (!expedia)
7092
7122
    g_snprintf (hostname, sizeof (hostname), "%s", WEBSERVER);
7093
7123
 
7094
7124
/*   if (expedia) */
7125
7155
 *   http://www.vicinity.com/gif?&CT=45:-93:10000&IC=&W=1024&H=800&FAM=myblast&LB=
7126
7156
 */
7127
7157
 
7128
 
  if (topozone)                 //TopoZone.com supported Added by Russell Harding Jan, 2004
7129
 
    {                           //<hardingr at cunap dot com>
7130
 
      UTMNorthing = malloc (sizeof (float));
7131
 
      UTMEasting = malloc (sizeof (float));
7132
 
      UTMZone = malloc (sizeof (int));
7133
 
      scale_f = atof (sctext);
7134
 
 
7135
 
      LLtoUTM (Lat, Long, UTMNorthing, UTMEasting, UTMZone);
7136
 
 
7137
 
      Lat1 = *UTMNorthing - (1024 * scale_f / PIXELFACT) / 2;
7138
 
      Lat2 = *UTMNorthing + (1024 * scale_f / PIXELFACT) / 2;
7139
 
      Long1 = *UTMEasting - (1280 * scale_f / PIXELFACT) / 2;
7140
 
      Long2 = *UTMEasting + (1280 * scale_f / PIXELFACT) / 2;
7141
 
 
7142
 
      if (*UTMZone >= 10)
7143
 
        g_snprintf (s_zone, sizeof (s_zone), "269%i", *UTMZone);
7144
 
      else
7145
 
        g_snprintf (s_zone, sizeof (s_zone), "2690%i", *UTMZone);
7146
 
 
7147
 
      if (Lat > 50)             //Maps in Alaska have different scales
7148
 
        {
7149
 
          if (scale_f <= 75000)
7150
 
            g_snprintf (typ, sizeof (typ), "DRG50");
7151
 
          else
7152
 
            g_snprintf (typ, sizeof (typ), "DRG250");
7153
 
        }
7154
 
      else                      //Continental U.S.
7155
 
        {
7156
 
          if (scale_f <= 30000)
7157
 
            g_snprintf (typ, sizeof (typ), "DRG25");
7158
 
          if (scale_f > 30000 && scale_f <= 75000)
7159
 
            g_snprintf (typ, sizeof (typ), "DRG100");
7160
 
          if (scale_f > 75000)
7161
 
            g_snprintf (typ, sizeof (typ), "DRG250");
7162
 
        }
7163
 
      g_snprintf (Long1S, sizeof (Long1S), "%f", Long1);
7164
 
      g_strdelimit (Long1S, ",", '.');
7165
 
      g_snprintf (Lat1S, sizeof (Lat1S), "%f", Lat1);
7166
 
      g_strdelimit (Lat1S, ",", '.');
7167
 
      g_snprintf (Long2S, sizeof (Long2S), "%f", Long2);
7168
 
      g_strdelimit (Long2S, ",", '.');
7169
 
      g_snprintf (Lat2S, sizeof (Lat2S), "%f", Lat2);
7170
 
      g_strdelimit (Lat2S, ",", '.');
7171
 
 
7172
 
      g_snprintf (writebuff, sizeof (writebuff),
7173
 
                  "GET http://%s/map.php?map=PNG8|4|%s|%s|%s,%s,%s,%s|1280|1024 HTTP/1.0\r\nUser-Agent: Wget/1.6\r\nHost: %s\r\nAccept: */*\r\nConnection: Keep-Alive\r\n\r\n",
7174
 
                  WEBSERVER3, typ, s_zone, Long1S, Lat1S, Long2S, Lat2S,
7175
 
                  hostname);
7176
 
 
7177
 
      free (UTMNorthing);
7178
 
      free (UTMEasting);
7179
 
      free (UTMZone);
7180
 
    }
7181
 
 
7182
 
  if (!expedia && !topozone)
 
7158
  if (!expedia)
7183
7159
    g_snprintf (writebuff, sizeof (writebuff),
7184
7160
                "GET http://%s/gif?&CT=%s:%s:%s&IC=&W=1280&H=1024&FAM=myblast&LB= HTTP/1.0\r\nUser-Agent: Wget/1.6\r\nHost: %s\r\nAccept: */*\r\nConnection: Keep-Alive\r\n\r\n",
7185
7161
                WEBSERVER, lat, longi, sctext, hostname);
7219
7195
      if (debug)
7220
7196
        printf ("\n%s\n", url);
7221
7197
      p = strstr (url, "Location: ");
 
7198
      if (p == NULL)
 
7199
        {
 
7200
          if (debug)
 
7201
            printf
 
7202
              ("http data error, could not find 'Location:' sub string\n");
 
7203
          return FALSE;
 
7204
        }
7222
7205
      g_strlcpy (url2, (p + 10), sizeof (url2));
7223
7206
      p = strstr (url2, "\n");
 
7207
      if (p == NULL)
 
7208
        {
 
7209
          if (debug)
 
7210
            printf ("http data error, could not find new line\n");
 
7211
          return FALSE;
 
7212
        }
 
7213
 
7224
7214
      url2[p - url2] = 0;
7225
7215
      if (debug)
7226
7216
        printf ("\n**********\n%s\n", url2);
7227
7217
      g_strlcpy (hn, (url2 + 7), sizeof (hn));
7228
7218
      p = strstr (hn, "/");
 
7219
      if (p == NULL)
 
7220
        {
 
7221
          if (debug)
 
7222
            printf ("http request error, could not find forward slash\n");
 
7223
          return FALSE;
 
7224
        }
 
7225
 
7229
7226
      hn[p - hn] = 0;
7230
7227
      g_strlcpy (url, (url2 + strlen (hn) + 7), sizeof (url));
7231
7228
      url[strlen (url) - 1] = 0;
7232
7229
      g_strlcpy (actualhostname, hn, sizeof (actualhostname));
7233
7230
      if (debug)
7234
7231
        printf ("\nhn: %s, url: %s", hn, url);
7235
 
      g_snprintf (url2, sizeof (url2), "GET %s HTTP/1.1\r\n", url);
 
7232
      
 
7233
      if(haveproxy==TRUE)
 
7234
        {
 
7235
                // Format the GET request correctly for the proxy server
 
7236
                g_snprintf (url2, sizeof (url2), "GET http://%s/%s HTTP/1.1\r\n", hn,url);
 
7237
        }
 
7238
        else
 
7239
        {
 
7240
                g_snprintf (url2, sizeof (url2), "GET %s HTTP/1.1\r\n", url);
 
7241
        }
 
7242
      
7236
7243
      g_strlcat (url2, "Host: ", sizeof (url2));
7237
7244
      g_strlcat (url2, hn, sizeof (url2));
7238
7245
      g_strlcat (url2, "\r\n", sizeof (url2));
7376
7383
 
7377
7384
  downloadfilelen = 0;
7378
7385
  downloadactive = TRUE;
7379
 
  if (!expedia && !topozone)
 
7386
  if (!expedia)
7380
7387
    g_snprintf (str, sizeof (str), _("Connecting to %s"), WEBSERVER);
7381
7388
  if (expedia)
7382
7389
    {
7385
7392
      else
7386
7393
        g_snprintf (str, sizeof (str), _("Connecting to %s"), WEBSERVER2);
7387
7394
    }
7388
 
  if (topozone)
7389
 
    g_snprintf (str, sizeof (str), _("Connecting to %s"), WEBSERVER3);
 
7395
 
7390
7396
  gtk_statusbar_pop (GTK_STATUSBAR (status), statusid);
7391
7397
  gtk_statusbar_push (GTK_STATUSBAR (status), statusid, str);
7392
7398
  while (gtk_events_pending ())
7395
7401
  if ((dlsock = socket (AF_INET, SOCK_STREAM, 0)) < 0)
7396
7402
    {
7397
7403
      perror (_("can't open socket for port 80"));
7398
 
      if (!expedia && !topozone)
 
7404
      if (!expedia)
7399
7405
        g_snprintf (str, sizeof (str), _("Connecting to %s FAILED!"),
7400
7406
                    WEBSERVER);
7401
7407
      if (expedia)
7407
7413
            g_snprintf (str, sizeof (str), _("Connecting to %s FAILED!"),
7408
7414
                        WEBSERVER2);
7409
7415
        }
7410
 
      if (topozone)
7411
 
        g_snprintf (str, sizeof (str), _("Connecting to %s FAILED!"),
7412
 
                    WEBSERVER3);
 
7416
 
7413
7417
      gtk_statusbar_pop (GTK_STATUSBAR (status), statusid);
7414
7418
      gtk_statusbar_push (GTK_STATUSBAR (status), statusid, str);
7415
7419
      gtk_widget_destroy (downloadwindow);
7430
7434
          else
7431
7435
            g_strlcpy (sn, WEBSERVER2, sizeof (sn));
7432
7436
        }
7433
 
      if (topozone)
7434
 
        g_strlcpy (sn, WEBSERVER3, sizeof (sn));
7435
 
      if (!expedia && !topozone)
 
7437
 
 
7438
      if (!expedia)
7436
7439
        g_strlcpy (sn, WEBSERVER, sizeof (sn));
7437
7440
    }
7438
7441
 
7439
 
  if (expedia)
 
7442
  if (expedia==TRUE && haveproxy==FALSE)
7440
7443
    g_strlcpy (sn, actualhostname, sizeof (sn));
7441
7444
 
7442
7445
  if ((server_data = gethostbyname (sn)) == NULL)
7443
7446
    {
7444
7447
      perror (_("Can't resolve webserver address"));
7445
 
      if (!expedia && !topozone)
 
7448
      if (!expedia)
7446
7449
        g_snprintf (str, sizeof (str), _("Connecting to %s FAILED!"),
7447
7450
                    WEBSERVER);
7448
7451
      if (expedia)
7454
7457
            g_snprintf (str, sizeof (str), _("Connecting to %s FAILED!"),
7455
7458
                        WEBSERVER2);
7456
7459
        }
7457
 
      if (topozone)
7458
 
        g_snprintf (str, sizeof (str), _("Connecting to %s FAILED!"),
7459
 
                    WEBSERVER3);
 
7460
 
7460
7461
      gtk_statusbar_pop (GTK_STATUSBAR (status), statusid);
7461
7462
      gtk_statusbar_push (GTK_STATUSBAR (status), statusid, str);
7462
7463
      gtk_widget_destroy (downloadwindow);
7469
7470
  if (connect (dlsock, (struct sockaddr *) &server, sizeof server) < 0)
7470
7471
    {
7471
7472
      perror (_("unable to connect to Website"));
7472
 
      if (!expedia && !topozone)
 
7473
      if (!expedia)
7473
7474
        g_snprintf (str, sizeof (str), _("Connecting to %s FAILED!"),
7474
7475
                    WEBSERVER);
7475
7476
      if (expedia)
7481
7482
            g_snprintf (str, sizeof (str), _("Connecting to %s FAILED!"),
7482
7483
                        WEBSERVER2);
7483
7484
        }
7484
 
      if (topozone)
7485
 
        g_snprintf (str, sizeof (str), _("Connecting to %s FAILED!"),
7486
 
                    WEBSERVER3);
 
7485
 
7487
7486
      gtk_statusbar_pop (GTK_STATUSBAR (status), statusid);
7488
7487
      gtk_statusbar_push (GTK_STATUSBAR (status), statusid, str);
7489
7488
      gtk_widget_destroy (downloadwindow);
7495
7494
  dlbuff = g_new0 (gchar, 8192);
7496
7495
  dlpstart = NULL;
7497
7496
  dldiff = dlcount = 0;
7498
 
  if (!expedia && !topozone)
 
7497
  if (!expedia)
7499
7498
    g_snprintf (str, sizeof (str), _("Now connected to %s"), WEBSERVER);
7500
7499
  if (expedia)
7501
7500
    {
7504
7503
      else
7505
7504
        g_snprintf (str, sizeof (str), _("Now connected to %s"), WEBSERVER2);
7506
7505
    }
7507
 
  if (topozone)
7508
 
    g_snprintf (str, sizeof (str), _("Now connected to %s"), WEBSERVER3);
 
7506
 
7509
7507
  gtk_statusbar_pop (GTK_STATUSBAR (status), statusid);
7510
7508
  gtk_statusbar_push (GTK_STATUSBAR (status), statusid, str);
7511
7509
  gtk_timeout_add (100, (GtkFunction) downloadslave_cb, widget);
7593
7591
        }
7594
7592
      if ((e == 0) || ((downloadfilelen + dldiff) == dlcount))
7595
7593
        {
7596
 
          if (topozone && dlcount < 10000)
7597
 
            downloadfilelen = 0;        //Data Unavailable
 
7594
 
7598
7595
          if (downloadfilelen == 0)
7599
7596
            g_snprintf (str, sizeof (str), _("Download FAILED!"));
7600
7597
          else
8881
8878
        }
8882
8879
    }
8883
8880
 
 
8881
/*   From Russell Mirov: */
 
8882
  if (pdamode)
 
8883
    {
 
8884
      if (event->keyval == 0xFF52)
 
8885
        scalerbt_cb (NULL, 1);  /* RNM */
 
8886
      if (event->keyval == 0xFF54)
 
8887
        scalerbt_cb (NULL, 2);  /* RNM */
 
8888
    }
 
8889
 
 
8890
 
8884
8891
  return 0;
8885
8892
}
8886
8893
 
8887
 
/* does not work */
8888
8894
gint
8889
 
mapclick_cb (GtkWidget * widget, GdkEventMotion * event)
 
8895
mapclick_cb (GtkWidget * widget, GdkEventButton * event)
8890
8896
{
8891
8897
  gint x, y;
8892
8898
  gdouble lon, lat, vali;
8895
8901
 
8896
8902
/*   printf("\n bin in mapclick\n"); */
8897
8903
 
8898
 
  if (event->is_hint)
 
8904
  if (event->button)
8899
8905
    gdk_window_get_pointer (event->window, &x, &y, &state);
8900
8906
  else
8901
8907
    {
10386
10392
 
10387
10393
  lt = gmtime (&gmt_time);
10388
10394
  local_time = mktime (lt);
10389
 
  zone = (gmt_time - local_time) / 3600;
 
10395
  zone = lt->tm_isdst + (gmt_time - local_time) / 3600;
10390
10396
/*   fprintf(stderr,"\n zeitzone: %d\n",zone); */
10391
10397
 
10392
10398
/*   zone = st->tm_gmtoff / 3600; */
10494
10500
        handle =
10495
10501
          dlopen ("@PREFIX@/lib/mysql/libmysqlclient.10.dylib", RTLD_LAZY);
10496
10502
      if (!handle)
 
10503
        handle = dlopen ("/usr/lib/libmysqlclient.so", RTLD_LAZY);
 
10504
      if (!handle)
10497
10505
        handle = dlopen ("libmysqlclient.so", RTLD_LAZY);
10498
10506
      if (!handle)
10499
 
        handle = dlopen ("libmysqlclient.so.15", RTLD_LAZY);
10500
 
      if (!handle)
10501
 
        handle = dlopen ("/opt/lib/mysql/libmysqlclient.so.15", RTLD_LAZY);
10502
 
      if (!handle)
10503
 
        handle = dlopen ("/opt/mysql/lib/libmysqlclient.so.15", RTLD_LAZY);
10504
 
      if (!handle)
10505
 
        handle = dlopen ("/usr/lib/mysql/libmysqlclient.so.15", RTLD_LAZY);
10506
 
      if (!handle)
10507
 
        handle = dlopen ("/usr/lib/libmysqlclient.so.15", RTLD_LAZY);
 
10507
        handle = dlopen ("libmysqlclient.so.10", RTLD_LAZY);
 
10508
      if (!handle)
 
10509
        handle = dlopen ("/opt/lib/mysql/libmysqlclient.so.10", RTLD_LAZY);
 
10510
      if (!handle)
 
10511
        handle = dlopen ("/opt/mysql/lib/libmysqlclient.so.10", RTLD_LAZY);
 
10512
      if (!handle)
 
10513
        handle = dlopen ("/usr/lib/mysql/libmysqlclient.so.10", RTLD_LAZY);
 
10514
      if (!handle)
 
10515
        handle = dlopen ("/usr/lib/libmysqlclient.so.10", RTLD_LAZY);
10508
10516
      if (!handle)
10509
10517
        handle =
10510
 
          dlopen ("/usr/local/lib/mysql/libmysqlclient.so.15", RTLD_LAZY);
10511
 
      if (!handle)
10512
 
        handle = dlopen ("/usr/local/mysql/libmysqlclient.so.15", RTLD_LAZY);
10513
 
      if (!handle)
10514
 
        handle = dlopen ("/usr/local/lib/libmysqlclient.so.15", RTLD_LAZY);
 
10518
          dlopen ("/usr/local/lib/mysql/libmysqlclient.so.10", RTLD_LAZY);
 
10519
      if (!handle)
 
10520
        handle = dlopen ("/usr/local/mysql/libmysqlclient.so.10", RTLD_LAZY);
 
10521
      if (!handle)
 
10522
        handle = dlopen ("/usr/local/lib/libmysqlclient.so.10", RTLD_LAZY);
10515
10523
      if (!handle)
10516
10524
        handle = dlopen ("/sw/lib/libmysqlclient.dylib", RTLD_LAZY);
10517
10525