aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/dialogs/event-page.c34
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));