[gnome-calendar] window: use GcalView::get_children_by_uuid
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: use GcalView::get_children_by_uuid
- Date: Tue, 20 Jan 2015 19:53:36 +0000 (UTC)
commit 648ae1816224ce313f3af695ff9c9db1cd7910b6
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Tue Jan 20 14:48:46 2015 -0500
window: use GcalView::get_children_by_uuid
src/gcal-subscriber-view.c | 13 +++++++++++++
src/gcal-window.c | 13 ++++++++-----
2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/src/gcal-subscriber-view.c b/src/gcal-subscriber-view.c
index 42b97c9..dda1ca7 100644
--- a/src/gcal-subscriber-view.c
+++ b/src/gcal-subscriber-view.c
@@ -35,6 +35,9 @@ static guint signals[NUM_SIGNALS] = { 0, };
static void event_activated (GcalEventWidget
*widget,
gpointer
user_data);
+static void event_visibility_changed (GtkWidget
*widget,
+ gpointer
user_data);
+
static void gcal_data_model_subscriber_interface_init (ECalDataModelSubscriberInterface
*iface);
static void gcal_subscriber_view_finalize (GObject
*object);
@@ -90,6 +93,14 @@ event_activated (GcalEventWidget *widget,
}
static void
+event_visibility_changed(GtkWidget *widget,
+ gpointer user_data)
+{
+ GcalSubscriberViewPrivate *priv = GCAL_SUBSCRIBER_VIEW (user_data)->priv;
+ priv->children_changed = TRUE;
+}
+
+static void
gcal_subscriber_view_class_init (GcalSubscriberViewClass *klass)
{
GtkContainerClass *container_class;
@@ -470,4 +481,6 @@ _gcal_subscriber_view_setup_child (GcalSubscriberView *subscriber_view,
if (gtk_widget_get_parent (child_widget) == NULL)
gtk_widget_set_parent (child_widget, GTK_WIDGET (subscriber_view));
g_signal_connect (child_widget, "activate", G_CALLBACK (event_activated), subscriber_view);
+ g_signal_connect (child_widget, "hide", G_CALLBACK (event_visibility_changed), subscriber_view);
+ g_signal_connect (child_widget, "show", G_CALLBACK (event_visibility_changed), subscriber_view);
}
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 23059fe..3e1ca7c 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -905,6 +905,7 @@ edit_dialog_closed (GtkDialog *dialog,
ECalComponent *component;
GcalView *view;
+ GList *widgets;
gchar *uuid;
priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data));
@@ -954,7 +955,9 @@ edit_dialog_closed (GtkDialog *dialog,
uuid = gcal_edit_dialog_get_event_uuid (edit_dialog);
/* hide widget of the event */
- gtk_widget_hide (gcal_subscriber_view_get_child_by_uuid (GCAL_SUBSCRIBER_VIEW (view), uuid));
+ widgets = gcal_view_get_children_by_uuid (view, uuid);
+ g_list_foreach (widgets, (GFunc) gtk_widget_hide, NULL);
+ g_list_free (widgets);
g_free (uuid);
break;
@@ -1049,18 +1052,18 @@ undo_remove_event (GtkButton *button,
{
GcalWindowPrivate *priv;
gchar *uuid;
- GtkWidget *event_widget;
priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data));
if (priv->event_to_delete != NULL)
{
+ GList *widgets;
uuid = get_uuid_from_component (priv->event_to_delete->source, priv->event_to_delete->event_component);
- event_widget = gcal_subscriber_view_get_child_by_uuid (GCAL_SUBSCRIBER_VIEW
(priv->views[priv->active_view]),
- uuid);
- gtk_widget_show (event_widget);
+ widgets = gcal_view_get_children_by_uuid (GCAL_VIEW (priv->views[priv->active_view]), uuid);
+ g_list_foreach (widgets, (GFunc) gtk_widget_show, NULL);
g_clear_pointer (&(priv->event_to_delete), g_free);
+ g_list_free (widgets);
g_free (uuid);
gtk_revealer_set_reveal_child (GTK_REVEALER (priv->notification),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]