[gnome-control-center] datetime: Change combobox when map is clicked



commit 0d2903f1c4768052f0670ae65d7ce1dada515cf9
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Mar 11 13:01:23 2011 +0000

    datetime: Change combobox when map is clicked
    
    https://bugzilla.redhat.com/show_bug.cgi?id=684072

 panels/datetime/cc-datetime-panel.c |   39 ++++++++++++++++++++++++----------
 1 files changed, 27 insertions(+), 12 deletions(-)
---
diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c
index 3270361..ce82778 100644
--- a/panels/datetime/cc-datetime-panel.c
+++ b/panels/datetime/cc-datetime-panel.c
@@ -339,18 +339,6 @@ change_date (CcDateTimePanel *self)
 }
 
 static void
-location_changed_cb (CcTimezoneMap   *map,
-                     TzLocation      *location,
-                     CcDateTimePanel *self)
-{
-  g_debug ("location changed");
-
-  self->priv->current_location = location;
-
-  queue_set_timezone (self);
-}
-
-static void
 region_changed_cb (GtkComboBox     *box,
                    CcDateTimePanel *self)
 {
@@ -455,6 +443,33 @@ update_timezone (CcDateTimePanel *self)
 }
 
 static void
+location_changed_cb (CcTimezoneMap   *map,
+                     TzLocation      *location,
+                     CcDateTimePanel *self)
+{
+  CcDateTimePanelPrivate *priv = self->priv;
+  GtkWidget *region_combo, *city_combo;
+
+  g_debug ("location changed to %s/%s", location->country, location->zone);
+
+  self->priv->current_location = location;
+
+  /* Update the combo boxes */
+  region_combo = W("region_combobox");
+  city_combo = W("city_combobox");
+
+  g_signal_handlers_block_by_func (region_combo, region_changed_cb, self);
+  g_signal_handlers_block_by_func (city_combo, city_changed_cb, self);
+
+  update_timezone (self);
+
+  g_signal_handlers_unblock_by_func (region_combo, region_changed_cb, self);
+  g_signal_handlers_unblock_by_func (city_combo, city_changed_cb, self);
+
+  queue_set_timezone (self);
+}
+
+static void
 get_timezone_cb (CcDateTimePanel *self,
                  const gchar     *timezone,
                  GError          *error)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]