Commit e295905b68729e1a03e986954f713494b4008b90

Authored by perry.werneck@gmail.com
1 parent c31c2649

Ajustes em função do novo método de conexão

android/jni/main.cpp
... ... @@ -365,7 +365,7 @@ JNIEXPORT void JNICALL Java_br_com_bb_pw3270_lib3270_setStartupScript(JNIEnv *en
365 365  
366 366 JNIEXPORT jstring JNICALL Java_br_com_bb_pw3270_lib3270_getHost(JNIEnv *env, jobject obj)
367 367 {
368   - return env->NewStringUTF(lib3270_get_host(lib3270_get_default_session_handle()));
  368 + return env->NewStringUTF(lib3270_get_hostname(lib3270_get_default_session_handle()));
369 369 }
370 370  
371 371 JNIEXPORT void JNICALL Java_br_com_bb_pw3270_lib3270_set_1connection_1status(JNIEnv *env, jobject obj, jboolean connected)
... ...
src/include/lib3270.h
... ... @@ -409,14 +409,14 @@
409 409 LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *url);
410 410  
411 411 /**
412   - * Get host id for the connect/reconnect operations.
  412 + * Get hostname for the connect/reconnect operations.
413 413 *
414 414 * @param h Session handle.
415 415 *
416 416 * @return Pointer to host id set (internal data, do not change it)
417 417 *
418 418 */
419   - LIB3270_EXPORT const char * lib3270_get_host(H3270 *h);
  419 + LIB3270_EXPORT const char * lib3270_get_hostname(H3270 *h);
420 420  
421 421 /**
422 422 * Network connect operation, keep main loop running
... ...
src/include/pw3270.h
... ... @@ -53,7 +53,7 @@
53 53  
54 54 LIB3270_EXPORT GtkWidget * pw3270_new(const gchar *host, const gchar *systype, unsigned short colors);
55 55 LIB3270_EXPORT const gchar * pw3270_set_host(GtkWidget *widget, const gchar *uri);
56   - LIB3270_EXPORT const gchar * pw3270_get_host(GtkWidget *widget);
  56 + LIB3270_EXPORT const gchar * pw3270_get_hostname(GtkWidget *widget);
57 57 LIB3270_EXPORT void pw3270_connect_host(GtkWidget *widget, const gchar *uri);
58 58  
59 59 LIB3270_EXPORT gboolean pw3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix);
... ...
src/include/pw3270/v3270.h
... ... @@ -214,7 +214,7 @@
214 214 LIB3270_EXPORT void v3270_set_session_options(GtkWidget *widget, LIB3270_OPTION options);
215 215 LIB3270_EXPORT int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype);
216 216 LIB3270_EXPORT const gchar * v3270_set_host(GtkWidget *widget, const gchar *uri);
217   - LIB3270_EXPORT const gchar * v3270_get_host(GtkWidget *widget);
  217 + LIB3270_EXPORT const gchar * v3270_get_hostname(GtkWidget *widget);
218 218 LIB3270_EXPORT GtkWidget * v3270_get_default_widget(void);
219 219  
220 220 // Keyboard & Mouse special actions
... ...
src/lib3270/api.h
... ... @@ -319,7 +319,6 @@
319 319  
320 320 /* Get connection info */
321 321 #define get_connected_lu(h) lib3270_get_luname(h)
322   -// #define get_current_host(h) lib3270_get_host(h)
323 322  
324 323 LOCAL_EXTERN SCRIPT_STATE status_script(SCRIPT_STATE state);
325 324  
... ...
src/lib3270/host.c
... ... @@ -714,7 +714,7 @@ LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n)
714 714 Replace(h->host.full,
715 715 lib3270_strdup_printf(
716 716 "%s%s:%s%s%s",
717   - h->host.opt&LIB3270_CONNECT_OPTION_SSL ? "L:" : "",
  717 + h->host.opt&LIB3270_CONNECT_OPTION_SSL ? "tn3270s://" : "",
718 718 hostname,
719 719 srvc,
720 720 *query ? "?" : "",
... ... @@ -727,10 +727,10 @@ LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n)
727 727 return h->host.current;
728 728 }
729 729  
730   -LIB3270_EXPORT const char * lib3270_get_host(H3270 *h)
  730 +LIB3270_EXPORT const char * lib3270_get_hostname(H3270 *h)
