datetime: add detection of location from map clicks

This commit is contained in:
Thomas Wood 2010-06-25 17:36:14 +01:00
parent 1d60affa61
commit 26ae0134cf
6 changed files with 587 additions and 8 deletions

View file

@ -178,6 +178,18 @@ apply_button_clicked_cb (GtkButton *button,
}
static void
location_changed_cb (CcTimezoneMap *map,
TzLocation *location,
CcDateTimePanel *self)
{
GtkWidget *label;
label = (GtkWidget *) gtk_builder_get_object (self->priv->builder,
"label_current_location");
gtk_label_set_text (GTK_LABEL (label), location->zone);
}
static void
cc_date_time_panel_init (CcDateTimePanel *self)
{
@ -205,6 +217,8 @@ cc_date_time_panel_init (CcDateTimePanel *self)
}
widget = (GtkWidget *) cc_timezone_map_new ();
g_signal_connect (widget, "location-changed",
G_CALLBACK (location_changed_cb), self);
gtk_widget_show (widget);
gtk_container_add (GTK_CONTAINER (gtk_builder_get_object (priv->builder,