Commit 2a3185b845c956658a3db159ec3258c8fdcc50b8
1 parent
cd0f450e
Exists in
master
and in
5 other branches
função hllapi_get_text não deve considerar as quebras de linha.
Showing
9 changed files
with
85 additions
and
36 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-08-07 09:47-0300\n" | |
| 8 | +"POT-Creation-Date: 2017-08-10 10:12-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-09 10:33-0300\n" | |
| 12 | +"POT-Creation-Date: 2017-08-10 10:12-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-09 10:33-0300\n" | |
| 23 | +"POT-Creation-Date: 2017-08-10 10:12-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-10 10:12-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
| ... | ... | @@ -203,7 +203,7 @@ |
| 203 | 203 | string ebc2asc(string &str); |
| 204 | 204 | |
| 205 | 205 | // Get/Set/Text with charset translation |
| 206 | - string get_string(int baddr = 0, size_t len = -1); | |
| 206 | + string get_string(int baddr = 0, size_t len = -1, bool lf = false); | |
| 207 | 207 | string get_string_at(int row, int col, size_t sz); |
| 208 | 208 | int set_string_at(int row, int col, const char *str); |
| 209 | 209 | int cmp_string_at(int row, int col, const char *text); |
| ... | ... | @@ -274,12 +274,12 @@ |
| 274 | 274 | session(); |
| 275 | 275 | |
| 276 | 276 | // Get/Set/Test without charset translation |
| 277 | - virtual string get_text(int baddr = 0, size_t len = 1) = 0; | |
| 278 | - virtual string get_text_at(int row, int col, size_t sz) = 0; | |
| 279 | - virtual int set_text_at(int row, int col, const char *str) = 0; | |
| 280 | - virtual int cmp_text_at(int row, int col, const char *text) = 0; | |
| 277 | + virtual string get_text(int baddr = 0, size_t len = 1, bool lf = false) = 0; | |
| 278 | + virtual string get_text_at(int row, int col, size_t sz) = 0; | |
| 279 | + virtual int set_text_at(int row, int col, const char *str) = 0; | |
| 280 | + virtual int cmp_text_at(int row, int col, const char *text) = 0; | |
| 281 | + virtual int emulate_input(const char *str) = 0; | |
| 281 | 282 | virtual int wait_for_text_at(int row, int col, const char *key, int timeout); |
| 282 | - virtual int emulate_input(const char *str) = 0; | |
| 283 | 283 | |
| 284 | 284 | private: |
| 285 | 285 | ... | ... |
src/libpw3270cpp/local.cc
| ... | ... | @@ -377,10 +377,10 @@ |
| 377 | 377 | return _cmp_text_at(hSession,row,col,text); |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | - string get_text(int offset, size_t len) | |
| 380 | + string get_text(int offset, size_t len, bool lf) | |
| 381 | 381 | { |
| 382 | 382 | string rc; |
| 383 | - char * ptr = _get_text(hSession,offset,len,'\n'); | |
| 383 | + char * ptr = _get_text(hSession,offset,len,lf ? '\n' : 0); | |
| 384 | 384 | |
| 385 | 385 | if(ptr) |
| 386 | 386 | { | ... | ... |
src/libpw3270cpp/remote.cc
| ... | ... | @@ -1148,18 +1148,18 @@ |
| 1148 | 1148 | return ETIMEDOUT; |
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | - string get_text(int baddr, size_t len) | |
| 1151 | + string get_text(int baddr, size_t len, bool lf) | |
| 1152 | 1152 | { |
| 1153 | 1153 | #if defined(WIN32) |
| 1154 | 1154 | |
| 1155 | - struct hllapi_packet_query_offset query = { HLLAPI_PACKET_GET_TEXT_AT_OFFSET, (unsigned short) baddr, (unsigned short) len, '\n' }; | |
| 1155 | + struct hllapi_packet_query_offset query = { HLLAPI_PACKET_GET_TEXT_AT_OFFSET, (unsigned short) baddr, (unsigned short) len, lf ? '\n' : 0 }; | |
| 1156 | 1156 | return query_string(&query,sizeof(query),len); |
| 1157 | 1157 | |
| 1158 | 1158 | #elif defined(HAVE_DBUS) |
| 1159 | 1159 | |
| 1160 | 1160 | dbus_int32_t b = (dbus_int32_t) baddr; |
| 1161 | 1161 | dbus_int32_t l = (dbus_int32_t) len; |
| 1162 | - unsigned char d = '\n'; | |
| 1162 | + unsigned char d = lf ? '\n' : 0; | |
| 1163 | 1163 | |
| 1164 | 1164 | DBusMessage * msg = create_message("getText"); |
| 1165 | 1165 | if(!msg) | ... | ... |
src/libpw3270cpp/service.cc
| ... | ... | @@ -198,15 +198,17 @@ |
| 198 | 198 | |
| 199 | 199 | protected: |
| 200 | 200 | |
| 201 | - virtual string get_text(int baddr = 0, size_t len = 1) | |
| 201 | + virtual string get_text(int baddr = 0, size_t len = 1, bool lf = true) | |
| 202 | 202 | { |
| 203 | - dbus_int32_t a = (dbus_int32_t) baddr; | |
| 204 | - dbus_int32_t s = (dbus_int32_t) len; | |
| 203 | + dbus_int32_t a = (dbus_int32_t) baddr; | |
| 204 | + dbus_int32_t s = (dbus_int32_t) len; | |
| 205 | + char c = lf ? '\n' : 0; | |
| 205 | 206 | |
| 206 | 207 | return getString( "getText", |
| 207 | 208 | DBUS_TYPE_STRING, &this->id, |
| 208 | - DBUS_TYPE_INT32, &a, | |
| 209 | - DBUS_TYPE_INT32, &s, | |
| 209 | + DBUS_TYPE_INT32, &a, | |
| 210 | + DBUS_TYPE_INT32, &s, | |
| 211 | + DBUS_TYPE_BYTE, &c, | |
| 210 | 212 | DBUS_TYPE_INVALID); |
| 211 | 213 | |
| 212 | 214 | } | ... | ... |
src/libpw3270cpp/session.cc
| ... | ... | @@ -588,9 +588,9 @@ |
| 588 | 588 | return wait_for_text_at(row,col,get_3270_text(key).c_str(),timeout); |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | - string session::get_string(int baddr, size_t len) | |
| 591 | + string session::get_string(int baddr, size_t len, bool lf) | |
| 592 | 592 | { |
| 593 | - return get_local_text(get_text(baddr,len).c_str()); | |
| 593 | + return get_local_text(get_text(baddr,len,lf).c_str()); | |
| 594 | 594 | } |
| 595 | 595 | |
| 596 | 596 | string session::asc2ebc(string &str) | ... | ... |
src/plugins/hllapi/calls.cc
| ... | ... | @@ -318,8 +318,9 @@ |
| 318 | 318 | return HLLAPI_STATUS_DISCONNECTED; |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | - if(!(buffer && *buffer)) | |
| 322 | - return rc; | |
| 321 | + if(!(buffer && *buffer)) { | |
| 322 | + return HLLAPI_STATUS_BAD_PARAMETER; | |
| 323 | + } | |
| 323 | 324 | |
| 324 | 325 | try |
| 325 | 326 | { |
| ... | ... | @@ -336,7 +337,7 @@ |
| 336 | 337 | |
| 337 | 338 | memset(buffer,' ',szBuffer); |
| 338 | 339 | |
| 339 | - string str = session::get_default()->get_string(offset,szBuffer); | |
| 340 | + string str = session::get_default()->get_string(offset,szBuffer,false); | |
| 340 | 341 | strncpy(buffer,str.c_str(),szBuffer); |
| 341 | 342 | rc = HLLAPI_STATUS_SUCCESS; |
| 342 | 343 | } | ... | ... |
src/plugins/hllapi/hllapi.cbp
| ... | ... | @@ -64,6 +64,7 @@ |
| 64 | 64 | </Compiler> |
| 65 | 65 | <Unit filename="../../include/lib3270.h" /> |
| 66 | 66 | <Unit filename="../../include/pw3270/hllapi.h" /> |
| 67 | + <Unit filename="../../include/pw3270cpp.h" /> | |
| 67 | 68 | <Unit filename="Makefile.in" /> |
| 68 | 69 | <Unit filename="calls.cc" /> |
| 69 | 70 | <Unit filename="client.h" /> | ... | ... |