X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fmoonshot-msrpc-server.vala;h=937f616a44e946d8822ad2f3cef1072a328da7e1;hb=2b94b6286fa49cac7c3ba96fd1e1c5b2fe9002c3;hp=ff718d2f48403bf8d430ad162fd70788ac91de84;hpb=dae6ff16c79372f6cf033f28da934a43f0c7a2f3;p=moonshot-ui.git diff --git a/src/moonshot-msrpc-server.vala b/src/moonshot-msrpc-server.vala index ff718d2..937f616 100644 --- a/src/moonshot-msrpc-server.vala +++ b/src/moonshot-msrpc-server.vala @@ -8,25 +8,22 @@ using MoonshotRpcInterface; public class IdentityRequest : Object { private Rpc.AsyncCall call; private MainWindow main_window; - private char **p_identity; - private char **p_password; - private char **p_service; + private Identity **result; public IdentityRequest (Rpc.AsyncCall _call, Gtk.Window window, - char **_p_identity, - char **_p_password, - char **_p_service) + Identity **_result) { call = _call; - p_identity = _p_identity; - p_password = _p_password; - p_service = _p_service; + main_window = (MainWindow)window; + result = _result; } public bool main_loop_cb () { - main_window.set_callback (id_card_selected_cb); + // Execution is passed from the RPC get_identity() call to + // here, where we are inside the main loop thread. + main_window.set_callback (this.id_card_selected_cb); return false; } @@ -34,9 +31,16 @@ public class IdentityRequest : Object { { var id_card = this.main_window.selected_id_card_widget.id_card; - *p_identity = "identity"; - *p_password = id_card.password; - *p_service = "certificate"; + *result = new Identity(); + + (*result)->identity = "identity"; + (*result)->password = id_card.password; + (*result)->service = "certificate"; + + call.return (null); + + //delete result; + return false; } } @@ -49,7 +53,6 @@ public class IdentityRequest : Object { * Shutdown is automatically done by the RPC runtime when the * process ends */ - public class MoonshotServer : Object { private static int counter; private static MainWindow main_window; @@ -85,15 +88,9 @@ public class MoonshotServer : Object { string in_identity, string in_password, string in_service, - char **out_identity, - char **out_password, - char **out_service) + Identity **result) { - IdentityRequest request = new IdentityRequest (call, - main_window, - out_identity, - out_password, - out_service); + IdentityRequest request = new IdentityRequest (call, main_window, result); // Pass execution to the main loop thread Idle.add (request.main_loop_cb);