From 22f7837413a8fe36ec0e75a85023045bd1dbfb63 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Mon, 3 Jun 2013 18:27:26 +0000 Subject: [PATCH] Versão win64 passa a instalar o plugin rexx caso o ooRexx também esteja instalado --- po/pt_BR.po | 58 +++++++++++++++++++++++++++++++++++++--------------------- pw3270-x86_64.nsi.in | 39 +++++++++++++++++++++++++-------------- src/include/plugin.mak.in | 10 +++++----- src/plugins/hllapi/hllapi.c | 2 +- src/pw3270/main.c | 22 ++++++++++++++++++++++ src/pw3270/plugin.c | 21 +++++++++++++++++++++ ui/80rexx.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ ui/rexx.xml | 42 ------------------------------------------ 8 files changed, 153 insertions(+), 83 deletions(-) create mode 100644 ui/80rexx.xml delete mode 100644 ui/rexx.xml diff --git a/po/pt_BR.po b/po/pt_BR.po index adfcaa9..7a73994 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-06-03 08:12-0300\n" +"POT-Creation-Date: 2013-06-03 15:24-0300\n" "PO-Revision-Date: 2013-05-08 14:30-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português <>\n" @@ -43,7 +43,7 @@ msgstr "Ação %s precisa de um valor válido" msgid "%s action needs src attribute" msgstr "Ação %s precisa do atributo src" -#: main.c:88 +#: main.c:89 #, c-format msgid "%s requires GTK version %d.%d.%d" msgstr "%s requer GTK versão %d.%d.%d" @@ -88,7 +88,7 @@ msgstr "%s: Familia %d é inválida" msgid "%s:%d" msgstr "%s:%d" -#: main.c:323 +#: main.c:339 msgid "- 3270 Emulator for Gtk" msgstr "- Emulador 3270 para GTK" @@ -169,7 +169,7 @@ msgstr "" msgid "SSL state is undefinedUnexpected SSL status %ld" msgstr "Estado do SSL é indefinidoEstado SSL inesperado %ld" -#: main.c:343 +#: main.c:359 msgid "" "Valid options:\n" "\n" @@ -222,7 +222,7 @@ msgid "An error occurred trying to allocate memory. This should never happen." msgstr "" "Ocorreu um erro ao tentar alocar memória. Isso nunca deveria acontecer." -#: main.c:304 main.c:306 +#: main.c:319 main.c:321 msgid "Application name" msgstr "Nome da aplicação" @@ -675,7 +675,7 @@ msgstr "Erro ao resolver %s: %s" msgid "Event Trace" msgstr "Trace de eventos" -#: ui/rexx.xml:260 +#: ui/80rexx.xml:260 msgid "External Rexx script" msgstr "Script rexx externo" @@ -731,7 +731,7 @@ msgstr "Tela cheia" msgid "Function bar" msgstr "Barra de funções" -#: main.c:92 main.c:384 +#: main.c:93 main.c:406 msgid "GTK Version mismatch" msgstr "Divergência de versão GTK" @@ -800,11 +800,11 @@ msgstr "Servidor rejeitou o tipo de dispositivo ou requisição" msgid "Host rejected resource(s)" msgstr "Servidor rejeitou recurso(s)" -#: main.c:312 +#: main.c:327 msgid "Host system type" msgstr "Tipo do sistema no servidor" -#: main.c:310 +#: main.c:325 msgid "Host to connect" msgstr "Servidor a conectar" @@ -900,6 +900,11 @@ msgstr "LRECL:" msgid "Lateral keypad" msgstr "Barra lateral" +#: main.c:334 +#, fuzzy +msgid "Log to file" +msgstr "Salvar cópia para arquivo" + #: colors.c:388 msgid "Misc colors" msgstr "Cores diversas" @@ -1134,7 +1139,7 @@ msgstr "PF8" msgid "PF9" msgstr "PF9" -#: main.c:341 +#: main.c:357 msgid "Parse error" msgstr "Erro de interpretação" @@ -1171,7 +1176,7 @@ msgstr "Colar com margem esquerda" msgid "Path length constraint exceeded" msgstr "Path length constraint exceeded" -#: main.c:307 +#: main.c:322 msgid "Path to application data files" msgstr "Caminho para os arquivos de dados da aplicação" @@ -1524,7 +1529,7 @@ msgstr "Trace de tela" msgid "Screen size" msgstr "Tamanho da tela" -#: ui/rexx.xml:260 +#: ui/80rexx.xml:260 msgid "Scripts" msgstr "Scripts" @@ -1588,7 +1593,7 @@ msgstr "Enviar arquivo" msgid "Send file to host" msgstr "Enviar arquivo para o servidor" -#: main.c:317 +#: main.c:332 msgid "Send messages to syslog" msgstr "Enviar mensagens para o log do sistema" @@ -1596,7 +1601,7 @@ msgstr "Enviar mensagens para o log do sistema" msgid "Send/Receive" msgstr "Enviar/Receber" -#: main.c:309 +#: main.c:324 msgid "Session name" msgstr "Nome da sessão" @@ -1604,15 +1609,15 @@ msgstr "Nome da sessão" msgid "Set hostname" msgstr "Selecione servidor" -#: main.c:311 +#: main.c:326 msgid "Set reported colors (8/16)" msgstr "Define número de cores informadas (8/16)" -#: main.c:314 +#: main.c:329 msgid "Set toggles OFF" msgstr "Desativa toggles" -#: main.c:313 +#: main.c:328 msgid "Set toggles ON" msgstr "Ativa toggles" @@ -1896,7 +1901,7 @@ msgstr "" "programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple " "Place, Suite 330, Boston, MA, 02111-1307, USA" -#: main.c:380 +#: main.c:402 #, c-format msgid "This program requires GTK version %d.%d.%d" msgstr "Este programa precisa do GTK versão %d.%d.%d" @@ -2039,7 +2044,7 @@ msgstr "Atributo %s inesperado ou inválido: \"%s\"" msgid "Unexpected or invalid attribute value \"%s\"" msgstr "Valor de attributo inesperado ou inválido: \"%s\"" -#: main.c:193 +#: main.c:194 #, c-format msgid "Unexpected or invalid color value \"%s\"" msgstr "Valor de cor inválido ou inesperado: \"%s\"" @@ -2249,7 +2254,7 @@ msgstr "_Desconectar" msgid "_Edit" msgstr "_Editar" -#: ui/rexx.xml:256 +#: ui/80rexx.xml:256 msgid "_File" msgstr "_Arquivo" @@ -2309,7 +2314,7 @@ msgstr "Arquivo _texto" msgid "_To" msgstr "_Para" -#: ui/rexx.xml:258 +#: ui/80rexx.xml:258 msgid "_View" msgstr "_Exibir" @@ -2355,6 +2360,17 @@ msgstr "translator-credits" msgid "unknown error" msgstr "Erro desconhecido" +#~ msgid "%s\n" +#~ msgstr "%s\n" + +#, fuzzy +#~ msgid "Can't load plugin" +#~ msgstr "Não foi possível carregar arquivo" + +#, fuzzy +#~ msgid "Can't load plugin %s" +#~ msgstr "Não foi possível carregar %s" + #, fuzzy #~ msgid "Script" #~ msgstr "Scripts" diff --git a/pw3270-x86_64.nsi.in b/pw3270-x86_64.nsi.in index 98a7193..94c07fc 100644 --- a/pw3270-x86_64.nsi.in +++ b/pw3270-x86_64.nsi.in @@ -128,19 +128,19 @@ SubSection "@PACKAGE@" SecMain sectionEnd -# -# Section /o "Rexx" RexxPlugin -# setOutPath $INSTDIR -# -# CreateDirectory "$INSTDIR" -# file src\plugins\rexx\rx3270.cls -# -# CreateDirectory "$INSTDIR\plugins" -# file "/oname=$INSTDIR\plugins\rx3270.dll" ".bin\Release\plugins\rx3270.dll" -# file "/oname=$INSTDIR\ui\rexx.xml" ui\rexx.xml -# -# sectionEnd -# + Section /o "Rexx" RexxPlugin + + setOutPath $INSTDIR + + file "/oname=$INSTDIR\plugins\rxplug.dll" ".bin\Release\plugins\rx3270.dll" + file "/oname=$INSTDIR\ui\80rexx.xml" "ui\80rexx.xml" + + file "/oname=$PROGRAMFILES64\ooRexx\rx3270.cls" "src/plugins/rx3270/rx3270.cls" + file "/oname=$INSTDIR\rx3270.dll.@PACKAGE_VERSION@" ".bin\Release\rx3270.dll.@PACKAGE_VERSION@" + file "/oname=$PROGRAMFILES64\ooRexx\rx3270.dll" ".bin\Release\rx3270.dll" + + sectionEnd + SubSectionEnd SubSectionEnd @@ -205,7 +205,8 @@ section "Uninstall" delete $SYSDIR\libhllapi.dll # Delete extension libraries -# delete $PROGRAMFILES\ooRexx\rx3270.dll + delete "$PROGRAMFILES64\ooRexx\rx3270.cls" + delete "$PROGRAMFILES64\ooRexx\rx3270.dll" RMDir /r "$INSTDIR" @@ -213,6 +214,16 @@ sectionEnd Function .onInit +IfFileExists $PROGRAMFILES64\ooRexx\rexx.exe EnableRexx RexxSET + +EnableRexx: + SectionGetFlags "${RexxPlugin}" $0 + IntOp $0 $0 | ${SF_SELECTED} + SectionSetFlags "${RexxPlugin}" $0 + +RexxSET: + + FunctionEnd diff --git a/src/include/plugin.mak.in b/src/include/plugin.mak.in index 3e3763d..679dc81 100644 --- a/src/include/plugin.mak.in +++ b/src/include/plugin.mak.in @@ -72,8 +72,8 @@ DLL_FLAGS=@DLL_FLAGS@ DLL_CFLAGS=@DLL_CFLAGS@ DEBUG_CFLAGS=-DDEBUG=1 -g -Wall LIB3270_MODE ?= Default -DLL_NAME=@DLLDIR@/@DLLPREFIX@$(MODULE_NAME)@DLLEXT@ -PLUGIN_NAME=plugins/$(MODULE_NAME)@DLLEXT@ +DLL_NAME ?= @DLLDIR@/@DLLPREFIX@$(MODULE_NAME)@DLLEXT@ +PLUGIN_NAME ?= plugins/$(MODULE_NAME)@DLLEXT@ ifeq ($(LIB3270_MODE),Debug) PW3270_LIBS=-L../../../.bin/Debug@DLLDIR@ -l$(PACKAGE_TARNAME) @@ -122,11 +122,11 @@ $(OBJRLS)/%.o: %.cc $(DEPENDS) #---[ Targets ]---------------------------------------------------------------- -all: $(BINRLS)/plugins/$(MODULE_NAME)@DLLEXT@ +all: $(BINRLS)/$(PLUGIN_NAME) -Release: $(BINRLS)/plugins/$(MODULE_NAME)@DLLEXT@ +Release: $(BINRLS)/$(PLUGIN_NAME) -Debug: $(BINDBG)/plugins/$(MODULE_NAME)@DLLEXT@ +Debug: $(BINDBG)/$(PLUGIN_NAME) $(BINDBG)$(DLL_NAME): $(BINDBG)$(DLL_NAME).$(VERSION) @rm -f $@ diff --git a/src/plugins/hllapi/hllapi.c b/src/plugins/hllapi/hllapi.c index 989843f..aa92463 100644 --- a/src/plugins/hllapi/hllapi.c +++ b/src/plugins/hllapi/hllapi.c @@ -114,7 +114,7 @@ static int connect_ps(char *buffer, unsigned short *length, unsigned short *rc) { char *tempbuffer = NULL; - trace("%s: len=%d buflen=%d",__FUNCTION__,*length,strlen(buffer)); + trace("%s: len=%d buflen=%d",__FUNCTION__,*length,(int) strlen(buffer)); if(strlen(buffer) > *length) buffer[*length] = 0; diff --git a/src/pw3270/main.c b/src/pw3270/main.c index ea08ccb..ab965ef 100644 --- a/src/pw3270/main.c +++ b/src/pw3270/main.c @@ -55,6 +55,7 @@ static const gchar * systype = NULL; static const gchar * toggleset = NULL; static const gchar * togglereset = NULL; + static const gchar * logfile = NULL; #ifdef HAVE_GTKMAC GtkOSXApplication * osxapp = NULL; @@ -240,6 +241,20 @@ static void g_syslog(const gchar *log_domain,GLogLevelFlags log_level,const gcha } #endif // HAVE_SYSLOG +static void g_logfile(const gchar *log_domain,GLogLevelFlags log_level,const gchar *message,gpointer user_data) +{ + FILE *out = fopen(logfile,"a"); + if(out) + { + time_t ltime; + char wrk[40]; + time(<ime); + strftime(wrk, 39, "%d/%m/%Y %H:%M:%S", localtime(<ime)); + fprintf(out,"%s\t%s\n",wrk,message); + fclose(out); + } +} + int main(int argc, char *argv[]) { static const gchar * session_name = PACKAGE_NAME; @@ -316,6 +331,7 @@ int main(int argc, char *argv[]) #if defined( HAVE_SYSLOG ) { "syslog", 'l', 0, G_OPTION_ARG_NONE, &log_to_syslog, N_( "Send messages to syslog" ), NULL }, #endif + { "log", 'L', 0, G_OPTION_ARG_STRING, &logfile, N_( "Log to file" ), NULL }, { NULL } }; @@ -362,7 +378,13 @@ int main(int argc, char *argv[]) openlog(g_get_prgname(), LOG_NDELAY, LOG_USER); g_log_set_default_handler(g_syslog,NULL); } + else if(logfile) +#else + if(logfile) #endif // HAVE_SYSLOG + { + g_log_set_default_handler(g_logfile,NULL); + } } diff --git a/src/pw3270/plugin.c b/src/pw3270/plugin.c index 8b4fb5a..397aee4 100644 --- a/src/pw3270/plugin.c +++ b/src/pw3270/plugin.c @@ -82,6 +82,27 @@ if(!handle) { g_message("Error \"%s\" loading %s",g_module_error(),filename); +/* + gchar * text = g_strdup(g_module_error()); + gchar * name = g_path_get_basename(filename); + GtkWidget * popup = gtk_message_dialog_new_with_markup( + NULL, + GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR,GTK_BUTTONS_OK, + _( "Can't load plugin %s" ),name); + + gtk_window_set_title(GTK_WINDOW(popup),_("Can't load plugin")); + + g_message("Error \"%s\" loading %s",text,filename); + + gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(popup),_( "%s\n" ),text); + + gtk_dialog_run(GTK_DIALOG(popup)); + gtk_widget_destroy(popup); + + g_free(text); + g_free(name); +*/ } else { diff --git a/ui/80rexx.xml b/ui/80rexx.xml new file mode 100644 index 0000000..57e9c3c --- /dev/null +++ b/ui/80rexx.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + diff --git a/ui/rexx.xml b/ui/rexx.xml deleted file mode 100644 index 57e9c3c..0000000 --- a/ui/rexx.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - -- libgit2 0.21.2