[california/wip/725783-time: 7/7] Integrate main editor dialog with new time dialog



commit 32928efdd39d7dcf76980f66a1515b8903838b8e
Author: Jim Nelson <jim yorba org>
Date:   Thu Jul 31 18:32:55 2014 -0700

    Integrate main editor dialog with new time dialog

 src/component/component-event.vala     |    1 +
 src/host/host-create-update-event.vala |  198 +++++-----------------
 src/host/host-event-time-settings.vala |   65 ++++++--
 src/host/host-quick-create-event.vala  |    4 +
 src/rc/create-update-event.ui          |  287 ++++++++++++++------------------
 5 files changed, 226 insertions(+), 329 deletions(-)
---
diff --git a/src/component/component-event.vala b/src/component/component-event.vala
index 1a0e224..ed3e2ed 100644
--- a/src/component/component-event.vala
+++ b/src/component/component-event.vala
@@ -244,6 +244,7 @@ public class Event : Instance, Gee.Comparable<Event> {
      *
      * This will return a DateSpan whether the Event is a DATE or DATE-TIME VEVENT.
      */
+    // TODO: Make date_span/exact_time_span a separate object
     public Calendar.DateSpan get_event_date_span(Calendar.Timezone? tz) {
         if (date_span != null)
             return date_span;
diff --git a/src/host/host-create-update-event.vala b/src/host/host-create-update-event.vala
index 75036c2..1fffb56 100644
--- a/src/host/host-create-update-event.vala
+++ b/src/host/host-create-update-event.vala
@@ -17,8 +17,6 @@ namespace California.Host {
 public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
     public const string ID = "CreateUpdateEvent";
     
-    public const string PROP_SELECTED_DATE_SPAN = "selected-date-span";
-    
     private const int START_HOUR = 0;
     private const int END_HOUR = 23;
     private const int MIN_DIVISIONS = 15;
@@ -38,19 +36,7 @@ public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
     private Gtk.Entry summary_entry;
     
     [GtkChild]
-    private Gtk.Button dtstart_date_button;
-    
-    [GtkChild]
-    private Gtk.ComboBoxText dtstart_time_combo;
-    
-    [GtkChild]
-    private Gtk.Button dtend_date_button;
-    
-    [GtkChild]
-    private Gtk.ComboBoxText dtend_time_combo;
-    
-    [GtkChild]
-    private Gtk.CheckButton all_day_toggle;
+    private Gtk.Label time_summary_label;
     
     [GtkChild]
     private Gtk.Entry location_entry;
@@ -64,16 +50,12 @@ public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
     [GtkChild]
     private Gtk.Box rotating_button_box_container;
     
-    public Calendar.DateSpan selected_date_span { get; set; }
-    
     public bool is_update { get; set; default = false; }
     
     private new Component.Event event = new Component.Event.blank();
-    private Gee.HashMap<string, Calendar.WallTime> time_map = new Gee.HashMap<string, Calendar.WallTime>();
+    private EventTimeSettings.Message? dt = null;
     private Backing.CalendarSource? original_calendar_source;
     private Toolkit.ComboBoxTextModel<Backing.CalendarSource> calendar_model;
-    private Gtk.Button? last_date_button_touched = null;
-    private bool both_date_buttons_touched = false;
     
     private Toolkit.RotatingButtonBox rotating_button_box = new Toolkit.RotatingButtonBox();
     private Toolkit.EntryClearTextConnector summary_clear_text_connector;
@@ -86,29 +68,14 @@ public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
     private Gtk.Button cancel_recurring_button = new Gtk.Button.with_mnemonic(_("_Cancel"));
     
     public CreateUpdateEvent() {
-        // when selected_date_span updates, update date buttons as well
-        notify[PROP_SELECTED_DATE_SPAN].connect(() => {
-            dtstart_date_button.label = selected_date_span.start_date.to_standard_string();
-            dtend_date_button.label = selected_date_span.end_date.to_standard_string();
-        });
-        
         // create button is active only if summary is filled out; all other fields (so far)
         // guarantee valid values at all times
         summary_clear_text_connector = new Toolkit.EntryClearTextConnector(summary_entry);
-        summary_entry.bind_property("text-length", accept_button, "sensitive",
-            BindingFlags.SYNC_CREATE);
+        summary_entry.bind_property("text", accept_button, "sensitive", BindingFlags.SYNC_CREATE,
+            transform_summary_to_accept);
         
         location_clear_text_connector = new Toolkit.EntryClearTextConnector(location_entry);
         
-        // hide start/end time widgets if an all-day event ..."no-show-all" needed to avoid the
-        // merciless effects of show_all()
-        all_day_toggle.bind_property("active", dtstart_time_combo, "visible",
-            BindingFlags.INVERT_BOOLEAN | BindingFlags.SYNC_CREATE);
-        dtstart_time_combo.no_show_all = true;
-        all_day_toggle.bind_property("active", dtend_time_combo, "visible",
-            BindingFlags.INVERT_BOOLEAN | BindingFlags.SYNC_CREATE);
-        dtend_time_combo.no_show_all = true;
-        
         // use model to control calendars combo box
         calendar_model = new Toolkit.ComboBoxTextModel<Backing.CalendarSource>(calendar_combo,
             (cal) => cal.title);
@@ -146,8 +113,12 @@ public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
         rotating_button_box.halign = Gtk.Align.FILL;
         rotating_button_box.valign = Gtk.Align.END;
         rotating_button_box_container.add(rotating_button_box);
+    }
+    
+    private bool transform_summary_to_accept(Binding binding, Value source_value, ref Value target_value) {
+        target_value = summary_entry.text_length > 0 && (event != null ? event.is_valid(false) : false);
         
-        update_controls();
+        return true;
     }
     
     public void jumped_to(Toolkit.Card? from, Toolkit.Card.Jump reason, Value? message) {
@@ -155,7 +126,15 @@ public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
         if (message == null)
             return;
         
-        event = (Component.Event) message;
+        if (message.type() == typeof(EventTimeSettings.Message)) {
+            debug("is message");
+            dt = (EventTimeSettings.Message) message;
+        } else {
+            debug("is event");
+            event = (Component.Event) message;
+            if (dt == null)
+                dt = new EventTimeSettings.Message.from_event(event);
+        }
         
         update_controls();
     }
@@ -166,70 +145,17 @@ public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
         else
             summary_entry.text = "";
         
-        Calendar.WallTime initial_start_time, initial_end_time;
-        if (event.exact_time_span != null) {
-            all_day_toggle.active = false;
-            selected_date_span = event.exact_time_span.get_date_span();
-            initial_start_time =
-                event.exact_time_span.start_exact_time.to_timezone(Calendar.Timezone.local).to_wall_time();
-            initial_end_time =
-                event.exact_time_span.end_exact_time.to_timezone(Calendar.Timezone.local).to_wall_time();
-        } else if (event.date_span != null) {
-            all_day_toggle.active = true;
-            selected_date_span = event.date_span;
-            initial_start_time = Calendar.System.now.to_wall_time();
-            initial_end_time = Calendar.System.now.adjust_time(1, Calendar.TimeUnit.HOUR).to_wall_time();
+        // use the Message, not the Event, to load this up
+        time_summary_label.visible = true;
+        if (dt.date_span != null) {
+            time_summary_label.label = dt.date_span.to_pretty_string(Calendar.Date.PrettyFlag.NONE);
+        } else if (dt.exact_time_span != null) {
+            time_summary_label.label = dt.exact_time_span.to_pretty_string(Calendar.Date.PrettyFlag.NONE,
+                Calendar.ExactTimeSpan.PrettyFlag.NONE);
         } else {
-            all_day_toggle.active = false;
-            selected_date_span = new Calendar.DateSpan(Calendar.System.today, Calendar.System.today);
-            initial_start_time = Calendar.System.now.to_wall_time();
-            initial_end_time = Calendar.System.now.adjust_time(1, Calendar.TimeUnit.HOUR).to_wall_time();
-            
-            // set in Component.Event as well, to at least initialize it for use elsewhere while
-            // editing (such as the RRULE)
-            event.set_event_exact_time_span(new Calendar.ExactTimeSpan(
-                new Calendar.ExactTime(Calendar.Timezone.local, Calendar.System.today, initial_start_time),
-                new Calendar.ExactTime(Calendar.Timezone.local, Calendar.System.today, initial_end_time)
-            ));
-        }
-        
-        // initialize start and end time controls (as in, wall clock time)
-        Calendar.WallTime current = new Calendar.WallTime(START_HOUR, Calendar.WallTime.MIN_MINUTE, 0);
-        Calendar.WallTime end = new Calendar.WallTime(END_HOUR, Calendar.WallTime.MAX_MINUTE, 0);
-        int index = 0;
-        int dtstart_active_index = -1, dtend_active_index = -1;
-        bool rollover = false;
-        while (current.compare_to(end) <= 0 && !rollover) {
-            string fmt = current.to_pretty_string(Calendar.WallTime.PrettyFlag.NONE);
-            
-            dtstart_time_combo.append_text(fmt);
-            dtend_time_combo.append_text(fmt);
-            
-            // use the latest time for each end of the span to initialize combo boxes, looking for
-            // exact match, otherwise taking the *next* index (to default to the future slot, not
-            // one that's past)
-            int cmp = initial_start_time.compare_to(current);
-            if (cmp == 0)
-                dtstart_active_index = index;
-            else if (cmp > 0)
-                dtstart_active_index = index + 1;
-            
-            cmp = initial_end_time.compare_to(current);
-            if (cmp == 0)
-                dtend_active_index = index;
-            else if (cmp > 0)
-                dtend_active_index = index + 1;
-            
-            index++;
-            
-            time_map.set(fmt, current);
-            current = current.adjust(MIN_DIVISIONS, Calendar.TimeUnit.MINUTE, out rollover);
+            time_summary_label.visible = false;
         }
         
-        // set initial indices, careful to avoid overrun
-        dtstart_time_combo.set_active(dtstart_active_index.clamp(0, index - 1));
-        dtend_time_combo.set_active(dtend_active_index.clamp(0, index - 1));
-        
         // set combo to event's calendar
         if (event.calendar_source != null) {
             calendar_model.set_item_active(event.calendar_source);
@@ -250,50 +176,20 @@ public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
     }
     
     [GtkCallback]
-    private void on_date_button_clicked(Gtk.Button button) {
-        bool is_dtstart = (button == dtstart_date_button);
-        
-        // if both buttons have been touched, go into free-selection mode with the dates, otherwise
-        // respect the original span duration
-        both_date_buttons_touched =
-            both_date_buttons_touched
-            || (last_date_button_touched != null && last_date_button_touched != button);
-        
-        Toolkit.CalendarPopup popup = new Toolkit.CalendarPopup(button,
-            is_dtstart ? selected_date_span.start_date : selected_date_span.end_date);
-        
-        popup.date_selected.connect((date) => {
-            // if both buttons touched, use free date selection, otherwise respect the original
-            // span duration
-            if (both_date_buttons_touched) {
-                selected_date_span = new Calendar.DateSpan(
-                    is_dtstart ? date : selected_date_span.start_date,
-                    !is_dtstart ? date : selected_date_span.end_date
-                );
-            } else {
-                selected_date_span = is_dtstart
-                    ? selected_date_span.adjust_start_date(date)
-                    : selected_date_span.adjust_end_date(date);
-            }
-        });
-        
-        popup.dismissed.connect(() => {
-            popup.destroy();
-        });
-        
-        popup.show_all();
-        
-        last_date_button_touched = button;
-    }
-    
-    [GtkCallback]
     private void on_recurring_button_clicked() {
         // update the component with what's in the controls now
         update_component(event, true);
         
         // send off to recurring editor
-        // TODO: reset to CreateUpdateRecurring.ID
-        jump_to_card_by_name(EventTimeSettings.ID, event);
+        jump_to_card_by_name(CreateUpdateRecurring.ID, event);
+    }
+    
+    [GtkCallback]
+    private void on_edit_time_button_clicked() {
+        if (dt == null)
+            dt = new EventTimeSettings.Message.from_event(event);
+        
+        jump_to_card_by_name(EventTimeSettings.ID, dt);
     }
     
     private void on_accept_button_clicked() {
@@ -323,13 +219,13 @@ public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
         // if updating the master, don't replace the dtstart/dtend, but do want to adjust it from
         // DATE to DATE-TIME or vice-versa
         if (!replace_dtstart) {
-            if (target.is_all_day != all_day_toggle.active) {
-                if (all_day_toggle.active) {
+            if (target.is_all_day != dt.is_all_day) {
+                if (dt.is_all_day) {
                     target.timed_to_all_day_event();
                 } else {
                     target.all_day_to_timed_event(
-                        time_map.get(dtstart_time_combo.get_active_text()),
-                        time_map.get(dtend_time_combo.get_active_text()),
+                        dt.exact_time_span.start_exact_time.to_wall_time(),
+                        dt.exact_time_span.end_exact_time.to_wall_time(),
                         Calendar.Timezone.local
                     );
                 }
@@ -338,18 +234,10 @@ public class CreateUpdateEvent : Gtk.Grid, Toolkit.Card {
             return;
         }
         
-        if (all_day_toggle.active) {
-            target.set_event_date_span(selected_date_span);
-        } else {
-            target.set_event_exact_time_span(
-                new Calendar.ExactTimeSpan(
-                    new Calendar.ExactTime(Calendar.Timezone.local, selected_date_span.start_date,
-                        time_map.get(dtstart_time_combo.get_active_text())),
-                    new Calendar.ExactTime(Calendar.Timezone.local, selected_date_span.end_date,
-                        time_map.get(dtend_time_combo.get_active_text()))
-                )
-            );
-        }
+        if (dt.is_all_day)
+            target.set_event_date_span(dt.date_span);
+        else
+            target.set_event_exact_time_span(dt.exact_time_span);
     }
     
     private void create_update_event(Component.Event target, bool replace_dtstart) {
diff --git a/src/host/host-event-time-settings.vala b/src/host/host-event-time-settings.vala
index 2e9da3b..8c9a365 100644
--- a/src/host/host-event-time-settings.vala
+++ b/src/host/host-event-time-settings.vala
@@ -10,6 +10,47 @@ namespace California.Host {
 public class EventTimeSettings : Gtk.Box, Toolkit.Card {
     public const string ID = "CaliforniaHostEventTimeSettings";
     
+    public class Message : Object {
+        public Calendar.DateSpan? date_span { get; private set; default = null; }
+        
+        public Calendar.ExactTimeSpan? exact_time_span { get; private set; default = null; }
+        
+        public bool is_all_day { get { return exact_time_span == null; } }
+        
+        public Message.for_date_span(Calendar.DateSpan date_span) {
+            reset_date_span(date_span);
+        }
+        
+        public Message.for_exact_time_span(Calendar.ExactTimeSpan exact_time_span) {
+            reset_exact_time_span(exact_time_span);
+        }
+        
+        public Message.from_event(Component.Event event) {
+            if (event.is_all_day)
+                reset_date_span(event.date_span);
+            else
+                reset_exact_time_span(event.exact_time_span);
+        }
+        
+        public void reset_date_span(Calendar.DateSpan date_span) {
+            this.date_span = date_span;
+            exact_time_span = null;
+        }
+        
+        public void reset_exact_time_span(Calendar.ExactTimeSpan exact_time_span) {
+            date_span = null;
+            this.exact_time_span = exact_time_span;
+        }
+        
+        public Calendar.DateSpan get_event_date_span(Calendar.Timezone? tz) {
+        if (date_span != null)
+            return date_span;
+        
+        return new Calendar.DateSpan.from_exact_time_span(
+            tz != null ? exact_time_span.to_timezone(tz) : exact_time_span);
+        }
+    }
+    
     [GtkChild]
     private Gtk.Label summary_label;
     
@@ -27,7 +68,7 @@ public class EventTimeSettings : Gtk.Box, Toolkit.Card {
     public Gtk.Widget? default_widget { get { return null; } }
     public Gtk.Widget? initial_focus { get { return null; } }
     
-    private new Component.Event? event = null;
+    private Message? message = null;
     private DateTimeWidget from_widget = new DateTimeWidget();
     private DateTimeWidget to_widget = new DateTimeWidget();
     
@@ -48,22 +89,22 @@ public class EventTimeSettings : Gtk.Box, Toolkit.Card {
             BindingFlags.SYNC_CREATE | BindingFlags.INVERT_BOOLEAN);
     }
     
-    public void jumped_to(Toolkit.Card? from, Toolkit.Card.Jump reason, Value? message) {
-        event = (Component.Event) message;
+    public void jumped_to(Toolkit.Card? from, Toolkit.Card.Jump reason, Value? message_value) {
+        message = (Message) message_value;
         
         // only set wall time if not all day; let old wall times float so user can return to them
         // later while Deck is active
-        if (!event.is_all_day) {
-            Calendar.ExactTimeSpan time_span = event.exact_time_span.to_timezone(Calendar.Timezone.local);
+        if (message.exact_time_span != null) {
+            Calendar.ExactTimeSpan time_span = message.exact_time_span.to_timezone(Calendar.Timezone.local);
             from_widget.wall_time = time_span.start_exact_time.to_wall_time();
             to_widget.wall_time = time_span.end_exact_time.to_wall_time();
         }
         
-        Calendar.DateSpan event_span = event.get_event_date_span(Calendar.Timezone.local);
-        from_widget.date = event_span.start_date;
-        to_widget.date = event_span.end_date;
+        Calendar.DateSpan date_span = message.get_event_date_span(Calendar.Timezone.local);
+        from_widget.date = date_span.start_date;
+        to_widget.date = date_span.end_date;
         
-        all_day_checkbutton.active = event.is_all_day;
+        all_day_checkbutton.active = (message.exact_time_span == null);
     }
     
     [GtkCallback]
@@ -74,11 +115,11 @@ public class EventTimeSettings : Gtk.Box, Toolkit.Card {
     [GtkCallback]
     private void on_ok_button_clicked() {
         if (all_day_checkbutton.active)
-            event.set_event_date_span(get_date_span());
+            message.reset_date_span(get_date_span());
         else
-            event.set_event_exact_time_span(get_exact_time_span());
+            message.reset_exact_time_span(get_exact_time_span());
         
-        jump_to_card_by_name(CreateUpdateEvent.ID, event);
+        jump_to_card_by_name(CreateUpdateEvent.ID, message);
     }
     
     // This does not respect the all-day checkbox
diff --git a/src/host/host-quick-create-event.vala b/src/host/host-quick-create-event.vala
index 5daee65..5d9c5a9 100644
--- a/src/host/host-quick-create-event.vala
+++ b/src/host/host-quick-create-event.vala
@@ -138,6 +138,10 @@ public class QuickCreateEvent : Gtk.Grid, Toolkit.Card {
         if (event == null)
             event = new Component.Event.blank();
         
+        // ensure it's at least valid
+        if (!event.is_valid(false))
+            event.set_event_date_span(Calendar.System.today.to_date_span());
+        
         // jump to Create/Update dialog and remove this Card from the Deck ... this ensures
         // that if the user presses Cancel in the Create/Update dialog the Deck exits rather
         // than returns here (via jump_home_or_user_closed())
diff --git a/src/rc/create-update-event.ui b/src/rc/create-update-event.ui
index 92b2637..89ab375 100644
--- a/src/rc/create-update-event.ui
+++ b/src/rc/create-update-event.ui
@@ -32,125 +32,31 @@
       </packing>
     </child>
     <child>
-      <object class="GtkBox" id="dt_selection_box">
+      <object class="GtkComboBoxText" id="calendar_combo">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="spacing">4</property>
-        <property name="baseline_position">top</property>
-        <child>
-          <object class="GtkLabel" id="from_label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes" comments="As in &quot;From &lt;date&gt; &lt;time&gt; 
to &lt;date&gt; &lt;time&gt;&quot;">From</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">0</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkButton" id="dtstart_date_button">
-            <property name="label">dtstart</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="xalign">0.52999997138977051</property>
-            <signal name="clicked" handler="on_date_button_clicked" object="CaliforniaHostCreateUpdateEvent" 
swapped="no"/>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkComboBoxText" id="dtstart_time_combo">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">2</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="to_label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="label" translatable="yes" comments="As in &quot;From &lt;date&gt; &lt;time&gt; 
to &lt;date&gt; &lt;time&gt;&quot;">to</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">3</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkButton" id="dtend_date_button">
-            <property name="label">dtend</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <signal name="clicked" handler="on_date_button_clicked" object="CaliforniaHostCreateUpdateEvent" 
swapped="no"/>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">4</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkComboBoxText" id="dtend_time_combo">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">5</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkCheckButton" id="all_day_toggle">
-            <property name="label" translatable="yes">_All-day</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">False</property>
-            <property name="halign">start</property>
-            <property name="use_underline">True</property>
-            <property name="xalign">0</property>
-            <property name="image_position">right</property>
-            <property name="draw_indicator">True</property>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="position">6</property>
-          </packing>
-        </child>
+      </object>
+      <packing>
+        <property name="left_attach">0</property>
+        <property name="top_attach">3</property>
+        <property name="width">2</property>
+        <property name="height">1</property>
+      </packing>
+    </child>
+    <child>
+      <object class="GtkBox" id="rotating_button_box_container">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="margin_top">8</property>
+        <property name="hexpand">True</property>
+        <property name="vexpand">False</property>
         <child>
-          <object class="GtkButton" id="recurring_button">
-            <property name="label" translatable="yes">Re_peats...</property>
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="margin_left">8</property>
-            <property name="use_underline">True</property>
-            <signal name="clicked" handler="on_recurring_button_clicked" 
object="CaliforniaHostCreateUpdateEvent" swapped="no"/>
-          </object>
-          <packing>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
-            <property name="position">7</property>
-          </packing>
+          <placeholder/>
         </child>
       </object>
       <packing>
         <property name="left_attach">0</property>
-        <property name="top_attach">1</property>
+        <property name="top_attach">4</property>
         <property name="width">2</property>
         <property name="height">1</property>
       </packing>
@@ -162,48 +68,63 @@
         <property name="row_spacing">6</property>
         <property name="column_spacing">6</property>
         <child>
-          <object class="GtkLabel" id="location_label">
+          <object class="GtkLabel" id="description_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">1</property>
-            <property name="label" translatable="yes">_Location</property>
+            <property name="yalign">0</property>
+            <property name="label" translatable="yes">_Description</property>
             <property name="use_underline">True</property>
-            <property name="mnemonic_widget">location_entry</property>
-            <property name="single_line_mode">True</property>
+            <property name="wrap">True</property>
+            <property name="mnemonic_widget">description_textview</property>
             <style>
               <class name="dim-label"/>
             </style>
           </object>
           <packing>
             <property name="left_attach">0</property>
-            <property name="top_attach">0</property>
+            <property name="top_attach">2</property>
             <property name="width">1</property>
             <property name="height">1</property>
           </packing>
         </child>
         <child>
-          <object class="GtkEntry" id="location_entry">
+          <object class="GtkScrolledWindow" id="scrolledwindow1">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="activates_default">True</property>
+            <property name="shadow_type">in</property>
+            <property name="min_content_height">75</property>
+            <child>
+              <object class="GtkViewport" id="viewport1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <object class="GtkTextView" id="description_textview">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="wrap_mode">word</property>
+                  </object>
+                </child>
+              </object>
+            </child>
           </object>
           <packing>
             <property name="left_attach">1</property>
-            <property name="top_attach">0</property>
+            <property name="top_attach">2</property>
             <property name="width">1</property>
             <property name="height">1</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="description_label">
+          <object class="GtkLabel" id="location_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">1</property>
-            <property name="yalign">0</property>
-            <property name="label" translatable="yes">_Description</property>
+            <property name="label" translatable="yes">_Location</property>
             <property name="use_underline">True</property>
-            <property name="wrap">True</property>
-            <property name="mnemonic_widget">description_textview</property>
+            <property name="single_line_mode">True</property>
             <style>
               <class name="dim-label"/>
             </style>
@@ -216,30 +137,96 @@
           </packing>
         </child>
         <child>
-          <object class="GtkScrolledWindow" id="scrolledwindow1">
+          <object class="GtkEntry" id="location_entry">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="shadow_type">in</property>
-            <property name="min_content_height">75</property>
+            <property name="activates_default">True</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">1</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">4</property>
             <child>
-              <object class="GtkViewport" id="viewport1">
+              <object class="GtkLabel" id="time_summary_label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="label">(none)</property>
+                <property name="selectable">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="recurring_button">
+                <property name="label" translatable="yes">Re_peats…</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="margin_left">8</property>
+                <property name="use_underline">True</property>
+                <signal name="clicked" handler="on_recurring_button_clicked" 
object="CaliforniaHostCreateUpdateEvent" swapped="no"/>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="pack_type">end</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="edit_time_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="tooltip_text" translatable="yes">Set the start and end time</property>
+                <property name="relief">none</property>
+                <signal name="clicked" handler="on_edit_time_button_clicked" 
object="CaliforniaHostCreateUpdateEvent" swapped="no"/>
                 <child>
-                  <object class="GtkTextView" id="description_textview">
+                  <object class="GtkImage" id="image1">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="hexpand">True</property>
-                    <property name="vexpand">True</property>
-                    <property name="wrap_mode">word</property>
+                    <property name="can_focus">False</property>
+                    <property name="icon_name">alarm-symbolic</property>
                   </object>
                 </child>
               </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
             </child>
           </object>
           <packing>
             <property name="left_attach">1</property>
-            <property name="top_attach">1</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="time_label">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">1</property>
+            <property name="label" translatable="yes">Time</property>
+            <style>
+              <class name="dim-label"/>
+            </style>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
             <property name="width">1</property>
             <property name="height">1</property>
           </packing>
@@ -250,40 +237,16 @@
       </object>
       <packing>
         <property name="left_attach">0</property>
-        <property name="top_attach">2</property>
+        <property name="top_attach">1</property>
         <property name="width">2</property>
         <property name="height">1</property>
       </packing>
     </child>
     <child>
-      <object class="GtkComboBoxText" id="calendar_combo">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-      </object>
-      <packing>
-        <property name="left_attach">0</property>
-        <property name="top_attach">3</property>
-        <property name="width">2</property>
-        <property name="height">1</property>
-      </packing>
+      <placeholder/>
     </child>
     <child>
-      <object class="GtkBox" id="rotating_button_box_container">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="margin_top">8</property>
-        <property name="hexpand">True</property>
-        <property name="vexpand">False</property>
-        <child>
-          <placeholder/>
-        </child>
-      </object>
-      <packing>
-        <property name="left_attach">0</property>
-        <property name="top_attach">4</property>
-        <property name="width">2</property>
-        <property name="height">1</property>
-      </packing>
+      <placeholder/>
     </child>
   </template>
 </interface>


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