[evolution] Bug #314599 - Recurrence Tab Should Not Default To Forever



commit 135b14779eed39d6f4373212ba6ebf0683e5a6dc
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jul 28 19:56:11 2009 +0200

    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 deletions(-)
---
diff --git a/calendar/gui/calendar-config-keys.h b/calendar/gui/calendar-config-keys.h
index 9b2bd1c..deac5d5 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 f1730d5..86c771f 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 a009ed7..bbee7e6 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 092a44d..4b28856 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]