Commit d582641b5831e4c44d89a078fcfc8c1bf540345d
1 parent
378dc731
Exists in
master
and in
5 other branches
Incluindo método para pesquisa dentro do buffer de terminal e opção para obter c…
…onteúdo sem quebra de linha.
Showing
5 changed files
with
94 additions
and
19 deletions
Show diff stats
locale/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: 2017-07-28 14:17-0300\n" | 8 | +"POT-Creation-Date: 2017-08-07 09:30-0300\n" |
9 | "PO-Revision-Date: 2017-02-15 17:08-0200\n" | 9 | "PO-Revision-Date: 2017-02-15 17:08-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 <perry.werneck@gmail.com>\n" | 11 | "Language-Team: Português <perry.werneck@gmail.com>\n" |
@@ -419,6 +419,11 @@ msgstr "Não foi possível conectar a %s" | @@ -419,6 +419,11 @@ msgstr "Não foi possível conectar a %s" | ||
419 | msgid "Can't connect to %s:%s" | 419 | msgid "Can't connect to %s:%s" |
420 | msgstr "Não foi possível conectar a %s:%s" | 420 | msgstr "Não foi possível conectar a %s:%s" |
421 | 421 | ||
422 | +#: main.c:70 | ||
423 | +#, fuzzy | ||
424 | +msgid "Can't connect to DBUS server" | ||
425 | +msgstr "Não foi possível conectar a %s" | ||
426 | + | ||
422 | #: selection.c:425 | 427 | #: selection.c:425 |
423 | #, c-format | 428 | #, c-format |
424 | msgid "Can't convert line %d from %s to %s" | 429 | msgid "Can't convert line %d from %s to %s" |
@@ -433,6 +438,10 @@ msgstr "Recortar não permitido em seleção retangular" | @@ -433,6 +438,10 @@ msgstr "Recortar não permitido em seleção retangular" | ||
433 | msgid "Can't determine value for environment variable \"%s\" " | 438 | msgid "Can't determine value for environment variable \"%s\" " |
434 | msgstr "Não consigo determinar o valor da variável de ambiente \"%s\" " | 439 | msgstr "Não consigo determinar o valor da variável de ambiente \"%s\" " |
435 | 440 | ||
441 | +#: main.c:115 | ||
442 | +msgid "Can't get DBUS object name" | ||
443 | +msgstr "" | ||
444 | + | ||
436 | #: ft.c:413 | 445 | #: ft.c:413 |
437 | msgid "Can't get file size" | 446 | msgid "Can't get file size" |
438 | msgstr "Não foi possível obter o tamanho do arquivo" | 447 | msgstr "Não foi possível obter o tamanho do arquivo" |
@@ -654,6 +663,11 @@ msgstr "Configurar host" | @@ -654,6 +663,11 @@ msgstr "Configurar host" | ||
654 | msgid "Connect on startup" | 663 | msgid "Connect on startup" |
655 | msgstr "Conectar ao iniciar" | 664 | msgstr "Conectar ao iniciar" |
656 | 665 | ||
666 | +#: gobject.c:205 | ||
667 | +#, fuzzy | ||
668 | +msgid "Connecting to host" | ||
669 | +msgstr "Não foi possível conectar ao servidor" | ||
670 | + | ||
657 | #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 | 671 | #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 |
658 | #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 | 672 | #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 |
659 | #: connect.c:573 | 673 | #: connect.c:573 |
@@ -1913,6 +1927,11 @@ msgstr "Iniciar transferência de arquivo" | @@ -1913,6 +1927,11 @@ msgstr "Iniciar transferência de arquivo" | ||
1913 | msgid "Starting" | 1927 | msgid "Starting" |
1914 | msgstr "Iniciando" | 1928 | msgstr "Iniciando" |
1915 | 1929 | ||
1930 | +#: gobject.c:193 | ||
1931 | +#, c-format | ||
1932 | +msgid "State %04d can't accept requests" | ||
1933 | +msgstr "" | ||
1934 | + | ||
1916 | #: security.c:237 | 1935 | #: security.c:237 |
1917 | msgid "Subject issuer mismatch" | 1936 | msgid "Subject issuer mismatch" |
1918 | msgstr "Divergência na identidade do emissor" | 1937 | msgstr "Divergência na identidade do emissor" |
@@ -2398,6 +2417,11 @@ msgstr "Valor de cor inválido ou inesperado: \"%s\"" | @@ -2398,6 +2417,11 @@ msgstr "Valor de cor inválido ou inesperado: \"%s\"" | ||
2398 | msgid "Unexpected or unknown security status" | 2417 | msgid "Unexpected or unknown security status" |
2399 | msgstr "Estado de segurança inesperado ou desconhecido." | 2418 | msgstr "Estado de segurança inesperado ou desconhecido." |
2400 | 2419 | ||
2420 | +#: gobject.c:208 | ||
2421 | +#, fuzzy, c-format | ||
2422 | +msgid "Unexpected state %04d" | ||
2423 | +msgstr "Alvo inesperado \"%s\"" | ||
2424 | + | ||
2401 | #: actions.c:391 | 2425 | #: actions.c:391 |
2402 | #, c-format | 2426 | #, c-format |
2403 | msgid "Unexpected target \"%s\"" | 2427 | msgid "Unexpected target \"%s\"" |
@@ -2802,10 +2826,6 @@ msgstr "translator-credits" | @@ -2802,10 +2826,6 @@ msgstr "translator-credits" | ||
2802 | #~ "32768. Valores maiores trazem maior performance, porem, nem todos os " | 2826 | #~ "32768. Valores maiores trazem maior performance, porem, nem todos os " |
2803 | #~ "hosts podem suportá-los." | 2827 | #~ "hosts podem suportá-los." |
2804 | 2828 | ||
2805 | -#, fuzzy | ||
2806 | -#~ msgid "Can't connect to DBUS server" | ||
2807 | -#~ msgstr "Não foi possível conectar a %s" | ||
2808 | - | ||
2809 | #~ msgid "Can't start download." | 2829 | #~ msgid "Can't start download." |
2810 | #~ msgstr "Não foi possível iniciar o download." | 2830 | #~ msgstr "Não foi possível iniciar o download." |
2811 | 2831 | ||
@@ -2842,10 +2862,6 @@ msgstr "translator-credits" | @@ -2842,10 +2862,6 @@ msgstr "translator-credits" | ||
2842 | #~ msgid "Complete" | 2862 | #~ msgid "Complete" |
2843 | #~ msgstr "Completo" | 2863 | #~ msgstr "Completo" |
2844 | 2864 | ||
2845 | -#, fuzzy | ||
2846 | -#~ msgid "Connecting to host" | ||
2847 | -#~ msgstr "Não foi possível conectar ao servidor" | ||
2848 | - | ||
2849 | #~ msgid "Copiar tudo" | 2865 | #~ msgid "Copiar tudo" |
2850 | #~ msgstr "Copiar tudo" | 2866 | #~ msgstr "Copiar tudo" |
2851 | 2867 | ||
@@ -3208,10 +3224,6 @@ msgstr "translator-credits" | @@ -3208,10 +3224,6 @@ msgstr "translator-credits" | ||
3208 | #~ msgid "Unexpected element <%s>" | 3224 | #~ msgid "Unexpected element <%s>" |
3209 | #~ msgstr "Elemento <%s> inesperado" | 3225 | #~ msgstr "Elemento <%s> inesperado" |
3210 | 3226 | ||
3211 | -#, fuzzy | ||
3212 | -#~ msgid "Unexpected state %04d" | ||
3213 | -#~ msgstr "Alvo inesperado \"%s\"" | ||
3214 | - | ||
3215 | #~ msgid "" | 3227 | #~ msgid "" |
3216 | #~ "Unknown host:\n" | 3228 | #~ "Unknown host:\n" |
3217 | #~ "%s" | 3229 | #~ "%s" |
locale/pw3270.pot
@@ -9,7 +9,7 @@ msgstr "" | @@ -9,7 +9,7 @@ msgstr "" | ||
9 | "#-#-#-#-# lib3270.pot (PACKAGE VERSION) #-#-#-#-#\n" | 9 | "#-#-#-#-# lib3270.pot (PACKAGE VERSION) #-#-#-#-#\n" |
10 | "Project-Id-Version: PACKAGE VERSION\n" | 10 | "Project-Id-Version: PACKAGE VERSION\n" |
11 | "Report-Msgid-Bugs-To: \n" | 11 | "Report-Msgid-Bugs-To: \n" |
12 | -"POT-Creation-Date: 2017-08-04 14:23-0300\n" | 12 | +"POT-Creation-Date: 2017-08-07 09:30-0300\n" |
13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
14 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 14 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
15 | "Language-Team: LANGUAGE <LL@li.org>\n" | 15 | "Language-Team: LANGUAGE <LL@li.org>\n" |
@@ -20,7 +20,7 @@ msgstr "" | @@ -20,7 +20,7 @@ msgstr "" | ||
20 | "#-#-#-#-# pw3270.pot (PACKAGE VERSION) #-#-#-#-#\n" | 20 | "#-#-#-#-# pw3270.pot (PACKAGE VERSION) #-#-#-#-#\n" |
21 | "Project-Id-Version: PACKAGE VERSION\n" | 21 | "Project-Id-Version: PACKAGE VERSION\n" |
22 | "Report-Msgid-Bugs-To: \n" | 22 | "Report-Msgid-Bugs-To: \n" |
23 | -"POT-Creation-Date: 2017-08-04 14:23-0300\n" | 23 | +"POT-Creation-Date: 2017-08-07 09:30-0300\n" |
24 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 24 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
25 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 25 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
26 | "Language-Team: LANGUAGE <LL@li.org>\n" | 26 | "Language-Team: LANGUAGE <LL@li.org>\n" |
@@ -39,6 +39,17 @@ msgstr "" | @@ -39,6 +39,17 @@ msgstr "" | ||
39 | "MIME-Version: 1.0\n" | 39 | "MIME-Version: 1.0\n" |
40 | "Content-Type: text/plain; charset=CHARSET\n" | 40 | "Content-Type: text/plain; charset=CHARSET\n" |
41 | "Content-Transfer-Encoding: 8bit\n" | 41 | "Content-Transfer-Encoding: 8bit\n" |
42 | +"#-#-#-#-# dbus3270.pot (PACKAGE VERSION) #-#-#-#-#\n" | ||
43 | +"Project-Id-Version: PACKAGE VERSION\n" | ||
44 | +"Report-Msgid-Bugs-To: \n" | ||
45 | +"POT-Creation-Date: 2017-08-07 09:30-0300\n" | ||
46 | +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
47 | +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
48 | +"Language-Team: LANGUAGE <LL@li.org>\n" | ||
49 | +"Language: \n" | ||
50 | +"MIME-Version: 1.0\n" | ||
51 | +"Content-Type: text/plain; charset=CHARSET\n" | ||
52 | +"Content-Transfer-Encoding: 8bit\n" | ||
42 | 53 | ||
43 | #: window.c:329 | 54 | #: window.c:329 |
44 | #, c-format | 55 | #, c-format |
@@ -424,6 +435,10 @@ msgstr "" | @@ -424,6 +435,10 @@ msgstr "" | ||
424 | msgid "Can't connect to %s:%s" | 435 | msgid "Can't connect to %s:%s" |
425 | msgstr "" | 436 | msgstr "" |
426 | 437 | ||
438 | +#: main.c:70 | ||
439 | +msgid "Can't connect to DBUS server" | ||
440 | +msgstr "" | ||
441 | + | ||
427 | #: selection.c:425 | 442 | #: selection.c:425 |
428 | #, c-format | 443 | #, c-format |
429 | msgid "Can't convert line %d from %s to %s" | 444 | msgid "Can't convert line %d from %s to %s" |
@@ -438,6 +453,10 @@ msgstr "" | @@ -438,6 +453,10 @@ msgstr "" | ||
438 | msgid "Can't determine value for environment variable \"%s\" " | 453 | msgid "Can't determine value for environment variable \"%s\" " |
439 | msgstr "" | 454 | msgstr "" |
440 | 455 | ||
456 | +#: main.c:115 | ||
457 | +msgid "Can't get DBUS object name" | ||
458 | +msgstr "" | ||
459 | + | ||
441 | #: ft.c:413 | 460 | #: ft.c:413 |
442 | msgid "Can't get file size" | 461 | msgid "Can't get file size" |
443 | msgstr "" | 462 | msgstr "" |
@@ -647,6 +666,10 @@ msgstr "" | @@ -647,6 +666,10 @@ msgstr "" | ||
647 | msgid "Connect on startup" | 666 | msgid "Connect on startup" |
648 | msgstr "" | 667 | msgstr "" |
649 | 668 | ||
669 | +#: gobject.c:205 | ||
670 | +msgid "Connecting to host" | ||
671 | +msgstr "" | ||
672 | + | ||
650 | #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 | 673 | #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 |
651 | #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 | 674 | #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 |
652 | #: connect.c:573 | 675 | #: connect.c:573 |
@@ -1861,6 +1884,11 @@ msgstr "" | @@ -1861,6 +1884,11 @@ msgstr "" | ||
1861 | msgid "Starting" | 1884 | msgid "Starting" |
1862 | msgstr "" | 1885 | msgstr "" |
1863 | 1886 | ||
1887 | +#: gobject.c:193 | ||
1888 | +#, c-format | ||
1889 | +msgid "State %04d can't accept requests" | ||
1890 | +msgstr "" | ||
1891 | + | ||
1864 | #: security.c:237 | 1892 | #: security.c:237 |
1865 | msgid "Subject issuer mismatch" | 1893 | msgid "Subject issuer mismatch" |
1866 | msgstr "" | 1894 | msgstr "" |
@@ -2292,6 +2320,11 @@ msgstr "" | @@ -2292,6 +2320,11 @@ msgstr "" | ||
2292 | msgid "Unexpected or unknown security status" | 2320 | msgid "Unexpected or unknown security status" |
2293 | msgstr "" | 2321 | msgstr "" |
2294 | 2322 | ||
2323 | +#: gobject.c:208 | ||
2324 | +#, c-format | ||
2325 | +msgid "Unexpected state %04d" | ||
2326 | +msgstr "" | ||
2327 | + | ||
2295 | #: actions.c:391 | 2328 | #: actions.c:391 |
2296 | #, c-format | 2329 | #, c-format |
2297 | msgid "Unexpected target \"%s\"" | 2330 | msgid "Unexpected target \"%s\"" |
src/include/pw3270cpp.h
@@ -209,7 +209,8 @@ | @@ -209,7 +209,8 @@ | ||
209 | int cmp_string_at(int row, int col, const char *text); | 209 | int cmp_string_at(int row, int col, const char *text); |
210 | int wait_for_string_at(int row, int col, const char *key, int timeout); | 210 | int wait_for_string_at(int row, int col, const char *key, int timeout); |
211 | int input_string(const char *str); | 211 | int input_string(const char *str); |
212 | - string get_contents(); | 212 | + string get_contents(bool lf = true); |
213 | + size_t find_string(const char *str, bool lf = false); | ||
213 | 214 | ||
214 | inline operator string() { | 215 | inline operator string() { |
215 | return get_string(); | 216 | return get_string(); |
src/libpw3270cpp/session.cc
@@ -686,7 +686,7 @@ | @@ -686,7 +686,7 @@ | ||
686 | return -1; | 686 | return -1; |
687 | } | 687 | } |
688 | 688 | ||
689 | - string session::get_contents() | 689 | + string session::get_contents(bool lf) |
690 | { | 690 | { |
691 | string rc = ""; | 691 | string rc = ""; |
692 | int rows = get_height(); | 692 | int rows = get_height(); |
@@ -695,12 +695,37 @@ | @@ -695,12 +695,37 @@ | ||
695 | for(int r = 0; r < rows; r++) | 695 | for(int r = 0; r < rows; r++) |
696 | { | 696 | { |
697 | rc += get_string_at(r+1,1,cols).c_str(); | 697 | rc += get_string_at(r+1,1,cols).c_str(); |
698 | - rc += "\n"; | 698 | + if(lf) { |
699 | + rc += "\n"; | ||
700 | + } | ||
699 | } | 701 | } |
700 | 702 | ||
701 | return rc; | 703 | return rc; |
702 | } | 704 | } |
703 | 705 | ||
706 | + size_t session::find_string(const char *str, bool lf) { | ||
707 | + | ||
708 | + int rc = 0; | ||
709 | + | ||
710 | + try | ||
711 | + { | ||
712 | + size_t pos = get_contents(lf).find(str); | ||
713 | + | ||
714 | + if(pos != string::npos) { | ||
715 | + rc = ((int) pos) + 1; | ||
716 | + } | ||
717 | + | ||
718 | + } | ||
719 | + catch(std::exception &e) | ||
720 | + { | ||
721 | + rc = 0; | ||
722 | + } | ||
723 | + | ||
724 | + return rc; | ||
725 | + | ||
726 | + } | ||
727 | + | ||
728 | + | ||
704 | string session::get_session_name(void) const | 729 | string session::get_session_name(void) const |
705 | { | 730 | { |
706 | return string(); | 731 | return string(); |
src/plugins/hllapi/calls.cc
@@ -230,11 +230,14 @@ | @@ -230,11 +230,14 @@ | ||
230 | 230 | ||
231 | HLLAPI_API_CALL hllapi_find_text(LPSTR text) | 231 | HLLAPI_API_CALL hllapi_find_text(LPSTR text) |
232 | { | 232 | { |
233 | + return (int) session::get_default()->find_string((const char *text),false); | ||
234 | + | ||
235 | + /* | ||
233 | int rc = 0; | 236 | int rc = 0; |
234 | 237 | ||
235 | try | 238 | try |
236 | { | 239 | { |
237 | - size_t pos = session::get_default()->get_contents().find((const char *) text); | 240 | + size_t pos = session::get_default()->get_contents(true).find((const char *) text); |
238 | 241 | ||
239 | if(pos != string::npos) { | 242 | if(pos != string::npos) { |
240 | rc = ((int) pos) + 1; | 243 | rc = ((int) pos) + 1; |
@@ -247,6 +250,7 @@ | @@ -247,6 +250,7 @@ | ||
247 | } | 250 | } |
248 | 251 | ||
249 | return rc; | 252 | return rc; |
253 | + */ | ||
250 | } | 254 | } |
251 | 255 | ||
252 | 256 |