731 731 {
732 732 CHECK_SESSION_HANDLE(h);
733   - return h->host.full;
  733 + return h->host.current;
734 734 }
735 735  
736 736 LIB3270_EXPORT int lib3270_reconnect(H3270 *hSession,int wait)
... ...
src/lib3270/macros.c
... ... @@ -183,7 +183,7 @@
183 183 {
184 184 const char * luname = (const char *) lib3270_get_luname(hSession);
185 185 const char * state = get_state(hSession);
186   - const char * host = (const char *) lib3270_get_host(hSession);
  186 + const char * host = (const char *) lib3270_get_hostname(hSession);
187 187 char * rsp;
188 188 size_t sz;
189 189  
... ...
src/pw3270/v3270/security.c
... ... @@ -310,7 +310,7 @@
310 310 g_return_val_if_fail(GTK_IS_V3270(widget),"");
311 311  
312 312 if(lib3270_get_secure(GTK_V3270(widget)->host) == LIB3270_SSL_UNSECURE)
313   - return v3270_get_host(widget);
  313 + return v3270_get_hostname(widget);
314 314  
315 315 #ifdef HAVE_LIBSSL
316 316 if(lib3270_get_secure(GTK_V3270(widget)->host) != LIB3270_SSL_UNSECURE)
... ... @@ -320,7 +320,7 @@
320 320 return gettext(info->text);
321 321 }
322 322 #endif // HAVE_LIBSSL
323   - return v3270_get_host(widget);
  323 + return v3270_get_hostname(widget);
324 324 }
325 325  
326 326 LIB3270_EXPORT const gchar * v3270_get_ssl_status_message(GtkWidget *widget)
... ... @@ -362,7 +362,7 @@
362 362 GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
363 363 GTK_MESSAGE_INFO,
364 364 GTK_BUTTONS_CLOSE,
365   - "%s",v3270_get_host(widget)
  365 + "%s",v3270_get_hostname(widget)
366 366 );
367 367  
368 368 gtk_message_dialog_format_secondary_markup(
... ...
src/pw3270/v3270/widget.c
... ... @@ -1495,7 +1495,7 @@ static void v3270_activate(GtkWidget *widget)
1495 1495  
1496 1496 if(lib3270_connected(terminal->host))
1497 1497 lib3270_enter(terminal->host);
1498   - else if(lib3270_get_host(terminal->host))
  1498 + else if(lib3270_get_hostname(terminal->host))
1499 1499 v3270_connect(widget,NULL);
1500 1500 else
1501 1501 g_warning("Terminal widget %p activated without connection or valid hostname",terminal);
... ... @@ -1557,10 +1557,10 @@ const gchar * v3270_set_host(GtkWidget *widget, const gchar *uri)
1557 1557 return lib3270_set_host(GTK_V3270(widget)->host,uri);
1558 1558 }
1559 1559  
1560   -const gchar * v3270_get_host(GtkWidget *widget)
  1560 +const gchar * v3270_get_hostname(GtkWidget *widget)
1561 1561 {
1562 1562 g_return_val_if_fail(GTK_IS_V3270(widget),"");
1563   - return lib3270_get_host(GTK_V3270(widget)->host);
  1563 + return lib3270_get_hostname(GTK_V3270(widget)->host);
1564 1564 }
1565 1565  
1566 1566 const gchar * v3270_get_session_name(GtkWidget *widget)
... ...
src/pw3270/window.c
... ... @@ -239,10 +239,10 @@
239 239 return v3270_set_host(GTK_PW3270(widget)->terminal,uri);
240 240 }
241 241  
242   - const gchar * pw3270_get_host(GtkWidget *widget)
  242 + const gchar * pw3270_get_hostname(GtkWidget *widget)
243 243 {
244 244 g_return_val_if_fail(GTK_IS_PW3270(widget),"");
245   - return v3270_get_host(GTK_PW3270(widget)->terminal);
  245 + return v3270_get_hostname(GTK_PW3270(widget)->terminal);
246 246 }
247 247  
248 248 gboolean pw3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix)
... ... @@ -271,7 +271,7 @@
271 271  
272 272 if(v3270_is_connected(widget))
273 273 {
274   - const gchar *host = v3270_get_host(widget);
  274 + const gchar *host = v3270_get_hostname(widget);
275 275  
276 276 if(host && *host)
277 277 title = g_strdup_printf("%s - %s",v3270_get_session_name(widget),host);
... ...