1 delegate void ReturnIdentityCallback (IdentityRequest request);
3 class IdentityRequest : Object {
4 public IdCard? id_card = null;
5 public bool complete = false;
7 private MainWindow main_window;
9 private string password;
10 private string certificate;
12 // Only one of these is used, we must support two types for
13 // the DBus and MSRPC servers.
14 ReturnIdentityCallback return_identity_cb = null;
15 SourceFunc source_func_cb = null;
17 public IdentityRequest (MainWindow main_window,
22 this.main_window = main_window;
24 this.password = password;
25 this.certificate = certificate;
28 public void set_return_identity_callback (owned ReturnIdentityCallback cb)
31 this.return_identity_cb = ((owned) cb);
33 this.return_identity_cb = (() => cb ());
37 public void set_source_func_callback (owned SourceFunc cb)
40 this.source_func_cb = ((owned) cb);
42 this.source_func_cb = (() => cb ());
46 public void execute () {
47 main_window.select_identity (this);
50 public void return_identity (IdCard? id_card) {
51 this.id_card = id_card;
54 if (return_identity_cb != null)
55 return_identity_cb (this);
56 else if (source_func_cb != null)