misc: move ::change_avatar to ContactEditor source
This was previously misplaced, now, with the cleaning you can tell easily.
This commit is contained in:
parent
de76b16a99
commit
17abc28ba1
2 changed files with 21 additions and 21 deletions
|
@ -20,6 +20,27 @@ using Gtk;
|
|||
using Folks;
|
||||
using Gee;
|
||||
|
||||
namespace Contacts {
|
||||
public static void change_avatar (Contact contact, ContactFrame image_frame) {
|
||||
var dialog = new AvatarDialog (contact);
|
||||
dialog.show ();
|
||||
dialog.set_avatar.connect ( (icon) => {
|
||||
Value v = Value (icon.get_type ());
|
||||
v.set_object (icon);
|
||||
Contact.set_individual_property.begin (contact,
|
||||
"avatar", v,
|
||||
(obj, result) => {
|
||||
try {
|
||||
Contact.set_individual_property.end (result);
|
||||
} catch (GLib.Error e) {
|
||||
App.app.show_message (e.message);
|
||||
image_frame.set_image (contact.individual, contact);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class Contacts.AddressEditor : Box {
|
||||
public Entry? entries[7];
|
||||
public PostalAddressFieldDetails details;
|
||||
|
|
|
@ -22,27 +22,6 @@ using Gee;
|
|||
|
||||
const int PROFILE_SIZE = 96;
|
||||
|
||||
namespace Contacts {
|
||||
public static void change_avatar (Contact contact, ContactFrame image_frame) {
|
||||
var dialog = new AvatarDialog (contact);
|
||||
dialog.show ();
|
||||
dialog.set_avatar.connect ( (icon) => {
|
||||
Value v = Value (icon.get_type ());
|
||||
v.set_object (icon);
|
||||
Contact.set_individual_property.begin (contact,
|
||||
"avatar", v,
|
||||
(obj, result) => {
|
||||
try {
|
||||
Contact.set_individual_property.end (result);
|
||||
} catch (GLib.Error e) {
|
||||
App.app.show_message (e.message);
|
||||
image_frame.set_image (contact.individual, contact);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class Contacts.ContactPane : Notebook {
|
||||
private Store _store;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue