summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2009-08-10 15:20:46 -0300
committerLeandro A. F. Pereira <leandro@hardinfo.org>2009-08-10 15:20:46 -0300
commit58f91c51b739e55676b732cb4b4eefa7ba16a40b (patch)
tree4f68cda81cae970a10ab4aa288ed562f59a95936
parent99fdf857f95bf57b77291c9e1bf23dacd243f2d9 (diff)
Forgot to commit changes to callbacks.[ch] :)
-rw-r--r--hardinfo2/callbacks.c24
-rw-r--r--hardinfo2/callbacks.h1
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__ */