aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/datetime-dialog.ui2
-rw-r--r--src/datetime-service.c6
-rw-r--r--src/timezone-completion.c31
-rw-r--r--src/utils.c6
4 files changed, 28 insertions, 17 deletions
diff --git a/data/datetime-dialog.ui b/data/datetime-dialog.ui
index 7ec485f..7545227 100644
--- a/data/datetime-dialog.ui
+++ b/data/datetime-dialog.ui
@@ -474,7 +474,7 @@
</child>
<child>
<object class="GtkCheckButton" id="showDateTimeCheck">
- <property name="label" translatable="yes">_Date and time</property>
+ <property name="label" translatable="yes">_Date and month</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
diff --git a/src/datetime-service.c b/src/datetime-service.c
index eacce36..65df77e 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -371,11 +371,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/timezone-completion.c b/src/timezone-completion.c
index 1138d0b..fd6c97b 100644
--- a/src/timezone-completion.c
+++ b/src/timezone-completion.c
@@ -58,12 +58,26 @@ static void timezone_completion_finalize (GObject *object);
G_DEFINE_TYPE (TimezoneCompletion, timezone_completion, GTK_TYPE_ENTRY_COMPLETION);
+static gboolean
+match_func (GtkEntryCompletion *completion, const gchar *key,
+ GtkTreeIter *iter, gpointer user_data)
+{
+ // geonames does the work for us
+ return TRUE;
+}
+
static void
save_and_use_model (TimezoneCompletion * completion, GtkTreeModel * model)
{
TimezoneCompletionPrivate * priv = TIMEZONE_COMPLETION_GET_PRIVATE(completion);
- g_hash_table_insert (priv->request_table, g_strdup (priv->request_text), g_object_ref (model));
+ g_hash_table_insert (priv->request_table, g_strdup (priv->request_text), g_object_ref_sink (model));
+
+ if (model == priv->initial_model)
+ gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (completion), NULL, NULL, NULL);
+ else
+ gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (completion), match_func, NULL, NULL);
+
gtk_entry_completion_set_model (GTK_ENTRY_COMPLETION (completion), model);
gtk_entry_completion_complete (GTK_ENTRY_COMPLETION (completion));
}
@@ -101,8 +115,10 @@ json_parse_ready (GObject *object, GAsyncResult *res, gpointer user_data)
JsonReader * reader = json_reader_new (json_parser_get_root (JSON_PARSER (object)));
- if (!json_reader_is_array (reader))
+ if (!json_reader_is_array (reader)) {
+ g_object_unref (G_OBJECT (reader));
return;
+ }
gint i, count = json_reader_count_elements (reader);
for (i = 0; i < count; ++i) {
@@ -167,7 +183,7 @@ json_parse_ready (GObject *object, GAsyncResult *res, gpointer user_data)
}
save_and_use_model (completion, GTK_TREE_MODEL (store));
- g_object_unref (G_OBJECT (store));
+ g_object_unref (G_OBJECT (reader));
}
static void
@@ -335,14 +351,6 @@ data_func (GtkCellLayout *cell_layout, GtkCellRenderer *cell,
g_value_unset (&country_val);
}
-static gboolean
-match_func (GtkEntryCompletion *completion, const gchar *key,
- GtkTreeIter *iter, gpointer user_data)
-{
- // geonames does the work for us
- return TRUE;
-}
-
static void
timezone_completion_class_init (TimezoneCompletionClass *klass)
{
@@ -363,7 +371,6 @@ timezone_completion_init (TimezoneCompletion * self)
priv->initial_model = GTK_TREE_MODEL (get_initial_model ());
- gtk_entry_completion_set_match_func (GTK_ENTRY_COMPLETION (self), match_func, NULL, NULL);
g_object_set (G_OBJECT (self),
"text-column", TIMEZONE_COMPLETION_NAME,
"popup-set-width", FALSE,
diff --git a/src/utils.c b/src/utils.c
index 7471926..537495b 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -181,9 +181,9 @@ generate_format_string_full (gboolean show_day, gboolean show_date)
g_return_val_if_fail(date_string != NULL, g_strdup(time_string));
/* 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);
+ 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);
}
gchar *