Merge lp:~xnox/indicator-datetime/clickanywhere into lp:indicator-datetime/13.04

Proposed by Dimitri John Ledkov
Status: Rejected
Rejected by: Mathieu Trudel-Lapierre
Proposed branch: lp:~xnox/indicator-datetime/clickanywhere
Merge into: lp:indicator-datetime/13.04
Diff against target: 146 lines (+56/-6) (has conflicts)
4 files modified
data/com.canonical.indicator.datetime.gschema.xml (+14/-0)
debian/changelog (+4/-0)
src/datetime-prefs.c (+36/-6)
src/settings-shared.h (+2/-0)
Text conflict in debian/changelog
To merge this branch: bzr merge lp:~xnox/indicator-datetime/clickanywhere
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Disapprove
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+155994@code.launchpad.net

Commit message

Set a pin point based on the selected town instead of closest timezone (LP: #892370)

Description of the change

Set a pin point based on the selected town instead of closest timezone (LP: #892370)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

rejected as requested.

review: Disapprove

Unmerged revisions

214. By Dimitri John Ledkov

Set a pin point based on the selected town instead of closest timezone

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/com.canonical.indicator.datetime.gschema.xml'
--- data/com.canonical.indicator.datetime.gschema.xml 2012-07-13 15:52:55 +0000
+++ data/com.canonical.indicator.datetime.gschema.xml 2013-03-28 15:30:34 +0000
@@ -114,5 +114,19 @@
114 Some timezones can be known by many different cities or names. This setting describes how the current zone prefers to be named. Format is "TIMEZONE NAME" (e.g. "America/New_York Boston" to name the New_York zone Boston).114 Some timezones can be known by many different cities or names. This setting describes how the current zone prefers to be named. Format is "TIMEZONE NAME" (e.g. "America/New_York Boston" to name the New_York zone Boston).
115 </description>115 </description>
116 </key>116 </key>
117 <key name="location-longitude" type="d">
118 <default>0.0</default>
119 <summary>The longitude of the current location</summary>
120 <description>
121 Some timezones can be known by many different cities or names. This setting describes the longitudinal component of the coordinate for the location in timezone-name above.
122 </description>
123 </key>
124 <key name="location-latitude" type="d">
125 <default>0.0</default>
126 <summary>The latitude of the current location</summary>
127 <description>
128 Some timezones can be known by many different cities or names. This setting describes the latitudinal component of the coordinate for the location in timezone-name above.
129 </description>
130 </key>
117 </schema>131 </schema>
118</schemalist>132</schemalist>
119133
=== modified file 'debian/changelog'
--- debian/changelog 2013-03-28 12:44:47 +0000
+++ debian/changelog 2013-03-28 15:30:34 +0000
@@ -1,4 +1,8 @@
1<<<<<<< TREE
1indicator-datetime (12.10.3daily13.03.26-0ubuntu1) raring; urgency=low2indicator-datetime (12.10.3daily13.03.26-0ubuntu1) raring; urgency=low
3=======
4indicator-datetime (12.10.3daily13.03.27-0ubuntu1) UNRELEASED; urgency=low
5>>>>>>> MERGE-SOURCE
26
3 * Use systemd's service backend, ffe lp: #11535677 * Use systemd's service backend, ffe lp: #1153567
4 * debian/control: depends on systemd-services and systemd-shim8 * debian/control: depends on systemd-services and systemd-shim
59
=== modified file 'src/datetime-prefs.c'
--- src/datetime-prefs.c 2013-03-26 20:42:11 +0000
+++ src/datetime-prefs.c 2013-03-28 15:30:34 +0000
@@ -220,18 +220,30 @@
220}220}
221221
222static void222static void
223sync_location (IndicatorDatetimePanel * self, const gchar * en_name)
224{
225 gtk_entry_set_text (GTK_ENTRY (self->priv->tz_entry), en_name);
226 gtk_entry_set_icon_from_stock (GTK_ENTRY (self->priv->tz_entry),
227 GTK_ENTRY_ICON_SECONDARY, NULL);
228
229 GSettings * conf = g_settings_new (SETTINGS_INTERFACE);
230 g_settings_set_string (conf, SETTINGS_TIMEZONE_NAME_S, en_name);
231}
232
233static void
223tz_changed (CcTimezoneMap * map, CcTimezoneLocation * location, IndicatorDatetimePanel * self)234tz_changed (CcTimezoneMap * map, CcTimezoneLocation * location, IndicatorDatetimePanel * self)
224{235{
225 if (location == NULL)236 if (location == NULL)
226 return;237 return;
227238
228 gchar * zone;239 gchar * zone, * name;
229 g_object_get (location, "zone", &zone, NULL);240 g_object_get (location, "zone", &zone, NULL);
241 g_object_get (location, "en_name", &name, NULL);
230242
231 g_dbus_proxy_call (self->priv->proxy, "SetTimezone", g_variant_new ("(sb)", zone, TRUE),243 g_dbus_proxy_call (self->priv->proxy, "SetTimezone", g_variant_new ("(sb)", zone, TRUE),
232 G_DBUS_CALL_FLAGS_NONE, -1, NULL, dbus_set_answered, "timezone");244 G_DBUS_CALL_FLAGS_NONE, -1, NULL, dbus_set_answered, "timezone");
233245
234 sync_entry (self, zone);246 sync_location (self, name);
235247
236 g_free (zone);248 g_free (zone);
237}249}
@@ -278,7 +290,25 @@
278 {290 {
279 const gchar *timezone = g_variant_get_string (value, NULL);291 const gchar *timezone = g_variant_get_string (value, NULL);
280292
281 cc_timezone_map_set_timezone (priv->tzmap, timezone);293 GSettings * conf = g_settings_new (SETTINGS_INTERFACE);
294 gdouble lon = g_settings_get_double(conf, SETTINGS_LOCATION_LONGITUDE);
295 gdouble lat = g_settings_get_double(conf, SETTINGS_LOCATION_LATITUDE);
296 gchar * saved_tz = g_settings_get_string (conf, SETTINGS_TIMEZONE_NAME_S);
297 gchar * saved_zone, * saved_name;
298
299 split_settings_location (saved_tz, &saved_zone, &saved_name);
300
301 if (g_strcmp0 (saved_zone, timezone) == 0) {
302 cc_timezone_map_set_location (self->priv->tzmap, lon, lat);
303 } else {
304 cc_timezone_map_set_timezone (self->priv->tzmap, timezone);
305 }
306
307 g_free (saved_tz);
308 g_free (saved_zone);
309 g_free (saved_name);
310 g_object_unref (conf);
311
282 sync_entry (self, timezone);312 sync_entry (self, timezone);
283 g_signal_connect (priv->tzmap, "location-changed", G_CALLBACK (tz_changed), self);313 g_signal_connect (priv->tzmap, "location-changed", G_CALLBACK (tz_changed), self);
284 }314 }
@@ -572,6 +602,7 @@
572 GtkTreeIter * iter, IndicatorDatetimePanel * self)602 GtkTreeIter * iter, IndicatorDatetimePanel * self)
573{603{
574 const gchar * name, * zone;604 const gchar * name, * zone;
605 gdouble lon = 0.0, lat = 0.0;
575606
576 gtk_tree_model_get (model, iter,607 gtk_tree_model_get (model, iter,
577 CC_TIMEZONE_COMPLETION_NAME, &name,608 CC_TIMEZONE_COMPLETION_NAME, &name,
@@ -580,7 +611,6 @@
580611
581 if (zone == NULL || zone[0] == 0) {612 if (zone == NULL || zone[0] == 0) {
582 const gchar * strlon, * strlat;613 const gchar * strlon, * strlat;
583 gdouble lon = 0.0, lat = 0.0;
584614
585 gtk_tree_model_get (model, iter,615 gtk_tree_model_get (model, iter,
586 CC_TIMEZONE_COMPLETION_LONGITUDE, &strlon,616 CC_TIMEZONE_COMPLETION_LONGITUDE, &strlon,
@@ -598,14 +628,14 @@
598 zone = cc_timezone_map_get_timezone_at_coords (self->priv->tzmap, lon, lat);628 zone = cc_timezone_map_get_timezone_at_coords (self->priv->tzmap, lon, lat);
599 }629 }
600630
631 cc_timezone_map_set_location (self->priv->tzmap, lon, lat);
632
601 GSettings * conf = g_settings_new (SETTINGS_INTERFACE);633 GSettings * conf = g_settings_new (SETTINGS_INTERFACE);
602 gchar * tz_name = g_strdup_printf ("%s %s", zone, name);634 gchar * tz_name = g_strdup_printf ("%s %s", zone, name);
603 g_settings_set_string (conf, SETTINGS_TIMEZONE_NAME_S, tz_name);635 g_settings_set_string (conf, SETTINGS_TIMEZONE_NAME_S, tz_name);
604 g_free (tz_name);636 g_free (tz_name);
605 g_object_unref (conf);637 g_object_unref (conf);
606638
607 cc_timezone_map_set_timezone (self->priv->tzmap, zone);
608
609 return FALSE; // Do normal action too639 return FALSE; // Do normal action too
610}640}
611641
612642
=== modified file 'src/settings-shared.h'
--- src/settings-shared.h 2012-05-17 20:46:42 +0000
+++ src/settings-shared.h 2013-03-28 15:30:34 +0000
@@ -36,6 +36,8 @@
36#define SETTINGS_SHOW_DETECTED_S "show-auto-detected-location"36#define SETTINGS_SHOW_DETECTED_S "show-auto-detected-location"
37#define SETTINGS_LOCATIONS_S "locations"37#define SETTINGS_LOCATIONS_S "locations"
38#define SETTINGS_TIMEZONE_NAME_S "timezone-name"38#define SETTINGS_TIMEZONE_NAME_S "timezone-name"
39#define SETTINGS_LOCATION_LONGITUDE "location-longitude"
40#define SETTINGS_LOCATION_LATITUDE "location-latitude"
3941
40enum {42enum {
41 SETTINGS_TIME_LOCALE = 0,43 SETTINGS_TIME_LOCALE = 0,

Subscribers

People subscribed via source and target branches