From ecd294fa2b9277bec0d3e1c2c979bddc2333f0f8 Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Fri, 5 Aug 2011 13:18:52 -0400 Subject: Spell out "and" to match other System Settings panels --- data/datetime-dialog.ui | 2 +- data/indicator-datetime-preferences.desktop.in | 2 +- src/datetime-service.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/datetime-dialog.ui b/data/datetime-dialog.ui index 59d6753..c7729b3 100644 --- a/data/datetime-dialog.ui +++ b/data/datetime-dialog.ui @@ -414,7 +414,7 @@ True False 1 - _Time & Date + _Time and Date True diff --git a/data/indicator-datetime-preferences.desktop.in b/data/indicator-datetime-preferences.desktop.in index 226ae67..7e933c3 100644 --- a/data/indicator-datetime-preferences.desktop.in +++ b/data/indicator-datetime-preferences.desktop.in @@ -1,7 +1,7 @@ [Desktop Entry] Version=1.0 -_Name=Time & Date +_Name=Time and Date _Comment=Change your clock and date settings Icon=preferences-system-time diff --git a/src/datetime-service.c b/src/datetime-service.c index 6c876aa..8897046 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -1110,7 +1110,7 @@ build_menus (DbusmenuMenuitem * root) dbusmenu_menuitem_child_append(root, separator); settings = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set (settings, DBUSMENU_MENUITEM_PROP_LABEL, _("Time & Date Settings...")); + dbusmenu_menuitem_property_set (settings, DBUSMENU_MENUITEM_PROP_LABEL, _("Time and Date Settings...")); /* insensitive until we check for available apps */ dbusmenu_menuitem_property_set_bool(settings, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), "gnome-control-center indicator-datetime"); -- cgit v1.2.3 From c287dc427bdb1bed0e2a71b46ca21318f7f9e11c Mon Sep 17 00:00:00 2001 From: Jeremy Bicha Date: Fri, 5 Aug 2011 13:48:42 -0400 Subject: Use real ellipsis (LP: #621339) --- src/datetime-service.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index 8897046..85c4ddc 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -491,7 +491,7 @@ check_for_calendar (gpointer user_data) dbusmenu_menuitem_property_set(events_separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); dbusmenu_menuitem_child_add_position(root, events_separator, 2); add_appointment = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set (add_appointment, DBUSMENU_MENUITEM_PROP_LABEL, _("Add Event...")); + dbusmenu_menuitem_property_set (add_appointment, DBUSMENU_MENUITEM_PROP_LABEL, _("Add Event…")); dbusmenu_menuitem_property_set_bool(add_appointment, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE); g_signal_connect(G_OBJECT(add_appointment), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), "evolution -c calendar"); dbusmenu_menuitem_child_add_position (root, add_appointment, 3); @@ -1059,7 +1059,7 @@ build_menus (DbusmenuMenuitem * root) g_debug("Building Menus."); if (date == NULL) { date = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set (date, DBUSMENU_MENUITEM_PROP_LABEL, _("No date yet...")); + dbusmenu_menuitem_property_set (date, DBUSMENU_MENUITEM_PROP_LABEL, _("No date yet…")); dbusmenu_menuitem_property_set_bool(date, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); dbusmenu_menuitem_child_append(root, date); @@ -1110,7 +1110,7 @@ build_menus (DbusmenuMenuitem * root) dbusmenu_menuitem_child_append(root, separator); settings = dbusmenu_menuitem_new(); - dbusmenu_menuitem_property_set (settings, DBUSMENU_MENUITEM_PROP_LABEL, _("Time and Date Settings...")); + dbusmenu_menuitem_property_set (settings, DBUSMENU_MENUITEM_PROP_LABEL, _("Time and Date Settings…")); /* insensitive until we check for available apps */ dbusmenu_menuitem_property_set_bool(settings, DBUSMENU_MENUITEM_PROP_ENABLED, FALSE); g_signal_connect(G_OBJECT(settings), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), "gnome-control-center indicator-datetime"); -- cgit v1.2.3 From d8c9e950d6bf1a4f0134b67ea598bf48b9b029c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Tue, 16 Aug 2011 14:05:22 +0100 Subject: Show the preferred date representation for the current locale Fixes https://bugs.launchpad.net/indicator-datetime/+bug/729056 --- src/datetime-prefs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datetime-prefs.c b/src/datetime-prefs.c index bed5ff1..e7fef5d 100644 --- a/src/datetime-prefs.c +++ b/src/datetime-prefs.c @@ -478,7 +478,7 @@ format_time_text (GtkWidget * spinner, gpointer user_data) } } else { - format = "%Y-%m-%d"; + format = "%x"; } GDateTime * datetime = g_date_time_new_from_unix_local (gtk_spin_button_get_value (GTK_SPIN_BUTTON (spinner))); -- cgit v1.2.3 From 8d74e5b47c5134f906fcd728b836047b8a4ad81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Tue, 16 Aug 2011 15:18:37 +0100 Subject: Use the new GDateTime glib API to deal with time --- src/datetime-service.c | 24 ++++++++++++------------ src/indicator-datetime.c | 21 ++++++++++----------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/datetime-service.c b/src/datetime-service.c index 8d25b3c..d396f8e 100644 --- a/src/datetime-service.c +++ b/src/datetime-service.c @@ -299,25 +299,25 @@ quick_set_tz (DbusmenuMenuitem * menuitem, guint timestamp, gpointer user_data) static gboolean update_datetime (gpointer user_data) { - g_debug("Updating Date/Time"); + GDateTime *datetime; + gchar *utf8; - gchar longstr[128]; - time_t t; - struct tm *ltime; + g_debug("Updating Date/Time"); - t = time(NULL); - ltime = localtime(&t); - if (ltime == NULL) { + datetime = g_date_time_new_now_local (); + if (datetime == NULL) { g_warning("Error getting local time"); dbusmenu_menuitem_property_set(date, DBUSMENU_MENUITEM_PROP_LABEL, _("Error getting time")); + g_date_time_unref (datetime); return FALSE; } - /* Translators: strftime(3) style date format on top of the menu when you click on the clock */ - strftime(longstr, 128, _("%A, %e %B %Y"), ltime); - - gchar * utf8 = g_locale_to_utf8(longstr, -1, NULL, NULL, NULL); + /* eranslators: strftime(3) style date format on top of the menu when you click on the clock */ + utf8 = g_date_time_format (datetime, _("%A, %e %B %Y")); + dbusmenu_menuitem_property_set(date, DBUSMENU_MENUITEM_PROP_LABEL, utf8); + + g_date_time_unref (datetime); g_free(utf8); return FALSE; @@ -701,7 +701,7 @@ update_appointment_menu_items (gpointer user_data) // Get today & work out query times time(&curtime); - struct tm *today = localtime(&curtime); + struct tm *today = localtime(&curtime); const int mday = today->tm_mday; const int mon = today->tm_mon; const int year = today->tm_year; diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 163804b..5da4a37 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -270,6 +270,9 @@ static void menu_visible_notfy_cb(GtkWidget * menu, G_GNUC_UNUSED GParamSpec *pspec, gpointer user_data) { IndicatorDatetime * self = INDICATOR_DATETIME(user_data); + GDateTime *datetime; + gint y, m, d; + g_debug("notify visible signal received"); // we should only react if we're currently visible @@ -277,18 +280,14 @@ menu_visible_notfy_cb(GtkWidget * menu, G_GNUC_UNUSED GParamSpec *pspec, gpointe g_object_get(G_OBJECT(menu), "visible", &visible, NULL); if (visible) return; g_debug("notify visible menu hidden, resetting date"); - - time_t curtime; - - time(&curtime); - struct tm *today = localtime(&curtime); - int y = today->tm_year; - int m = today->tm_mon; - int d = today->tm_mday; - + + datetime = g_date_time_new_now_local (); + g_date_time_get_ymd (datetime, &y, &m, &d); + g_date_time_unref (datetime); + // Set the calendar to todays date - ido_calendar_menu_item_set_date (self->priv->ido_calendar, y+1900, m, d); - + ido_calendar_menu_item_set_date (self->priv->ido_calendar, y, m, d); + // Make sure the day-selected signal is sent so the menu updates - may duplicate /*GVariant *variant = g_variant_new_uint32((guint)curtime); guint timestamp = (guint)time(NULL); -- cgit v1.2.3 From ac74e3a3a1600fd57d23a7d8a5bf1be674a5b2d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Wed, 17 Aug 2011 16:50:43 +0100 Subject: Set the correct month number g_datetime_get_ymd() gets the Gregorian month number but gtk_calendar_set_month() needs a value between [0,11] --- src/indicator-datetime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 5da4a37..aca1101 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -286,7 +286,7 @@ menu_visible_notfy_cb(GtkWidget * menu, G_GNUC_UNUSED GParamSpec *pspec, gpointe g_date_time_unref (datetime); // Set the calendar to todays date - ido_calendar_menu_item_set_date (self->priv->ido_calendar, y, m, d); + ido_calendar_menu_item_set_date (self->priv->ido_calendar, y, m-1, d); // Make sure the day-selected signal is sent so the menu updates - may duplicate /*GVariant *variant = g_variant_new_uint32((guint)curtime); -- cgit v1.2.3 From 5298a3957ac3c81ff197a73e1f7986ead22818c2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 18 Aug 2011 10:57:14 -0500 Subject: 0.2.93 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ec4720e..71fd0e9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([indicator-datetime], - [0.2.92], + [0.2.93], [http://bugs.launchpad.net/indicator-datetime], [indicator-datetime], [http://launchpad.net/indicator-datetime]) -- cgit v1.2.3