After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 680449 - Add UOA app plugin
Add UOA app plugin
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: UOA
2.33.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
empathy-maint
Depends on: 680448
Blocks:
 
 
Reported: 2012-07-23 13:57 UTC by Guillaume Desmottes
Modified: 2012-07-30 07:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
EmpathyContactWidget: Stop using EmpathyAvatarChooser (8.17 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
accepted-commit_now Details | Review
EmpathyAvatarChooser: rebase on TpAccount API (21.52 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
reviewed Details | Review
EmpathyCalendarButton: Make it work without gtk_widget_show_all (2.11 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
accepted-commit_now Details | Review
EmpathyUserInfo: New widget to edit personal information (26.39 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
none Details | Review
EmpathAccountsDialog: user the new EmpathyUserInfo widget (5.34 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
accepted-commit_now Details | Review
UOA: fix empathy.application XML indentation (1.11 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
accepted-commit_now Details | Review
UOA accounts plugin widget: tweak styling of the info bar (3.50 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
accepted-commit_now Details | Review
add empathy-app-plugin (7.98 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
accepted-commit_now Details | Review
add empathy-app-plugin-widget (14.63 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
reviewed Details | Review
UOA cc plugin: Support editing existing accounts (4.22 KB, patch)
2012-07-29 09:58 UTC, Xavier Claessens
reviewed Details | Review
EmpathyContactWidget: remove unused flags and dead code (35.55 KB, patch)
2012-07-29 11:26 UTC, Xavier Claessens
accepted-commit_now Details | Review
EmpathyContactWidget: remove all remaining flags (12.40 KB, patch)
2012-07-29 11:26 UTC, Xavier Claessens
reviewed Details | Review
EmpathyUserInfo: New widget to edit personal information (25.40 KB, patch)
2012-07-29 11:27 UTC, Xavier Claessens
rejected Details | Review

Description Guillaume Desmottes 2012-07-23 13:57:27 UTC
Such plugin will allow us to change personnal settings from the UOA UI.
Comment 1 Xavier Claessens 2012-07-29 09:58:14 UTC
Created attachment 219817 [details] [review]
EmpathyContactWidget: Stop using EmpathyAvatarChooser

Changing avatar is only used for editing user's information, and
it will soon be replaced by a dedicated widget.

This is done to make easier to change EmpathyAvatarChooser's API before
introducing the new widget.
Comment 2 Xavier Claessens 2012-07-29 09:58:17 UTC
Created attachment 219818 [details] [review]
EmpathyAvatarChooser: rebase on TpAccount API

It can now edit the avatar of a TpAccount passed at construct time.
The image is taken from the TpAccount directly instead of asking
the user to set one. This is much more self contained code.
Comment 3 Xavier Claessens 2012-07-29 09:58:20 UTC
Created attachment 219819 [details] [review]
EmpathyCalendarButton: Make it work without gtk_widget_show_all
Comment 4 Xavier Claessens 2012-07-29 09:58:22 UTC
Created attachment 219820 [details] [review]
EmpathyUserInfo: New widget to edit personal information

This is a much simplified version of EmpathyContactWidget
Comment 5 Xavier Claessens 2012-07-29 09:58:25 UTC
Created attachment 219821 [details] [review]
EmpathAccountsDialog: user the new EmpathyUserInfo widget
Comment 6 Xavier Claessens 2012-07-29 09:58:28 UTC
Created attachment 219822 [details] [review]
UOA: fix empathy.application XML indentation
Comment 7 Xavier Claessens 2012-07-29 09:58:31 UTC
Created attachment 219823 [details] [review]
UOA accounts plugin widget: tweak styling of the info bar
Comment 8 Xavier Claessens 2012-07-29 09:58:34 UTC
Created attachment 219824 [details] [review]
add empathy-app-plugin
Comment 9 Xavier Claessens 2012-07-29 09:58:37 UTC
Created attachment 219825 [details] [review]
add empathy-app-plugin-widget
Comment 10 Xavier Claessens 2012-07-29 09:58:40 UTC
Created attachment 219826 [details] [review]
UOA cc plugin: Support editing existing accounts
Comment 11 Xavier Claessens 2012-07-29 11:26:41 UTC
Created attachment 219829 [details] [review]
EmpathyContactWidget: remove unused flags and dead code

This widget is used only to add a new contact, all its flexibility
isn't needed anymore.
Comment 12 Xavier Claessens 2012-07-29 11:26:44 UTC
Created attachment 219830 [details] [review]
EmpathyContactWidget: remove all remaining flags

It can now be used only in one scenario: add a new contact dialog
Comment 13 Xavier Claessens 2012-07-29 11:27:52 UTC
Created attachment 219831 [details] [review]
EmpathyUserInfo: New widget to edit personal information

This is a much simplified version of EmpathyContactWidget
Comment 14 Guillaume Desmottes 2012-07-29 14:56:11 UTC
Review of attachment 219817 [details] [review]:

++
Comment 15 Guillaume Desmottes 2012-07-29 15:01:53 UTC
Review of attachment 219818 [details] [review]:

::: libempathy-gtk/empathy-avatar-chooser.c
@@ +132,3 @@
+  if (self->priv->account == NULL)
+    {
+    GAsyncResult *result,

How can this happen? We are reffing self while the call is running.

@@ +174,3 @@
+
+  tp_account_get_avatar_async (self->priv->account,
+    }

TpWeakRef maybe?

@@ +185,3 @@
+      get_avatar_cb, g_object_ref (self));
+
+    }

Open a tp-glib bug and link it in this comment.

@@ +190,3 @@
+      NULL);
+
+  pixbuf = empathy_pixbuf_from_data_and_mime ((gchar *) avatar->data,

constructed is supposed to be chain-up first thing in the function.
Comment 16 Guillaume Desmottes 2012-07-29 15:02:19 UTC
Review of attachment 219819 [details] [review]:

++
Comment 17 Guillaume Desmottes 2012-07-29 15:07:28 UTC
Review of attachment 219821 [details] [review]:

++
Comment 18 Guillaume Desmottes 2012-07-29 15:07:29 UTC
Review of attachment 219821 [details] [review]:

++
Comment 19 Guillaume Desmottes 2012-07-29 15:07:49 UTC
Review of attachment 219822 [details] [review]:

++
Comment 20 Guillaume Desmottes 2012-07-29 15:08:27 UTC
Review of attachment 219823 [details] [review]:

++
Comment 21 Guillaume Desmottes 2012-07-29 15:09:36 UTC
Review of attachment 219824 [details] [review]:

++
Comment 22 Guillaume Desmottes 2012-07-29 15:15:44 UTC
Review of attachment 219825 [details] [review]:

++

::: ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin-widget.c
@@ +50,3 @@
+static guint signals[LAST_SIGNAL];
+
+

double \n

@@ +184,3 @@
+  GError *error = NULL;
+
+  if (!tp_account_manager_prepare_all_finish (manager, result, &error))

prepare_all? Is that new API?

@@ +215,3 @@
+      accounts = g_list_delete_link (accounts, accounts);
+    }
+  g_list_free (accounts);

do we still need this as you are destroying the list while iterating over it?

@@ +259,3 @@
+      TP_CONTACT_FEATURE_PRESENCE,
+      TP_CONTACT_FEATURE_LOCATION,
+      TP_CONTACT_FEATURE_INVALID,

Do we really need Presence and Location?
Comment 23 Guillaume Desmottes 2012-07-29 15:19:57 UTC
Review of attachment 219826 [details] [review]:

::: ubuntu-online-accounts/cc-plugins/empathy-accounts-plugin-widget.c
@@ +315,3 @@
+      accounts = g_list_delete_link (accounts, accounts);
+    }
+    {

need to free?
Comment 24 Guillaume Desmottes 2012-07-29 15:20:46 UTC
Review of attachment 219829 [details] [review]:

++
Comment 25 Guillaume Desmottes 2012-07-29 15:24:05 UTC
Review of attachment 219830 [details] [review]:

::: libempathy-gtk/empathy-individual-dialogs.c
@@ +135,3 @@
     contact = empathy_contact_dup_from_folks_individual (individual);
 
+  contact_widget = empathy_contact_widget_new (contact);

can we still set the alias when adding a new contact?
Comment 26 Guillaume Desmottes 2012-07-29 16:18:17 UTC
Review of attachment 219831 [details] [review]:

No need to add it to po/POTFILES.in?
Comment 27 Xavier Claessens 2012-07-30 06:31:58 UTC
(In reply to comment #15)
> Review of attachment 219818 [details] [review]:
> 
> ::: libempathy-gtk/empathy-avatar-chooser.c
> @@ +132,3 @@
> +  if (self->priv->account == NULL)
> +    {
> +    GAsyncResult *result,
> 
> How can this happen? We are reffing self while the call is running.

This happens if the callback arrives after the widget as been destroyed. gtk_widget_destroy() calls dispose on it even if we are still holding a ref. Of course it won't be finalized until we unref, so it's still safe to dereference self->priv.

> @@ +174,3 @@
> +
> +  tp_account_get_avatar_async (self->priv->account,
> +    }
> 
> TpWeakRef maybe?

Good point, did that. It also makes the above stull more obvious :-)

> @@ +185,3 @@
> +      get_avatar_cb, g_object_ref (self));
> +
> +    }
> 
> Open a tp-glib bug and link it in this comment.

done: https://bugs.freedesktop.org/show_bug.cgi?id=52938

> @@ +190,3 @@
> +      NULL);
> +
> +  pixbuf = empathy_pixbuf_from_data_and_mime ((gchar *) avatar->data,
> 
> constructed is supposed to be chain-up first thing in the function.

fixed.
Comment 28 Xavier Claessens 2012-07-30 06:36:32 UTC
(In reply to comment #22)
> Review of attachment 219825 [details] [review]:
> 
> ++
> 
> ::: ubuntu-online-accounts/cc-plugins/app-plugin/empathy-app-plugin-widget.c
> @@ +50,3 @@
> +static guint signals[LAST_SIGNAL];
> +
> +
> 
> double \n

Fixed

> @@ +184,3 @@
> +  GError *error = NULL;
> +
> +  if (!tp_account_manager_prepare_all_finish (manager, result, &error))
> 
> prepare_all? Is that new API?

See https://bugs.freedesktop.org/show_bug.cgi?id=52531, and please review it as well :D

> @@ +215,3 @@
> +      accounts = g_list_delete_link (accounts, accounts);
> +    }
> +  g_list_free (accounts);
> 
> do we still need this as you are destroying the list while iterating over it?

Yes, if it hit the beak it still need to free the rest of the list.

> @@ +259,3 @@
> +      TP_CONTACT_FEATURE_PRESENCE,
> +      TP_CONTACT_FEATURE_LOCATION,
> +      TP_CONTACT_FEATURE_INVALID,
> 
> Do we really need Presence and Location?

no, removed.
Comment 29 Xavier Claessens 2012-07-30 06:37:22 UTC
(In reply to comment #23)
> Review of attachment 219826 [details] [review]:
> 
> ::: ubuntu-online-accounts/cc-plugins/empathy-accounts-plugin-widget.c
> @@ +315,3 @@
> +      accounts = g_list_delete_link (accounts, accounts);
> +    }
> +    {
> 
> need to free?

Same as above: in case of break.
Comment 30 Xavier Claessens 2012-07-30 06:40:37 UTC
(In reply to comment #25)
> Review of attachment 219830 [details] [review]:
> 
> ::: libempathy-gtk/empathy-individual-dialogs.c
> @@ +135,3 @@
>      contact = empathy_contact_dup_from_folks_individual (individual);
> 
> +  contact_widget = empathy_contact_widget_new (contact);
> 
> can we still set the alias when adding a new contact?

Sure, why not? I removed the flag because EmpathyContactWidget now always make it editable.
Comment 31 Xavier Claessens 2012-07-30 06:46:13 UTC
(In reply to comment #26)
> Review of attachment 219831 [details] [review]:
> 
> No need to add it to po/POTFILES.in?

Good point, empathy-app-plugin-widget.c and empathy-accounts-plugin-widget.c as well.

btw how does it know where to find empathy's translations when the code is running as a plugin for another app?
Comment 32 Xavier Claessens 2012-07-30 06:59:54 UTC
(In reply to comment #31)
> (In reply to comment #26)
> > Review of attachment 219831 [details] [review] [details]:
> > 
> > No need to add it to po/POTFILES.in?
> 
> Good point, empathy-app-plugin-widget.c and empathy-accounts-plugin-widget.c as
> well.

Actually only empathy-app-plugin-widget.c was missing.

> btw how does it know where to find empathy's translations when the code is
> running as a plugin for another app?

Replying to myself it seems we just have to include gi18n-lib.h, but it seems some of libempathy/ and libempathy-gtk/ still includes gi18n.h, I'll fix.


I've merged all the commits with the fixes, thanks!