From 135b14779eed39d6f4373212ba6ebf0683e5a6dc Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 28 Jul 2009 19:56:11 +0200 Subject: Bug #314599 - Recurrence Tab Should Not Default To Forever --- calendar/gui/calendar-config-keys.h | 3 +++ calendar/gui/calendar-config.c | 15 +++++++++++++++ calendar/gui/calendar-config.h | 3 +++ calendar/gui/dialogs/recurrence-page.c | 2 +- 4 files changed, 22 insertions(+), 1 deletion(-) (limited to 'calendar') diff --git a/calendar/gui/calendar-config-keys.h b/calendar/gui/calendar-config-keys.h index 9b2bd1c644..deac5d595c 100644 --- a/calendar/gui/calendar-config-keys.h +++ b/calendar/gui/calendar-config-keys.h @@ -100,6 +100,9 @@ G_BEGIN_DECLS #define CALENDAR_CONFIG_BA_REMINDER CALENDAR_CONFIG_PREFIX "/other/use_ba_reminder" #define CALENDAR_CONFIG_BA_REMINDER_INTERVAL CALENDAR_CONFIG_PREFIX "/other/ba_reminder_interval" #define CALENDAR_CONFIG_BA_REMINDER_UNITS CALENDAR_CONFIG_PREFIX "/other/ba_reminder_units" + +#define CALENDAR_CONFIG_DEF_RECUR_COUNT CALENDAR_CONFIG_PREFIX "/other/def_recur_count" + G_END_DECLS #endif diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index f1730d5bc7..86c771ff3e 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -1721,3 +1721,18 @@ calendar_config_add_notification_day_second_zone (GConfClientNotifyFunc func, gp return id; } + +/* default count for recurring events */ +gint +calendar_config_get_default_count (void) +{ + gint res; + + calendar_config_init (); + + res = gconf_client_get_int (config, CALENDAR_CONFIG_DEF_RECUR_COUNT, NULL); + if (res <= 0) + res = 2; + + return res; +} diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index a009ed73d7..bbee7e6da1 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -277,4 +277,7 @@ gboolean calendar_config_get_month_scroll_by_week (void); void calendar_config_set_month_scroll_by_week (gboolean value); guint calendar_config_add_notification_month_scroll_by_week (GConfClientNotifyFunc func, gpointer data); +/* default count for recurring events */ +gint calendar_config_get_default_count (void); + #endif /* _CALENDAR_CONFIG_H_ */ diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 092a44db15..4b28856e82 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -437,7 +437,7 @@ clear_widgets (RecurrencePage *rpage) g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); priv->ending_date_tt = icaltime_today (); - priv->ending_count = 1; + priv->ending_count = calendar_config_get_default_count (); g_signal_handlers_block_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); e_dialog_combo_box_set (priv->ending_combo, -- cgit