[gnome-online-accounts] Add Chat account type
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] Add Chat account type
- Date: Thu, 23 Jun 2011 20:07:43 +0000 (UTC)
commit 851c46d18f523240d65ce275e05b2f30d8dd608a
Author: Bastien Nocera <hadess hadess net>
Date: Tue Jun 14 16:20:49 2011 +0100
Add Chat account type
And implement it in the Google backend
https://bugzilla.gnome.org/show_bug.cgi?id=652574
data/dbus-interfaces.xml | 9 ++++++++
doc/goa-docs.xml | 2 +
doc/goa-sections.txt | 40 ++++++++++++++++++++++++++++++++++++
src/goabackend/goagoogleprovider.c | 24 +++++++++++++++++++++
4 files changed, 75 insertions(+), 0 deletions(-)
---
diff --git a/data/dbus-interfaces.xml b/data/dbus-interfaces.xml
index dd37c95..8e078f2 100644
--- a/data/dbus-interfaces.xml
+++ b/data/dbus-interfaces.xml
@@ -344,4 +344,13 @@
<interface name="org.gnome.OnlineAccounts.Contacts">
</interface>
+ <!--
+ org.gnome.OnlineAccounts.Chat:
+
+ An account object implements this interface if it provides
+ chat-like capabilities.
+ -->
+ <interface name="org.gnome.OnlineAccounts.Chat">
+ </interface>
+
</node>
diff --git a/doc/goa-docs.xml b/doc/goa-docs.xml
index 4967e4e..1d0922c 100644
--- a/doc/goa-docs.xml
+++ b/doc/goa-docs.xml
@@ -109,6 +109,7 @@
<xi:include href="../src/goa/goa-generated-doc-org.gnome.OnlineAccounts.Mail.xml"/>
<xi:include href="../src/goa/goa-generated-doc-org.gnome.OnlineAccounts.Calendar.xml"/>
<xi:include href="../src/goa/goa-generated-doc-org.gnome.OnlineAccounts.Contacts.xml"/>
+ <xi:include href="../src/goa/goa-generated-doc-org.gnome.OnlineAccounts.Chat.xml"/>
</chapter>
</part>
@@ -127,6 +128,7 @@
<xi:include href="xml/GoaMail.xml"/>
<xi:include href="xml/GoaCalendar.xml"/>
<xi:include href="xml/GoaContacts.xml"/>
+ <xi:include href="xml/GoaChat.xml"/>
</chapter>
</part>
diff --git a/doc/goa-sections.txt b/doc/goa-sections.txt
index 7ec98c0..ca5416d 100644
--- a/doc/goa-sections.txt
+++ b/doc/goa-sections.txt
@@ -567,6 +567,46 @@ goa_contacts_skeleton_get_type
</SECTION>
<SECTION>
+<FILE>GoaChat</FILE>
+GoaChat
+GoaChatIface
+goa_chat_interface_info
+GoaChatProxy
+GoaChatProxyClass
+goa_chat_proxy_new
+goa_chat_proxy_new_finish
+goa_chat_proxy_new_sync
+goa_chat_proxy_new_for_bus
+goa_chat_proxy_new_for_bus_finish
+goa_chat_proxy_new_for_bus_sync
+GoaChatSkeleton
+GoaChatSkeletonClass
+goa_chat_skeleton_new
+<SUBSECTION Standard>
+GOA_TYPE_CHAT
+GOA_IS_CHAT
+GOA_CHAT
+GOA_CHAT_GET_IFACE
+GOA_TYPE_CHAT_PROXY
+GOA_IS_CHAT_PROXY
+GOA_IS_CHAT_PROXY_CLASS
+GOA_CHAT_PROXY
+GOA_CHAT_PROXY_CLASS
+GOA_CHAT_PROXY_GET_CLASS
+GOA_TYPE_CHAT_SKELETON
+GOA_IS_CHAT_SKELETON
+GOA_IS_CHAT_SKELETON_CLASS
+GOA_CHAT_SKELETON
+GOA_CHAT_SKELETON_CLASS
+GOA_CHAT_SKELETON_GET_CLASS
+GoaChatProxyPrivate
+GoaChatSkeletonPrivate
+goa_chat_get_type
+goa_chat_proxy_get_type
+goa_chat_skeleton_get_type
+</SECTION>
+
+<SECTION>
<FILE>goalog</FILE>
GoaLogLevel
goa_log
diff --git a/src/goabackend/goagoogleprovider.c b/src/goabackend/goagoogleprovider.c
index 8260968..d59860d 100644
--- a/src/goabackend/goagoogleprovider.c
+++ b/src/goabackend/goagoogleprovider.c
@@ -253,15 +253,18 @@ build_object (GoaProvider *provider,
GoaMail *mail;
GoaCalendar *calendar;
GoaContacts *contacts;
+ GoaChat *chat;
gboolean ret;
gboolean mail_enabled;
gboolean calendar_enabled;
gboolean contacts_enabled;
+ gboolean chat_enabled;
account = NULL;
mail = NULL;
calendar = NULL;
contacts = NULL;
+ chat = NULL;
ret = FALSE;
/* Chain up */
@@ -338,10 +341,29 @@ build_object (GoaProvider *provider,
goa_object_skeleton_set_contacts (object, NULL);
}
+ /* Chat */
+ chat = goa_object_get_chat (GOA_OBJECT (object));
+ chat_enabled = g_key_file_get_boolean (key_file, group, "ChatEnabled", NULL);
+ if (chat_enabled)
+ {
+ if (chat == NULL)
+ {
+ chat = goa_chat_skeleton_new ();
+ goa_object_skeleton_set_chat (object, chat);
+ }
+ }
+ else
+ {
+ if (chat != NULL)
+ goa_object_skeleton_set_chat (object, NULL);
+ }
+
ret = TRUE;
out:
+ if (chat != NULL)
+ g_object_unref (chat);
if (contacts != NULL)
g_object_unref (contacts);
if (calendar != NULL)
@@ -378,6 +400,7 @@ show_account (GoaProvider *provider,
goa_util_add_row_switch_from_keyfile (table, object, _("Mail"), "MailEnabled");
goa_util_add_row_switch_from_keyfile (table, object, _("Calendar"), "CalendarEnabled");
goa_util_add_row_switch_from_keyfile (table, object, _("Contacts"), "ContactsEnabled");
+ goa_util_add_row_switch_from_keyfile (table, object, _("Chat"), "ChatEnabled");
}
/* ---------------------------------------------------------------------------------------------------- */
@@ -389,6 +412,7 @@ add_account_key_values (GoaOAuthProvider *provider,
g_variant_builder_add (builder, "{ss}", "MailEnabled", "true");
g_variant_builder_add (builder, "{ss}", "CalendarEnabled", "true");
g_variant_builder_add (builder, "{ss}", "ContactsEnabled", "true");
+ g_variant_builder_add (builder, "{ss}", "ChatEnabled", "true");
}
/* ---------------------------------------------------------------------------------------------------- */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]