[gnome-calendar] application: send a signal when GoaClient init finishes
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] application: send a signal when GoaClient init finishes
- Date: Mon, 25 May 2015 17:00:03 +0000 (UTC)
commit ebb08f5eeb9d8c946265b6be58f8e88fbf624e01
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Apr 30 17:01:32 2015 -0300
application: send a signal when GoaClient init finishes
src/gcal-application.c | 26 ++++++++++++++++++++++++++
src/gcal-application.h | 2 ++
2 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-application.c b/src/gcal-application.c
index f2c6f59..7387931 100644
--- a/src/gcal-application.c
+++ b/src/gcal-application.c
@@ -52,6 +52,14 @@ struct _GcalApplicationPrivate
icaltimetype *initial_date;
};
+enum
+{
+ GOA_CLIENT_READY,
+ NUM_SIGNALS
+};
+
+static guint signals[NUM_SIGNALS] = { 0, };
+
static void gcal_application_finalize (GObject *object);
static void gcal_application_activate (GApplication *app);
@@ -203,6 +211,22 @@ gcal_application_class_init (GcalApplicationClass *klass)
application_class->dbus_register = gcal_application_dbus_register;
application_class->dbus_unregister = gcal_application_dbus_unregister;
+
+ /**
+ * GcalApplication::goa-client-ready:
+ *
+ * Emited when the #GoaClient asyncronous loading is finished.
+ */
+ signals[GOA_CLIENT_READY] = g_signal_new ("source-removed",
+ GCAL_TYPE_APPLICATION,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GcalApplicationClass, goa_client_ready),
+ NULL,
+ NULL,
+ NULL,
+ G_TYPE_NONE,
+ 1,
+ GOA_TYPE_CLIENT);
}
static void
@@ -236,6 +260,8 @@ gcal_application_goa_client_ready (GObject *source,
priv->client = goa_client_new_finish (result, &error);
+ g_signal_emit (user_data, signals[GOA_CLIENT_READY], 0, priv->client);
+
if (error != NULL)
{
g_warning ("%s: Error retrieving GoaClient: %s",
diff --git a/src/gcal-application.h b/src/gcal-application.h
index 116a59b..4aaca56 100644
--- a/src/gcal-application.h
+++ b/src/gcal-application.h
@@ -49,6 +49,8 @@ struct _GcalApplication
struct _GcalApplicationClass
{
GtkApplicationClass parent_class;
+
+ void (*goa_client_ready) (GcalApplication *app, GoaClient *client);
};
GType gcal_application_get_type (void) G_GNUC_CONST;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]