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 657097 - improved avatar chooser with icon preview
improved avatar chooser with icon preview
Status: RESOLVED OBSOLETE
Product: empathy
Classification: Core
Component: Accounts
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks:
 
 
Reported: 2011-08-22 18:21 UTC by Raluca-Elena Podiuc
Modified: 2018-05-22 15:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
avatar-chooser: add new avatar chooser with icon preview (71.69 KB, patch)
2011-08-24 18:04 UTC, Raluca-Elena Podiuc
reviewed Details | Review

Description Raluca-Elena Podiuc 2011-08-22 18:21:48 UTC
Currently the Empathy avatar can be chosen from the open-file-dialog as an image from the disk or a camera capture (if a camera was detected).


Improve Empathy's avatar chooser by presenting:
- a grid of standard or previously used avatars
- an option to get avatar from camera (if a camera was detected)
- an option to select another image
Comment 1 Guillaume Desmottes 2011-08-23 08:18:55 UTC
Cool; do you have a branch/patches? Would be great to get this in for 3.2 (UI freeze is next week).
Comment 2 Raluca-Elena Podiuc 2011-08-23 08:37:42 UTC
I need to tidy things up a bit. I just finished the work Nick requested on the video effects feature. Will post a branch later today or tomorrow. Is that ok?
Comment 3 Guillaume Desmottes 2011-08-23 08:51:22 UTC
sure.
Comment 4 Raluca-Elena Podiuc 2011-08-24 18:04:33 UTC
Created attachment 194647 [details] [review]
avatar-chooser: add new avatar chooser with icon preview
Comment 5 Guillaume Desmottes 2011-08-25 09:02:55 UTC
Review of attachment 194647 [details] [review]:

Looks pretty cool! I didn't review the code yet so here a just general
comments.

Why did you record this commit with another name/email?

Are the um-* files a bare copy from the control center? I'd add a comment in their header documenting the original projects of those files.

You broke "make check", some files should be added to POTFILES.in. Those files should not be added to libempathy_gtk_handwritten_source (they are considered as imported, not written) so their coding style won't be checked.

I hit this error when opening the "edit personnal info" dialog:

Gtk-CRITICAL **: gtk_widget_get_state: assertion `GTK_IS_WIDGET (widget)' failed

Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007fffea8adc88 in g_logv (log_domain=0x7fffef239897 "Gtk", log_level=G_LOG_LEVEL_CRITICAL, 
    format=0x7fffea936178 "%s: assertion `%s' failed", args1=0x7fffffffab80) at gmessages.c:570
