diff options
author | zhuyaliang <[email protected]> | 2019-06-11 10:44:58 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-14 12:05:04 +0200 |
commit | dddc42521483fe8f686050d8326c0720e6562046 (patch) | |
tree | 1f6b44022520557375747d5f8466df71180f22a4 /capplets/time-admin/src | |
parent | 8f247df3e36d8c34baa31f1448db67c9028b2d9d (diff) | |
download | mate-control-center-dddc42521483fe8f686050d8326c0720e6562046.tar.bz2 mate-control-center-dddc42521483fe8f686050d8326c0720e6562046.tar.xz |
Display the correct time when selecting the time zone
Diffstat (limited to 'capplets/time-admin/src')
-rw-r--r-- | capplets/time-admin/src/main.c | 2 | ||||
-rw-r--r-- | capplets/time-admin/src/time-map.c | 9 | ||||
-rw-r--r-- | capplets/time-admin/src/time-share.c | 2 | ||||
-rw-r--r-- | capplets/time-admin/src/time-zone.c | 14 |
4 files changed, 8 insertions, 19 deletions
diff --git a/capplets/time-admin/src/main.c b/capplets/time-admin/src/main.c index a29cb89e..14ef2917 100644 --- a/capplets/time-admin/src/main.c +++ b/capplets/time-admin/src/main.c @@ -156,7 +156,7 @@ static int RecordPid(void) ******************************************************************************/ static gboolean ProcessRuning(void) { - int fd = 0; + int fd; int pid = 0; gboolean Run = FALSE; char ReadBuf[30] = { 0 }; diff --git a/capplets/time-admin/src/time-map.c b/capplets/time-admin/src/time-map.c index 2d86660e..cdda5577 100644 --- a/capplets/time-admin/src/time-map.c +++ b/capplets/time-admin/src/time-map.c @@ -535,15 +535,6 @@ timezone_map_class_init (TimezoneMapClass *klass) g_cclosure_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); -/* - signals[LOCATION_CHANGED] = g_signal_new ("location-changed", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - 0, - NULL,NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); -*/ } static void diff --git a/capplets/time-admin/src/time-share.c b/capplets/time-admin/src/time-share.c index 12bd8801..e3ae18bb 100644 --- a/capplets/time-admin/src/time-share.c +++ b/capplets/time-admin/src/time-share.c @@ -145,7 +145,7 @@ void SetTooltip(GtkWidget*box,gboolean mode) if(!mode) { gtk_widget_set_tooltip_markup(box, - _("Network time synchronization has been set up.prohibit Modification Time")); + _("Network time synchronization has been set up. Manual time/date setting is disabled.")); } else { diff --git a/capplets/time-admin/src/time-zone.c b/capplets/time-admin/src/time-zone.c index dfb86f3b..8f58e755 100644 --- a/capplets/time-admin/src/time-zone.c +++ b/capplets/time-admin/src/time-zone.c @@ -220,13 +220,6 @@ static GtkWidget *GetTimeZoneMap(TimeAdmin *ta) g_autoptr(GtkEntryCompletion) completion = NULL; map = (GtkWidget *) timezone_map_new (); - /* - g_signal_connect_object (map, - "location-changed", - G_CALLBACK (LocationChanged), - map, - G_CONNECT_SWAPPED); - */ g_signal_connect (map, "location-changed", G_CALLBACK (LocationChanged), @@ -269,6 +262,8 @@ static void update_timezone (TimezoneMap *map) { g_autofree gchar *bubble_text = NULL; + g_autoptr(GDateTime) current_date = NULL; + g_autoptr(GTimeZone) timezone = NULL; g_autofree gchar *city_country = NULL; g_autofree gchar *utc_label = NULL; g_autofree gchar *time_label = NULL; @@ -276,10 +271,13 @@ update_timezone (TimezoneMap *map) TzLocation *current_location; GDateTime *date; - date = g_date_time_new_now_local (); current_location = timezone_map_get_location (TIMEZONEMAP (map)); city_country = translated_city_name (current_location); + timezone = g_time_zone_new (current_location->zone); + current_date = g_date_time_new_now_local (); + date = g_date_time_to_timezone (current_date, timezone); + utc_label = g_date_time_format (date, _("UTC%:::z")); tz_desc = g_strdup_printf ( "%s (%s)", |