aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-04-26 18:57:58 +0800
committerMilan Crha <mcrha@redhat.com>2012-04-26 18:58:58 +0800
commit3a9ac1edd9a03da18bf1631fc22cc8e4af47f102 (patch)
tree6bd3944b12e22e72ea241880c215cf45d6206ead /calendar
parent9d50684189ba6e3ed434c5cdc954bde7b92c2656 (diff)
downloadgsoc2013-evolution-3a9ac1edd9a03da18bf1631fc22cc8e4af47f102.tar.gz
gsoc2013-evolution-3a9ac1edd9a03da18bf1631fc22cc8e4af47f102.tar.zst
gsoc2013-evolution-3a9ac1edd9a03da18bf1631fc22cc8e4af47f102.zip
Bug #668988 - Handle a "minutes" entry greater than 59 intelligently
Diffstat (limited to 'calendar')
-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 3697ce5daa..41b894e557 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)
{
@@ -3346,6 +3371,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 (