1 delegate void ReturnIdentityCallback (IdentityRequest request);
3 class IdentityRequest : Object {
4 public IdCard? id_card = null;
5 public bool complete = false;
6 public bool select_default = false;
8 private IdentityManagerView main_window;
10 public string password;
11 public string service;
13 ReturnIdentityCallback callback = null;
15 public IdentityRequest (IdentityManagerView main_window,
20 this.main_window = main_window;
22 this.password = password;
23 this.service = service;
26 public IdentityRequest.default (IdentityManagerView main_window)
28 this.main_window = main_window;
29 this.select_default = true;
32 public void set_callback (owned ReturnIdentityCallback cb)
35 this.callback = ((owned) cb);
37 this.callback = ((IdCard) => cb (IdCard));
41 public bool execute () {
42 main_window.select_identity (this);
44 /* This function works as a GSourceFunc, so it can be passed to
45 * the main loop from other threads
50 public void return_identity (IdCard? id_card) {
51 return_if_fail (callback != null);
53 this.id_card = id_card;
60 /* For synchronisation between RPC thread and main loop. Because
61 * these objects are not refcounted, it's best to tie them to the
62 * lifecycle of the IdentityRequest object.