Commit a9725fb4 authored by Srinivasa Ragavan's avatar Srinivasa Ragavan

Add signal for account added/removed/changed.

parent 0fa3fd63
......@@ -537,3 +537,33 @@ e_mail_session_emit_send_receive_completed (EMailDataSession *msession)
ipc(printf("Emitting Send/Receive completed signal\n"));
egdbus_session_cs_emit_send_receive_complete (priv->gdbus_object);
}
void
e_mail_session_emit_account_added (EMailDataSession *msession, const char *uid)
{
EMailDataSessionPrivate *priv = DATA_SESSION_PRIVATE(msession);
ipc(printf("Emitting Account added signal\n"));
egdbus_session_cs_emit_account_added (priv->gdbus_object, uid);
}
void
e_mail_session_emit_account_removed (EMailDataSession *msession, const char *uid)
{
EMailDataSessionPrivate *priv = DATA_SESSION_PRIVATE(msession);
ipc(printf("Emitting Account removed signal\n"));
egdbus_session_cs_emit_account_removed (priv->gdbus_object, uid);
}
void
e_mail_session_emit_account_changed (EMailDataSession *msession, const char *uid)
{
EMailDataSessionPrivate *priv = DATA_SESSION_PRIVATE(msession);
ipc(printf("Emitting Account changed signal\n"));
egdbus_session_cs_emit_account_changed (priv->gdbus_object, uid);
}
......@@ -48,6 +48,9 @@ const char * e_mail_data_session_get_path_from_store (EMailDataSession *msession
CamelFolder * e_mail_session_get_folder_from_path (EMailDataSession *msession, const char *path);
void e_mail_session_emit_ask_password (EMailDataSession *msession, const char *title, const gchar *prompt, const gchar *key);
void e_mail_session_emit_send_receive_completed (EMailDataSession *msession);
void e_mail_session_emit_account_added (EMailDataSession *msession, const char *uid);
void e_mail_session_emit_account_removed (EMailDataSession *msession, const char *uid);
void e_mail_session_emit_account_changed (EMailDataSession *msession, const char *uid);
G_END_DECLS
......
......@@ -46,6 +46,15 @@
</method>
<signal name="sendReceiveComplete">
</signal>
<signal name="AccountAdded">
<arg name="uid" type="s"/>
</signal>
<signal name="AccountRemoved">
<arg name="uid" type="s"/>
</signal>
<signal name="AccountChanged">
<arg name="uid" type="s"/>
</signal>
<signal name="GetPassword">
<arg name="title" type="s"/>
......
......@@ -1082,6 +1082,7 @@ auto_account_removed(EAccountList *eal, EAccount *ea, gpointer dummy)
g_source_remove(info->timeout_id);
info->timeout_id = 0;
}
e_mail_session_emit_account_removed (data_session, ea->uid);
}
static void
......@@ -1125,6 +1126,8 @@ auto_account_added(EAccountList *eal, EAccount *ea, gpointer dummy)
G_OBJECT (ea), "mail-autoreceive", info,
(GDestroyNotify) auto_account_finalised);
auto_account_commit (info);
if (data_session)
e_mail_session_emit_account_added (data_session, ea->uid);
}
static void
......@@ -1135,6 +1138,7 @@ auto_account_changed(EAccountList *eal, EAccount *ea, gpointer dummy)
g_return_if_fail(info != NULL);
auto_account_commit(info);
e_mail_session_emit_account_changed (data_session, ea->uid);
}
static void
......
......@@ -597,6 +597,90 @@ static const _ExtendedGDBusSignalInfo _egdbus_session_cs_signal_info_send_receiv
"send-receive-complete"
};
static const _ExtendedGDBusArgInfo _egdbus_session_cs_signal_info_account_added_ARG_uid =
{
{
-1,
"uid",
"s",
NULL
},
FALSE
};
static const _ExtendedGDBusArgInfo * const _egdbus_session_cs_signal_info_account_added_ARG_pointers[] =
{
&_egdbus_session_cs_signal_info_account_added_ARG_uid,
NULL
};
static const _ExtendedGDBusSignalInfo _egdbus_session_cs_signal_info_account_added =
{
{
-1,
"AccountAdded",
(GDBusArgInfo **) &_egdbus_session_cs_signal_info_account_added_ARG_pointers,
NULL
},
"account-added"
};
static const _ExtendedGDBusArgInfo _egdbus_session_cs_signal_info_account_removed_ARG_uid =
{
{
-1,
"uid",
"s",
NULL
},
FALSE
};
static const _ExtendedGDBusArgInfo * const _egdbus_session_cs_signal_info_account_removed_ARG_pointers[] =
{
&_egdbus_session_cs_signal_info_account_removed_ARG_uid,
NULL
};
static const _ExtendedGDBusSignalInfo _egdbus_session_cs_signal_info_account_removed =
{
{
-1,
"AccountRemoved",
(GDBusArgInfo **) &_egdbus_session_cs_signal_info_account_removed_ARG_pointers,
NULL
},
"account-removed"
};
static const _ExtendedGDBusArgInfo _egdbus_session_cs_signal_info_account_changed_ARG_uid =
{
{
-1,
"uid",
"s",
NULL
},
FALSE
};
static const _ExtendedGDBusArgInfo * const _egdbus_session_cs_signal_info_account_changed_ARG_pointers[] =
{
&_egdbus_session_cs_signal_info_account_changed_ARG_uid,
NULL
};
static const _ExtendedGDBusSignalInfo _egdbus_session_cs_signal_info_account_changed =
{
{
-1,
"AccountChanged",
(GDBusArgInfo **) &_egdbus_session_cs_signal_info_account_changed_ARG_pointers,
NULL
},
"account-changed"
};
static const _ExtendedGDBusArgInfo _egdbus_session_cs_signal_info_get_password_ARG_title =
{
{
......@@ -652,6 +736,9 @@ static const _ExtendedGDBusSignalInfo _egdbus_session_cs_signal_info_get_passwor
static const _ExtendedGDBusSignalInfo * const _egdbus_session_cs_signal_info_pointers[] =
{
&_egdbus_session_cs_signal_info_send_receive_complete,
&_egdbus_session_cs_signal_info_account_added,
&_egdbus_session_cs_signal_info_account_removed,
&_egdbus_session_cs_signal_info_account_changed,
&_egdbus_session_cs_signal_info_get_password,
NULL
};
......@@ -781,6 +868,36 @@ egdbus_session_cs_default_init (EGdbusSessionCSIface *iface)
G_TYPE_NONE,
0);
g_signal_new ("account-added",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EGdbusSessionCSIface, account_added),
NULL,
NULL,
_cclosure_marshal_generic,
G_TYPE_NONE,
1, G_TYPE_STRING);
g_signal_new ("account-removed",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EGdbusSessionCSIface, account_removed),
NULL,
NULL,
_cclosure_marshal_generic,
G_TYPE_NONE,
1, G_TYPE_STRING);
g_signal_new ("account-changed",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (EGdbusSessionCSIface, account_changed),
NULL,
NULL,
_cclosure_marshal_generic,
G_TYPE_NONE,
1, G_TYPE_STRING);
g_signal_new ("get-password",
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
......@@ -805,6 +922,30 @@ egdbus_session_cs_emit_send_receive_complete (
g_signal_emit_by_name (object, "send-receive-complete");
}
void
egdbus_session_cs_emit_account_added (
EGdbusSessionCS *object,
const gchar *uid)
{
g_signal_emit_by_name (object, "account-added", uid);
}
void
egdbus_session_cs_emit_account_removed (
EGdbusSessionCS *object,
const gchar *uid)
{
g_signal_emit_by_name (object, "account-removed", uid);
}
void
egdbus_session_cs_emit_account_changed (
EGdbusSessionCS *object,
const gchar *uid)
{
g_signal_emit_by_name (object, "account-changed", uid);
}
void
egdbus_session_cs_emit_get_password (
EGdbusSessionCS *object,
......@@ -1783,6 +1924,48 @@ _egdbus_session_cs_on_signal_send_receive_complete (
g_variant_new ("()"), NULL);
}
static void
_egdbus_session_cs_on_signal_account_added (
EGdbusSessionCS *object,
const gchar *uid)
{
EGdbusSessionCSStub *stub = EGDBUS_SESSION_CS_STUB (object);
if (stub->priv->connection == NULL)
return;
g_dbus_connection_emit_signal (stub->priv->connection,
NULL, stub->priv->object_path, "org.gnome.evolution.dataserver.mail.Session", "AccountAdded",
g_variant_new ("(s)",
uid), NULL);
}
static void
_egdbus_session_cs_on_signal_account_removed (
EGdbusSessionCS *object,
const gchar *uid)
{
EGdbusSessionCSStub *stub = EGDBUS_SESSION_CS_STUB (object);
if (stub->priv->connection == NULL)
return;
g_dbus_connection_emit_signal (stub->priv->connection,
NULL, stub->priv->object_path, "org.gnome.evolution.dataserver.mail.Session", "AccountRemoved",
g_variant_new ("(s)",
uid), NULL);
}
static void
_egdbus_session_cs_on_signal_account_changed (
EGdbusSessionCS *object,
const gchar *uid)
{
EGdbusSessionCSStub *stub = EGDBUS_SESSION_CS_STUB (object);
if (stub->priv->connection == NULL)
return;
g_dbus_connection_emit_signal (stub->priv->connection,
NULL, stub->priv->object_path, "org.gnome.evolution.dataserver.mail.Session", "AccountChanged",
g_variant_new ("(s)",
uid), NULL);
}
static void
_egdbus_session_cs_on_signal_get_password (
EGdbusSessionCS *object,
......@@ -1805,6 +1988,9 @@ static void
egdbus_session_cs_stub_iface_init (EGdbusSessionCSIface *iface)
{
iface->send_receive_complete = _egdbus_session_cs_on_signal_send_receive_complete;
iface->account_added = _egdbus_session_cs_on_signal_account_added;
iface->account_removed = _egdbus_session_cs_on_signal_account_removed;
iface->account_changed = _egdbus_session_cs_on_signal_account_changed;
iface->get_password = _egdbus_session_cs_on_signal_get_password;
}
......
......@@ -72,6 +72,18 @@ struct _EGdbusSessionCSIface
void (*send_receive_complete) (
EGdbusSessionCS *object);
void (*account_added) (
EGdbusSessionCS *object,
const gchar *uid);
void (*account_removed) (
EGdbusSessionCS *object,
const gchar *uid);
void (*account_changed) (
EGdbusSessionCS *object,
const gchar *uid);
void (*get_password) (
EGdbusSessionCS *object,
const gchar *title,
......@@ -124,6 +136,18 @@ void egdbus_session_cs_complete_cancel_operations (
void egdbus_session_cs_emit_send_receive_complete (
EGdbusSessionCS *object);
void egdbus_session_cs_emit_account_added (
EGdbusSessionCS *object,
const gchar *uid);
void egdbus_session_cs_emit_account_removed (
EGdbusSessionCS *object,
const gchar *uid);
void egdbus_session_cs_emit_account_changed (
EGdbusSessionCS *object,
const gchar *uid);
void egdbus_session_cs_emit_get_password (
EGdbusSessionCS *object,
const gchar *title,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment