From 80670b469deb3da9ba7973e6a95405adaffea607 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 21 Aug 2017 10:13:27 -0300 Subject: [PATCH] Corrigindo diálogo de "paste text file" no windows. --- locale/pt_BR.po | 55 +++++++++++++++++++++++++++++++++---------------------- locale/pw3270.pot | 51 ++++++++++++++++++++++++++++++++++++++++----------- src/include/pw3270.h | 2 +- src/pw3270/dialog.c | 29 ++++++++++++++++++++++++++++- src/pw3270/v3270ft/private.h | 3 --- 5 files changed, 102 insertions(+), 38 deletions(-) diff --git a/locale/pt_BR.po b/locale/pt_BR.po index bf98b31..b397668 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-10 10:21-0300\n" +"POT-Creation-Date: 2017-08-21 09:51-0300\n" "PO-Revision-Date: 2017-02-15 17:08-0200\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português \n" @@ -119,7 +119,7 @@ msgstr "Alerta 3270" msgid "3270 screen" msgstr "Tela 3270" -#: dialog.c:523 +#: dialog.c:531 #, c-format msgid "3270 terminal emulator for GTK %d.%d" msgstr "Emulador 3270 para GTK+ %d.%d" @@ -363,7 +363,7 @@ msgstr "Azul" msgid "Bold" msgstr "Negrito" -#: dialog.c:530 +#: dialog.c:538 msgid "Brazilian Public Software Portal" msgstr "Portal do Software Público Brasileiro" @@ -419,6 +419,11 @@ msgstr "Não foi possível conectar a %s" msgid "Can't connect to %s:%s" msgstr "Não foi possível conectar a %s:%s" +#: main.c:70 +#, fuzzy +msgid "Can't connect to DBUS server" +msgstr "Não foi possível conectar a %s" + #: selection.c:425 #, c-format msgid "Can't convert line %d from %s to %s" @@ -433,6 +438,10 @@ msgstr "Recortar não permitido em seleção retangular" msgid "Can't determine value for environment variable \"%s\" " msgstr "Não consigo determinar o valor da variável de ambiente \"%s\" " +#: main.c:115 +msgid "Can't get DBUS object name" +msgstr "" + #: ft.c:413 msgid "Can't get file size" msgstr "Não foi possível obter o tamanho do arquivo" @@ -654,6 +663,11 @@ msgstr "Configurar host" msgid "Connect on startup" msgstr "Conectar ao iniciar" +#: gobject.c:205 +#, fuzzy +msgid "Connecting to host" +msgstr "Não foi possível conectar ao servidor" + #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 #: connect.c:573 @@ -1353,10 +1367,6 @@ msgstr "Colar próximo" msgid "Paste text file" msgstr "Colar arquivo texto" -#: dialog.c:428 -msgid "Paste text file contents" -msgstr "Colar conteúdo de arquivo texto" - #: toggles.c:128 00default.xml:120 msgid "Paste with left margin" msgstr "Colar com margem esquerda" @@ -1913,6 +1923,11 @@ msgstr "Iniciar transferência de arquivo" msgid "Starting" msgstr "Iniciando" +#: gobject.c:193 +#, c-format +msgid "State %04d can't accept requests" +msgstr "" + #: security.c:237 msgid "Subject issuer mismatch" msgstr "Divergência na identidade do emissor" @@ -2175,7 +2190,7 @@ msgstr "Não encontrei configuração para a tabela de caracteres \"%s\"" msgid "This is a host program error." msgstr "Este é um erro no programa do host." -#: dialog.c:472 +#: dialog.c:480 msgid "" "This program is free software; you can redistribute it and/or modify it " "under the terms of the GNU General Public License as published by the Free " @@ -2398,6 +2413,11 @@ msgstr "Valor de cor inválido ou inesperado: \"%s\"" msgid "Unexpected or unknown security status" msgstr "Estado de segurança inesperado ou desconhecido." +#: gobject.c:208 +#, fuzzy, c-format +msgid "Unexpected state %04d" +msgstr "Alvo inesperado \"%s\"" + #: actions.c:391 #, c-format msgid "Unexpected target \"%s\"" @@ -2460,7 +2480,7 @@ msgstr "Use the keys +/- from keypad to select editable fields" msgid "Variable" msgstr "Variável" -#: dialog.c:513 dialog.c:515 +#: dialog.c:521 dialog.c:523 #, c-format msgid "Version %s-%s" msgstr "Versão %s-%s" @@ -2742,7 +2762,7 @@ msgstr "ioctlsocket(FIONBIO) failed." msgid "setsockopt(SO_OOBINLINE) has failed" msgstr "setsockopt(SO_OOBINLINE) has failed" -#: dialog.c:533 +#: dialog.c:541 msgid "translator-credits" msgstr "translator-credits" @@ -2802,10 +2822,6 @@ msgstr "translator-credits" #~ "32768. Valores maiores trazem maior performance, porem, nem todos os " #~ "hosts podem suportá-los." -#, fuzzy -#~ msgid "Can't connect to DBUS server" -#~ msgstr "Não foi possível conectar a %s" - #~ msgid "Can't start download." #~ msgstr "Não foi possível iniciar o download." @@ -2842,10 +2858,6 @@ msgstr "translator-credits" #~ msgid "Complete" #~ msgstr "Completo" -#, fuzzy -#~ msgid "Connecting to host" -#~ msgstr "Não foi possível conectar ao servidor" - #~ msgid "Copiar tudo" #~ msgstr "Copiar tudo" @@ -2990,6 +3002,9 @@ msgstr "translator-credits" #~ msgid "Passthru Proxy: send error" #~ msgstr "Passthru Proxy: Erro ao enviar" +#~ msgid "Paste text file contents" +#~ msgstr "Colar conteúdo de arquivo texto" + #~ msgid "Proxy server (type:host[:port])" #~ msgstr "Servidor proxy (tipo:nome[:port])" @@ -3208,10 +3223,6 @@ msgstr "translator-credits" #~ msgid "Unexpected element <%s>" #~ msgstr "Elemento <%s> inesperado" -#, fuzzy -#~ msgid "Unexpected state %04d" -#~ msgstr "Alvo inesperado \"%s\"" - #~ msgid "" #~ "Unknown host:\n" #~ "%s" diff --git a/locale/pw3270.pot b/locale/pw3270.pot index 2d32a95..b5237cb 100644 --- a/locale/pw3270.pot +++ b/locale/pw3270.pot @@ -9,7 +9,7 @@ msgstr "" "#-#-#-#-# lib3270.pot (PACKAGE VERSION) #-#-#-#-#\n" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-16 15:19-0300\n" +"POT-Creation-Date: 2017-08-21 09:51-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,7 +20,7 @@ msgstr "" "#-#-#-#-# pw3270.pot (PACKAGE VERSION) #-#-#-#-#\n" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-16 15:19-0300\n" +"POT-Creation-Date: 2017-08-21 09:51-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -39,6 +39,17 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" +"#-#-#-#-# dbus3270.pot (PACKAGE VERSION) #-#-#-#-#\n" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-21 09:51-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" #: window.c:329 #, c-format @@ -140,7 +151,7 @@ msgstr "" msgid "3270 screen" msgstr "" -#: dialog.c:523 +#: dialog.c:531 #, c-format msgid "3270 terminal emulator for GTK %d.%d" msgstr "" @@ -368,7 +379,7 @@ msgstr "" msgid "Bold" msgstr "" -#: dialog.c:530 +#: dialog.c:538 msgid "Brazilian Public Software Portal" msgstr "" @@ -424,6 +435,10 @@ msgstr "" msgid "Can't connect to %s:%s" msgstr "" +#: main.c:70 +msgid "Can't connect to DBUS server" +msgstr "" + #: selection.c:425 #, c-format msgid "Can't convert line %d from %s to %s" @@ -438,6 +453,10 @@ msgstr "" msgid "Can't determine value for environment variable \"%s\" " msgstr "" +#: main.c:115 +msgid "Can't get DBUS object name" +msgstr "" + #: ft.c:413 msgid "Can't get file size" msgstr "" @@ -647,6 +666,10 @@ msgstr "" msgid "Connect on startup" msgstr "" +#: gobject.c:205 +msgid "Connecting to host" +msgstr "" + #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 #: connect.c:573 @@ -1321,10 +1344,6 @@ msgstr "" msgid "Paste text file" msgstr "" -#: dialog.c:428 -msgid "Paste text file contents" -msgstr "" - #: toggles.c:128 00default.xml:120 msgid "Paste with left margin" msgstr "" @@ -1861,6 +1880,11 @@ msgstr "" msgid "Starting" msgstr "" +#: gobject.c:193 +#, c-format +msgid "State %04d can't accept requests" +msgstr "" + #: security.c:237 msgid "Subject issuer mismatch" msgstr "" @@ -2082,7 +2106,7 @@ msgstr "" msgid "This is a host program error." msgstr "" -#: dialog.c:472 +#: dialog.c:480 msgid "" "This program is free software; you can redistribute it and/or modify it " "under the terms of the GNU General Public License as published by the Free " @@ -2292,6 +2316,11 @@ msgstr "" msgid "Unexpected or unknown security status" msgstr "" +#: gobject.c:208 +#, c-format +msgid "Unexpected state %04d" +msgstr "" + #: actions.c:391 #, c-format msgid "Unexpected target \"%s\"" @@ -2354,7 +2383,7 @@ msgstr "" msgid "Variable" msgstr "" -#: dialog.c:513 dialog.c:515 +#: dialog.c:521 dialog.c:523 #, c-format msgid "Version %s-%s" msgstr "" @@ -2618,6 +2647,6 @@ msgstr "" msgid "setsockopt(SO_OOBINLINE) has failed" msgstr "" -#: dialog.c:533 +#: dialog.c:541 msgid "translator-credits" msgstr "" diff --git a/src/include/pw3270.h b/src/include/pw3270.h index f882659..834ba14 100644 --- a/src/include/pw3270.h +++ b/src/include/pw3270.h @@ -84,7 +84,7 @@ LIB3270_EXPORT gchar * pw3270_get_datadir(const gchar *first_element, ...); - LIB3270_EXPORT gchar * pw3270_file_chooser(GtkFileChooserAction action, const gchar *name, const gchar *title, const gchar *file, const gchar *ext); + LIB3270_EXPORT gchar * pw3270_file_chooser(GtkFileChooserAction action, const gchar *name, const gchar *title, const gchar *file); LIB3270_EXPORT void pw3270_set_host_charset(GtkWidget *widget, const gchar *name); diff --git a/src/pw3270/dialog.c b/src/pw3270/dialog.c index d386038..45fa508 100644 --- a/src/pw3270/dialog.c +++ b/src/pw3270/dialog.c @@ -410,6 +410,32 @@ void paste_file_action(GtkAction *action, GtkWidget *widget) { + const gchar * name = g_object_get_data(G_OBJECT(action),"filename"); + const gchar * charset = g_object_get_data(G_OBJECT(action),"charset"); + + trace("Action %s activated on widget %p",gtk_action_get_name(action),widget); + + if(name) { + + // Tem nome pre-definido, colca direto + paste_filename(widget,name,charset); + return; + + } + + + gchar * filename = pw3270_file_chooser( GTK_FILE_CHOOSER_ACTION_OPEN, + "paste", + g_object_get_data(G_OBJECT(action),"title"), + name + ); + + if(filename) { + paste_filename(widget,filename,charset); + g_free(filename); + } + + /* const gchar * user_title = g_object_get_data(G_OBJECT(action),"title"); const gchar * filename = g_object_get_data(G_OBJECT(action),"filename"); gchar * encattr = NULL; @@ -458,6 +484,7 @@ if(encattr) g_free(encattr); + */ } G_GNUC_INTERNAL void about_dialog_action(GtkAction *action, GtkWidget *widget) @@ -564,7 +591,7 @@ static gpointer select_file(struct file *fl) { } #endif // _WIN32 - LIB3270_EXPORT gchar * pw3270_file_chooser(GtkFileChooserAction action, const gchar *name, const gchar *title, const gchar *file, const gchar *ext) + LIB3270_EXPORT gchar * pw3270_file_chooser(GtkFileChooserAction action, const gchar *name, const gchar *title, const gchar *file) { gchar * filename = NULL; diff --git a/src/pw3270/v3270ft/private.h b/src/pw3270/v3270ft/private.h index aff05e8..c32c9ca 100644 --- a/src/pw3270/v3270ft/private.h +++ b/src/pw3270/v3270ft/private.h @@ -183,9 +183,6 @@ G_GNUC_INTERNAL guint v3270ftprogress_signal[V3270FTPROGRESS_SIGNAL_COUNT]; -// G_GNUC_INTERNAL void v3270ft_store(v3270ft *dialog, struct v3270ft_entry *info); -// G_GNUC_INTERNAL void v3270ft_restore(v3270ft *dialog, struct v3270ft_entry *info); - G_GNUC_INTERNAL void v3270ft_update_actions(v3270ft *dialog); G_GNUC_INTERNAL void v3270ft_update_state(struct v3270ft_entry *entry); G_GNUC_INTERNAL void v3270ft_set_active(v3270ft *dialog, GList * active); -- libgit2 0.21.2