diff options
author | Milan Crha <mcrha@redhat.com> | 2012-04-26 18:56:46 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-04-26 18:57:33 +0800 |
commit | 4eb33fd3daa58ffac6b945506bcd729ab71f5a9f (patch) | |
tree | 8cf731f06bc00ef72e57983b53023d63c4b21454 | |
parent | 3016ec7badccaaebd4b951ba0515c89a882ca537 (diff) | |
download | gsoc2013-evolution-4eb33fd3daa58ffac6b945506bcd729ab71f5a9f.tar.gz gsoc2013-evolution-4eb33fd3daa58ffac6b945506bcd729ab71f5a9f.tar.zst gsoc2013-evolution-4eb33fd3daa58ffac6b945506bcd729ab71f5a9f.zip |
Bug #668988 - Handle a "minutes" entry greater than 59 intelligently
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 29 |
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 ( |