[california] Auto-enable event's start day for new weekly RRULE: Bug #735834



commit c54fc3a121ca00a97b069b7cc3780dc45266796d
Author: Jim Nelson <jim yorba org>
Date:   Wed Sep 3 18:31:40 2014 -0700

    Auto-enable event's start day for new weekly RRULE: Bug #735834

 src/host/host-create-update-recurring.vala |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/host/host-create-update-recurring.vala b/src/host/host-create-update-recurring.vala
index 8d9fb7f..48683ee 100644
--- a/src/host/host-create-update-recurring.vala
+++ b/src/host/host-create-update-recurring.vala
@@ -243,9 +243,17 @@ public class CreateUpdateRecurring : Gtk.Grid, Toolkit.Card {
         start_date = event_span.start_date;
         end_date = event_span.end_date;
         
-        // Clear all "On days" checkboxes for sanity's sake
-        foreach (Gtk.CheckButton checkbutton in on_day_checkbuttons.values)
-            checkbutton.active = false;
+        // Clear all "On days" checkboxes for sanity's sake except for the start day of this event
+        // (iff it is a single-day event -- multiday events get hairy -- and this is a new RRULE,
+        // not an existing one)
+        foreach (Calendar.DayOfWeek dow in on_day_checkbuttons.keys) {
+            Gtk.CheckButton checkbutton = on_day_checkbuttons[dow];
+            
+            if (master.rrule == null && event_span.is_same_day && start_date.day_of_week.equal_to(dow))
+                checkbutton.active = true;
+            else
+                checkbutton.active = false;
+        }
         
         // set remaining defaults if not a recurring event
         if (master.rrule == null) {


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