From 5c798d437ee03a923ff2bdb7d29263eb121b58b2 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Tue, 3 Dec 2013 11:43:59 +0000 Subject: [PATCH] Incluindo teste pelo novo gtk para remoção de warnings --- src/classlib/session.cc | 7 +++++++ src/include/pw3270/class.h | 4 ++++ src/plugins/rx3270/pluginmain.cc | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 0 deletions(-) diff --git a/src/classlib/session.cc b/src/classlib/session.cc index b6cac4c..db9880c 100644 --- a/src/classlib/session.cc +++ b/src/classlib/session.cc @@ -463,6 +463,13 @@ return string(ebc2asc(buffer,sz)); } + int session::file_transfer(LIB3270_FT_OPTION options, const gchar *local, const gchar *remote, int lrecl, int blksize, int primspace, int secspace, int dft) + { + log("Can't transfer %s: File transfer is unavailable", local ? local : "file"); + return EINVAL; + } + + } diff --git a/src/include/pw3270/class.h b/src/include/pw3270/class.h index 454c194..d26f1f3 100644 --- a/src/include/pw3270/class.h +++ b/src/include/pw3270/class.h @@ -42,6 +42,7 @@ #include #include #include + #include #ifdef HAVE_ICONV #include @@ -188,6 +189,9 @@ virtual int popup_dialog(LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...); virtual string * file_chooser_dialog(GtkFileChooserAction action, const char *title, const char *extension, const char *filename); + // File transfer + virtual int file_transfer(LIB3270_FT_OPTION options, const gchar *local, const gchar *remote, int lrecl = 0, int blksize = 0, int primspace = 0, int secspace = 0, int dft = 4096); + // Charset translation string * get_3270_text(string *str); string * get_local_text(string *str); diff --git a/src/plugins/rx3270/pluginmain.cc b/src/plugins/rx3270/pluginmain.cc index 05a91f4..86b55e2 100644 --- a/src/plugins/rx3270/pluginmain.cc +++ b/src/plugins/rx3270/pluginmain.cc @@ -138,6 +138,8 @@ const char * asc2ebc(unsigned char *str, int sz = -1); const char * ebc2asc(unsigned char *str, int sz = -1); + int file_transfer(LIB3270_FT_OPTION options, const gchar *local, const gchar *remote, int lrecl = 0, int blksize = 0, int primspace = 0, int secspace = 0, int dft = 4096); + int quit(void); protected: @@ -401,7 +403,11 @@ extern "C" { gchar *filename = (gchar *) g_object_get_data(G_OBJECT(action),"src"); +#if GTK_CHECK_VERSION(3,10,0) + lib3270_trace_event(v3270_get_session(widget),"Action %s activated on widget %p",g_action_get_name(G_ACTION(action)),widget); +#else lib3270_trace_event(v3270_get_session(widget),"Action %s activated on widget %p",gtk_action_get_name(action),widget); +#endif // GTK_CHECK_VERSION #if GTK_CHECK_VERSION(2,32,0) if(!g_mutex_trylock(&mutex)) @@ -423,7 +429,12 @@ extern "C" return; } +#if GTK_CHECK_VERSION(3,10,0) + g_simple_action_set_enabled(G_SIMPLE_ACTION(action),FALSE); +#else gtk_action_set_sensitive(action,FALSE); +#endif // GTK(3,10) + if(filename) { @@ -466,7 +477,12 @@ extern "C" } +#if GTK_CHECK_VERSION(3,10,0) + g_simple_action_set_enabled(G_SIMPLE_ACTION(action),TRUE); +#else gtk_action_set_sensitive(action,TRUE); +#endif // GTK(3,10) + #if GTK_CHECK_VERSION(2,32,0) g_mutex_unlock(&mutex); #else @@ -771,3 +787,7 @@ const char * plugin::ebc2asc(unsigned char *str, int sz) return lib3270_ebc2asc(hSession,str,sz); } +int plugin::file_transfer(LIB3270_FT_OPTION options, const gchar *local, const gchar *remote, int lrecl, int blksize, int primspace, int secspace, int dft) +{ + return v3270_transfer_file(v3270_get_default_widget(),options,local,remote,lrecl,blksize,primspace,secspace,dft); +} -- libgit2 0.21.2