Commit 5933730c5b8c40c9e478edda790eec38a71a2936
1 parent
250f57e2
Exists in
master
and in
5 other branches
Trabalhando no plugin DBUS
Showing
6 changed files
with
16 additions
and
5 deletions
Show diff stats
configure.ac
@@ -348,7 +348,7 @@ AC_SUBST(GLIB_CFLAGS) | @@ -348,7 +348,7 @@ AC_SUBST(GLIB_CFLAGS) | ||
348 | 348 | ||
349 | #--[ Check DBUS ]--------------------------------------------------------------------------------------------------------------------------------------------- | 349 | #--[ Check DBUS ]--------------------------------------------------------------------------------------------------------------------------------------------- |
350 | 350 | ||
351 | -PKG_CHECK_MODULES( [DBUS], [dbus-glib-1], AC_DEFINE(HAVE_DBUS) ) | 351 | +PKG_CHECK_MODULES( [DBUS], [dbus-glib-1], AC_DEFINE(HAVE_DBUS), AC_MSG_NOTICE([No DBUS support.]) ) |
352 | AC_SUBST(DBUS_LIBS) | 352 | AC_SUBST(DBUS_LIBS) |
353 | AC_SUBST(DBUS_CFLAGS) | 353 | AC_SUBST(DBUS_CFLAGS) |
354 | 354 |
po/pt_BR.po
@@ -5,7 +5,7 @@ msgid "" | @@ -5,7 +5,7 @@ msgid "" | ||
5 | msgstr "" | 5 | msgstr "" |
6 | "Project-Id-Version: pw3270 5.0\n" | 6 | "Project-Id-Version: pw3270 5.0\n" |
7 | "Report-Msgid-Bugs-To: \n" | 7 | "Report-Msgid-Bugs-To: \n" |
8 | -"POT-Creation-Date: 2013-02-15 16:38-0200\n" | 8 | +"POT-Creation-Date: 2013-02-19 17:42-0300\n" |
9 | "PO-Revision-Date: 2013-01-14 09:49-0200\n" | 9 | "PO-Revision-Date: 2013-01-14 09:49-0200\n" |
10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
11 | "Language-Team: Português <>\n" | 11 | "Language-Team: Português <>\n" |
src/include/lib3270/log.h
@@ -56,6 +56,7 @@ | @@ -56,6 +56,7 @@ | ||
56 | LIB3270_EXPORT void lib3270_write_va_log(H3270 *session, const char *module, const char *fmt, va_list arg); | 56 | LIB3270_EXPORT void lib3270_write_va_log(H3270 *session, const char *module, const char *fmt, va_list arg); |
57 | 57 | ||
58 | #ifdef DEBUG | 58 | #ifdef DEBUG |
59 | + #include <stdio.h> | ||
59 | #define trace( fmt, ... ) fprintf(stderr, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fflush(stderr); | 60 | #define trace( fmt, ... ) fprintf(stderr, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fflush(stderr); |
60 | #else | 61 | #else |
61 | #define trace(x, ...) // __VA_ARGS__ | 62 | #define trace(x, ...) // __VA_ARGS__ |
src/plugins/3270dbus/gobject.c
@@ -74,24 +74,30 @@ PW3270Dbus * pw3270_dbus_new(void) | @@ -74,24 +74,30 @@ PW3270Dbus * pw3270_dbus_new(void) | ||
74 | 74 | ||
75 | void pw3270_dbus_get_revision(PW3270Dbus *object, DBusGMethodInvocation *context) | 75 | void pw3270_dbus_get_revision(PW3270Dbus *object, DBusGMethodInvocation *context) |
76 | { | 76 | { |
77 | + trace("%s object=%p context=%p",__FUNCTION__,object,context); | ||
77 | dbus_g_method_return(context,PACKAGE_REVISION); | 78 | dbus_g_method_return(context,PACKAGE_REVISION); |
78 | } | 79 | } |
79 | 80 | ||
80 | void pw3270_dbus_connect(PW3270Dbus *object, const gchar *uri, DBusGMethodInvocation *context) | 81 | void pw3270_dbus_connect(PW3270Dbus *object, const gchar *uri, DBusGMethodInvocation *context) |
81 | { | 82 | { |
83 | + trace("%s object=%p context=%p",__FUNCTION__,object,context); | ||
84 | + | ||
82 | g_message("Connecting to \"%s\" by remote request",uri); | 85 | g_message("Connecting to \"%s\" by remote request",uri); |
83 | dbus_g_method_return(context,lib3270_connect(pw3270_dbus_get_session_handle(PW3270_DBUS(object)),uri,0)); | 86 | dbus_g_method_return(context,lib3270_connect(pw3270_dbus_get_session_handle(PW3270_DBUS(object)),uri,0)); |
84 | } | 87 | } |
85 | 88 | ||
86 | void pw3270_dbus_disconnect(PW3270Dbus *object, DBusGMethodInvocation *context) | 89 | void pw3270_dbus_disconnect(PW3270Dbus *object, DBusGMethodInvocation *context) |
87 | { | 90 | { |
91 | + trace("%s object=%p context=%p",__FUNCTION__,object,context); | ||
92 | + | ||
88 | g_message("Disconnecting by remote request"); | 93 | g_message("Disconnecting by remote request"); |
89 | lib3270_disconnect(pw3270_dbus_get_session_handle(object)); | 94 | lib3270_disconnect(pw3270_dbus_get_session_handle(object)); |
90 | dbus_g_method_return(context,0); | 95 | dbus_g_method_return(context,0); |
91 | } | 96 | } |
92 | 97 | ||
93 | -void pw3270_dbus_get_program_message(PW3270Dbus *object, DBusGMethodInvocation *context) | 98 | +void pw3270_dbus_get_message_id(PW3270Dbus *object, DBusGMethodInvocation *context) |
94 | { | 99 | { |
100 | + trace("%s object=%p context=%p",__FUNCTION__,object,context); | ||
95 | dbus_g_method_return(context,lib3270_get_program_message(pw3270_dbus_get_session_handle(object))); | 101 | dbus_g_method_return(context,lib3270_get_program_message(pw3270_dbus_get_session_handle(object))); |
96 | } | 102 | } |
97 | 103 | ||
@@ -105,6 +111,8 @@ int pw3270_dbus_check_valid_state(PW3270Dbus *object, DBusGMethodInvocation *con | @@ -105,6 +111,8 @@ int pw3270_dbus_check_valid_state(PW3270Dbus *object, DBusGMethodInvocation *con | ||
105 | H3270 * hSession = pw3270_dbus_get_session_handle(object); | 111 | H3270 * hSession = pw3270_dbus_get_session_handle(object); |
106 | GError * error = NULL; | 112 | GError * error = NULL; |
107 | 113 | ||
114 | + trace("%s object=%p context=%p",__FUNCTION__,object,context); | ||
115 | + | ||
108 | if(!lib3270_is_connected(hSession)) | 116 | if(!lib3270_is_connected(hSession)) |
109 | { | 117 | { |
110 | error = pw3270_dbus_get_error_from_errno(ENOTCONN); | 118 | error = pw3270_dbus_get_error_from_errno(ENOTCONN); |
@@ -164,6 +172,8 @@ void pw3270_dbus_get_screen_contents(PW3270Dbus *object, DBusGMethodInvocation * | @@ -164,6 +172,8 @@ void pw3270_dbus_get_screen_contents(PW3270Dbus *object, DBusGMethodInvocation * | ||
164 | gchar * utftext; | 172 | gchar * utftext; |
165 | H3270 * hSession = pw3270_dbus_get_session_handle(object); | 173 | H3270 * hSession = pw3270_dbus_get_session_handle(object); |
166 | 174 | ||
175 | + trace("%s object=%p context=%p",__FUNCTION__,object,context); | ||
176 | + | ||
167 | if(pw3270_dbus_check_valid_state(object,context)) | 177 | if(pw3270_dbus_check_valid_state(object,context)) |
168 | return; | 178 | return; |
169 | 179 |
src/plugins/3270dbus/pw3270dbus.xml
@@ -18,7 +18,7 @@ | @@ -18,7 +18,7 @@ | ||
18 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | 18 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> |
19 | <arg type="i" name="result" direction="out" /> | 19 | <arg type="i" name="result" direction="out" /> |
20 | </method> | 20 | </method> |
21 | - <method name="getProgramMessage"> | 21 | + <method name="getMessageID"> |
22 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> | 22 | <annotation name="org.freedesktop.DBus.GLib.Async" value="true"/> |
23 | <arg type="i" name="status" direction="out" /> | 23 | <arg type="i" name="status" direction="out" /> |
24 | </method> | 24 | </method> |
src/plugins/3270dbus/service.h
@@ -70,7 +70,7 @@ | @@ -70,7 +70,7 @@ | ||
70 | void pw3270_dbus_quit(PW3270Dbus *object, DBusGMethodInvocation *context); | 70 | void pw3270_dbus_quit(PW3270Dbus *object, DBusGMethodInvocation *context); |
71 | void pw3270_dbus_connect(PW3270Dbus *object, const gchar *uri, DBusGMethodInvocation *context); | 71 | void pw3270_dbus_connect(PW3270Dbus *object, const gchar *uri, DBusGMethodInvocation *context); |
72 | void pw3270_dbus_disconnect(PW3270Dbus *object, DBusGMethodInvocation *context); | 72 | void pw3270_dbus_disconnect(PW3270Dbus *object, DBusGMethodInvocation *context); |
73 | - void pw3270_dbus_get_program_message(PW3270Dbus *object, DBusGMethodInvocation *context); | 73 | + void pw3270_dbus_get_message_id(PW3270Dbus *object, DBusGMethodInvocation *context); |
74 | void pw3270_dbus_get_screen_contents(PW3270Dbus *object, DBusGMethodInvocation *context); | 74 | void pw3270_dbus_get_screen_contents(PW3270Dbus *object, DBusGMethodInvocation *context); |
75 | H3270 * pw3270_dbus_get_session_handle(PW3270Dbus *object); | 75 | H3270 * pw3270_dbus_get_session_handle(PW3270Dbus *object); |
76 | GError * pw3270_dbus_get_error_from_errno(int code); | 76 | GError * pw3270_dbus_get_error_from_errno(int code); |