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 | 5 | msgstr "" |
6 | 6 | "Project-Id-Version: pw3270 5.0\n" |
7 | 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 | 9 | "PO-Revision-Date: 2017-02-15 17:08-0200\n" |
10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
11 | 11 | "Language-Team: Português <perry.werneck@gmail.com>\n" |
... | ... | @@ -419,6 +419,11 @@ msgstr "Não foi possível conectar a %s" |
419 | 419 | msgid "Can't connect to %s:%s" |
420 | 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 | 427 | #: selection.c:425 |
423 | 428 | #, c-format |
424 | 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 | 438 | msgid "Can't determine value for environment variable \"%s\" " |
434 | 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 | 445 | #: ft.c:413 |
437 | 446 | msgid "Can't get file size" |
438 | 447 | msgstr "Não foi possível obter o tamanho do arquivo" |
... | ... | @@ -654,6 +663,11 @@ msgstr "Configurar host" |
654 | 663 | msgid "Connect on startup" |
655 | 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 | 671 | #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 |
658 | 672 | #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 |
659 | 673 | #: connect.c:573 |
... | ... | @@ -1913,6 +1927,11 @@ msgstr "Iniciar transferência de arquivo" |
1913 | 1927 | msgid "Starting" |
1914 | 1928 | msgstr "Iniciando" |
1915 | 1929 | |
1930 | +#: gobject.c:193 | |
1931 | +#, c-format | |
1932 | +msgid "State %04d can't accept requests" | |
1933 | +msgstr "" | |
1934 | + | |
1916 | 1935 | #: security.c:237 |
1917 | 1936 | msgid "Subject issuer mismatch" |
1918 | 1937 | msgstr "Divergência na identidade do emissor" |
... | ... | @@ -2398,6 +2417,11 @@ msgstr "Valor de cor inválido ou inesperado: \"%s\"" |
2398 | 2417 | msgid "Unexpected or unknown security status" |
2399 | 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 | 2425 | #: actions.c:391 |
2402 | 2426 | #, c-format |
2403 | 2427 | msgid "Unexpected target \"%s\"" |
... | ... | @@ -2802,10 +2826,6 @@ msgstr "translator-credits" |
2802 | 2826 | #~ "32768. Valores maiores trazem maior performance, porem, nem todos os " |
2803 | 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 | 2829 | #~ msgid "Can't start download." |
2810 | 2830 | #~ msgstr "Não foi possível iniciar o download." |
2811 | 2831 | |
... | ... | @@ -2842,10 +2862,6 @@ msgstr "translator-credits" |
2842 | 2862 | #~ msgid "Complete" |
2843 | 2863 | #~ msgstr "Completo" |
2844 | 2864 | |
2845 | -#, fuzzy | |
2846 | -#~ msgid "Connecting to host" | |
2847 | -#~ msgstr "Não foi possível conectar ao servidor" | |
2848 | - | |
2849 | 2865 | #~ msgid "Copiar tudo" |
2850 | 2866 | #~ msgstr "Copiar tudo" |
2851 | 2867 | |
... | ... | @@ -3208,10 +3224,6 @@ msgstr "translator-credits" |
3208 | 3224 | #~ msgid "Unexpected element <%s>" |
3209 | 3225 | #~ msgstr "Elemento <%s> inesperado" |
3210 | 3226 | |
3211 | -#, fuzzy | |
3212 | -#~ msgid "Unexpected state %04d" | |
3213 | -#~ msgstr "Alvo inesperado \"%s\"" | |
3214 | - | |
3215 | 3227 | #~ msgid "" |
3216 | 3228 | #~ "Unknown host:\n" |
3217 | 3229 | #~ "%s" | ... | ... |
locale/pw3270.pot
... | ... | @@ -9,7 +9,7 @@ msgstr "" |
9 | 9 | "#-#-#-#-# lib3270.pot (PACKAGE VERSION) #-#-#-#-#\n" |
10 | 10 | "Project-Id-Version: PACKAGE VERSION\n" |
11 | 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 | 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
14 | 14 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
15 | 15 | "Language-Team: LANGUAGE <LL@li.org>\n" |
... | ... | @@ -20,7 +20,7 @@ msgstr "" |
20 | 20 | "#-#-#-#-# pw3270.pot (PACKAGE VERSION) #-#-#-#-#\n" |
21 | 21 | "Project-Id-Version: PACKAGE VERSION\n" |
22 | 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 | 24 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
25 | 25 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
26 | 26 | "Language-Team: LANGUAGE <LL@li.org>\n" |
... | ... | @@ -39,6 +39,17 @@ msgstr "" |
39 | 39 | "MIME-Version: 1.0\n" |
40 | 40 | "Content-Type: text/plain; charset=CHARSET\n" |
41 | 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 | 54 | #: window.c:329 |
44 | 55 | #, c-format |
... | ... | @@ -424,6 +435,10 @@ msgstr "" |
424 | 435 | msgid "Can't connect to %s:%s" |
425 | 436 | msgstr "" |
426 | 437 | |
438 | +#: main.c:70 | |
439 | +msgid "Can't connect to DBUS server" | |
440 | +msgstr "" | |
441 | + | |
427 | 442 | #: selection.c:425 |
428 | 443 | #, c-format |
429 | 444 | msgid "Can't convert line %d from %s to %s" |
... | ... | @@ -438,6 +453,10 @@ msgstr "" |
438 | 453 | msgid "Can't determine value for environment variable \"%s\" " |
439 | 454 | msgstr "" |
440 | 455 | |
456 | +#: main.c:115 | |
457 | +msgid "Can't get DBUS object name" | |
458 | +msgstr "" | |
459 | + | |
441 | 460 | #: ft.c:413 |
442 | 461 | msgid "Can't get file size" |
443 | 462 | msgstr "" |
... | ... | @@ -647,6 +666,10 @@ msgstr "" |
647 | 666 | msgid "Connect on startup" |
648 | 667 | msgstr "" |
649 | 668 | |
669 | +#: gobject.c:205 | |
670 | +msgid "Connecting to host" | |
671 | +msgstr "" | |
672 | + | |
650 | 673 | #: connect.c:215 connect.c:311 connect.c:320 connect.c:382 connect.c:397 |
651 | 674 | #: connect.c:413 connect.c:427 connect.c:447 connect.c:461 connect.c:477 |
652 | 675 | #: connect.c:573 |
... | ... | @@ -1861,6 +1884,11 @@ msgstr "" |
1861 | 1884 | msgid "Starting" |
1862 | 1885 | msgstr "" |
1863 | 1886 | |
1887 | +#: gobject.c:193 | |
1888 | +#, c-format | |
1889 | +msgid "State %04d can't accept requests" | |
1890 | +msgstr "" | |
1891 | + | |
1864 | 1892 | #: security.c:237 |
1865 | 1893 | msgid "Subject issuer mismatch" |
1866 | 1894 | msgstr "" |
... | ... | @@ -2292,6 +2320,11 @@ msgstr "" |
2292 | 2320 | msgid "Unexpected or unknown security status" |
2293 | 2321 | msgstr "" |
2294 | 2322 | |
2323 | +#: gobject.c:208 | |
2324 | +#, c-format | |
2325 | +msgid "Unexpected state %04d" | |
2326 | +msgstr "" | |
2327 | + | |
2295 | 2328 | #: actions.c:391 |
2296 | 2329 | #, c-format |
2297 | 2330 | msgid "Unexpected target \"%s\"" | ... | ... |
src/include/pw3270cpp.h
... | ... | @@ -209,7 +209,8 @@ |
209 | 209 | int cmp_string_at(int row, int col, const char *text); |
210 | 210 | int wait_for_string_at(int row, int col, const char *key, int timeout); |
211 | 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 | 215 | inline operator string() { |
215 | 216 | return get_string(); | ... | ... |
src/libpw3270cpp/session.cc
... | ... | @@ -686,7 +686,7 @@ |
686 | 686 | return -1; |
687 | 687 | } |
688 | 688 | |
689 | - string session::get_contents() | |
689 | + string session::get_contents(bool lf) | |
690 | 690 | { |
691 | 691 | string rc = ""; |
692 | 692 | int rows = get_height(); |
... | ... | @@ -695,12 +695,37 @@ |
695 | 695 | for(int r = 0; r < rows; r++) |
696 | 696 | { |
697 | 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 | 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 | 729 | string session::get_session_name(void) const |
705 | 730 | { |
706 | 731 | return string(); | ... | ... |
src/plugins/hllapi/calls.cc
... | ... | @@ -230,11 +230,14 @@ |
230 | 230 | |
231 | 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 | 236 | int rc = 0; |
234 | 237 | |
235 | 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 | 242 | if(pos != string::npos) { |
240 | 243 | rc = ((int) pos) + 1; |
... | ... | @@ -247,6 +250,7 @@ |
247 | 250 | } |
248 | 251 | |
249 | 252 | return rc; |
253 | + */ | |
250 | 254 | } |
251 | 255 | |
252 | 256 | ... | ... |