[california/wip/732930-explain] Display recurring explanation when viewing an event
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [california/wip/732930-explain] Display recurring explanation when viewing an event
- Date: Fri, 5 Sep 2014 21:50:23 +0000 (UTC)
commit a3b700ec6a3813dc17fbd6e58f62f81f37d59c65
Author: Jim Nelson <jim yorba org>
Date: Fri Sep 5 12:50:06 2014 -0700
Display recurring explanation when viewing an event
src/host/host-show-event.vala | 9 +++++++++
src/rc/show-event.ui | 18 ++++++++++++++++++
2 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/src/host/host-show-event.vala b/src/host/host-show-event.vala
index 5d40370..0bce204 100644
--- a/src/host/host-show-event.vala
+++ b/src/host/host-show-event.vala
@@ -55,6 +55,9 @@ public class ShowEvent : Gtk.Grid, Toolkit.Card {
private Gtk.Label description_text;
[GtkChild]
+ private Gtk.Label recurring_explanation_label;
+
+ [GtkChild]
private Gtk.Box rotating_button_box_container;
private new Component.Event event;
@@ -153,6 +156,12 @@ public class ShowEvent : Gtk.Grid, Toolkit.Card {
// description
set_label(null, description_text, Markup.linkify(escape(event.description), linkify_delegate));
+ // recurring explanation (if appropriate)
+ string? explanation = (event.rrule != null) ? event.rrule.explain() : null;
+ recurring_explanation_label.label = explanation ?? "";
+ recurring_explanation_label.visible = !String.is_empty(explanation);
+ recurring_explanation_label.no_show_all = String.is_empty(explanation);
+
// if read-only, don't show Delete or Edit buttons; since they're the only two, don't show
// the entire button box
bool read_only = event.calendar_source != null && event.calendar_source.read_only;
diff --git a/src/rc/show-event.ui b/src/rc/show-event.ui
index 29dd4e8..f7a769d 100644
--- a/src/rc/show-event.ui
+++ b/src/rc/show-event.ui
@@ -199,6 +199,24 @@
</object>
<packing>
<property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="recurring_explanation_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label">(empty)</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]