570			G_BREAKPOINT ();
(gdb) bt
  • #0 g_logv
    at gmessages.c line 570
  • #1 g_log
    at gmessages.c line 591
  • #2 g_return_if_fail_warning
  • #3 gtk_widget_get_state
    at gtkwidget.c line 7236
  • #4 popup_button_draw
    at um-photo-dialog.c line 533
  • #5 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #6 gtk_widget_draw_marshaller
    at gtkwidget.c line 819
  • #7 g_closure_invoke
    at gclosure.c line 773
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3341
  • #9 g_signal_emit_valist
    at gsignal.c line 3012
  • #10 g_signal_emit
    at gsignal.c line 3059
  • #11 _gtk_widget_draw_internal
    at gtkwidget.c line 5718
  • #12 gtk_container_propagate_draw
    at gtkcontainer.c line 3340
  • #13 gtk_container_draw_child
    at gtkcontainer.c line 3187
  • #14 gtk_box_forall
    at gtkbox.c line 1844
  • #15 gtk_container_forall
    at gtkcontainer.c line 2012
  • #16 gtk_container_draw
    at gtkcontainer.c line 3204
  • #17 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #18 gtk_widget_draw_marshaller
    at gtkwidget.c line 819
  • #19 g_type_class_meta_marshal
    at gclosure.c line 884
  • #20 g_closure_invoke
    at gclosure.c line 773
  • #21 signal_emit_unlocked_R
    at gsignal.c line 3309
  • #22 g_signal_emit_valist
    at gsignal.c line 3012
  • #23 g_signal_emit
    at gsignal.c line 3059
  • #24 _gtk_widget_draw_internal
    at gtkwidget.c line 5718
  • #25 gtk_container_propagate_draw
    at gtkcontainer.c line 3340
  • #26 gtk_container_draw_child
    at gtkcontainer.c line 3187
  • #27 gtk_box_forall
    at gtkbox.c line 1844
  • #28 gtk_container_forall
    at gtkcontainer.c line 2012
  • #29 gtk_container_draw
    at gtkcontainer.c line 3204
  • #30 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #31 gtk_widget_draw_marshaller
    at gtkwidget.c line 819
  • #32 g_type_class_meta_marshal
    at gclosure.c line 884
  • #33 g_closure_invoke
    at gclosure.c line 773
  • #34 signal_emit_unlocked_R
    at gsignal.c line 3309
  • #35 g_signal_emit_valist
    at gsignal.c line 3012
  • #36 g_signal_emit
    at gsignal.c line 3059
  • #37 _gtk_widget_draw_internal
    at gtkwidget.c line 5718
  • #38 gtk_container_propagate_draw
    at gtkcontainer.c line 3340
  • #39 gtk_container_draw_child
    at gtkcontainer.c line 3187
  • #40 gtk_box_forall
    at gtkbox.c line 1844
  • #41 gtk_container_forall
    at gtkcontainer.c line 2012
  • #42 gtk_container_draw
    at gtkcontainer.c line 3204
  • #43 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #44 gtk_widget_draw_marshaller
    at gtkwidget.c line 819
  • #45 g_type_class_meta_marshal
    at gclosure.c line 884
  • #46 g_closure_invoke
    at gclosure.c line 773
  • #47 signal_emit_unlocked_R
    at gsignal.c line 3309
  • #48 g_signal_emit_valist
    at gsignal.c line 3012
  • #49 g_signal_emit
    at gsignal.c line 3059
  • #50 _gtk_widget_draw_internal
    at gtkwidget.c line 5718
  • #51 gtk_container_propagate_draw
    at gtkcontainer.c line 3340
  • #52 gtk_container_draw_child
    at gtkcontainer.c line 3187
  • #53 gtk_box_forall
  • #54 gtk_container_forall
    at gtkcontainer.c line 2012
  • #55 gtk_container_draw
    at gtkcontainer.c line 3204
  • #56 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #57 gtk_widget_draw_marshaller
    at gtkwidget.c line 819
  • #58 g_type_class_meta_marshal
    at gclosure.c line 884
  • #59 g_closure_invoke
    at gclosure.c line 773
  • #60 signal_emit_unlocked_R
    at gsignal.c line 3309
  • #61 g_signal_emit_valist
    at gsignal.c line 3012
  • #62 g_signal_emit
    at gsignal.c line 3059
  • #63 _gtk_widget_draw_internal
    at gtkwidget.c line 5718
  • #64 gtk_container_propagate_draw
    at gtkcontainer.c line 3340
  • #65 gtk_container_draw_child
    at gtkcontainer.c line 3187
  • #66 gtk_bin_forall
    at gtkbin.c line 172
  • #67 gtk_container_forall
    at gtkcontainer.c line 2012
  • #68 gtk_container_draw
    at gtkcontainer.c line 3204
  • #69 gtk_window_draw
    at gtkwindow.c line 7456
  • #70 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #71 gtk_widget_draw_marshaller
    at gtkwidget.c line 819
  • #72 g_type_class_meta_marshal
    at gclosure.c line 884
  • #73 g_closure_invoke
    at gclosure.c line 773
  • #74 signal_emit_unlocked_R
    at gsignal.c line 3309
  • #75 g_signal_emit_valist
    at gsignal.c line 3012
  • #76 g_signal_emit
    at gsignal.c line 3059
  • #77 _gtk_widget_draw_internal
    at gtkwidget.c line 5718
  • #78 gtk_widget_send_expose
    at gtkwidget.c line 5965
  • #79 gtk_main_do_event
    at gtkmain.c line 1801
  • #80 _gdk_event_emit
    at gdkevents.c line 71
  • #81 _gdk_window_process_updates_recurse
    at gdkwindow.c line 3857
  • #82 gdk_x11_window_process_updates_recurse
    at gdkwindow-x11.c line 4672
  • #83 gdk_window_process_updates_internal
    at gdkwindow.c line 4013
  • #84 gdk_window_process_updates
    at gdkwindow.c line 4209
  • #85 gtk_window_move_resize
    at gtkwindow.c line 7025
  • #86 gtk_window_check_resize
    at gtkwindow.c line 6069
  • #87 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #88 g_type_class_meta_marshal
    at gclosure.c line 884
  • #89 g_closure_invoke
    at gclosure.c line 773
  • #90 signal_emit_unlocked_R
    at gsignal.c line 3309
  • #91 g_signal_emit_valist
    at gsignal.c line 3002
  • #92 g_signal_emit
    at gsignal.c line 3059
  • #93 gtk_container_check_resize
    at gtkcontainer.c line 1769
  • #94 gtk_container_idle_sizer
    at gtkcontainer.c line 1659
  • #95 gdk_threads_dispatch
    at gdk.c line 754
  • #96 g_idle_dispatch
    at gmain.c line 4780
  • #97 g_main_dispatch
    at gmain.c line 2439
  • #98 g_main_context_dispatch
    at gmain.c line 3008
  • #99 g_main_context_iterate
    at gmain.c line 3086
  • #100 g_main_loop_run
    at gmain.c line 3294
  • #101 gtk_main
    at gtkmain.c line 1362
  • #102 gtk_application_run_mainloop
    at gtkapplication.c line 112
  • #103 g_application_run
    at gapplication.c line 1325
  • #104 main
    at empathy.c line 788
  • #0 g_logv
    at gmessages.c line 570
  • #1 g_log
    at gmessages.c line 591
  • #2 g_type_check_instance_cast
    at gtype.c line 3993
  • #3 clutter_x11_get_visual_info
    at ./x11/clutter-backend-x11.c line 1189
  • #4 gtk_clutter_embed_realize
    at ./gtk-clutter-embed.c line 218
  • #5 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #6 g_type_class_meta_marshal
    at gclosure.c line 884
  • #7 g_closure_invoke
    at gclosure.c line 773
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3201
  • #9 g_signal_emit_valist
    at gsignal.c line 3002
  • #10 g_signal_emit
    at gsignal.c line 3059
  • #11 gtk_widget_realize
    at gtkwidget.c line 4401
  • #12 cheese_widget_realize
    at cheese-widget.c line 372
  • #13 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #14 g_type_class_meta_marshal
    at gclosure.c line 884
  • #15 g_closure_invoke
    at gclosure.c line 773
  • #16 signal_emit_unlocked_R
    at gsignal.c line 3201
  • #17 g_signal_emit_valist
    at gsignal.c line 3002
  • #18 g_signal_emit
    at gsignal.c line 3059
  • #19 gtk_widget_realize
    at gtkwidget.c line 4401
  • #20 gtk_widget_map
    at gtkwidget.c line 4171
  • #21 gtk_container_map_child
    at gtkcontainer.c line 3218
  • #22 gtk_box_forall
    at gtkbox.c line 1844
  • #23 gtk_container_forall
    at gtkcontainer.c line 2012
  • #24 gtk_container_map
    at gtkcontainer.c line 3226
  • #25 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #26 g_type_class_meta_marshal
    at gclosure.c line 884
  • #27 g_closure_invoke
    at gclosure.c line 773
  • #28 signal_emit_unlocked_R
    at gsignal.c line 3201
  • #29 g_signal_emit_valist
    at gsignal.c line 3002
  • #30 g_signal_emit
    at gsignal.c line 3059
  • #31 gtk_widget_map
    at gtkwidget.c line 4173
  • #32 gtk_notebook_map
    at gtknotebook.c line 1815
  • #33 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #34 g_type_class_meta_marshal
    at gclosure.c line 884
  • #35 g_closure_invoke
    at gclosure.c line 773
  • #36 signal_emit_unlocked_R
    at gsignal.c line 3201
  • #37 g_signal_emit_valist
    at gsignal.c line 3002
  • #38 g_signal_emit
    at gsignal.c line 3059
  • #39 gtk_widget_map
    at gtkwidget.c line 4173
  • #40 gtk_container_map_child
    at gtkcontainer.c line 3218
  • #41 gtk_box_forall
    at gtkbox.c line 1844
  • #42 gtk_container_forall
    at gtkcontainer.c line 2012
  • #43 gtk_container_map
    at gtkcontainer.c line 3226
  • #44 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #45 g_type_class_meta_marshal
    at gclosure.c line 884
  • #46 g_closure_invoke
    at gclosure.c line 773
  • #47 signal_emit_unlocked_R
    at gsignal.c line 3201
  • #48 g_signal_emit_valist
    at gsignal.c line 3002
  • #49 g_signal_emit
    at gsignal.c line 3059
  • #50 gtk_widget_map
    at gtkwidget.c line 4173
  • #51 gtk_window_map
    at gtkwindow.c line 4734
  • #52 gtk_dialog_map
    at gtkdialog.c line 464
  • #53 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #54 g_type_class_meta_marshal
  • #55 g_closure_invoke
    at gclosure.c line 773
  • #56 signal_emit_unlocked_R
    at gsignal.c line 3201
  • #57 g_signal_emit_valist
    at gsignal.c line 3002
  • #58 g_signal_emit
    at gsignal.c line 3059
  • #59 gtk_widget_map
    at gtkwidget.c line 4173
  • #60 gtk_window_show
    at gtkwindow.c line 4673
  • #61 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #62 g_type_class_meta_marshal
    at gclosure.c line 884
  • #63 g_closure_invoke
    at gclosure.c line 773
  • #64 signal_emit_unlocked_R
    at gsignal.c line 3201
  • #65 g_signal_emit_valist
    at gsignal.c line 3002
  • #66 g_signal_emit
    at gsignal.c line 3059
  • #67 gtk_widget_show
    at gtkwidget.c line 3905
  • #68 webcam_icon_selected
    at um-photo-dialog.c line 297
  • #69 g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 85
  • #70 g_closure_invoke
    at gclosure.c line 773
  • #71 signal_emit_unlocked_R
    at gsignal.c line 3271
  • #72 g_signal_emit_valist
    at gsignal.c line 3002
  • #73 g_signal_emit
    at gsignal.c line 3059
  • #74 gtk_widget_activate
    at gtkwidget.c line 6159
  • #75 gtk_menu_shell_activate_item
    at gtkmenushell.c line 1407
  • #76 gtk_menu_shell_button_release
    at gtkmenushell.c line 806
  • #77 gtk_menu_button_release
    at gtkmenu.c line 3476
  • #78 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #79 g_type_class_meta_marshal
    at gclosure.c line 884
  • #80 g_closure_invoke
    at gclosure.c line 773
  • #81 signal_emit_unlocked_R
    at gsignal.c line 3309
  • #82 g_signal_emit_valist
    at gsignal.c line 3012
  • #83 g_signal_emit
    at gsignal.c line 3059
  • #84 gtk_widget_event_internal
    at gtkwidget.c line 6128
  • #85 gtk_widget_event
    at gtkwidget.c line 5844
  • #86 gtk_propagate_event
    at gtkmain.c line 2614
  • #87 gtk_main_do_event
    at gtkmain.c line 1889
  • #88 _gdk_event_emit
    at gdkevents.c line 71
  • #89 gdk_event_source_dispatch
    at gdkeventsource.c line 360
  • #90 g_main_dispatch
    at gmain.c line 2439
  • #91 g_main_context_dispatch
    at gmain.c line 3008
  • #92 g_main_context_iterate
    at gmain.c line 3086
  • #93 g_main_loop_run
    at gmain.c line 3294
  • #94 gtk_main
    at gtkmain.c line 1362
  • #95 gtk_application_run_mainloop
    at gtkapplication.c line 112
  • #96 g_application_run
    at gapplication.c line 1325
  • #97 main
    at empathy.c line 788

