diff options
author | Leandro Pereira <leandro@hardinfo.org> | 2009-09-08 10:28:56 -0300 |
---|---|---|
committer | Leandro Pereira <leandro@hardinfo.org> | 2009-09-08 10:28:56 -0300 |
commit | 0ae7e8020647dafaa382d7a9e82e46f2d63c132a (patch) | |
tree | 5923cfc6cb280a2b777484e67c4be0fbfa72d2fe /hardinfo2 | |
parent | 5e9949c3834f46faf76d6e57b10079cbd7687094 (diff) |
Cleanups
Diffstat (limited to 'hardinfo2')
-rw-r--r-- | hardinfo2/callbacks.c | 12 | ||||
-rw-r--r-- | hardinfo2/help-viewer.h | 3 | ||||
-rw-r--r-- | hardinfo2/remote.c | 6 | ||||
-rw-r--r-- | hardinfo2/ssh-conn.h | 4 | ||||
-rw-r--r-- | hardinfo2/uidefs.h | 9 | ||||
-rw-r--r-- | hardinfo2/xmlrpc-client.c | 4 | ||||
-rw-r--r-- | hardinfo2/xmlrpc-client.h | 4 | ||||
-rw-r--r-- | hardinfo2/xmlrpc-server.c | 1 | ||||
-rw-r--r-- | hardinfo2/xmlrpc-server.h | 3 |
9 files changed, 40 insertions, 6 deletions
diff --git a/hardinfo2/callbacks.c b/hardinfo2/callbacks.c index a7a784ef..c3b3b972 100644 --- a/hardinfo2/callbacks.c +++ b/hardinfo2/callbacks.c @@ -40,20 +40,25 @@ void cb_sync_manager() void cb_connect_to() { +#ifdef HAS_LIBSOUP Shell *shell = shell_get_main_shell(); connect_dialog_show(shell->window); +#endif /* HAS_LIBSOUP */ } void cb_manage_hosts() { +#ifdef HAS_LIBSOUP Shell *shell = shell_get_main_shell(); host_manager_show(shell->window); +#endif /* HAS_LIBSOUP */ } void cb_connect_host(GtkAction * action) { +#ifdef HAS_LIBSOUP Shell *shell = shell_get_main_shell(); gchar *name; @@ -71,19 +76,23 @@ void cb_connect_host(GtkAction * action) } g_free(name); +#endif /* HAS_LIBSOUP */ } static gboolean server_start_helper(gpointer server_loop) { +#ifdef HAS_LIBSOUP GMainLoop *loop = (GMainLoop *)server_loop; xmlrpc_server_start(loop); return FALSE; +#endif /* HAS_LIBSOUP */ } void cb_act_as_server() { +#ifdef HAS_LIBSOUP gboolean accepting; static GMainLoop *server_loop = NULL; @@ -94,10 +103,12 @@ void cb_act_as_server() } else { g_main_loop_quit(server_loop); } +#endif /* HAS_LIBSOUP */ } void cb_local_computer() { +#ifdef HAS_LIBSOUP Shell *shell = shell_get_main_shell(); shell_status_update("Disconnecting..."); @@ -115,6 +126,7 @@ void cb_local_computer() shell_view_set_enabled(TRUE); shell_status_update("Done."); shell_set_remote_label(shell, "Local"); +#endif /* HAS_LIBSOUP */ } void cb_save_graphic() diff --git a/hardinfo2/help-viewer.h b/hardinfo2/help-viewer.h index fc036cf5..688ff325 100644 --- a/hardinfo2/help-viewer.h +++ b/hardinfo2/help-viewer.h @@ -39,4 +39,5 @@ HelpViewer *help_viewer_new(const gchar *help_dir, const gchar *help_file); void help_viewer_open_page(HelpViewer *help_viewer, const gchar *page); void help_viewer_destroy(HelpViewer *help_viewer); -#endif /* __HELP_VIEWER_H__ */
\ No newline at end of file +#endif /* __HELP_VIEWER_H__ */ + diff --git a/hardinfo2/remote.c b/hardinfo2/remote.c index 0aacf61c..eab799a6 100644 --- a/hardinfo2/remote.c +++ b/hardinfo2/remote.c @@ -21,6 +21,9 @@ #include <string.h> #include "config.h" + +#ifdef HAS_LIBSOUP + #include "shell.h" #include "iconcache.h" #include "hardinfo.h" @@ -1187,3 +1190,6 @@ static HostManager *host_manager_new(GtkWidget * parent) return rd; } + +#endif /* HAS_LIBSOUP */ + diff --git a/hardinfo2/ssh-conn.h b/hardinfo2/ssh-conn.h index 654f90c3..b1b0a9ca 100644 --- a/hardinfo2/ssh-conn.h +++ b/hardinfo2/ssh-conn.h @@ -25,6 +25,8 @@ #ifndef __SSH_CONN_H__ #define __SSH_CONN_H__ +#include "config.h" +#ifdef HAS_LIBSOUP #include <libsoup/soup.h> typedef struct _SSHConn SSHConn; @@ -60,5 +62,5 @@ int ssh_write(SSHConn * conn, int ssh_read(gint fd, gpointer buffer, gint num_bytes, gint * bytes_read); const char *ssh_conn_errors[10]; - +#endif /* HAS_LIBSOUP */ #endif /* __SSH_CONN_H__ */ diff --git a/hardinfo2/uidefs.h b/hardinfo2/uidefs.h index cc8d057b..707d9c6e 100644 --- a/hardinfo2/uidefs.h +++ b/hardinfo2/uidefs.h @@ -20,8 +20,12 @@ " <menuitem name=\"LocalComputer\" action=\"LocalComputerAction\" />" \ " </menu>" +#define SYNC_MANAGER_ITEMS " <separator/>" \ +" <menuitem name=\"SyncManager\" action=\"SyncManagerAction\" />" + #else /* !HAS_LIBSOUP */ #define REMOTE_MENU_ITEMS +#define SYNC_MANAGER_ITEMS #endif /* !HAS_LIBSOUP */ char *uidefs_str = "<ui>" \ @@ -29,8 +33,7 @@ char *uidefs_str = "<ui>" \ " <menu name=\"InformationMenu\" action=\"InformationMenuAction\">" \ " <menuitem name=\"Report\" action=\"ReportAction\" />" \ " <menuitem name=\"Copy\" action=\"CopyAction\" />" \ -" <separator/>" \ -" <menuitem name=\"SyncManager\" action=\"SyncManagerAction\" />" \ +SYNC_MANAGER_ITEMS /* * Save Image is not ready for prime time. Yet. * "<menuitem name=\"SaveGraph\" action=\"SaveGraphAction\" />" \ @@ -45,7 +48,7 @@ char *uidefs_str = "<ui>" \ " <separator name=\"LastSep\"/>" \ " <menuitem name=\"Refresh\" action=\"RefreshAction\"/>" \ " </menu>" \ -REMOTE_MENU_ITEMS +REMOTE_MENU_ITEMS \ " <menu name=\"HelpMenu\" action=\"HelpMenuAction\">" \ " <menuitem name=\"OnlineDocs\" action=\"OnlineDocsAction\"/>" \ " <separator/>" \ diff --git a/hardinfo2/xmlrpc-client.c b/hardinfo2/xmlrpc-client.c index 9e71ba5b..d363729b 100644 --- a/hardinfo2/xmlrpc-client.c +++ b/hardinfo2/xmlrpc-client.c @@ -21,6 +21,7 @@ #include "config.h" #include "xmlrpc-client.h" +#ifdef HAS_LIBSOUP static GMainLoop *loop = NULL; static SoupSession *session = NULL; static gboolean lock = FALSE; @@ -241,3 +242,6 @@ GValueArray *xmlrpc_get_array(gchar *addr, return answer; } + +#endif /* HAS_LIBSOUP */ + diff --git a/hardinfo2/xmlrpc-client.h b/hardinfo2/xmlrpc-client.h index 98afd63b..32fad08c 100644 --- a/hardinfo2/xmlrpc-client.h +++ b/hardinfo2/xmlrpc-client.h @@ -20,6 +20,9 @@ #ifndef __XMLRPC_CLIENT_H__ #define __XMLRPC_CLIENT_H__ +#include "config.h" + +#ifdef HAS_LIBSOUP #include <libsoup/soup.h> void xmlrpc_init(void); @@ -35,5 +38,6 @@ GValueArray *xmlrpc_get_array(gchar *addr, gchar *method, const gchar *param_types, ...); +#endif /* HAS_LIBSOUP */ #endif /* __XMLRPC_CLIENT_H__ */ diff --git a/hardinfo2/xmlrpc-server.c b/hardinfo2/xmlrpc-server.c index 0e089ab5..5452647a 100644 --- a/hardinfo2/xmlrpc-server.c +++ b/hardinfo2/xmlrpc-server.c @@ -21,6 +21,7 @@ #include "config.h" +#include <glib.h> #ifdef HAS_LIBSOUP #include <stdio.h> #include <string.h> diff --git a/hardinfo2/xmlrpc-server.h b/hardinfo2/xmlrpc-server.h index 2c47dd1c..e608b711 100644 --- a/hardinfo2/xmlrpc-server.h +++ b/hardinfo2/xmlrpc-server.h @@ -21,4 +21,5 @@ void xmlrpc_server_start(GMainLoop *main_loop); void xmlrpc_server_init(void); -#endif /* __XMLRPC_SERVER_H__ */
\ No newline at end of file +#endif /* __XMLRPC_SERVER_H__ */ + |