diff options
| author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2009-08-10 15:20:46 -0300 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2009-08-10 15:20:46 -0300 | 
| commit | 58f91c51b739e55676b732cb4b4eefa7ba16a40b (patch) | |
| tree | 4f68cda81cae970a10ab4aa288ed562f59a95936 /hardinfo2 | |
| parent | 99fdf857f95bf57b77291c9e1bf23dacd243f2d9 (diff) | |
Forgot to commit changes to callbacks.[ch] :)
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__ */ | 
