2 * This file is part of mapper
4 * Copyright (C) 2007 Kaj-Michael Lang
5 * Copyright (C) 2006-2007 John Costigan.
7 * POI and GPS-Info code originally written by Cezary Jackiewicz.
9 * Default map data provided by http://www.openstreetmap.org/
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
32 #include <glib/gstdio.h>
33 #include <glib/gi18n.h>
36 #include <dbus/dbus-glib.h>
40 #include "hildon-mapper.h"
42 static GtkWidget *connect_banner = NULL;
43 static GtkWidget *fix_banner = NULL;
49 #include "ui-common.h"
53 * Set the connection state. This function controls all connection-related banners.
56 gps_conn_set_state(Gps *gps, GpsConnState new_conn_state)
58 switch (gps->io.conn=new_conn_state) {
60 set_action_activate("gps_enabled", FALSE);
63 gtk_widget_destroy(connect_banner);
67 gtk_widget_destroy(fix_banner);
71 gtk_progress_bar_set_text(_progress_item, "");
72 gtk_progress_bar_set_fraction(_progress_item, 0.0);
77 gtk_widget_destroy(fix_banner);
81 connect_banner=hildon_banner_show_animation(_window, NULL, _("Searching for GPS receiver"));
85 gtk_widget_destroy(connect_banner);
89 fix_banner=hildon_banner_show_progress(_window, NULL, _("Establishing GPS fix"));
91 default:; /* to quell warning. */
96 gps_conn_set_progress(Gps *gps, gdouble fix)
99 hildon_banner_set_fraction(fix_banner, fix);
101 gtk_progress_bar_set_fraction(_progress_item, fix);