aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/callbacks.c
diff options
context:
space:
mode:
Diffstat (limited to 'hardinfo2/callbacks.c')
-rw-r--r--hardinfo2/callbacks.c24
1 files changed, 24 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();