Comment 6 Guillaume Desmottes 2011-08-25 09:18:25 UTC
Review of attachment 194647 [details] [review]:

::: libempathy-gtk/empathy-avatar-chooser.c
@@ -74,3 @@
-#define EMPATHY_AVATAR_CHOOSER_RESPONSE_NO_IMAGE GTK_RESPONSE_NO
-#define EMPATHY_AVATAR_CHOOSER_RESPONSE_CANCEL   GTK_RESPONSE_CANCEL
- */

More stuffs are not used any more: AVATAR_SIZE_SAVE, DEFAULT_DIR, priv->chooser_dialog, gsettings_ui, etc.

I guess that means we can remove the EMPATHY_PREFS_UI_AVATAR_DIRECTORY gsetting key.

::: libempathy-gtk/empathy-avatar-chooser.h
@@ +69,3 @@
     TpAccount *account);
 
+void avatar_chooser_set_image_from_file (EmpathyAvatarChooser *self,

exported methods should be prefixed with empathy_

::: libempathy-gtk/um-photo-dialog.c
@@ +38,3 @@
+#include "um-crop-area.h"
+#include "um-utils.h"
+#include "empathy-avatar-chooser.h"

Ok, so this one has obvioulsy be modified to work with Empathy. It would be much cleaner and easier to maintain to keep um-* files as a bare copy from CC (so we can just sync this file when needed). Would it be possible to modify this object to fire signals that would be catched in EmpathyAvatarChooser?
Comment 7 Guillaume Desmottes 2011-08-25 09:22:02 UTC
Review of attachment 194647 [details] [review]:

::: libempathy-gtk/um-photo-dialog.c
@@ +426,3 @@
+                goto skip_faces;
+
+        image = gtk_image_new_from_icon_name ("avatar-default", GTK_ICON_SIZE_DIALOG);

It's not that clear that selecting this image will unset your avatar. I think we should be more explicit like, maybe a "Unset avatar" entry in the bottom menu?

Btw, unsetting avatar doesn't seem to work.
Comment 8 Raluca-Elena Podiuc 2011-08-25 10:27:11 UTC
I was working on my boyfriend's computer because on mine empathy was crashing (see bug #657271) and I forgot to configure git's user.email/user.name. Will fix.

I stripped down um-utils.c|h because we didn't need most of the functions from there.

um-crop-area.c|h are copy-pasted in libcheese too. I think these should go to a lower-level library (maybe gtk itself) but I don't know where it would be more suited.

I removed from um-photo-dialog.c|h all stuff that was related to um-user (including a pointer to a UmUser from the UmPhotoDialog structure).

UmPhotoDialog would need to be split into a low level UmPhotoDialog that would communicate with signals as you said earlier or call pointers to functions and classes that would work using this low-level UmPhotoDialog. I don't know if there's time to do that before the freeze in gnome-control-center/empathy.
Comment 9 Raluca-Elena Podiuc 2011-09-02 20:23:21 UTC
Hi,
I just got home with a dead laptop from my grandfather :(.I am trying to install on my home desktop all the stuff to make the changes.  
Is it still in time if I make the changes till tomorrow night?
Comment 10 Emilio Pozuelo Monfort 2011-09-05 10:30:05 UTC
Probably needs a freeze exception.
Comment 11 Nick Richards 2011-09-05 10:48:26 UTC
We should still ask for it though, since it shouldn't add to the translation and documentation load etc. as it's the same design that's used elsewhere.
Comment 12 André Klapper 2012-02-02 20:49:38 UTC
Raluca-Elena: Do you plan to continue working on this patch, or is anybody free to pick up your work? :)
Comment 13 Raluca-Elena Podiuc 2012-02-05 09:04:02 UTC
Yeap. I will look at it this week.If I can't find the time I will let you know.
Comment 14 GNOME Infrastructure Team 2018-05-22 15:01:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/empathy/issues/421.