aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkarl-qdh <karl@qdh.org.uk>2011-03-23 15:03:46 +0000
committerkarl-qdh <karl@qdh.org.uk>2011-03-23 15:03:46 +0000
commit438f4a55d549ae766be9add0e91bad5776b85130 (patch)
tree3e3899660087eb1fc0e508a5b0c7f1f61a4854b8 /src
parentf436da0a3f8cf7a01ccb0ae062d53e5be6cd5ff8 (diff)
parent74fe3165a907c7e7948c7a2066188eda2f234b59 (diff)
downloadayatana-indicator-datetime-438f4a55d549ae766be9add0e91bad5776b85130.tar.gz
ayatana-indicator-datetime-438f4a55d549ae766be9add0e91bad5776b85130.tar.bz2
ayatana-indicator-datetime-438f4a55d549ae766be9add0e91bad5776b85130.zip
merged back with sniffles branch and added some changes to the resetdate, which also effects the marked days.
Diffstat (limited to 'src')
-rw-r--r--src/datetime-service.c13
-rw-r--r--src/indicator-datetime.c3
-rw-r--r--src/settings-shared.h8
-rw-r--r--src/utils.c2
4 files changed, 18 insertions, 8 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 129ec14..17745fe 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -47,8 +47,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libical/icaltime.h>
#include <cairo/cairo.h>
-#include <oobs/oobs-timeconfig.h>
-
#include "datetime-interface.h"
#include "dbus-shared.h"
#include "settings-shared.h"
@@ -254,8 +252,8 @@ update_datetime (gpointer user_data)
return FALSE;
}
- /* Note: may require some localization tweaks */
- strftime(longstr, 128, "%A, %e %B %Y", ltime);
+ /* 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);
dbusmenu_menuitem_property_set(date, DBUSMENU_MENUITEM_PROP_LABEL, utf8);
@@ -322,6 +320,7 @@ static gboolean
close_menu_cb (DbusmenuMenuitem * menuitem, gchar *name, GVariant *variant)
{
if (calendar == NULL) return FALSE;
+ g_debug("Resetting date on menu close");
start_time_appointments = 0;
// TODO create a variant which will be an array of 3 ints {y,m,d}
GVariant *date_variant;
@@ -394,11 +393,15 @@ check_for_calendar (gpointer user_data)
dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
dbusmenu_menuitem_property_set_bool(calendar, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
+ dbusmenu_menuitem_property_set_bool(date, DBUSMENU_MENUITEM_PROP_ENABLED, TRUE);
+ g_signal_connect (G_OBJECT(date), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED,
+ G_CALLBACK (activate_cb), "evolution -c calendar");
+
events_separator = dbusmenu_menuitem_new();
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 Appointment"));
+ 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);
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index fb77974..7b1164d 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -1239,8 +1239,6 @@ new_appointment_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbu
dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, GTK_MENU_ITEM(mi_data->gmi), parent);
g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(indicator_prop_change_cb), mi_data);
- g_signal_connect_swapped(G_OBJECT(newitem), "destroyed", G_CALLBACK(g_free), mi_data);
-
return TRUE;
}
@@ -1334,6 +1332,7 @@ new_calendar_item (DbusmenuMenuitem * newitem,
g_signal_connect_after(ido, "day-selected", G_CALLBACK(day_selected_cb), (gpointer)newitem);
g_signal_connect_after(ido, "day-selected-double-click", G_CALLBACK(day_selected_double_click_cb), (gpointer)newitem);
+ g_signal_connect(G_OBJECT(newitem), DBUSMENU_MENUITEM_SIGNAL_PROPERTY_CHANGED, G_CALLBACK(indicator_prop_change_cb), ido);
return TRUE;
}
diff --git a/src/settings-shared.h b/src/settings-shared.h
index ef1183c..cdbb063 100644
--- a/src/settings-shared.h
+++ b/src/settings-shared.h
@@ -53,7 +53,15 @@ enum {
#define DEFAULT_TIME_FORMAT DEFAULT_TIME_12_FORMAT
#define DEFAULT_TIME_FORMAT_WITH_DAY DEFAULT_TIME_12_FORMAT
+/* TRANSLATORS: A format string for the strftime function for
+ a clock showing the day of the week and the time in 12-hour format without
+ seconds. */
#define DEFAULT_TIME_12_FORMAT_WITH_DAY N_("%a %l:%M %p")
+
+/* TRANSLATORS: A format string for the strftime function for
+ a clock showing the day of the week and the time in 24-hour format without
+ seconds. Information is available in this Launchpad answer:
+ https://answers.launchpad.net/ubuntu/+source/indicator-datetime/+question/149752 */
#define DEFAULT_TIME_24_FORMAT_WITH_DAY N_("%a %H:%M")
#endif
diff --git a/src/utils.c b/src/utils.c
index 7471926..6580f3b 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -183,7 +183,7 @@ generate_format_string_full (gboolean show_day, gboolean show_date)
/* TRANSLATORS: This is a format string passed to strftime to combine the
date and the time. The value of "%s, %s" would result in a string like
this in US English 12-hour time: 'Fri Jul 16, 11:50 AM' */
- return g_strdup_printf(T_("%s, %s"), date_string, time_string);
+ return g_strdup_printf(T_("%s %s"), date_string, time_string);
}
gchar *