aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/gui/dialogs/event-page.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 37373dffa5..28f54be901 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -1980,6 +1980,31 @@ minute_sel_changed (GtkSpinButton *widget,
hour_minute_changed (epage);
}
+static gboolean
+minute_sel_focus_out (GtkSpinButton *widget,
+ GdkEvent *event,
+ EventPage *epage)
+{
+ const gchar *text;
+ gint hours, minutes;
+
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (epage != NULL, FALSE);
+
+ text = gtk_entry_get_text (GTK_ENTRY (widget));
+ minutes = g_strtod (text, NULL);
+
+ if (minutes >= 60) {
+ hours = minutes / 60;
+ minutes = minutes % 60;
+
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (epage->priv->hour_selector), hours);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (epage->priv->minute_selector), minutes);
+ }
+
+ return FALSE;
+}
+
static void
hour_minute_changed (EventPage *epage)
{
@@ -3354,6 +3379,10 @@ init_widgets (EventPage *epage)
priv->minute_selector, "value-changed",
G_CALLBACK (minute_sel_changed), epage);
+ g_signal_connect (
+ priv->minute_selector, "focus-out-event",
+ G_CALLBACK (minute_sel_focus_out), epage);
+
/* Add the user defined time if necessary */
priv->alarm_units =
e_meeting_store_get_default_reminder_units (