IdCard should not depend on GDK.
Instead, add utility function to find the correct pixbuf given an IdCard.
For now, it simply returns the "avatar-default" icon, but should eventually
do something intelligent based on the IdCard data.
This incidentally fixes the bug that id's from the keyring data store didn't
get the avatar-default icon.
public TrustAnchor trust_anchor { get; set; default = new TrustAnchor (); }
- public Gdk.Pixbuf pixbuf { get; set; default = null; }
-
public unowned string nai { get { _nai = username + "@" + issuer; return _nai;}}
public bool store_password { get; set; default = false; }
{
this.id_card = id_card;
- var image = new Image.from_pixbuf (id_card.get_data ("pixbuf"));
+ var image = new Image.from_pixbuf (get_pixbuf(id_card));
label = new Label (null);
label.set_alignment ((float) 0, (float) 0.5);
id_card.password = dialog.password;
id_card.store_password = dialog.store_password;
id_card.services = {};
- id_card.set_data("pixbuf", find_icon ("avatar-default", 48));
return id_card;
}
TreeIter iter;
Gdk.Pixbuf pixbuf;
this.listmodel->append (out iter);
- pixbuf = id_card.get_data("pixbuf");
+ pixbuf = get_pixbuf(id_card);
listmodel->set (iter,
Columns.IDCARD_COL, id_card,
Columns.LOGO_COL, pixbuf,
#endif
if (ret == Gtk.ResponseType.YES) {
- id_card.set_data ("pixbuf", find_icon ("avatar-default", 48));
this.identities_manager.add_card (id_card, force_flat_file_store);
return true;
}
id_card.password = key_file.get_string (identity, "Password");
id_card.services = key_file.get_string_list (identity, "Services");
id_card.display_name = key_file.get_string (identity, "DisplayName");
- id_card.set_data ("pixbuf", find_icon ("avatar-default", 48));
if (key_file.has_key (identity, "StorePassword")) {
id_card.store_password = (key_file.get_string (identity, "StorePassword") == "yes");
} else {
public bool gtk_available = false;
+public Gdk.Pixbuf? get_pixbuf(IdCard id)
+{
+ return find_icon("avatar-default", 48);
+}
+
public Gdk.Pixbuf? find_icon (string name, int size)
{
if (!gtk_available)