Commit 8c67970fc273d1133a05bed0e71c21ecc47799a6
Committed by
GitHub
Exists in
master
and in
1 other branch
Merge pull request #9 from PerryWerneck/develop
Updating to the last development version; many fixes and improvements.
Showing
30 changed files
with
654 additions
and
246 deletions
Show diff stats
Makefile.in
| ... | ... | @@ -49,7 +49,8 @@ SOURCES= \ |
| 49 | 49 | $(wildcard src/dialogs/print/*.c) \ |
| 50 | 50 | $(wildcard src/dialogs/save/*.c) \ |
| 51 | 51 | $(wildcard src/dialogs/font/*.c) \ |
| 52 | - $(wildcard src/dialogs/settings/*.c) | |
| 52 | + $(wildcard src/dialogs/settings/*.c) \ | |
| 53 | + $(wildcard src/tools/*.c) | |
| 53 | 54 | |
| 54 | 55 | TEST_SOURCES= \ |
| 55 | 56 | $(wildcard src/testprogram/*.c) |
| ... | ... | @@ -70,10 +71,9 @@ WINDRES=@WINDRES@ |
| 70 | 71 | AR=@AR@ |
| 71 | 72 | VALGRIND=@VALGRIND@ |
| 72 | 73 | GENMARSHAL=@GENMARSHAL@ |
| 73 | -CONVERT=@CONVERT@ | |
| 74 | -OPTIPNG=@OPTIPNG@ | |
| 75 | 74 | ZIP=@ZIP@ |
| 76 | 75 | DLLTOOL=@DLLTOOL@ |
| 76 | +STRIP=@STRIP@ | |
| 77 | 77 | |
| 78 | 78 | #---[ Paths ]---------------------------------------------------------------------------- |
| 79 | 79 | |
| ... | ... | @@ -149,6 +149,11 @@ $(OBJDBG)/%.o: \ |
| 149 | 149 | |
| 150 | 150 | @$(CC) \ |
| 151 | 151 | $(CFLAGS) \ |
| 152 | + -DDEBUG=1 \ | |
| 153 | + -MM -MT $@ -MF $(patsubst %.o,%.d,$@) $< | |
| 154 | + | |
| 155 | + @$(CC) \ | |
| 156 | + $(CFLAGS) \ | |
| 152 | 157 | -Wall -Wextra -fstack-check \ |
| 153 | 158 | -DDEBUG=1 \ |
| 154 | 159 | -o $@ -c $< |
| ... | ... | @@ -177,6 +182,12 @@ $(OBJRLS)/%.o: \ |
| 177 | 182 | |
| 178 | 183 | @echo $< ... |
| 179 | 184 | @$(MKDIR) $(dir $@) |
| 185 | + | |
| 186 | + @$(CC) \ | |
| 187 | + $(CFLAGS) \ | |
| 188 | + -DNDEBUG=1 \ | |
| 189 | + -MM -MT $@ -MF $(patsubst %.o,%.d,$@) $< | |
| 190 | + | |
| 180 | 191 | @$(CC) \ |
| 181 | 192 | $(CFLAGS) \ |
| 182 | 193 | -DNDEBUG=1 \ |
| ... | ... | @@ -311,6 +322,11 @@ $(BINRLS)/$(SONAME): \ |
| 311 | 322 | -L$(BINRLS) \ |
| 312 | 323 | $(LIBS) |
| 313 | 324 | |
| 325 | +strip: \ | |
| 326 | + $(BINRLS)/$(SONAME) | |
| 327 | + | |
| 328 | + @$(STRIP) --discard-all $(BINRLS)/$(SONAME) | |
| 329 | + | |
| 314 | 330 | $(BINRLS)/static/$(LIBNAME).a: \ |
| 315 | 331 | $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC).o) |
| 316 | 332 | |
| ... | ... | @@ -414,7 +430,7 @@ install-linux-dev: |
| 414 | 430 | $(DESTDIR)$(libdir)/$(LIBNAME)@DLLEXT@ |
| 415 | 431 | |
| 416 | 432 | install-windows-dev: \ |
| 417 | - $(BINRLS)/$(SONAME) \ | |
| 433 | + strip \ | |
| 418 | 434 | $(BINRLS)/$(LIBNAME).dll.a |
| 419 | 435 | |
| 420 | 436 | @$(MKDIR) \ |
| ... | ... | @@ -564,4 +580,8 @@ clean: \ |
| 564 | 580 | cleanDebug \ |
| 565 | 581 | cleanRelease |
| 566 | 582 | |
| 583 | +-include $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC).d) | |
| 584 | +-include $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC).d) | |
| 585 | + | |
| 586 | + | |
| 567 | 587 | ... | ... |
configure.ac
| ... | ... | @@ -138,8 +138,6 @@ dnl Check for other programs |
| 138 | 138 | dnl --------------------------------------------------------------------------- |
| 139 | 139 | |
| 140 | 140 | AC_PATH_TOOL([AR], [ar], [ar]) |
| 141 | -AC_PATH_TOOL([CONVERT], [convert], [no]) | |
| 142 | -AC_PATH_TOOL([OPTIPNG],[optipng],[no]) | |
| 143 | 141 | AC_PATH_TOOL([ZIP],[zip],[no]) |
| 144 | 142 | AC_PATH_TOOL([DLLTOOL],[dlltool],[no]) |
| 145 | 143 | AC_PATH_TOOL([WINDRES], [windres], [no]) |
| ... | ... | @@ -238,6 +236,7 @@ AC_PATH_TOOL([MSGMERGE], [msgmerge], [no]) |
| 238 | 236 | AC_PATH_TOOL([MSGFMT], [msgfmt], [no]) |
| 239 | 237 | AC_PATH_TOOL([VALGRIND], [valgrind], [no]) |
| 240 | 238 | AC_PATH_TOOL([GENMARSHAL], [glib-genmarshal], [glib-genmarshal]) |
| 239 | +AC_PATH_TOOL([STRIP], [strip], [true]) | |
| 241 | 240 | |
| 242 | 241 | AC_CHECK_HEADER(libintl.h, [ |
| 243 | 242 | AC_DEFINE(HAVE_LIBINTL, 1) | ... | ... |
locale/pt_BR.po
| ... | ... | @@ -5,8 +5,8 @@ msgid "" |
| 5 | 5 | msgstr "" |
| 6 | 6 | "Project-Id-Version: pw3270 5.0\n" |
| 7 | 7 | "Report-Msgid-Bugs-To: \n" |
| 8 | -"POT-Creation-Date: 2020-09-12 13:50-0300\n" | |
| 9 | -"PO-Revision-Date: 2020-08-03 15:26-0300\n" | |
| 8 | +"POT-Creation-Date: 2020-10-24 11:11-0300\n" | |
| 9 | +"PO-Revision-Date: 2020-10-15 15:37-0300\n" | |
| 10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
| 11 | 11 | "Language-Team: Português <>\n" |
| 12 | 12 | "Language: pt_BR\n" |
| ... | ... | @@ -24,7 +24,7 @@ msgstr "" |
| 24 | 24 | msgid "16 colors" |
| 25 | 25 | msgstr "16 cores" |
| 26 | 26 | |
| 27 | -#: src/filetransfer/v3270ft.c:353 src/filetransfer/v3270ftprogress.c:386 | |
| 27 | +#: src/filetransfer/v3270ftprogress.c:386 src/filetransfer/v3270ft.c:353 | |
| 28 | 28 | #: src/dialogs/print/settingsdialog.c:284 |
| 29 | 29 | #: src/dialogs/print/settingsdialog.c:286 |
| 30 | 30 | #: src/dialogs/print/settingsdialog.c:288 |
| ... | ... | @@ -47,7 +47,7 @@ msgstr "" |
| 47 | 47 | "<b>Identidade não foi confirmada</b>\n" |
| 48 | 48 | "Desconectado do servidor" |
| 49 | 49 | |
| 50 | -#: src/dialogs/print/print.c:150 | |
| 50 | +#: src/dialogs/print/print.c:148 | |
| 51 | 51 | msgid "<b>Text options</b>" |
| 52 | 52 | msgstr "<b>Opções de texto</b>" |
| 53 | 53 | |
| ... | ... | @@ -80,7 +80,7 @@ msgstr "Nome da Ação" |
| 80 | 80 | msgid "Activity already on the queue" |
| 81 | 81 | msgstr "Atividade já está na fila" |
| 82 | 82 | |
| 83 | -#: src/terminal/actions/table.c:75 | |
| 83 | +#: src/terminal/actions/table.c:99 | |
| 84 | 84 | msgid "Add to copy" |
| 85 | 85 | msgstr "Adicionar à cópia" |
| 86 | 86 | |
| ... | ... | @@ -88,6 +88,10 @@ msgstr "Adicionar à cópia" |
| 88 | 88 | msgid "Address or name of the host to connect." |
| 89 | 89 | msgstr "Endereço ou nome do host a conectar." |
| 90 | 90 | |
| 91 | +#: src/tools/entry.c:121 | |
| 92 | +msgid "All files" | |
| 93 | +msgstr "Todos os arquivos" | |
| 94 | + | |
| 91 | 95 | #: src/dialogs/settings/accelerator.c:206 |
| 92 | 96 | msgid "Alternative" |
| 93 | 97 | msgstr "Alternativa" |
| ... | ... | @@ -108,11 +112,11 @@ msgstr "" |
| 108 | 112 | msgid "An invalid SEND or RECEIVE parameter was sent to the host." |
| 109 | 113 | msgstr "Um parametro de ENVIO/RECEBIMENTO inválido foi enviado para o host." |
| 110 | 114 | |
| 111 | -#: src/terminal/actions/table.c:77 | |
| 115 | +#: src/terminal/actions/table.c:101 | |
| 112 | 116 | msgid "Append selected area to current clipboard contents" |
| 113 | 117 | msgstr "Adiciona a área selecionada no conteúdo da área de transferência" |
| 114 | 118 | |
| 115 | -#: src/terminal/actions/table.c:76 | |
| 119 | +#: src/terminal/actions/table.c:100 | |
| 116 | 120 | msgid "Append selection to clipboard" |
| 117 | 121 | msgstr "Adiciona seleção na área de transferência" |
| 118 | 122 | |
| ... | ... | @@ -179,12 +183,12 @@ msgstr "Não é possível adicionar atividade" |
| 179 | 183 | msgid "Can't find a valid font with the name \"%s\"" |
| 180 | 184 | msgstr "Não encontrei uma fonte válida com o nome \"%s\"" |
| 181 | 185 | |
| 182 | -#: src/filetransfer/load.c:271 | |
| 186 | +#: src/filetransfer/load.c:269 | |
| 183 | 187 | #, c-format |
| 184 | 188 | msgid "Can't load %s" |
| 185 | 189 | msgstr "Não foi possível carregar %s" |
| 186 | 190 | |
| 187 | -#: src/dialogs/load.c:324 | |
| 191 | +#: src/dialogs/load.c:323 | |
| 188 | 192 | #, c-format |
| 189 | 193 | msgid "Can't open %s" |
| 190 | 194 | msgstr "Não foi possível abrir %s" |
| ... | ... | @@ -202,7 +206,7 @@ msgstr "Erro ao converter valor do cgcsid" |
| 202 | 206 | msgid "Can't parse character value" |
| 203 | 207 | msgstr "Erro ao analisar valor de caractere" |
| 204 | 208 | |
| 205 | -#: src/selection/windows/paste.c:79 src/selection/windows/paste.c:119 | |
| 209 | +#: src/selection/linux/paste.c:81 src/selection/linux/paste.c:115 | |
| 206 | 210 | msgid "Can't paste" |
| 207 | 211 | msgstr "Não é possivel colar" |
| 208 | 212 | |
| ... | ... | @@ -210,13 +214,13 @@ msgstr "Não é possivel colar" |
| 210 | 214 | msgid "Can't paste text" |
| 211 | 215 | msgstr "Não é possível colar texto" |
| 212 | 216 | |
| 213 | -#: src/filetransfer/activitylist.c:436 src/filetransfer/save.c:117 | |
| 214 | -#: src/trace/trace.c:486 src/dialogs/transfer.c:91 src/dialogs/save/save.c:627 | |
| 217 | +#: src/filetransfer/save.c:117 src/filetransfer/activitylist.c:436 | |
| 218 | +#: src/trace/trace.c:484 src/dialogs/transfer.c:91 src/dialogs/save/save.c:625 | |
| 215 | 219 | #, c-format |
| 216 | 220 | msgid "Can't save %s" |
| 217 | 221 | msgstr "Não foi possível salvar arquivo %s" |
| 218 | 222 | |
| 219 | -#: src/filetransfer/v3270ftprogress.c:773 src/filetransfer/worker.c:610 | |
| 223 | +#: src/filetransfer/worker.c:610 src/filetransfer/v3270ftprogress.c:773 | |
| 220 | 224 | msgid "Can't set callback table" |
| 221 | 225 | msgstr "Não foi possível setar a tabela de retornos" |
| 222 | 226 | |
| ... | ... | @@ -224,13 +228,13 @@ msgstr "Não foi possível setar a tabela de retornos" |
| 224 | 228 | msgid "Can't set lib3270 I/O controller" |
| 225 | 229 | msgstr "Não foi possível registrar manipuladores de I/O 3270" |
| 226 | 230 | |
| 227 | -#: src/filetransfer/v3270ftprogress.c:760 src/filetransfer/worker.c:591 | |
| 231 | +#: src/filetransfer/worker.c:591 src/filetransfer/v3270ftprogress.c:760 | |
| 228 | 232 | msgid "Can't start file transfer session" |
| 229 | 233 | msgstr "Não foi possível iniciar transferência de arquivo" |
| 230 | 234 | |
| 231 | -#: src/filetransfer/transfer.c:89 src/filetransfer/v3270ftprogress.c:433 | |
| 235 | +#: src/filetransfer/v3270ftprogress.c:433 src/filetransfer/transfer.c:89 | |
| 232 | 236 | #: src/dialogs/load.c:111 src/dialogs/save/save.c:117 |
| 233 | -#: src/dialogs/settings/host.c:401 | |
| 237 | +#: src/dialogs/settings/host.c:401 src/tools/entry.c:99 | |
| 234 | 238 | msgid "Cancel" |
| 235 | 239 | msgstr "Cancelar" |
| 236 | 240 | |
| ... | ... | @@ -298,15 +302,23 @@ msgstr "Comando a executar" |
| 298 | 302 | msgid "Connection" |
| 299 | 303 | msgstr "Conexão" |
| 300 | 304 | |
| 301 | -#: src/terminal/actions/table.c:64 src/terminal/actions/table.c:87 | |
| 305 | +#: src/terminal/actions/table.c:70 src/terminal/actions/table.c:111 | |
| 302 | 306 | msgid "Copy" |
| 303 | 307 | msgstr "Copiar" |
| 304 | 308 | |
| 309 | +#: src/terminal/actions/table.c:79 | |
| 310 | +msgid "Copy as HTML" | |
| 311 | +msgstr "Copiar como HTML" | |
| 312 | + | |
| 305 | 313 | #: src/terminal/actions/table.c:88 |
| 314 | +msgid "Copy as image" | |
| 315 | +msgstr "Copiar como imagem" | |
| 316 | + | |
| 317 | +#: src/terminal/actions/table.c:112 | |
| 306 | 318 | msgid "Copy as plain text" |
| 307 | 319 | msgstr "Copiar como texto puro" |
| 308 | 320 | |
| 309 | -#: src/terminal/actions/table.c:98 src/terminal/actions/table.c:99 | |
| 321 | +#: src/terminal/actions/table.c:122 src/terminal/actions/table.c:123 | |
| 310 | 322 | msgid "Copy as table" |
| 311 | 323 | msgstr "Copiar como tabela" |
| 312 | 324 | |
| ... | ... | @@ -314,7 +326,15 @@ msgstr "Copiar como tabela" |
| 314 | 326 | msgid "Copy options" |
| 315 | 327 | msgstr "Opções da cópia" |
| 316 | 328 | |
| 317 | -#: src/terminal/actions/table.c:65 | |
| 329 | +#: src/terminal/actions/table.c:80 | |
| 330 | +msgid "Copy selection in HTML format" | |
| 331 | +msgstr "Copia seleção em formato HTML" | |
| 332 | + | |
| 333 | +#: src/terminal/actions/table.c:89 | |
| 334 | +msgid "Copy selection in image format" | |
| 335 | +msgstr "Copia imagem da seleção" | |
| 336 | + | |
| 337 | +#: src/terminal/actions/table.c:71 | |
| 318 | 338 | msgid "Copy selection to clipboard" |
| 319 | 339 | msgstr "Salvar seleção para área de transferência" |
| 320 | 340 | |
| ... | ... | @@ -356,20 +376,20 @@ msgstr "Atual:" |
| 356 | 376 | msgid "Custom Remap" |
| 357 | 377 | msgstr "Mapeamento personalizado" |
| 358 | 378 | |
| 359 | -#: src/terminal/actions/table.c:109 src/terminal/actions/table.c:118 | |
| 360 | -#: src/terminal/actions/table.c:129 | |
| 379 | +#: src/terminal/actions/table.c:133 src/terminal/actions/table.c:142 | |
| 380 | +#: src/terminal/actions/table.c:153 | |
| 361 | 381 | msgid "Cut" |
| 362 | 382 | msgstr "Recortar" |
| 363 | 383 | |
| 364 | -#: src/terminal/actions/table.c:119 | |
| 384 | +#: src/terminal/actions/table.c:143 | |
| 365 | 385 | msgid "Cut and append to copy" |
| 366 | 386 | msgstr "Recortar e adicionar à cópia" |
| 367 | 387 | |
| 368 | -#: src/terminal/actions/table.c:130 | |
| 388 | +#: src/terminal/actions/table.c:154 | |
| 369 | 389 | msgid "Cut as plain text" |
| 370 | 390 | msgstr "Recortar como texto puro" |
| 371 | 391 | |
| 372 | -#: src/terminal/actions/table.c:140 src/terminal/actions/table.c:141 | |
| 392 | +#: src/terminal/actions/table.c:164 src/terminal/actions/table.c:165 | |
| 373 | 393 | msgid "Cut as table" |
| 374 | 394 | msgstr "Recortar como tabela" |
| 375 | 395 | |
| ... | ... | @@ -397,20 +417,19 @@ msgstr "Turquesa Escuro" |
| 397 | 417 | msgid "Default" |
| 398 | 418 | msgstr "Padrão" |
| 399 | 419 | |
| 400 | -#: src/dialogs/popups.c:146 | |
| 420 | +#: src/dialogs/popups.c:149 | |
| 401 | 421 | msgid "Don't ask again" |
| 402 | 422 | msgstr "Não perguntar de novo" |
| 403 | 423 | |
| 404 | 424 | #: src/dialogs/font/chooser.c:335 |
| 405 | -#, fuzzy | |
| 406 | 425 | msgid "Dynamic font spacing" |
| 407 | -msgstr "Estado do espaçamento dinâmico" | |
| 426 | +msgstr "Espaçamento dinâmico" | |
| 408 | 427 | |
| 409 | 428 | #: src/filetransfer/tables.c:224 |
| 410 | 429 | msgid "ETA:" |
| 411 | 430 | msgstr "ETA:" |
| 412 | 431 | |
| 413 | -#: src/terminal/actions/pakey.c:105 src/terminal/actions/pfkey.c:105 | |
| 432 | +#: src/terminal/actions/pfkey.c:105 src/terminal/actions/pakey.c:105 | |
| 414 | 433 | msgid "Emit a PA Key action" |
| 415 | 434 | msgstr "Emite uma ação de tecla PA" |
| 416 | 435 | |
| ... | ... | @@ -422,7 +441,7 @@ msgstr "Emulação" |
| 422 | 441 | msgid "Enabled" |
| 423 | 442 | msgstr "Habilitado" |
| 424 | 443 | |
| 425 | -#: src/dialogs/print/print.c:72 | |
| 444 | +#: src/dialogs/print/print.c:70 | |
| 426 | 445 | msgid "Error on print operation" |
| 427 | 446 | msgstr "Erro na operação de impressão" |
| 428 | 447 | |
| ... | ... | @@ -446,7 +465,7 @@ msgstr "_Formato do arquivo" |
| 446 | 465 | msgid "Files to transfer" |
| 447 | 466 | msgstr "Arquivos a transferir" |
| 448 | 467 | |
| 449 | -#: src/terminal/actions/table.c:216 | |
| 468 | +#: src/terminal/actions/table.c:240 | |
| 450 | 469 | msgid "Fit best" |
| 451 | 470 | msgstr "Melhor tamanho" |
| 452 | 471 | |
| ... | ... | @@ -569,11 +588,11 @@ msgstr "Ignore the fail and remove the file from queue." |
| 569 | 588 | msgid "Image copy" |
| 570 | 589 | msgstr "Copiar imagem" |
| 571 | 590 | |
| 572 | -#: src/terminal/actions/table.c:196 | |
| 591 | +#: src/terminal/actions/table.c:220 | |
| 573 | 592 | msgid "Increase the font size" |
| 574 | 593 | msgstr "Aumenta o tamanho da fonte" |
| 575 | 594 | |
| 576 | -#: src/terminal/actions/table.c:153 | |
| 595 | +#: src/terminal/actions/table.c:177 | |
| 577 | 596 | msgid "Input current clipboard contents to screen" |
| 578 | 597 | msgstr "Insere conteúdo da área de transferência" |
| 579 | 598 | |
| ... | ... | @@ -589,7 +608,7 @@ msgstr "Intensificado/Protegido" |
| 589 | 608 | msgid "Intensified/Unprotected" |
| 590 | 609 | msgstr "Intensificado/Desprotegido" |
| 591 | 610 | |
| 592 | -#: src/terminal/callbacks.c:477 | |
| 611 | +#: src/terminal/callbacks.c:440 | |
| 593 | 612 | #, c-format |
| 594 | 613 | msgid "" |
| 595 | 614 | "Invalid callback table, the release %s of lib%s can't be used (expecting " |
| ... | ... | @@ -619,11 +638,11 @@ msgstr "Atalhos de teclado" |
| 619 | 638 | msgid "L_U Names" |
| 620 | 639 | msgstr "Nomes de L_U" |
| 621 | 640 | |
| 622 | -#: src/filetransfer/activitylist.c:384 src/filetransfer/v3270ft.c:198 | |
| 641 | +#: src/filetransfer/v3270ft.c:198 src/filetransfer/activitylist.c:384 | |
| 623 | 642 | msgid "Load" |
| 624 | 643 | msgstr "Load" |
| 625 | 644 | |
| 626 | -#: src/filetransfer/activitylist.c:383 src/filetransfer/v3270ft.c:197 | |
| 645 | +#: src/filetransfer/v3270ft.c:197 src/filetransfer/activitylist.c:383 | |
| 627 | 646 | msgid "Load queue from file" |
| 628 | 647 | msgstr "Ler a fila de um arquivo" |
| 629 | 648 | |
| ... | ... | @@ -703,6 +722,10 @@ msgstr "Nenhum (Não exporta cores)" |
| 703 | 722 | msgid "None (Don't export font name)" |
| 704 | 723 | msgstr "Nenhuma (Não exporta fontes)" |
| 705 | 724 | |
| 725 | +#: src/selection/linux/paste.c:117 | |
| 726 | +msgid "None of the screens in the clipboard match with the current one." | |
| 727 | +msgstr "Nenhuma das telas da área de transferência corresponde à atual." | |
| 728 | + | |
| 706 | 729 | #: src/dialogs/settings/colors.c:174 |
| 707 | 730 | msgid "Normal/Protected" |
| 708 | 731 | msgstr "Normal/Protegido" |
| ... | ... | @@ -711,7 +734,7 @@ msgstr "Normal/Protegido" |
| 711 | 734 | msgid "Normal/Unprotected" |
| 712 | 735 | msgstr "Normal/Desprotegido" |
| 713 | 736 | |
| 714 | -#: src/selection/windows/paste.c:75 | |
| 737 | +#: src/selection/linux/paste.c:77 | |
| 715 | 738 | msgid "Not the same terminal type" |
| 716 | 739 | msgstr "O tipo de terminal é diferente" |
| 717 | 740 | |
| ... | ... | @@ -747,7 +770,7 @@ msgstr "Abrir" |
| 747 | 770 | msgid "Operation has failed" |
| 748 | 771 | msgstr "Operação falhou" |
| 749 | 772 | |
| 750 | -#: src/dialogs/print/print.c:209 | |
| 773 | +#: src/dialogs/print/print.c:207 | |
| 751 | 774 | msgid "Options" |
| 752 | 775 | msgstr "Opções" |
| 753 | 776 | |
| ... | ... | @@ -771,23 +794,23 @@ msgstr "Oversize" |
| 771 | 794 | msgid "Parameter Type" |
| 772 | 795 | msgstr "Tipo de parâmetro" |
| 773 | 796 | |
| 774 | -#: src/terminal/actions/table.c:151 src/terminal/actions/table.c:163 | |
| 797 | +#: src/terminal/actions/table.c:175 src/terminal/actions/table.c:187 | |
| 775 | 798 | msgid "Paste" |
| 776 | 799 | msgstr "Colar" |
| 777 | 800 | |
| 778 | -#: src/terminal/actions/table.c:164 | |
| 801 | +#: src/terminal/actions/table.c:188 | |
| 779 | 802 | msgid "Paste as plain text" |
| 780 | 803 | msgstr "Colar como texto puro" |
| 781 | 804 | |
| 782 | -#: src/terminal/actions/table.c:152 | |
| 805 | +#: src/terminal/actions/table.c:176 | |
| 783 | 806 | msgid "Paste clipboard contents" |
| 784 | 807 | msgstr "Colar conteúdo da área de transferência" |
| 785 | 808 | |
| 786 | -#: src/terminal/actions/table.c:173 | |
| 809 | +#: src/terminal/actions/table.c:197 | |
| 787 | 810 | msgid "Paste file" |
| 788 | 811 | msgstr "Colar arquivo" |
| 789 | 812 | |
| 790 | -#: src/terminal/actions/table.c:183 src/dialogs/settings/clipboard.c:153 | |
| 813 | +#: src/terminal/actions/table.c:207 src/dialogs/settings/clipboard.c:153 | |
| 791 | 814 | msgid "Paste formatted screen" |
| 792 | 815 | msgstr "Colar tela formatada" |
| 793 | 816 | |
| ... | ... | @@ -795,7 +818,7 @@ msgstr "Colar tela formatada" |
| 795 | 818 | msgid "Paste from file" |
| 796 | 819 | msgstr "Colar de um arquivo" |
| 797 | 820 | |
| 798 | -#: src/terminal/actions/table.c:174 | |
| 821 | +#: src/terminal/actions/table.c:198 | |
| 799 | 822 | msgid "Paste from text file" |
| 800 | 823 | msgstr "Colar de um arquivo texto" |
| 801 | 824 | |
| ... | ... | @@ -803,7 +826,7 @@ msgstr "Colar de um arquivo texto" |
| 803 | 826 | msgid "Paste options" |
| 804 | 827 | msgstr "Opções para colar" |
| 805 | 828 | |
| 806 | -#: src/terminal/actions/table.c:184 | |
| 829 | +#: src/terminal/actions/table.c:208 | |
| 807 | 830 | msgid "Paste similar screen from clipboard" |
| 808 | 831 | msgstr "Colar tela semelhante" |
| 809 | 832 | |
| ... | ... | @@ -855,11 +878,11 @@ msgstr "" |
| 855 | 878 | msgid "Primary space" |
| 856 | 879 | msgstr "Primary space" |
| 857 | 880 | |
| 858 | -#: src/terminal/actions/table.c:277 | |
| 881 | +#: src/terminal/actions/table.c:301 | |
| 859 | 882 | msgid "Print" |
| 860 | 883 | msgstr "Imprimir" |
| 861 | 884 | |
| 862 | -#: src/terminal/actions/table.c:310 | |
| 885 | +#: src/terminal/actions/table.c:334 | |
| 863 | 886 | msgid "Print Copy" |
| 864 | 887 | msgstr "Imprimir cópia" |
| 865 | 888 | |
| ... | ... | @@ -871,19 +894,19 @@ msgstr "Operação de impressão falhou" |
| 871 | 894 | msgid "Print operation has failed" |
| 872 | 895 | msgstr "Operação de impressão falhou" |
| 873 | 896 | |
| 874 | -#: src/terminal/actions/table.c:288 | |
| 897 | +#: src/terminal/actions/table.c:312 | |
| 875 | 898 | msgid "Print screen" |
| 876 | 899 | msgstr "Imrpimir tela" |
| 877 | 900 | |
| 878 | -#: src/terminal/actions/table.c:278 | |
| 901 | +#: src/terminal/actions/table.c:302 | |
| 879 | 902 | msgid "Print screen or selection" |
| 880 | 903 | msgstr "Imrpimir tela ou seleção" |
| 881 | 904 | |
| 882 | -#: src/terminal/actions/table.c:299 | |
| 905 | +#: src/terminal/actions/table.c:323 | |
| 883 | 906 | msgid "Print selected" |
| 884 | 907 | msgstr "Imprimir seleção" |
| 885 | 908 | |
| 886 | -#: src/terminal/actions/table.c:300 | |
| 909 | +#: src/terminal/actions/table.c:324 | |
| 887 | 910 | msgid "Print selected area" |
| 888 | 911 | msgstr "Imprimir área selecionada" |
| 889 | 912 | |
| ... | ... | @@ -891,7 +914,7 @@ msgstr "Imprimir área selecionada" |
| 891 | 914 | msgid "Print selection box" |
| 892 | 915 | msgstr "Imprimir marca de seleção" |
| 893 | 916 | |
| 894 | -#: src/terminal/actions/table.c:289 | |
| 917 | +#: src/terminal/actions/table.c:313 | |
| 895 | 918 | msgid "Print the entire screen" |
| 896 | 919 | msgstr "Imrpimir toda a tela" |
| 897 | 920 | |
| ... | ... | @@ -915,7 +938,7 @@ msgstr "Receber arquivo" |
| 915 | 938 | msgid "Receive text file" |
| 916 | 939 | msgstr "Receber arquivo texto" |
| 917 | 940 | |
| 918 | -#: src/filetransfer/v3270ftprogress.c:739 src/dialogs/transfer.c:126 | |
| 941 | +#: src/filetransfer/v3270ftprogress.c:739 src/dialogs/transfer.c:124 | |
| 919 | 942 | msgid "Receiving file" |
| 920 | 943 | msgstr "Recebendo arquivo" |
| 921 | 944 | |
| ... | ... | @@ -923,7 +946,7 @@ msgstr "Recebendo arquivo" |
| 923 | 946 | msgid "Record Length" |
| 924 | 947 | msgstr "Comprimento de registro:" |
| 925 | 948 | |
| 926 | -#: src/filetransfer/settings.c:519 src/filetransfer/v3270ft.c:340 | |
| 949 | +#: src/filetransfer/v3270ft.c:340 src/filetransfer/settings.c:519 | |
| 927 | 950 | msgid "Record format" |
| 928 | 951 | msgstr "Formato de registro" |
| 929 | 952 | |
| ... | ... | @@ -956,10 +979,24 @@ msgstr "Remoto:" |
| 956 | 979 | msgid "Remove selected file from the transfer queue" |
| 957 | 980 | msgstr "Remove arquivo selecionado da fila de transferência" |
| 958 | 981 | |
| 959 | -#: src/terminal/actions/table.c:66 | |
| 982 | +#: src/terminal/actions/table.c:72 | |
| 960 | 983 | msgid "Replace current clipboard contents with the selected area" |
| 961 | 984 | msgstr "Substituí conteúdo da área de transferência com a seleção" |
| 962 | 985 | |
| 986 | +#: src/terminal/actions/table.c:81 | |
| 987 | +msgid "" | |
| 988 | +"Replace current clipboard contents with the selected area in HTML format" | |
| 989 | +msgstr "" | |
| 990 | +"Substituí conteúdo da área de transferência com o conteúdo da área " | |
| 991 | +"selecionada em formato HTML" | |
| 992 | + | |
| 993 | +#: src/terminal/actions/table.c:90 | |
| 994 | +msgid "" | |
| 995 | +"Replace current clipboard contents with the selected area in image format" | |
| 996 | +msgstr "" | |
| 997 | +"Substituí conteúdo da área de transferência com uma imagem da área " | |
| 998 | +"selecionada" | |
| 999 | + | |
| 963 | 1000 | #: src/filetransfer/transfer.c:83 |
| 964 | 1001 | msgid "Retry" |
| 965 | 1002 | msgstr "Repetir" |
| ... | ... | @@ -984,13 +1021,13 @@ msgstr "SSL/TLS" |
| 984 | 1021 | msgid "Same of the screen" |
| 985 | 1022 | msgstr "Igual ao terminal" |
| 986 | 1023 | |
| 987 | -#: src/terminal/actions/table.c:230 src/filetransfer/activitylist.c:453 | |
| 988 | -#: src/filetransfer/v3270ft.c:215 src/trace/trace.c:505 | |
| 1024 | +#: src/terminal/actions/table.c:254 src/filetransfer/v3270ft.c:215 | |
| 1025 | +#: src/filetransfer/activitylist.c:451 src/trace/trace.c:499 | |
| 989 | 1026 | #: src/dialogs/transfer.c:69 |
| 990 | 1027 | msgid "Save" |
| 991 | 1028 | msgstr "Salvar" |
| 992 | 1029 | |
| 993 | -#: src/terminal/actions/table.c:264 | |
| 1030 | +#: src/terminal/actions/table.c:288 | |
| 994 | 1031 | msgid "Save Copy" |
| 995 | 1032 | msgstr "Salvar cópia" |
| 996 | 1033 | |
| ... | ... | @@ -998,31 +1035,31 @@ msgstr "Salvar cópia" |
| 998 | 1035 | msgid "Save _As" |
| 999 | 1036 | msgstr "Salvar _Como" |
| 1000 | 1037 | |
| 1001 | -#: src/terminal/actions/table.c:240 | |
| 1038 | +#: src/terminal/actions/table.c:264 | |
| 1002 | 1039 | msgid "Save all" |
| 1003 | 1040 | msgstr "Salvar tela" |
| 1004 | 1041 | |
| 1005 | -#: src/terminal/actions/table.c:262 src/dialogs/save/save.c:377 | |
| 1042 | +#: src/terminal/actions/table.c:286 src/dialogs/save/save.c:377 | |
| 1006 | 1043 | msgid "Save copy" |
| 1007 | 1044 | msgstr "Salvar cópia" |
| 1008 | 1045 | |
| 1009 | -#: src/filetransfer/activitylist.c:452 src/filetransfer/v3270ft.c:214 | |
| 1046 | +#: src/filetransfer/v3270ft.c:214 src/filetransfer/activitylist.c:450 | |
| 1010 | 1047 | msgid "Save queue to file" |
| 1011 | 1048 | msgstr "Salvar a fila para um arquivo" |
| 1012 | 1049 | |
| 1013 | -#: src/terminal/actions/table.c:242 | |
| 1050 | +#: src/terminal/actions/table.c:266 | |
| 1014 | 1051 | msgid "Save screen" |
| 1015 | 1052 | msgstr "Salvar tela" |
| 1016 | 1053 | |
| 1017 | -#: src/terminal/actions/table.c:231 | |
| 1054 | +#: src/terminal/actions/table.c:255 | |
| 1018 | 1055 | msgid "Save screen or selection" |
| 1019 | 1056 | msgstr "Salvar tela ou seleção" |
| 1020 | 1057 | |
| 1021 | -#: src/terminal/actions/table.c:251 | |
| 1058 | +#: src/terminal/actions/table.c:275 | |
| 1022 | 1059 | msgid "Save selected" |
| 1023 | 1060 | msgstr "Salvar seleção" |
| 1024 | 1061 | |
| 1025 | -#: src/terminal/actions/table.c:253 src/dialogs/save/save.c:376 | |
| 1062 | +#: src/terminal/actions/table.c:277 src/dialogs/save/save.c:376 | |
| 1026 | 1063 | msgid "Save selected area" |
| 1027 | 1064 | msgstr "Salvar área selecionada" |
| 1028 | 1065 | |
| ... | ... | @@ -1030,7 +1067,7 @@ msgstr "Salvar área selecionada" |
| 1030 | 1067 | msgid "Save terminal contents" |
| 1031 | 1068 | msgstr "Salvar conteúdo da tela" |
| 1032 | 1069 | |
| 1033 | -#: src/trace/trace.c:504 | |
| 1070 | +#: src/trace/trace.c:498 | |
| 1034 | 1071 | msgid "Save trace to file" |
| 1035 | 1072 | msgstr "Salvar trace para arquivo" |
| 1036 | 1073 | |
| ... | ... | @@ -1038,7 +1075,7 @@ msgstr "Salvar trace para arquivo" |
| 1038 | 1075 | msgid "Save transfer activity to file" |
| 1039 | 1076 | msgstr "Salvar atividade de transferência para arquivo" |
| 1040 | 1077 | |
| 1041 | -#: src/dialogs/transfer.c:191 | |
| 1078 | +#: src/dialogs/transfer.c:189 | |
| 1042 | 1079 | msgid "Save transfer information to file" |
| 1043 | 1080 | msgstr "Salvar informações da transferência para arquivo" |
| 1044 | 1081 | |
| ... | ... | @@ -1058,7 +1095,7 @@ msgstr "Salvar fila de transferências para arquivo" |
| 1058 | 1095 | msgid "Screen with terminal attributes" |
| 1059 | 1096 | msgstr "Completa incluindo atributos do terminal" |
| 1060 | 1097 | |
| 1061 | -#: src/terminal/actions/table.c:185 | |
| 1098 | +#: src/terminal/actions/table.c:209 | |
| 1062 | 1099 | msgid "" |
| 1063 | 1100 | "Search clipboard for a similar screen, if found paste unprotected fields and " |
| 1064 | 1101 | "restore cursor position" |
| ... | ... | @@ -1078,7 +1115,7 @@ msgstr "" |
| 1078 | 1115 | msgid "Secondary space" |
| 1079 | 1116 | msgstr "Secondary space" |
| 1080 | 1117 | |
| 1081 | -#: src/filetransfer/settings.c:209 src/filetransfer/v3270ft.c:303 | |
| 1118 | +#: src/filetransfer/v3270ft.c:303 src/filetransfer/settings.c:209 | |
| 1082 | 1119 | #: src/dialogs/save/save.c:98 src/dialogs/save/save.c:118 |
| 1083 | 1120 | #: src/dialogs/settings/host.c:402 |
| 1084 | 1121 | msgid "Select" |
| ... | ... | @@ -1096,7 +1133,7 @@ msgstr "Seleciona mapeamento de teclado personalizado" |
| 1096 | 1133 | msgid "Select destination file" |
| 1097 | 1134 | msgstr "Selecionar arquivo destino" |
| 1098 | 1135 | |
| 1099 | -#: src/filetransfer/settings.c:467 src/filetransfer/v3270ft.c:591 | |
| 1136 | +#: src/filetransfer/v3270ft.c:591 src/filetransfer/settings.c:467 | |
| 1100 | 1137 | #: src/dialogs/load.c:92 src/dialogs/load.c:108 src/dialogs/load.c:171 |
| 1101 | 1138 | #: src/dialogs/save/save.c:258 |
| 1102 | 1139 | msgid "Select file" |
| ... | ... | @@ -1110,7 +1147,7 @@ msgstr "Selecionar primeiro arquivo" |
| 1110 | 1147 | msgid "Select last file" |
| 1111 | 1148 | msgstr "Selecionar último arquivo" |
| 1112 | 1149 | |
| 1113 | -#: src/filetransfer/settings.c:208 src/filetransfer/v3270ft.c:302 | |
| 1150 | +#: src/filetransfer/v3270ft.c:302 src/filetransfer/settings.c:208 | |
| 1114 | 1151 | msgid "Select local file" |
| 1115 | 1152 | msgstr "Selecionar arquivo local" |
| 1116 | 1153 | |
| ... | ... | @@ -1138,11 +1175,11 @@ msgstr "Enviar arquivo" |
| 1138 | 1175 | msgid "Send text file" |
| 1139 | 1176 | msgstr "Enviar arquivo texto" |
| 1140 | 1177 | |
| 1141 | -#: src/filetransfer/v3270ftprogress.c:739 src/dialogs/transfer.c:126 | |
| 1178 | +#: src/filetransfer/v3270ftprogress.c:739 src/dialogs/transfer.c:124 | |
| 1142 | 1179 | msgid "Sending file" |
| 1143 | 1180 | msgstr "Enviando arquivo" |
| 1144 | 1181 | |
| 1145 | -#: src/terminal/actions/table.c:217 | |
| 1182 | +#: src/terminal/actions/table.c:241 | |
| 1146 | 1183 | msgid "Set the font to the best size for window" |
| 1147 | 1184 | msgstr "Ajusta a fonte para o melhor tamanho" |
| 1148 | 1185 | |
| ... | ... | @@ -1162,7 +1199,7 @@ msgstr "Skip this transfer, keep the file on queue." |
| 1162 | 1199 | msgid "Smart copy" |
| 1163 | 1200 | msgstr "Cópia inteligente" |
| 1164 | 1201 | |
| 1165 | -#: src/filetransfer/settings.c:544 src/filetransfer/v3270ft.c:341 | |
| 1202 | +#: src/filetransfer/v3270ft.c:341 src/filetransfer/settings.c:544 | |
| 1166 | 1203 | msgid "Space allocation units" |
| 1167 | 1204 | msgstr "Unidades de alocação de espaço" |
| 1168 | 1205 | |
| ... | ... | @@ -1222,7 +1259,7 @@ msgstr "Iniciar transferência" |
| 1222 | 1259 | msgid "Starting" |
| 1223 | 1260 | msgstr "Iniciando" |
| 1224 | 1261 | |
| 1225 | -#: src/filetransfer/worker.c:314 src/dialogs/transfer.c:144 | |
| 1262 | +#: src/filetransfer/worker.c:314 src/dialogs/transfer.c:142 | |
| 1226 | 1263 | msgid "Starting transfer" |
| 1227 | 1264 | msgstr "Iniciando transferência" |
| 1228 | 1265 | |
| ... | ... | @@ -1345,18 +1382,18 @@ msgstr "Nome do ícone associado à ação" |
| 1345 | 1382 | msgid "The name used to invoke the action" |
| 1346 | 1383 | msgstr "Nome que é usado para invocar a ação" |
| 1347 | 1384 | |
| 1348 | -#: src/dialogs/print/print.c:82 | |
| 1385 | +#: src/dialogs/print/print.c:80 | |
| 1349 | 1386 | msgid "" |
| 1350 | 1387 | "The print operation has been canceled, the print settings should not be " |
| 1351 | 1388 | "stored." |
| 1352 | 1389 | msgstr "" |
| 1353 | 1390 | "A operação de impressão foi cancelada, configuração não deve ser salva." |
| 1354 | 1391 | |
| 1355 | -#: src/dialogs/print/print.c:87 | |
| 1392 | +#: src/dialogs/print/print.c:85 | |
| 1356 | 1393 | msgid "The print operation is running" |
| 1357 | 1394 | msgstr "Operação de impressão está em andamento" |
| 1358 | 1395 | |
| 1359 | -#: src/dialogs/print/print.c:77 | |
| 1396 | +#: src/dialogs/print/print.c:75 | |
| 1360 | 1397 | msgid "The print settings should be stored." |
| 1361 | 1398 | msgstr "Configuração de impressão deve ser armazenada" |
| 1362 | 1399 | |
| ... | ... | @@ -1425,7 +1462,7 @@ msgstr "Janela de trace" |
| 1425 | 1462 | msgid "Tracks" |
| 1426 | 1463 | msgstr "Trilhas" |
| 1427 | 1464 | |
| 1428 | -#: src/filetransfer/v3270ftprogress.c:721 src/filetransfer/worker.c:568 | |
| 1465 | +#: src/filetransfer/worker.c:568 src/filetransfer/v3270ftprogress.c:721 | |
| 1429 | 1466 | msgid "Transfer failed" |
| 1430 | 1467 | msgstr "Transferência falhou" |
| 1431 | 1468 | |
| ... | ... | @@ -1433,7 +1470,7 @@ msgstr "Transferência falhou" |
| 1433 | 1470 | msgid "Transfer operation has timed out" |
| 1434 | 1471 | msgstr "Operação de transferência esgotou o tempo de espera" |
| 1435 | 1472 | |
| 1436 | -#: src/filetransfer/settings.c:492 src/filetransfer/v3270ft.c:339 | |
| 1473 | +#: src/filetransfer/v3270ft.c:339 src/filetransfer/settings.c:492 | |
| 1437 | 1474 | msgid "Transfer options" |
| 1438 | 1475 | msgstr "Opções de transferência" |
| 1439 | 1476 | |
| ... | ... | @@ -1467,16 +1504,16 @@ msgstr "Turquesa" |
| 1467 | 1504 | msgid "UTF-8" |
| 1468 | 1505 | msgstr "UTF-8" |
| 1469 | 1506 | |
| 1470 | -#: src/selection/windows/paste.c:115 | |
| 1507 | +#: src/selection/linux/paste.c:116 | |
| 1471 | 1508 | #, fuzzy |
| 1472 | -msgid "Unable to paste formatted data" | |
| 1509 | +msgid "Unable to paste formatted data." | |
| 1473 | 1510 | msgstr "Incapaz de colar dados formatados." |
| 1474 | 1511 | |
| 1475 | 1512 | #: src/filetransfer/tables.c:92 |
| 1476 | 1513 | msgid "Undefined" |
| 1477 | 1514 | msgstr "Indefinido" |
| 1478 | 1515 | |
| 1479 | -#: src/terminal/callbacks.c:486 | |
| 1516 | +#: src/terminal/callbacks.c:449 | |
| 1480 | 1517 | #, c-format |
| 1481 | 1518 | msgid "Unexpected callback table, the release %s of lib%s is invalid" |
| 1482 | 1519 | msgstr "Tabela de callbacks inesperada, a revisão %s da lib%s é inválida" |
| ... | ... | @@ -1491,7 +1528,7 @@ msgstr "Formato inesperado %d" |
| 1491 | 1528 | msgid "Unexpected mode %d" |
| 1492 | 1529 | msgstr "Modo inesperado %d" |
| 1493 | 1530 | |
| 1494 | -#: src/dialogs/print/print.c:92 | |
| 1531 | +#: src/dialogs/print/print.c:90 | |
| 1495 | 1532 | #, c-format |
| 1496 | 1533 | msgid "Unexpected status %d in print operation" |
| 1497 | 1534 | msgstr "Estado inesperado %d na operação de impressão" |
| ... | ... | @@ -1500,7 +1537,7 @@ msgstr "Estado inesperado %d na operação de impressão" |
| 1500 | 1537 | msgid "Unsecure" |
| 1501 | 1538 | msgstr "Insegura" |
| 1502 | 1539 | |
| 1503 | -#: src/dialogs/windows/select.c:169 src/dialogs/save/save.c:130 | |
| 1540 | +#: src/dialogs/save/save.c:130 | |
| 1504 | 1541 | msgid "Untitled document" |
| 1505 | 1542 | msgstr "Documento sem título" |
| 1506 | 1543 | |
| ... | ... | @@ -1690,11 +1727,11 @@ msgstr "" |
| 1690 | 1727 | msgid "You specified an option that is invalid." |
| 1691 | 1728 | msgstr "Você especificou uma opção inválida." |
| 1692 | 1729 | |
| 1693 | -#: src/terminal/actions/table.c:195 | |
| 1730 | +#: src/terminal/actions/table.c:219 | |
| 1694 | 1731 | msgid "Zoom in" |
| 1695 | 1732 | msgstr "Ampliar" |
| 1696 | 1733 | |
| 1697 | -#: src/terminal/actions/table.c:205 | |
| 1734 | +#: src/terminal/actions/table.c:229 | |
| 1698 | 1735 | msgid "Zoom out" |
| 1699 | 1736 | msgstr "Reduzir" |
| 1700 | 1737 | |
| ... | ... | @@ -1706,9 +1743,9 @@ msgstr "Texto _ASCII" |
| 1706 | 1743 | msgid "_Apply" |
| 1707 | 1744 | msgstr "_Aplicar" |
| 1708 | 1745 | |
| 1709 | -#: src/selection/windows/paste.c:83 src/selection/windows/paste.c:123 | |
| 1710 | -#: src/dialogs/load.c:205 src/dialogs/load.c:224 src/dialogs/popups.c:170 | |
| 1711 | -#: src/dialogs/windows/select.c:158 src/dialogs/print/settingsdialog.c:410 | |
| 1746 | +#: src/selection/linux/paste.c:85 src/dialogs/popups.c:173 | |
| 1747 | +#: src/dialogs/load.c:205 src/dialogs/load.c:224 src/dialogs/linux/select.c:51 | |
| 1748 | +#: src/dialogs/linux/select.c:77 src/dialogs/print/settingsdialog.c:410 | |
| 1712 | 1749 | #: src/dialogs/print/settingsdialog.c:429 src/dialogs/save/save.c:342 |
| 1713 | 1750 | #: src/dialogs/save/save.c:361 src/dialogs/settings/dialog.c:231 |
| 1714 | 1751 | msgid "_Cancel" |
| ... | ... | @@ -1718,9 +1755,9 @@ msgstr "_Cancelar" |
| 1718 | 1755 | msgid "_Charset" |
| 1719 | 1756 | msgstr "Tabela de _Caracteres" |
| 1720 | 1757 | |
| 1721 | -#: src/trace/tracewindow.c:125 src/dialogs/popups.c:101 | |
| 1722 | -#: src/dialogs/security.c:236 src/dialogs/transfer.c:163 | |
| 1723 | -#: src/dialogs/transfer.c:183 | |
| 1758 | +#: src/trace/tracewindow.c:125 src/dialogs/transfer.c:161 | |
| 1759 | +#: src/dialogs/transfer.c:181 src/dialogs/security.c:236 | |
| 1760 | +#: src/dialogs/popups.c:104 | |
| 1724 | 1761 | msgid "_Close" |
| 1725 | 1762 | msgstr "_Close" |
| 1726 | 1763 | |
| ... | ... | @@ -1728,6 +1765,10 @@ msgstr "_Close" |
| 1728 | 1765 | msgid "_Color table" |
| 1729 | 1766 | msgstr "_Tabela de cores" |
| 1730 | 1767 | |
| 1768 | +#: src/tools/entry.c:175 | |
| 1769 | +msgid "_Continue" | |
| 1770 | +msgstr "_Continuar" | |
| 1771 | + | |
| 1731 | 1772 | #: src/trace/tracewindow.c:117 |
| 1732 | 1773 | msgid "_File" |
| 1733 | 1774 | msgstr "_Arquivo" |
| ... | ... | @@ -1756,16 +1797,20 @@ msgstr "Arquivo _local:" |
| 1756 | 1797 | msgid "_Model" |
| 1757 | 1798 | msgstr "_Modelo" |
| 1758 | 1799 | |
| 1759 | -#: src/dialogs/popups.c:83 src/dialogs/popups.c:89 src/dialogs/popups.c:95 | |
| 1760 | -#: src/dialogs/popups.c:107 | |
| 1800 | +#: src/dialogs/popups.c:86 src/dialogs/popups.c:92 src/dialogs/popups.c:98 | |
| 1801 | +#: src/dialogs/popups.c:110 | |
| 1761 | 1802 | msgid "_Ok" |
| 1762 | 1803 | msgstr "_Ok" |
| 1763 | 1804 | |
| 1805 | +#: src/tools/entry.c:167 | |
| 1806 | +msgid "_Open" | |
| 1807 | +msgstr "_Abrir" | |
| 1808 | + | |
| 1764 | 1809 | #: src/filetransfer/v3270ft.c:333 |
| 1765 | 1810 | msgid "_Operation" |
| 1766 | 1811 | msgstr "_Operação:" |
| 1767 | 1812 | |
| 1768 | -#: src/selection/windows/paste.c:84 src/selection/windows/paste.c:124 | |
| 1813 | +#: src/selection/linux/paste.c:86 src/selection/linux/paste.c:118 | |
| 1769 | 1814 | msgid "_Paste as text" |
| 1770 | 1815 | msgstr "_Colar como texto" |
| 1771 | 1816 | |
| ... | ... | @@ -1774,7 +1819,7 @@ msgid "_Remote file" |
| 1774 | 1819 | msgstr "Arquivo _remoto:" |
| 1775 | 1820 | |
| 1776 | 1821 | #: src/trace/tracewindow.c:123 src/dialogs/save/save.c:347 |
| 1777 | -#: src/dialogs/save/save.c:362 | |
| 1822 | +#: src/dialogs/save/save.c:362 src/tools/entry.c:171 | |
| 1778 | 1823 | msgid "_Save" |
| 1779 | 1824 | msgstr "_Salvar" |
| 1780 | 1825 | |
| ... | ... | @@ -1790,7 +1835,7 @@ msgstr "_Serviço" |
| 1790 | 1835 | msgid "_Text file" |
| 1791 | 1836 | msgstr "Arquivo _texto" |
| 1792 | 1837 | |
| 1793 | -#: src/terminal/actions/table.c:206 | |
| 1838 | +#: src/terminal/actions/table.c:230 | |
| 1794 | 1839 | msgid "decrease the font size" |
| 1795 | 1840 | msgstr "Diminui o tamanho da fonte" |
| 1796 | 1841 | |
| ... | ... | @@ -1977,9 +2022,6 @@ msgstr "Diminui o tamanho da fonte" |
| 1977 | 2022 | #~ msgid "Alert sound" |
| 1978 | 2023 | #~ msgstr "Aviso sonoro" |
| 1979 | 2024 | |
| 1980 | -#~ msgid "All files" | |
| 1981 | -#~ msgstr "Todos os arquivos" | |
| 1982 | - | |
| 1983 | 2025 | #~ msgid "" |
| 1984 | 2026 | #~ "An error occurred trying to allocate memory. This should never happen." |
| 1985 | 2027 | #~ msgstr "" |
| ... | ... | @@ -2357,15 +2399,9 @@ msgstr "Diminui o tamanho da fonte" |
| 2357 | 2399 | #~ msgid "Connection state" |
| 2358 | 2400 | #~ msgstr "Estado da conexão" |
| 2359 | 2401 | |
| 2360 | -#~ msgid "Continue" | |
| 2361 | -#~ msgstr "Continuar" | |
| 2362 | - | |
| 2363 | 2402 | #~ msgid "Copiar tudo" |
| 2364 | 2403 | #~ msgstr "Copiar tudo" |
| 2365 | 2404 | |
| 2366 | -#~ msgid "Copy as HTML" | |
| 2367 | -#~ msgstr "Copiar como HTML" | |
| 2368 | - | |
| 2369 | 2405 | #~ msgid "Critical Error" |
| 2370 | 2406 | #~ msgstr "Erro crítico" |
| 2371 | 2407 | |
| ... | ... | @@ -2950,9 +2986,6 @@ msgstr "Diminui o tamanho da fonte" |
| 2950 | 2986 | #~ msgid "Non zero if the host is TSO." |
| 2951 | 2987 | #~ msgstr "Diferente de zero se o host é TSO" |
| 2952 | 2988 | |
| 2953 | -#~ msgid "None of the screens in the clipboard match with the current one." | |
| 2954 | -#~ msgstr "Nenhuma das telas da área de transferência corresponde à atual." | |
| 2955 | - | |
| 2956 | 2989 | #~ msgid "Not available" |
| 2957 | 2990 | #~ msgstr "Não disponível" |
| 2958 | 2991 | ... | ... |
src/dialogs/load.c
| ... | ... | @@ -315,16 +315,13 @@ static void icon_press(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_ |
| 315 | 315 | GError * error = NULL; |
| 316 | 316 | v3270_load_dialog_apply(widget,&error); |
| 317 | 317 | |
| 318 | - if(error) | |
| 319 | - { | |
| 320 | - v3270_popup_gerror( | |
| 321 | - widget, | |
| 322 | - error, | |
| 323 | - NULL, | |
| 324 | - _("Can't open %s"),gtk_entry_get_text(GTK_ENTRY(V3270_LOAD_DIALOG(widget)->filename)) | |
| 325 | - ); | |
| 326 | - g_error_free(error); | |
| 327 | - } | |
| 318 | + // The operation has failed? If yes notify user and free error object. | |
| 319 | + v3270_popup_gerror( | |
| 320 | + widget, | |
| 321 | + &error, | |
| 322 | + NULL, | |
| 323 | + _("Can't open %s"),gtk_entry_get_text(GTK_ENTRY(V3270_LOAD_DIALOG(widget)->filename)) | |
| 324 | + ); | |
| 328 | 325 | |
| 329 | 326 | } |
| 330 | 327 | debug("%s",__FUNCTION__); | ... | ... |
src/dialogs/popups.c
| ... | ... | @@ -44,6 +44,9 @@ |
| 44 | 44 | |
| 45 | 45 | GtkResponseType v3270_popup_dialog_show(GtkWidget *widget, const LIB3270_POPUP *popup, gboolean wait) { |
| 46 | 46 | |
| 47 | + // https://developer.gnome.org/hig/stable/dialogs.html.en | |
| 48 | + // https://developer.gnome.org/hig/stable/visual-layout.html.en | |
| 49 | + | |
| 47 | 50 | g_return_val_if_fail(GTK_IS_WIDGET(widget),GTK_RESPONSE_NONE); |
| 48 | 51 | |
| 49 | 52 | // Check if the dialog is enabled |
| ... | ... | @@ -178,6 +181,7 @@ |
| 178 | 181 | GTK_RESPONSE_CANCEL |
| 179 | 182 | ); |
| 180 | 183 | |
| 184 | + // https://developer.gnome.org/Buttons/ | |
| 181 | 185 | v3270_dialog_add_class_for_response(dialog,GTK_RESPONSE_APPLY,"destructive-action"); |
| 182 | 186 | v3270_dialog_add_class_for_response(dialog,GTK_RESPONSE_CANCEL,"suggested-action"); |
| 183 | 187 | break; |
| ... | ... | @@ -187,6 +191,8 @@ |
| 187 | 191 | GTK_DIALOG(dialog), |
| 188 | 192 | GTK_RESPONSE_CANCEL |
| 189 | 193 | ); |
| 194 | + | |
| 195 | + // https://developer.gnome.org/Buttons/ | |
| 190 | 196 | v3270_dialog_add_class_for_response(dialog,GTK_RESPONSE_CANCEL,"suggested-action"); |
| 191 | 197 | break; |
| 192 | 198 | |
| ... | ... | @@ -195,6 +201,8 @@ |
| 195 | 201 | GTK_DIALOG(dialog), |
| 196 | 202 | GTK_RESPONSE_APPLY |
| 197 | 203 | ); |
| 204 | + | |
| 205 | + // https://developer.gnome.org/Buttons/ | |
| 198 | 206 | v3270_dialog_add_class_for_response(dialog,GTK_RESPONSE_APPLY,"suggested-action"); |
| 199 | 207 | break; |
| 200 | 208 | |
| ... | ... | @@ -260,7 +268,10 @@ |
| 260 | 268 | |
| 261 | 269 | } |
| 262 | 270 | |
| 263 | - void v3270_popup_gerror(GtkWidget *widget, GError *error, const gchar *title, const gchar *fmt, ...) { | |
| 271 | + gboolean v3270_popup_gerror(GtkWidget *widget, GError **error, const gchar *title, const gchar *fmt, ...) { | |
| 272 | + | |
| 273 | + if(!(error && *error)) | |
| 274 | + return FALSE; | |
| 264 | 275 | |
| 265 | 276 | // Format message. |
| 266 | 277 | va_list arg_ptr; |
| ... | ... | @@ -272,10 +283,15 @@ |
| 272 | 283 | .type = LIB3270_NOTIFY_ERROR, |
| 273 | 284 | .title = title, |
| 274 | 285 | .summary = summary, |
| 275 | - .body = error->message | |
| 286 | + .body = (*error)->message | |
| 276 | 287 | }; |
| 277 | 288 | |
| 278 | 289 | v3270_popup_dialog_show(widget, &popup, FALSE); |
| 279 | 290 | |
| 291 | + g_error_free(*error); | |
| 292 | + *error = NULL; | |
| 293 | + | |
| 294 | + return TRUE; | |
| 295 | + | |
| 280 | 296 | } |
| 281 | 297 | ... | ... |
src/dialogs/print/convenience.c
| ... | ... | @@ -96,15 +96,13 @@ |
| 96 | 96 | |
| 97 | 97 | if(err) |
| 98 | 98 | { |
| 99 | - v3270_error_popup( | |
| 99 | + v3270_popup_gerror( | |
| 100 | 100 | widget, |
| 101 | - NULL, | |
| 101 | + &err, | |
| 102 | 102 | _("Print operation has failed"), |
| 103 | 103 | err->message |
| 104 | 104 | ); |
| 105 | 105 | |
| 106 | - g_error_free(err); | |
| 107 | - | |
| 108 | 106 | rc = -1; |
| 109 | 107 | } |
| 110 | 108 | } | ... | ... |
src/dialogs/print/print.c
src/dialogs/save/save.c
| ... | ... | @@ -618,17 +618,12 @@ static void icon_press(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_ |
| 618 | 618 | GError * error = NULL; |
| 619 | 619 | v3270_save_dialog_apply(widget,&error); |
| 620 | 620 | |
| 621 | - if(error) | |
| 622 | - { | |
| 623 | - v3270_popup_gerror( | |
| 624 | - widget, | |
| 625 | - error, | |
| 626 | - NULL, | |
| 627 | - _("Can't save %s"),gtk_entry_get_text(GTK_ENTRY(V3270_SAVE_DIALOG(widget)->filename)) | |
| 628 | - ); | |
| 629 | - | |
| 630 | - g_error_free(error); | |
| 631 | - } | |
| 621 | + v3270_popup_gerror( | |
| 622 | + widget, | |
| 623 | + &error, | |
| 624 | + NULL, | |
| 625 | + _("Can't save %s"),gtk_entry_get_text(GTK_ENTRY(V3270_SAVE_DIALOG(widget)->filename)) | |
| 626 | + ); | |
| 632 | 627 | |
| 633 | 628 | } |
| 634 | 629 | ... | ... |
src/dialogs/transfer.c
src/filetransfer/activitylist.c
src/filetransfer/load.c
| ... | ... | @@ -262,18 +262,13 @@ LIB3270_EXPORT void v3270ft_load(GtkWidget *widget,const gchar *filename) { |
| 262 | 262 | g_list_foreach(GTK_V3270FT(widget)->files,(GFunc) validate_item, error); |
| 263 | 263 | v3270ft_select_last(widget); |
| 264 | 264 | |
| 265 | - if(error) { | |
| 265 | + v3270_popup_gerror( | |
| 266 | + widget, | |
| 267 | + &error, | |
| 268 | + NULL, | |
| 269 | + _("Can't load %s"),filename | |
| 270 | + ); | |
| 266 | 271 | |
| 267 | - v3270_popup_gerror( | |
| 268 | - widget, | |
| 269 | - error, | |
| 270 | - NULL, | |
| 271 | - _("Can't load %s"),filename | |
| 272 | - ); | |
| 273 | - | |
| 274 | - g_error_free(error); | |
| 275 | - | |
| 276 | - } | |
| 277 | 272 | |
| 278 | 273 | } |
| 279 | 274 | ... | ... |
src/filetransfer/save.c
| ... | ... | @@ -112,13 +112,11 @@ static const gchar * getNameByFlag(LIB3270_FT_OPTION opt, LIB3270_FT_OPTION mask |
| 112 | 112 | |
| 113 | 113 | v3270_popup_gerror( |
| 114 | 114 | widget, |
| 115 | - error, | |
| 115 | + &error, | |
| 116 | 116 | NULL, |
| 117 | 117 | _("Can't save %s"),filename |
| 118 | 118 | ); |
| 119 | 119 | |
| 120 | - g_error_free(error); | |
| 121 | - | |
| 122 | 120 | } |
| 123 | 121 | |
| 124 | 122 | g_free(text); | ... | ... |
src/include/clipboard.h
| ... | ... | @@ -104,6 +104,9 @@ |
| 104 | 104 | G_GNUC_INTERNAL gchar * v3270_get_copy_as_table(v3270 * terminal, const gchar *delimiter, const gchar *encoding); |
| 105 | 105 | G_GNUC_INTERNAL gchar * v3270_get_copy_as_data_block(v3270 * terminal); |
| 106 | 106 | |
| 107 | + G_GNUC_INTERNAL void v3270_clipboard_clear(GtkClipboard *clipboard, GObject *obj); | |
| 108 | + G_GNUC_INTERNAL void v3270_clipboard_get(GtkClipboard *clipboard, GtkSelectionData *selection, guint target, GObject *obj); | |
| 109 | + | |
| 107 | 110 | /// @brief Set contents. |
| 108 | 111 | G_GNUC_INTERNAL gboolean v3270_set_from_data_block(v3270 * terminal, const struct SelectionHeader *selection); |
| 109 | 112 | ... | ... |
src/include/v3270.h
| ... | ... | @@ -238,13 +238,6 @@ |
| 238 | 238 | LIB3270_EXPORT void v3270_set_remap_filename(GtkWidget *widget, const gchar *path); |
| 239 | 239 | LIB3270_EXPORT const gchar * v3270_get_remap_filename(GtkWidget *widget); |
| 240 | 240 | |
| 241 | - // SSL & Security | |
| 242 | - LIB3270_EXPORT const gchar * v3270_get_ssl_state_icon_name(GtkWidget *widget); | |
| 243 | - LIB3270_EXPORT const gchar * v3270_get_ssl_state_message(GtkWidget *widget); | |
| 244 | - LIB3270_EXPORT const gchar * v3270_get_ssl_state_description(GtkWidget *widget); | |
| 245 | - LIB3270_EXPORT GtkWidget * v3270_security_dialog_new(GtkWidget *widget); | |
| 246 | - LIB3270_EXPORT void v3270_popup_security_dialog(GtkWidget *widget); | |
| 247 | - | |
| 248 | 241 | // Auxiliary widgets |
| 249 | 242 | LIB3270_EXPORT void v3270_select_host(GtkWidget *widget); |
| 250 | 243 | ... | ... |
src/include/v3270/dialogs.h
| ... | ... | @@ -40,7 +40,7 @@ |
| 40 | 40 | |
| 41 | 41 | LIB3270_EXPORT GtkWidget * v3270_dialog_section_new(const gchar * title, const gchar *tooltip, GtkWidget *child); |
| 42 | 42 | |
| 43 | - LIB3270_EXPORT void v3270_error_popup(GtkWidget *widget, const gchar *title, const gchar *summary, const gchar *body); | |
| 43 | + LIB3270_EXPORT void v3270_error_popup(GtkWidget *widget, const gchar *title, const gchar *summary, const gchar *body) G_GNUC_DEPRECATED; | |
| 44 | 44 | |
| 45 | 45 | LIB3270_EXPORT GtkWidget * v3270_save_dialog_new(GtkWidget *widget, LIB3270_CONTENT_OPTION mode, const gchar *filename); |
| 46 | 46 | LIB3270_EXPORT void v3270_save_dialog_run(GtkWidget *widget); |
| ... | ... | @@ -48,7 +48,19 @@ |
| 48 | 48 | LIB3270_EXPORT GtkWidget * v3270_load_dialog_new(GtkWidget *widget, const gchar *filename); |
| 49 | 49 | LIB3270_EXPORT void v3270_load_dialog_run(GtkWidget *widget); |
| 50 | 50 | |
| 51 | - LIB3270_EXPORT void v3270_popup_gerror(GtkWidget *widget, GError *error, const gchar *title, const gchar *fmt, ...) G_GNUC_PRINTF(4,5); | |
| 51 | + /// @brief Popup an error message. | |
| 52 | + /// | |
| 53 | + /// If the error is set show popup message and "free" the error. | |
| 54 | + /// | |
| 55 | + /// @param widget The terminal widget. | |
| 56 | + /// @param error The GError (it null doesn't show popup). | |
| 57 | + /// @param title The window title (can be NULL). | |
| 58 | + /// @param fmt Format for the popup message. | |
| 59 | + /// @param ... Arguments for fmt. | |
| 60 | + /// | |
| 61 | + /// @return TRUE if the popup was sent. | |
| 62 | + /// | |
| 63 | + LIB3270_EXPORT gboolean v3270_popup_gerror(GtkWidget *widget, GError **error, const gchar *title, const gchar *fmt, ...) G_GNUC_PRINTF(4,5); | |
| 52 | 64 | |
| 53 | 65 | LIB3270_EXPORT GtkTreeModel * v3270_font_family_model_new(GtkWidget *widget, const gchar *selected, GtkTreeIter * active); |
| 54 | 66 | ... | ... |
src/include/v3270/selection.h
| ... | ... | @@ -59,6 +59,9 @@ |
| 59 | 59 | LIB3270_EXPORT void v3270_copy_selection(GtkWidget *widget, V3270_COPY_MODE mode, gboolean cut) G_GNUC_DEPRECATED; |
| 60 | 60 | LIB3270_EXPORT void v3270_append_selection(GtkWidget *widget, gboolean cut) G_GNUC_DEPRECATED; |
| 61 | 61 | |
| 62 | + LIB3270_EXPORT void v3270_copy_as_html(GtkWidget *widget); | |
| 63 | + LIB3270_EXPORT void v3270_copy_as_pixbuff(GtkWidget *widget); | |
| 64 | + | |
| 62 | 65 | // Selections |
| 63 | 66 | |
| 64 | 67 | LIB3270_EXPORT gchar * v3270_get_selected(GtkWidget *widget, gboolean cut); | ... | ... |
| ... | ... | @@ -0,0 +1,46 @@ |
| 1 | +/* | |
| 2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
| 5 | + * | |
| 6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 7 | + * | |
| 8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 10 | + * Free Software Foundation. | |
| 11 | + * | |
| 12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 15 | + * obter mais detalhes. | |
| 16 | + * | |
| 17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
| 19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como tools.h e possui - linhas de código. | |
| 22 | + * | |
| 23 | + * Contatos: | |
| 24 | + * | |
| 25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
| 27 | + * | |
| 28 | + */ | |
| 29 | + | |
| 30 | +#ifndef V3270_TOOLS_H_INCLUDED | |
| 31 | + | |
| 32 | + #include <gtk/gtk.h> | |
| 33 | + #include <lib3270.h> | |
| 34 | + | |
| 35 | + G_BEGIN_DECLS | |
| 36 | + | |
| 37 | + /// @brief Bind pointer to widget; release it when widget is destroyed. | |
| 38 | + LIB3270_EXPORT void gtk_widget_bind_ptr(GtkWidget *widget, gpointer ptr); | |
| 39 | + | |
| 40 | + /// @brief Bind file chooser with entry field. | |
| 41 | + LIB3270_EXPORT void gtk_entry_bind_to_filechooser(GtkWidget *widget, GtkFileChooserAction action, const gchar *title, const gchar *icon_name, const gchar *pattern, const gchar *name); | |
| 42 | + | |
| 43 | + G_END_DECLS | |
| 44 | + | |
| 45 | +#endif // V3270_TOOLS_H_INCLUDED | |
| 46 | + | ... | ... |
src/selection/copy.c
| ... | ... | @@ -30,7 +30,17 @@ |
| 30 | 30 | #include <clipboard.h> |
| 31 | 31 | #include <lib3270/selection.h> |
| 32 | 32 | |
| 33 | - static void do_copy(v3270 *terminal, gboolean cut) { | |
| 33 | + static void do_copy(v3270 *terminal, V3270_COPY_MODE mode, gboolean cut) { | |
| 34 | + | |
| 35 | + if(mode == V3270_COPY_SMART) { | |
| 36 | + mode = (terminal->append ? V3270_COPY_APPEND : V3270_COPY_FORMATTED); | |
| 37 | + } | |
| 38 | + | |
| 39 | + if(mode != V3270_COPY_APPEND) { | |
| 40 | + // It's not append, clear current contents ... | |
| 41 | + v3270_clear_selection(terminal); | |
| 42 | + terminal->selection.format = mode; | |
| 43 | + } | |
| 34 | 44 | |
| 35 | 45 | lib3270_selection * selection = lib3270_selection_new(terminal->host,cut,0); |
| 36 | 46 | |
| ... | ... | @@ -44,32 +54,100 @@ |
| 44 | 54 | LIB3270_EXPORT void v3270_clipboard_set(GtkWidget *widget, V3270_COPY_MODE mode, gboolean cut) { |
| 45 | 55 | |
| 46 | 56 | g_return_if_fail(GTK_IS_V3270(widget)); |
| 57 | + do_copy(GTK_V3270(widget),mode,cut); | |
| 58 | + v3270_update_system_clipboard(widget); | |
| 59 | + | |
| 60 | + } | |
| 61 | + | |
| 62 | + LIB3270_EXPORT void v3270_copy_selection(GtkWidget *widget, V3270_COPY_MODE mode, gboolean cut) { | |
| 63 | + v3270_clipboard_set(widget,mode,cut); | |
| 64 | + } | |
| 65 | + | |
| 66 | + LIB3270_EXPORT void v3270_append_selection(GtkWidget *widget, gboolean cut) { | |
| 67 | + v3270_clipboard_set(widget,V3270_COPY_APPEND,cut); | |
| 68 | + } | |
| 69 | + | |
| 70 | + LIB3270_EXPORT void v3270_copy_as_html(GtkWidget *widget) { | |
| 47 | 71 | |
| 72 | + g_return_if_fail(GTK_IS_V3270(widget)); | |
| 48 | 73 | v3270 * terminal = GTK_V3270(widget); |
| 49 | 74 | |
| 50 | - if(mode == V3270_COPY_SMART) { | |
| 51 | - mode = (terminal->append ? V3270_COPY_APPEND : V3270_COPY_FORMATTED); | |
| 52 | - } | |
| 75 | + debug("%s",__FUNCTION__); | |
| 53 | 76 | |
| 54 | - if(mode != V3270_COPY_APPEND) { | |
| 77 | + do_copy(terminal,V3270_COPY_FORMATTED,0); | |
| 55 | 78 | |
| 56 | - // It's not append, clear current contents ... | |
| 57 | - v3270_clear_selection(terminal); | |
| 79 | + // | |
| 80 | + // Export only in HTML format | |
| 81 | + // | |
| 82 | + GtkClipboard * clipboard = gtk_widget_get_clipboard(widget,terminal->selection.target); | |
| 58 | 83 | |
| 59 | - terminal->selection.format = mode; | |
| 84 | + GtkTargetList * list = gtk_target_list_new(NULL,0); | |
| 85 | + | |
| 86 | + static const GtkTargetEntry entry = { | |
| 87 | + .target = "text/html", | |
| 88 | + .flags = 0, | |
| 89 | + .info = CLIPBOARD_TYPE_HTML | |
| 90 | + }; | |
| 91 | + | |
| 92 | + gtk_target_list_add_table(list, &entry, 1); | |
| 60 | 93 | |
| 94 | + int n_targets; | |
| 95 | + GtkTargetEntry * targets = gtk_target_table_new_from_list(list, &n_targets); | |
| 96 | + | |
| 97 | + if(gtk_clipboard_set_with_owner( | |
| 98 | + clipboard, | |
| 99 | + targets, | |
| 100 | + n_targets, | |
| 101 | + (GtkClipboardGetFunc) v3270_clipboard_get, | |
| 102 | + (GtkClipboardClearFunc) v3270_clipboard_clear, | |
| 103 | + G_OBJECT(widget) | |
| 104 | + )) | |
| 105 | + { | |
| 106 | + gtk_clipboard_set_can_store(clipboard,targets,1); | |
| 61 | 107 | } |
| 62 | 108 | |
| 63 | - do_copy(terminal,cut); | |
| 109 | + gtk_target_table_free(targets, n_targets); | |
| 110 | + gtk_target_list_unref(list); | |
| 64 | 111 | |
| 65 | - v3270_update_system_clipboard(widget); | |
| 112 | + v3270_emit_copy_state(widget); | |
| 66 | 113 | } |
| 67 | 114 | |
| 68 | - LIB3270_EXPORT void v3270_copy_selection(GtkWidget *widget, V3270_COPY_MODE format, gboolean cut) { | |
| 69 | - v3270_clipboard_set(widget,format,cut); | |
| 70 | - } | |
| 115 | + LIB3270_EXPORT void v3270_copy_as_pixbuff(GtkWidget *widget) { | |
| 71 | 116 | |
| 72 | - LIB3270_EXPORT void v3270_append_selection(GtkWidget *widget, gboolean cut) { | |
| 73 | - v3270_clipboard_set(widget,V3270_COPY_APPEND,cut); | |
| 74 | - } | |
| 117 | + g_return_if_fail(GTK_IS_V3270(widget)); | |
| 118 | + v3270 * terminal = GTK_V3270(widget); | |
| 119 | + | |
| 120 | + debug("%s",__FUNCTION__); | |
| 121 | + | |
| 122 | + do_copy(terminal,V3270_COPY_FORMATTED,0); | |
| 123 | + | |
| 124 | + // | |
| 125 | + // Export only in HTML format | |
| 126 | + // | |
| 127 | + GtkClipboard * clipboard = gtk_widget_get_clipboard(widget,terminal->selection.target); | |
| 128 | + | |
| 129 | + GtkTargetList * list = gtk_target_list_new(NULL,0); | |
| 130 | + | |
| 131 | + gtk_target_list_add_image_targets(list,CLIPBOARD_TYPE_PIXBUFF,TRUE); | |
| 132 | + | |
| 133 | + int n_targets; | |
| 134 | + GtkTargetEntry * targets = gtk_target_table_new_from_list(list, &n_targets); | |
| 135 | + | |
| 136 | + if(gtk_clipboard_set_with_owner( | |
| 137 | + clipboard, | |
| 138 | + targets, | |
| 139 | + n_targets, | |
| 140 | + (GtkClipboardGetFunc) v3270_clipboard_get, | |
| 141 | + (GtkClipboardClearFunc) v3270_clipboard_clear, | |
| 142 | + G_OBJECT(widget) | |
| 143 | + )) | |
| 144 | + { | |
| 145 | + gtk_clipboard_set_can_store(clipboard,targets,1); | |
| 146 | + } | |
| 147 | + | |
| 148 | + gtk_target_table_free(targets, n_targets); | |
| 149 | + gtk_target_list_unref(list); | |
| 150 | + | |
| 151 | + v3270_emit_copy_state(widget); | |
| 75 | 152 | |
| 153 | + } | ... | ... |
src/selection/linux/copy.c
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | |
| 34 | 34 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
| 35 | 35 | |
| 36 | -static void clipboard_clear(G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED GObject *obj) | |
| 36 | +void v3270_clipboard_clear(G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED GObject *obj) | |
| 37 | 37 | { |
| 38 | 38 | v3270 * terminal = GTK_V3270(obj); |
| 39 | 39 | |
| ... | ... | @@ -45,7 +45,7 @@ static void clipboard_clear(G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED |
| 45 | 45 | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | -static void clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionData *selection, guint target, GObject *obj) | |
| 48 | +void v3270_clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionData *selection, guint target, GObject *obj) | |
| 49 | 49 | { |
| 50 | 50 | v3270 * terminal = GTK_V3270(obj); |
| 51 | 51 | |
| ... | ... | @@ -178,8 +178,8 @@ void v3270_update_system_clipboard(GtkWidget *widget) |
| 178 | 178 | clipboard, |
| 179 | 179 | targets, |
| 180 | 180 | n_targets, |
| 181 | - (GtkClipboardGetFunc) clipboard_get, | |
| 182 | - (GtkClipboardClearFunc) clipboard_clear, | |
| 181 | + (GtkClipboardGetFunc) v3270_clipboard_get, | |
| 182 | + (GtkClipboardClearFunc) v3270_clipboard_clear, | |
| 183 | 183 | G_OBJECT(widget) |
| 184 | 184 | )) |
| 185 | 185 | { |
| ... | ... | @@ -193,3 +193,4 @@ void v3270_update_system_clipboard(GtkWidget *widget) |
| 193 | 193 | |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | + | ... | ... |
src/selection/text.c
| ... | ... | @@ -183,8 +183,7 @@ LIB3270_EXPORT void v3270_input_text(GtkWidget *widget, const gchar *text, const |
| 183 | 183 | V3270_SIGNAL_PASTENEXT, |
| 184 | 184 | FALSE |
| 185 | 185 | ); |
| 186 | - v3270_popup_gerror(widget,error,NULL,"%s",_("Can't paste text")); | |
| 187 | - g_error_free(error); | |
| 186 | + v3270_popup_gerror(widget,&error,NULL,"%s",_("Can't paste text")); | |
| 188 | 187 | return; |
| 189 | 188 | } |
| 190 | 189 | ... | ... |
src/selection/windows/copy.c
| ... | ... | @@ -33,7 +33,7 @@ |
| 33 | 33 | |
| 34 | 34 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
| 35 | 35 | |
| 36 | -static void clipboard_clear(G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED GObject *obj) | |
| 36 | +void v3270_clipboard_clear(G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED GObject *obj) | |
| 37 | 37 | { |
| 38 | 38 | v3270 * terminal = GTK_V3270(obj); |
| 39 | 39 | |
| ... | ... | @@ -45,7 +45,7 @@ static void clipboard_clear(G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED |
| 45 | 45 | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | -static void clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionData *selection, guint target, GObject *obj) | |
| 48 | +void v3270_clipboard_get(G_GNUC_UNUSED GtkClipboard *clipboard, GtkSelectionData *selection, guint target, GObject *obj) | |
| 49 | 49 | { |
| 50 | 50 | v3270 * terminal = GTK_V3270(obj); |
| 51 | 51 | |
| ... | ... | @@ -178,8 +178,8 @@ void v3270_update_system_clipboard(GtkWidget *widget) |
| 178 | 178 | clipboard, |
| 179 | 179 | targets, |
| 180 | 180 | n_targets, |
| 181 | - (GtkClipboardGetFunc) clipboard_get, | |
| 182 | - (GtkClipboardClearFunc) clipboard_clear, | |
| 181 | + (GtkClipboardGetFunc) v3270_clipboard_get, | |
| 182 | + (GtkClipboardClearFunc) v3270_clipboard_clear, | |
| 183 | 183 | G_OBJECT(widget) |
| 184 | 184 | )) |
| 185 | 185 | { |
| ... | ... | @@ -192,4 +192,3 @@ void v3270_update_system_clipboard(GtkWidget *widget) |
| 192 | 192 | v3270_emit_copy_state(widget); |
| 193 | 193 | |
| 194 | 194 | } |
| 195 | - | ... | ... |
src/terminal/actions/table.c
| ... | ... | @@ -33,14 +33,19 @@ |
| 33 | 33 | #include <v3270/selection.h> |
| 34 | 34 | #include <terminal.h> |
| 35 | 35 | |
| 36 | - static int fire_kp_add_action(GtkWidget *widget, const struct _v3270_action * action); | |
| 37 | - static int fire_kp_sub_action(GtkWidget *widget, const struct _v3270_action * action); | |
| 36 | +// static int fire_kp_add_action(GtkWidget *widget, const struct _v3270_action * action); | |
| 37 | +// static int fire_kp_sub_action(GtkWidget *widget, const struct _v3270_action * action); | |
| 38 | + | |
| 39 | + static int fire_copy_as_html(GtkWidget *widget, const struct _v3270_action * action); | |
| 40 | + static int fire_copy_as_pixbuff(GtkWidget *widget, const struct _v3270_action * action); | |
| 38 | 41 | |
| 39 | 42 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
| 40 | 43 | |
| 41 | 44 | LIB3270_EXPORT const V3270_ACTION * v3270_get_actions() { |
| 42 | 45 | |
| 43 | 46 | static const V3270_ACTION actions[] = { |
| 47 | + | |
| 48 | + /* | |
| 44 | 49 | { |
| 45 | 50 | .name = "keypad-add", |
| 46 | 51 | .keys = "<Mod2>KP_Add", |
| ... | ... | @@ -53,6 +58,7 @@ |
| 53 | 58 | .group = LIB3270_ACTION_GROUP_ONLINE, |
| 54 | 59 | .activate = fire_kp_sub_action |
| 55 | 60 | }, |
| 61 | + */ | |
| 56 | 62 | |
| 57 | 63 | // Standard Clipboard actions |
| 58 | 64 | { |
| ... | ... | @@ -68,6 +74,24 @@ |
| 68 | 74 | }, |
| 69 | 75 | |
| 70 | 76 | { |
| 77 | + .name = "copy-html", | |
| 78 | + .group = LIB3270_ACTION_GROUP_SELECTION, | |
| 79 | + .label = N_( "Copy as HTML" ), | |
| 80 | + .summary = N_("Copy selection in HTML format"), | |
| 81 | + .description = N_("Replace current clipboard contents with the selected area in HTML format"), | |
| 82 | + .activate = fire_copy_as_html | |
| 83 | + }, | |
| 84 | + | |
| 85 | + { | |
| 86 | + .name = "copy-pixbuff", | |
| 87 | + .group = LIB3270_ACTION_GROUP_SELECTION, | |
| 88 | + .label = N_( "Copy as image" ), | |
| 89 | + .summary = N_("Copy selection in image format"), | |
| 90 | + .description = N_("Replace current clipboard contents with the selected area in image format"), | |
| 91 | + .activate = fire_copy_as_pixbuff | |
| 92 | + }, | |
| 93 | + | |
| 94 | + { | |
| 71 | 95 | .name = "copy-append", |
| 72 | 96 | .keys = "<Alt>c", |
| 73 | 97 | .flags = (V3270_ACTION_FLAGS) V3270_COPY_APPEND, |
| ... | ... | @@ -321,6 +345,17 @@ |
| 321 | 345 | |
| 322 | 346 | } |
| 323 | 347 | |
| 348 | + static int fire_copy_as_html(GtkWidget *widget, const struct _v3270_action G_GNUC_UNUSED(* action)) { | |
| 349 | + v3270_copy_as_html(widget); | |
| 350 | + return 0; | |
| 351 | + } | |
| 352 | + | |
| 353 | + static int fire_copy_as_pixbuff(GtkWidget *widget, const struct _v3270_action G_GNUC_UNUSED(* action)) { | |
| 354 | + v3270_copy_as_pixbuff(widget); | |
| 355 | + return 0; | |
| 356 | + } | |
| 357 | + | |
| 358 | + /* | |
| 324 | 359 | int fire_kp_add_action(GtkWidget *widget, const struct _v3270_action G_GNUC_UNUSED(* action)) { |
| 325 | 360 | |
| 326 | 361 | if(v3270_get_toggle(widget,LIB3270_TOGGLE_KP_ALTERNATIVE)) |
| ... | ... | @@ -342,3 +377,4 @@ |
| 342 | 377 | return 0; |
| 343 | 378 | |
| 344 | 379 | } |
| 380 | +*/ | ... | ... |
src/terminal/charset.c
src/terminal/drawing/oia.c
| ... | ... | @@ -762,6 +762,9 @@ void v3270_update_cursor(H3270 *session, unsigned short row, unsigned short col, |
| 762 | 762 | if(!terminal->surface) |
| 763 | 763 | return; |
| 764 | 764 | |
| 765 | + // Reset input context | |
| 766 | + gtk_im_context_reset(terminal->input_method); | |
| 767 | + | |
| 765 | 768 | // Update cursor rectangle |
| 766 | 769 | saved = terminal->cursor.rect; |
| 767 | 770 | ... | ... |
src/terminal/keyboard.c
| ... | ... | @@ -86,7 +86,7 @@ |
| 86 | 86 | #ifdef DEBUG |
| 87 | 87 | { |
| 88 | 88 | g_autofree gchar * keyname = gtk_accelerator_name(event->keyval,event->state); |
| 89 | - debug("%s Keyval: %d (%s) State: %04x %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", | |
| 89 | + debug("%s Keyval: %d (%s) State: %04x %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%", | |
| 90 | 90 | __FUNCTION__, |
| 91 | 91 | event->keyval, |
| 92 | 92 | gdk_keyval_name(event->keyval), |
| ... | ... | @@ -111,13 +111,25 @@ |
| 111 | 111 | } |
| 112 | 112 | #endif // DEBUG |
| 113 | 113 | |
| 114 | - if(gtk_im_context_filter_keypress(terminal->input_method,event)) | |
| 115 | - return TRUE; | |
| 114 | + // Check +/- keyboard redirection | |
| 115 | + if(lib3270_get_toggle(terminal->host,LIB3270_TOGGLE_KP_ALTERNATIVE) && !(event->state & (GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK))) { | |
| 116 | 116 | |
| 117 | - /* | |
| 118 | - if(!gtk_accelerator_valid(event->keyval,event->state)) | |
| 119 | - return FALSE; | |
| 120 | - */ | |
| 117 | + switch(event->keyval) { | |
| 118 | + case GDK_KP_Add: | |
| 119 | + debug("%s: Calling lib3270_nextfield",__FUNCTION__); | |
| 120 | + gtk_im_context_reset(terminal->input_method); | |
| 121 | + lib3270_nextfield(terminal->host); | |
| 122 | + return TRUE; | |
| 123 | + | |
| 124 | + case GDK_KP_Subtract: | |
| 125 | + debug("%s: Calling lib3270_previousfield",__FUNCTION__); | |
| 126 | + gtk_im_context_reset(terminal->input_method); | |
| 127 | + lib3270_previousfield(terminal->host); | |
| 128 | + return TRUE; | |
| 129 | + | |
| 130 | + } | |
| 131 | + | |
| 132 | + } | |
| 121 | 133 | |
| 122 | 134 | // Signal to the application. |
| 123 | 135 | gboolean handled = FALSE; |
| ... | ... | @@ -135,37 +147,23 @@ |
| 135 | 147 | debug("Keyboard action \"%s\" was %s",key_name,handled ? "Handled" : "Not handled"); |
| 136 | 148 | } |
| 137 | 149 | #endif // DEBUG |
| 138 | - if(handled) | |
| 139 | - return TRUE; | |
| 140 | 150 | |
| 151 | + if(handled) { | |
| 152 | + gtk_im_context_reset(terminal->input_method); | |
| 153 | + return TRUE; | |
| 154 | + } | |
| 141 | 155 | |
| 142 | - // Check for s | |
| 156 | + // Check for acelerator | |
| 143 | 157 | const V3270Accelerator * accelerator = v3270_accelerator_map_lookup_entry(widget, event->keyval, event->state); |
| 144 | 158 | if(accelerator) |
| 145 | 159 | { |
| 146 | 160 | debug("Found accelerator %s",v3270_accelerator_get_name(accelerator)); |
| 161 | + gtk_im_context_reset(terminal->input_method); | |
| 147 | 162 | v3270_accelerator_activate(accelerator,widget); |
| 148 | 163 | return TRUE; |
| 149 | 164 | } |
| 150 | 165 | |
| 151 | - /* | |
| 152 | - if(event->keyval >= GDK_F1 && event->keyval <= GDK_F12 && !(event->state & (GDK_CONTROL_MASK|GDK_MOD1_MASK))) | |
| 153 | - { | |
| 154 | - // It's a PFKey Action. | |
| 155 | - int pfcode = (event->keyval - GDK_F1) + ((event->state & GDK_SHIFT_MASK) ? 13 : 1); | |
| 156 | - | |
| 157 | - if(pfcode > 0 && pfcode < 25) | |
| 158 | - { | |
| 159 | - if(lib3270_pfkey(GTK_V3270(widget)->host,pfcode)) | |
| 160 | - gdk_display_beep(gtk_widget_get_display(widget)); | |
| 161 | - | |
| 162 | - return TRUE; | |
| 163 | - } | |
| 164 | - | |
| 165 | - } | |
| 166 | - */ | |
| 167 | - | |
| 168 | - return FALSE; | |
| 166 | + return gtk_im_context_filter_keypress(terminal->input_method,event); | |
| 169 | 167 | |
| 170 | 168 | } |
| 171 | 169 | ... | ... |
src/terminal/mouse.c
src/terminal/widget.c
| ... | ... | @@ -816,6 +816,11 @@ gboolean v3270_focus_out_event(GtkWidget *widget, GdkEventFocus *event) |
| 816 | 816 | |
| 817 | 817 | gtk_im_context_focus_out(terminal->input_method); |
| 818 | 818 | |
| 819 | +#ifdef KEY_FLAG_ALT | |
| 820 | + terminal->keyflags &= ~KEY_FLAG_ALT; | |
| 821 | + v3270_draw_alt_status(terminal); | |
| 822 | +#endif // KEY_FLAG_ALT | |
| 823 | + | |
| 819 | 824 | return notify_focus(widget,event); |
| 820 | 825 | } |
| 821 | 826 | ... | ... |
| ... | ... | @@ -0,0 +1,190 @@ |
| 1 | +/* | |
| 2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
| 5 | + * | |
| 6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 7 | + * | |
| 8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 10 | + * Free Software Foundation. | |
| 11 | + * | |
| 12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 15 | + * obter mais detalhes. | |
| 16 | + * | |
| 17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
| 19 | + * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | + * | |
| 21 | + * Este programa está nomeado como - e possui - linhas de código. | |
| 22 | + * | |
| 23 | + * Contatos: | |
| 24 | + * | |
| 25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
| 27 | + * | |
| 28 | + */ | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * @brief Usefull extensions for GtkEntry. | |
| 32 | + * | |
| 33 | + */ | |
| 34 | + | |
| 35 | + #include <internals.h> | |
| 36 | + #include <v3270/tools.h> | |
| 37 | + #include <string.h> | |
| 38 | + | |
| 39 | + struct FileEntry { | |
| 40 | + GtkFileChooserAction action; | |
| 41 | + const gchar * title; | |
| 42 | + const gchar * pattern; | |
| 43 | + const gchar * name; | |
| 44 | + const gchar * accept; | |
| 45 | + }; | |
| 46 | + | |
| 47 | + static void icon_response(GtkDialog *dialog, int response_id, GtkEntry *entry) { | |
| 48 | + | |
| 49 | + if(response_id == GTK_RESPONSE_ACCEPT) { | |
| 50 | + | |
| 51 | + g_autofree gchar * filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); | |
| 52 | + | |
| 53 | + if(filename) { | |
| 54 | + | |
| 55 | + // https://github.com/PerryWerneck/pw3270/issues/9#issuecomment-708963229 | |
| 56 | + // | |
| 57 | + // Works here (openSUSE Tumbleweed), BUT: the "open session" dialog comes with a filter | |
| 58 | + // set to "TN3270 files" and that's good, but when you save a session pw3270 does NOT add | |
| 59 | + // the extension, so how do you know what file extension those "TN3270 files" are supposed to have? | |
| 60 | + // | |
| 61 | + // I tried .tn3270 but it did not work, so I had to look hard in the internet to find out this page | |
| 62 | + // ... | |
| 63 | + // | |
| 64 | + if(strchr(filename,'.')) { | |
| 65 | + | |
| 66 | + // Filename has extension, use it. | |
| 67 | + gtk_entry_set_text(entry,filename); | |
| 68 | + | |
| 69 | + } else { | |
| 70 | + | |
| 71 | + // No extension, add it from the standard. | |
| 72 | + const gchar *ext = (const gchar *) g_object_get_data(G_OBJECT(dialog),"default-file-extension"); | |
| 73 | + if(ext) { | |
| 74 | + g_autofree gchar * new_name = g_strconcat(filename,ext,NULL); | |
| 75 | + gtk_entry_set_text(entry,new_name); | |
| 76 | + } else { | |
| 77 | + g_warning("No default file extension set"); | |
| 78 | + gtk_entry_set_text(entry,filename); | |
| 79 | + } | |
| 80 | + | |
| 81 | + } | |
| 82 | + | |
| 83 | + } else { | |
| 84 | + gtk_entry_set_text(entry,""); | |
| 85 | + } | |
| 86 | + } | |
| 87 | + | |
| 88 | + gtk_widget_destroy(GTK_WIDGET(dialog)); | |
| 89 | + | |
| 90 | + } | |
| 91 | + | |
| 92 | + static void icon_press(GtkWidget *entry, G_GNUC_UNUSED GtkEntryIconPosition icon_pos, G_GNUC_UNUSED GdkEvent *event, const struct FileEntry *descr) { | |
| 93 | + | |
| 94 | + GtkWidget * dialog = | |
| 95 | + gtk_file_chooser_dialog_new( | |
| 96 | + gettext(descr->title), | |
| 97 | + GTK_WINDOW(gtk_widget_get_toplevel(entry)), | |
| 98 | + descr->action, | |
| 99 | + _("Cancel"), GTK_RESPONSE_CANCEL, | |
| 100 | + descr->accept, GTK_RESPONSE_ACCEPT, | |
| 101 | + NULL | |
| 102 | + ); | |
| 103 | + | |
| 104 | + { | |
| 105 | + GtkFileFilter *filter; | |
| 106 | + | |
| 107 | + // Standard filter | |
| 108 | + filter = gtk_file_filter_new(); | |
| 109 | + gtk_file_filter_add_pattern (filter, descr->pattern); | |
| 110 | + gtk_file_filter_set_name(filter, gettext(descr->name)); | |
| 111 | + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter); | |
| 112 | + | |
| 113 | + const gchar *ext = strchr(descr->pattern,'.'); | |
| 114 | + if(ext) { | |
| 115 | + g_object_set_data_full(G_OBJECT(dialog),"default-file-extension",g_strdup(ext),g_free); | |
| 116 | + } | |
| 117 | + | |
| 118 | + // All files | |
| 119 | + filter = gtk_file_filter_new(); | |
| 120 | + gtk_file_filter_add_pattern (filter, "*.*"); | |
| 121 | + gtk_file_filter_set_name(filter, _("All files")); | |
| 122 | + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter); | |
| 123 | + | |
| 124 | + } | |
| 125 | + | |
| 126 | + gtk_window_set_modal(GTK_WINDOW(dialog),TRUE); | |
| 127 | + gtk_window_set_deletable(GTK_WINDOW(dialog),FALSE); | |
| 128 | + | |
| 129 | + const gchar *filename = gtk_entry_get_text(GTK_ENTRY(entry)); | |
| 130 | + | |
| 131 | + if(filename && *filename) | |
| 132 | + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog),filename); | |
| 133 | + | |
| 134 | + g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); | |
| 135 | + g_signal_connect(dialog,"response",G_CALLBACK(icon_response),entry); | |
| 136 | + | |
| 137 | + gtk_widget_show_all(dialog); | |
| 138 | + | |
| 139 | + | |
| 140 | + } | |
| 141 | + | |
| 142 | + static void release_ptr(GtkWidget G_GNUC_UNUSED(*object), gpointer ptr) { | |
| 143 | + g_free(ptr); | |
| 144 | + } | |
| 145 | + | |
| 146 | + LIB3270_EXPORT void gtk_widget_bind_ptr(GtkWidget *widget, gpointer ptr) { | |
| 147 | + g_signal_connect(widget,"destroy",G_CALLBACK(release_ptr),ptr); | |
| 148 | + } | |
| 149 | + | |
| 150 | + LIB3270_EXPORT void gtk_entry_bind_to_filechooser(GtkWidget *widget, GtkFileChooserAction action, const gchar *title, const gchar *icon_name, const gchar *pattern, const gchar *name) { | |
| 151 | + | |
| 152 | + gtk_entry_set_icon_from_icon_name( | |
| 153 | + GTK_ENTRY(widget), | |
| 154 | + GTK_ENTRY_ICON_SECONDARY, | |
| 155 | + icon_name ? icon_name : "document-open" | |
| 156 | + ); | |
| 157 | + | |
| 158 | + // Store data | |
| 159 | + gsize szEntry = sizeof(struct FileEntry) + strlen(title) + strlen(pattern) + strlen(name) + 4; | |
| 160 | + struct FileEntry * entry = (struct FileEntry *) g_malloc0(szEntry); | |
| 161 | + gtk_widget_bind_ptr(widget,entry); | |
| 162 | + | |
| 163 | + entry->action = action; | |
| 164 | + | |
| 165 | + switch(action) { | |
| 166 | + case GTK_FILE_CHOOSER_ACTION_OPEN: | |
| 167 | + entry->accept = _("_Open"); | |
| 168 | + break; | |
| 169 | + | |
| 170 | + case GTK_FILE_CHOOSER_ACTION_SAVE: | |
| 171 | + entry->accept = _("_Save"); | |
| 172 | + break; | |
| 173 | + | |
| 174 | + default: | |
| 175 | + entry->accept = _("_Continue"); | |
| 176 | + | |
| 177 | + } | |
| 178 | + | |
| 179 | + entry->title = (const char *) (entry+1); | |
| 180 | + strcpy((char *) entry->title,title); | |
| 181 | + | |
| 182 | + entry->pattern = entry->title + strlen(entry->title) +1; | |
| 183 | + strcpy((char *) entry->pattern,pattern); | |
| 184 | + | |
| 185 | + entry->name = entry->pattern + strlen(entry->pattern) + 1; | |
| 186 | + strcpy((char *) entry->name,name); | |
| 187 | + | |
| 188 | + g_signal_connect(widget,"icon_press",G_CALLBACK(icon_press),(gpointer) entry); | |
| 189 | + | |
| 190 | + } | ... | ... |
src/trace/trace.c
| ... | ... | @@ -477,18 +477,12 @@ |
| 477 | 477 | |
| 478 | 478 | g_free(text); |
| 479 | 479 | |
| 480 | - if(error) | |
| 481 | - { | |
| 482 | - v3270_popup_gerror( | |
| 483 | - widget, | |
| 484 | - error, | |
| 485 | - NULL, | |
| 486 | - _( "Can't save %s" ), filename | |
| 487 | - ); | |
| 488 | - | |
| 489 | - g_error_free(error); | |
| 490 | - | |
| 491 | - } | |
| 480 | + v3270_popup_gerror( | |
| 481 | + widget, | |
| 482 | + &error, | |
| 483 | + NULL, | |
| 484 | + _( "Can't save %s" ), filename | |
| 485 | + ); | |
| 492 | 486 | |
| 493 | 487 | } |
| 494 | 488 | ... | ... |
v3270.cbp
| ... | ... | @@ -198,6 +198,7 @@ |
| 198 | 198 | <Unit filename="src/include/v3270/selection.h" /> |
| 199 | 199 | <Unit filename="src/include/v3270/settings.h" /> |
| 200 | 200 | <Unit filename="src/include/v3270/toggle.h" /> |
| 201 | + <Unit filename="src/include/v3270/tools.h" /> | |
| 201 | 202 | <Unit filename="src/include/v3270/trace.h" /> |
| 202 | 203 | <Unit filename="src/selection/copy.c"> |
| 203 | 204 | <Option compilerVar="CC" /> |
| ... | ... | @@ -404,6 +405,9 @@ |
| 404 | 405 | <Unit filename="src/testprogram/toolbar.c"> |
| 405 | 406 | <Option compilerVar="CC" /> |
| 406 | 407 | </Unit> |
| 408 | + <Unit filename="src/tools/entry.c"> | |
| 409 | + <Option compilerVar="CC" /> | |
| 410 | + </Unit> | |
| 407 | 411 | <Unit filename="src/trace/exec.c"> |
| 408 | 412 | <Option compilerVar="CC" /> |
| 409 | 413 | </Unit> | ... | ... |