diff options
Diffstat (limited to 'hardinfo2')
-rw-r--r-- | hardinfo2/callbacks.c | 24 | ||||
-rw-r--r-- | hardinfo2/callbacks.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/hardinfo2/callbacks.c b/hardinfo2/callbacks.c index 1d27b5f7..3b77bd33 100644 --- a/hardinfo2/callbacks.c +++ b/hardinfo2/callbacks.c @@ -27,6 +27,7 @@ #include "report.h" #include "syncmanager.h" #include "help-viewer.h" +#include "xmlrpc-server.h" #include "config.h" @@ -72,6 +73,29 @@ void cb_connect_host(GtkAction * action) g_free(name); } +static gboolean server_start_helper(gpointer server_loop) +{ + GMainLoop *loop = (GMainLoop *)server_loop; + + xmlrpc_server_start(loop); + + return FALSE; +} + +void cb_act_as_server() +{ + gboolean accepting; + static GMainLoop *server_loop = NULL; + + accepting = shell_action_get_active("ActAsServerAction"); + if (accepting) { + server_loop = g_main_loop_new(NULL, FALSE); + g_idle_add(server_start_helper, server_loop); + } else { + g_main_loop_quit(server_loop); + } +} + void cb_local_computer() { Shell *shell = shell_get_main_shell(); diff --git a/hardinfo2/callbacks.h b/hardinfo2/callbacks.h index 9f145554..8cb29a87 100644 --- a/hardinfo2/callbacks.h +++ b/hardinfo2/callbacks.h @@ -39,5 +39,6 @@ void cb_connect_to(); void cb_manage_hosts(); void cb_connect_host(GtkAction * action); void cb_local_computer(); +void cb_act_as_server(); #endif /* __CALLBACKS_H__ */ |