application: send a signal when GoaClient init finishes
This commit is contained in:
committed by
Erick Pérez Castellanos
parent
0aad536ca1
commit
ebb08f5eeb
@@ -52,6 +52,14 @@ struct _GcalApplicationPrivate
|
|||||||
icaltimetype *initial_date;
|
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_finalize (GObject *object);
|
||||||
|
|
||||||
static void gcal_application_activate (GApplication *app);
|
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_register = gcal_application_dbus_register;
|
||||||
application_class->dbus_unregister = gcal_application_dbus_unregister;
|
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
|
static void
|
||||||
@@ -236,6 +260,8 @@ gcal_application_goa_client_ready (GObject *source,
|
|||||||
|
|
||||||
priv->client = goa_client_new_finish (result, &error);
|
priv->client = goa_client_new_finish (result, &error);
|
||||||
|
|
||||||
|
g_signal_emit (user_data, signals[GOA_CLIENT_READY], 0, priv->client);
|
||||||
|
|
||||||
if (error != NULL)
|
if (error != NULL)
|
||||||
{
|
{
|
||||||
g_warning ("%s: Error retrieving GoaClient: %s",
|
g_warning ("%s: Error retrieving GoaClient: %s",
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ struct _GcalApplication
|
|||||||
struct _GcalApplicationClass
|
struct _GcalApplicationClass
|
||||||
{
|
{
|
||||||
GtkApplicationClass parent_class;
|
GtkApplicationClass parent_class;
|
||||||
|
|
||||||
|
void (*goa_client_ready) (GcalApplication *app, GoaClient *client);
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gcal_application_get_type (void) G_GNUC_CONST;
|
GType gcal_application_get_type (void) G_GNUC_CONST;
|
||||||
|
|||||||
Reference in New Issue
Block a user