private EventBox event_box;
public signal void expanded ();
+ public signal void remove_id ();
+ public signal void details_id ();
public void collapse ()
{
return false;
}
+ private void delete_button_cb ()
+ {
+ this.remove_id ();
+ }
+
+ private void details_button_cb ()
+ {
+ this.details_id ();
+ }
+
private void set_idcard_color ()
{
var color = Gdk.Color ();
this.event_box.modify_bg (state, color);
}
- public IdCardWidget ()
+ public IdCardWidget (IdCard id_card)
{
- Gdk.Pixbuf pixbuf;
+ this.id_card = id_card;
- var icon_theme = IconTheme.get_default ();
- try
- {
- pixbuf = icon_theme.load_icon ("avatar-default",
- 48,
- IconLookupFlags.FORCE_SIZE);
- }
- catch (Error e)
- {
- pixbuf = null;
- stdout.printf("Error: %s\n", e.message);
- }
- var image = new Image.from_pixbuf (pixbuf);
+ var image = new Image.from_pixbuf (id_card.pixbuf);
- var issuer = Markup.printf_escaped ("<b>%s</b>", "University");
+ var issuer = Markup.printf_escaped ("<b>%s</b>", this.id_card.issuer);
var services = Markup.printf_escaped ("<i>%s</i>", "Send Email, Connect to jabber");
var text = issuer + "\n" + services;
hbutton_box.pack_end (details_button);
hbutton_box.pack_end (send_button);
+ delete_button.clicked.connect (delete_button_cb);
+ details_button.clicked.connect (details_button_cb);
+
this.main_vbox = new VBox (false, 12);
main_vbox.pack_start (table, true, true, 0);
main_vbox.pack_start (hbutton_box, false, false, 0);