X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=gps-tracker.c;h=7d7761d2c55edf48d6b86bf32598047ed32cc6e3;hb=e35d2c2c815a31bddfe91336bae75dd0ed092bf9;hp=3499a8e2781a465df8a8ba649b0cb890fee3fbf5;hpb=a942a375486ac5b28d397adb2de6eadbec4c1ff1;p=gps-tracker diff --git a/gps-tracker.c b/gps-tracker.c index 3499a8e..7d7761d 100644 --- a/gps-tracker.c +++ b/gps-tracker.c @@ -6,6 +6,8 @@ #include #include +static GtkWidget *window = NULL; + static void on_gps_device_changed (LocationGPSDevice *device, gpointer data) { @@ -65,6 +67,9 @@ on_gps_device_changed (LocationGPSDevice *device, gpointer data) g_print ("Satellites in use: %d\n", device->satellites_in_use); g_print ("GPS status: %d\n", device->status); + hildon_gtk_window_set_progress_indicator(GTK_WINDOW(window), device->status == LOCATION_GPS_DEVICE_STATUS_NO_FIX); + + if (device->cell_info) { if (device->cell_info->flags & LOCATION_CELL_INFO_GSM_CELL_INFO_SET) g_print ("Mobile Coutry Code GSM: %d\n", device->cell_info->gsm_cell_info.mcc); @@ -99,10 +104,10 @@ on_gps_start (LocationGPSDevice *device, gpointer data) int main (int argc, char **argv) { HildonProgram *program = NULL; - GtkWidget *window = NULL; GtkWidget *picker_button = NULL; GtkVBox *vbox; GtkWidget *status_label; + GtkButton *start_button; hildon_gtk_init (&argc, &argv); LocationGPSDControl *control; @@ -114,7 +119,7 @@ int main (int argc, char **argv) window = hildon_stackable_window_new (); hildon_program_add_window (program, HILDON_WINDOW (window)); - vbox = (void*)gtk_vbox_new(TRUE, 8); + vbox = (void*)gtk_vbox_new(FALSE, 0); /* Create a picker button */ picker_button = hildon_date_button_new (HILDON_SIZE_AUTO, @@ -123,7 +128,10 @@ int main (int argc, char **argv) /* Set a title to the button*/ hildon_button_set_title (HILDON_BUTTON (picker_button), "Pick a date"); - gtk_box_pack_start(GTK_BOX(vbox), picker_button, FALSE, FALSE, 0); + start_button = GTK_BUTTON (hildon_gtk_button_new (HILDON_SIZE_THUMB_HEIGHT)); + gtk_button_set_label (start_button, "Start"); + gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(start_button), FALSE, FALSE, 8); + gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(picker_button), FALSE, FALSE, 0); status_label = gtk_label_new("Hier kommt der Status hin\nUnd hier ist die 2. Zeile"); gtk_box_pack_start_defaults(GTK_BOX(vbox), status_label); /* Add vbox to main window */ @@ -133,6 +141,7 @@ int main (int argc, char **argv) G_CALLBACK (gtk_main_quit), NULL); control = location_gpsd_control_get_default (); + hildon_banner_show_information(GTK_WIDGET(window), NULL, "Hi there!"); location_gpsd_control_start (control); /* @@ -155,6 +164,7 @@ int main (int argc, char **argv) gtk_widget_show_all (GTK_WIDGET (window)); + hildon_gtk_window_set_progress_indicator(GTK_WINDOW(window), 1); gtk_main (); location_gpsd_control_stop (control);