+
#include "interface.h"
#include <hildon/hildon.h>
ui->longitude_value_label = lon_val_label;
ui->altitude_value_label = alt_val_label;
ui->speed_value_label = speed_val_label;
-// ui->fix_status_label = fix_status_val_label;
+ ui->fix_status_label = fix_status_val_label;
gtk_widget_show_all (main_win);
#include "app_data.h"
#include "loc_data.h"
-
+#include <stdio.h>
void on_error(LocationGPSDControl *control, LocationGPSDControlError error, gpointer data)
{
g_debug("location error: %d... quitting", error);
void on_changed(LocationGPSDevice *device, gpointer data)
{
+ printf("asd");
if (!device)
return;
-
+
if (device->fix) {
if (device->fix->fields & LOCATION_GPS_DEVICE_LATLONG_SET) {
AppData *app_data = (AppData *) data;
gchar *tmp_str = (gchar *) g_malloc (25);
+ gchar *no_data = "-";
g_sprintf(tmp_str,"%f", device->fix->latitude);
gtk_label_set_text( GTK_LABEL(app_data->main_ui->latitude_value_label), tmp_str );
if (device->fix->fields & LOCATION_GPS_DEVICE_ALTITUDE_SET) {
g_sprintf(tmp_str,"%f", device->fix->altitude);
gtk_label_set_text( GTK_LABEL(app_data->main_ui->altitude_value_label), tmp_str );
- }
+ } else
+ gtk_label_set_text( GTK_LABEL(app_data->main_ui->altitude_value_label), no_data );
+
if (device->fix->fields & LOCATION_GPS_DEVICE_SPEED_SET) {
g_sprintf(tmp_str,"%f", device->fix->speed);
gtk_label_set_text( GTK_LABEL(app_data->main_ui->speed_value_label), tmp_str );
- }
+ } else
+ gtk_label_set_text( GTK_LABEL(app_data->main_ui->altitude_value_label), no_data );
switch(device->fix->mode) {
case LOCATION_GPS_DEVICE_MODE_NOT_SEEN:
g_sprintf(tmp_str,"%s", "Bho");
}
-
gtk_label_set_text( GTK_LABEL(app_data->main_ui->fix_status_label), tmp_str );
- g_debug("lat = %f, long = %f", device->fix->latitude, device->fix->longitude);
-
g_free(tmp_str);
}
}