diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2006-08-22 19:57:47 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2006-08-22 19:57:47 +0800 |
commit | 000e7a9625bff0db25efa553b487c482620f354e (patch) | |
tree | d4ff2b98ff5f744bb00dc866d97488489943eddc /calendar | |
parent | 9de0b61f706f8ec51cd60059fbb04c5cda3c235c (diff) | |
download | gsoc2013-evolution-000e7a9625bff0db25efa553b487c482620f354e.tar gsoc2013-evolution-000e7a9625bff0db25efa553b487c482620f354e.tar.gz gsoc2013-evolution-000e7a9625bff0db25efa553b487c482620f354e.tar.bz2 gsoc2013-evolution-000e7a9625bff0db25efa553b487c482620f354e.tar.lz gsoc2013-evolution-000e7a9625bff0db25efa553b487c482620f354e.tar.xz gsoc2013-evolution-000e7a9625bff0db25efa553b487c482620f354e.tar.zst gsoc2013-evolution-000e7a9625bff0db25efa553b487c482620f354e.zip |
Fixes #351263
svn path=/trunk/; revision=32626
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 34 |
2 files changed, 22 insertions, 20 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index f5b38017b4..bb8dfba7cc 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2006-08-22 Chenthill Palanisamy <pchenthill@novell.com> + + Fixes #351263 + * gui/dialogs/event-page.c: (init_widgets): + do not add duplicate items in menu. + + Committing the patch from Sebastien Bacher <seb123@debian.org> + 2006-08-22 Kjartan Maraas <kmaraas@gnome.org> * gui/calendar-component.c (ensure_sources): Plug a leak. diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 4f27a21b47..1ce4769527 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -2920,42 +2920,36 @@ init_widgets (EventPage *epage) /* Add the user defined time if necessary */ priv->alarm_units = calendar_config_get_default_reminder_units (); priv->alarm_interval = calendar_config_get_default_reminder_interval (); - + + menu_label = ""; switch (priv->alarm_units) { case CAL_DAYS: - if (priv->alarm_interval != -1) { + if (priv->alarm_interval != 1) { menu_label = g_strdup_printf (ngettext("%d day before appointment", "%d days before appointment", priv->alarm_interval), priv->alarm_interval); - } else { - priv->alarm_interval = -1; - } + } break; case CAL_HOURS: - if (priv->alarm_interval != -1) { + if (priv->alarm_interval != 1) { menu_label = g_strdup_printf (ngettext("%d hour before appointment", "%d hours before appointment", priv->alarm_interval), priv->alarm_interval); - } else { - priv->alarm_interval = -1; - } + } break; case CAL_MINUTES: - if (priv->alarm_interval != -1) { + if (priv->alarm_interval != 15) { menu_label = g_strdup_printf (ngettext("%d minute before appointement", "%d minutes before appointment", priv->alarm_interval), priv->alarm_interval); - } else { - priv->alarm_interval = -1; - } + } break; } - - if (menu_label) { - GtkWidget *item, *menu; - item = gtk_menu_item_new_with_label (menu_label); - gtk_widget_show (item); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->alarm_time)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + cus_item = gtk_menu_item_new_with_label (menu_label); + if(menu_label[0] != '\0') { + gtk_widget_show (cus_item); } + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->alarm_time)); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), cus_item); + cus_item = gtk_menu_item_new_with_label (_("Customize")); gtk_widget_show (cus_item); menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->alarm_time)); |