Commit 7727b019c9bba64aa444c7dc4136945daef20aa5

Authored by Perry Werneck
1 parent f7c504e3
Exists in master and in 1 other branch develop

Adding buttons in the new standard popup dialog.

Showing 2 changed files with 66 additions and 30 deletions   Show diff stats
locale/pt_BR.po
@@ -5,8 +5,8 @@ msgid "" @@ -5,8 +5,8 @@ msgid ""
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2020-07-16 15:51-0300\n"  
9 -"PO-Revision-Date: 2020-07-06 16:12-0300\n" 8 +"POT-Creation-Date: 2020-07-22 16:02-0300\n"
  9 +"PO-Revision-Date: 2020-07-23 11:06-0300\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Português <>\n" 11 "Language-Team: Português <>\n"
12 "Language: pt_BR\n" 12 "Language: pt_BR\n"
@@ -228,7 +228,7 @@ msgstr &quot;Não foi possível registrar manipuladores de I/O 3270&quot; @@ -228,7 +228,7 @@ msgstr &quot;Não foi possível registrar manipuladores de I/O 3270&quot;
228 msgid "Can't start file transfer session" 228 msgid "Can't start file transfer session"
229 msgstr "Não foi possível iniciar transferência de arquivo" 229 msgstr "Não foi possível iniciar transferência de arquivo"
230 230
231 -#: src/terminal/callbacks.c:396 src/filetransfer/v3270ftprogress.c:433 231 +#: src/terminal/callbacks.c:412 src/filetransfer/v3270ftprogress.c:433
232 #: src/filetransfer/transfer.c:89 src/dialogs/load.c:111 232 #: src/filetransfer/transfer.c:89 src/dialogs/load.c:111
233 #: src/dialogs/save/save.c:117 src/dialogs/settings/host.c:401 233 #: src/dialogs/save/save.c:117 src/dialogs/settings/host.c:401
234 msgid "Cancel" 234 msgid "Cancel"
@@ -302,7 +302,7 @@ msgstr &quot;Comando a executar&quot; @@ -302,7 +302,7 @@ msgstr &quot;Comando a executar&quot;
302 msgid "Connection" 302 msgid "Connection"
303 msgstr "Conexão" 303 msgstr "Conexão"
304 304
305 -#: src/terminal/callbacks.c:397 305 +#: src/terminal/callbacks.c:413
306 msgid "Continue" 306 msgid "Continue"
307 msgstr "Continuar" 307 msgstr "Continuar"
308 308
@@ -339,6 +339,10 @@ msgstr &quot;&quot; @@ -339,6 +339,10 @@ msgstr &quot;&quot;
339 msgid "Creates a file with variable-length records." 339 msgid "Creates a file with variable-length records."
340 msgstr "Cria arquivo com registros de tamanho variável." 340 msgstr "Cria arquivo com registros de tamanho variável."
341 341
  342 +#: src/dialogs/popups.c:78
  343 +msgid "Critical Error"
  344 +msgstr "Erro crítico"
  345 +
342 #: src/dialogs/settings/colors.c:180 346 #: src/dialogs/settings/colors.c:180
343 msgid "Cross hair cursor" 347 msgid "Cross hair cursor"
344 msgstr "Cursor mira" 348 msgstr "Cursor mira"
@@ -405,7 +409,7 @@ msgstr &quot;Turquesa Escuro&quot; @@ -405,7 +409,7 @@ msgstr &quot;Turquesa Escuro&quot;
405 msgid "Default" 409 msgid "Default"
406 msgstr "Padrão" 410 msgstr "Padrão"
407 411
408 -#: src/dialogs/popups.c:149 412 +#: src/dialogs/popups.c:223
409 msgid "Don't ask again" 413 msgid "Don't ask again"
410 msgstr "Não perguntar de novo" 414 msgstr "Não perguntar de novo"
411 415
@@ -425,7 +429,7 @@ msgstr &quot;Emulação&quot; @@ -425,7 +429,7 @@ msgstr &quot;Emulação&quot;
425 msgid "Enabled" 429 msgid "Enabled"
426 msgstr "Habilitado" 430 msgstr "Habilitado"
427 431
428 -#: src/dialogs/popups.c:56 src/dialogs/popups.c:85 432 +#: src/dialogs/popups.c:70
429 msgid "Error" 433 msgid "Error"
430 msgstr "Erro" 434 msgstr "Erro"
431 435
@@ -580,6 +584,10 @@ msgstr &quot;Copiar imagem&quot; @@ -580,6 +584,10 @@ msgstr &quot;Copiar imagem&quot;
580 msgid "Increase the font size" 584 msgid "Increase the font size"
581 msgstr "Aumenta o tamanho da fonte" 585 msgstr "Aumenta o tamanho da fonte"
582 586
  587 +#: src/dialogs/popups.c:54
  588 +msgid "Information"
  589 +msgstr "Informação"
  590 +
583 #: src/terminal/actions/table.c:153 591 #: src/terminal/actions/table.c:153
584 msgid "Input current clipboard contents to screen" 592 msgid "Input current clipboard contents to screen"
585 msgstr "Insere conteúdo da área de transferência" 593 msgstr "Insere conteúdo da área de transferência"
@@ -596,7 +604,7 @@ msgstr &quot;Intensificado/Protegido&quot; @@ -596,7 +604,7 @@ msgstr &quot;Intensificado/Protegido&quot;
596 msgid "Intensified/Unprotected" 604 msgid "Intensified/Unprotected"
597 msgstr "Intensificado/Desprotegido" 605 msgstr "Intensificado/Desprotegido"
598 606
599 -#: src/terminal/callbacks.c:424 607 +#: src/terminal/callbacks.c:454
600 msgid "Invalid callback table, possible version mismatch in lib3270" 608 msgid "Invalid callback table, possible version mismatch in lib3270"
601 msgstr "" 609 msgstr ""
602 "Tabela de callbacks inválida, possível divergência de versão na lib3270" 610 "Tabela de callbacks inválida, possível divergência de versão na lib3270"
@@ -686,7 +694,7 @@ msgstr &quot;Próxima página&quot; @@ -686,7 +694,7 @@ msgstr &quot;Próxima página&quot;
686 msgid "No active transfer" 694 msgid "No active transfer"
687 msgstr "Nenhuma transferência ativa" 695 msgstr "Nenhuma transferência ativa"
688 696
689 -#: src/terminal/properties/get.c:198 697 +#: src/terminal/properties/get.c:203
690 msgid "No host defined" 698 msgid "No host defined"
691 msgstr "Nenhum servidor definido" 699 msgstr "Nenhum servidor definido"
692 700
@@ -754,10 +762,6 @@ msgstr &quot;Estado normal na OIA&quot; @@ -754,10 +762,6 @@ msgstr &quot;Estado normal na OIA&quot;
754 msgid "Open" 762 msgid "Open"
755 msgstr "Abrir" 763 msgstr "Abrir"
756 764
757 -#: src/dialogs/popups.c:116  
758 -msgid "Operation failed"  
759 -msgstr "Operação falhou"  
760 -  
761 #: src/dialogs/save/convenience.c:65 src/dialogs/save/convenience.c:93 765 #: src/dialogs/save/convenience.c:65 src/dialogs/save/convenience.c:93
762 msgid "Operation has failed" 766 msgid "Operation has failed"
763 msgstr "Operação falhou" 767 msgstr "Operação falhou"
@@ -1097,6 +1101,10 @@ msgstr &quot;&quot; @@ -1097,6 +1101,10 @@ msgstr &quot;&quot;
1097 msgid "Secondary space" 1101 msgid "Secondary space"
1098 msgstr "Secondary space" 1102 msgstr "Secondary space"
1099 1103
  1104 +#: src/dialogs/popups.c:86
  1105 +msgid "Security alert"
  1106 +msgstr "Alerta de segurança"
  1107 +
1100 #: src/filetransfer/v3270ft.c:303 src/filetransfer/settings.c:209 1108 #: src/filetransfer/v3270ft.c:303 src/filetransfer/settings.c:209
1101 #: src/dialogs/save/save.c:98 src/dialogs/save/save.c:118 1109 #: src/dialogs/save/save.c:98 src/dialogs/save/save.c:118
1102 #: src/dialogs/settings/host.c:402 1110 #: src/dialogs/settings/host.c:402
@@ -1325,7 +1333,7 @@ msgstr &quot;&quot; @@ -1325,7 +1333,7 @@ msgstr &quot;&quot;
1325 "Tabela de callbacks para transferência de arquivos inválida, possível " 1333 "Tabela de callbacks para transferência de arquivos inválida, possível "
1326 "divergência de versão na lib3270" 1334 "divergência de versão na lib3270"
1327 1335
1328 -#: src/terminal/callbacks.c:391 1336 +#: src/terminal/callbacks.c:407
1329 #, c-format 1337 #, c-format
1330 msgid "The error code was %d" 1338 msgid "The error code was %d"
1331 msgstr "O código de erro foi %d" 1339 msgstr "O código de erro foi %d"
@@ -1476,10 +1484,14 @@ msgstr &quot;Fila de transferências&quot; @@ -1476,10 +1484,14 @@ msgstr &quot;Fila de transferências&quot;
1476 msgid "Transfer speed" 1484 msgid "Transfer speed"
1477 msgstr "Velocidade de transferência" 1485 msgstr "Velocidade de transferência"
1478 1486
1479 -#: src/terminal/properties/init.c:250 1487 +#: src/terminal/properties/init.c:249
1480 msgid "True if the terminal has copy blocks" 1488 msgid "True if the terminal has copy blocks"
1481 msgstr "Verdadeiro se o terminal tiver blocos copiados" 1489 msgstr "Verdadeiro se o terminal tiver blocos copiados"
1482 1490
  1491 +#: src/terminal/properties/init.c:264
  1492 +msgid "True if the timer indicator is active"
  1493 +msgstr "Verdadeiro se indicador de tempo estiver ativo"
  1494 +
1483 #: src/filetransfer/transfer.c:84 1495 #: src/filetransfer/transfer.c:84
1484 msgid "Try again with the same file." 1496 msgid "Try again with the same file."
1485 msgstr "Tente de novo com o mesmo arquivo." 1497 msgstr "Tente de novo com o mesmo arquivo."
@@ -1532,6 +1544,10 @@ msgstr &quot;Usar espaço inseparável&quot; @@ -1532,6 +1544,10 @@ msgstr &quot;Usar espaço inseparável&quot;
1532 msgid "Variable" 1544 msgid "Variable"
1533 msgstr "Variável" 1545 msgstr "Variável"
1534 1546
  1547 +#: src/dialogs/popups.c:62
  1548 +msgid "Warning"
  1549 +msgstr "Alerta"
  1550 +
1535 #: src/dialogs/tools.c:172 1551 #: src/dialogs/tools.c:172
1536 msgid "Western Europe (ISO 8859-1)" 1552 msgid "Western Europe (ISO 8859-1)"
1537 msgstr "Europa ocidental (ISO 8859-1)" 1553 msgstr "Europa ocidental (ISO 8859-1)"
@@ -1722,8 +1738,9 @@ msgid &quot;_Apply&quot; @@ -1722,8 +1738,9 @@ msgid &quot;_Apply&quot;
1722 msgstr "_Aplicar" 1738 msgstr "_Aplicar"
1723 1739
1724 #: src/selection/linux/paste.c:84 src/selection/linux/paste.c:118 1740 #: src/selection/linux/paste.c:84 src/selection/linux/paste.c:118
1725 -#: src/dialogs/load.c:205 src/dialogs/load.c:224 src/dialogs/linux/select.c:51  
1726 -#: src/dialogs/linux/select.c:77 src/dialogs/print/settingsdialog.c:410 1741 +#: src/dialogs/popups.c:118 src/dialogs/load.c:205 src/dialogs/load.c:224
  1742 +#: src/dialogs/linux/select.c:51 src/dialogs/linux/select.c:77
  1743 +#: src/dialogs/print/settingsdialog.c:410
1727 #: src/dialogs/print/settingsdialog.c:429 src/dialogs/save/save.c:342 1744 #: src/dialogs/print/settingsdialog.c:429 src/dialogs/save/save.c:342
1728 #: src/dialogs/save/save.c:361 src/dialogs/settings/dialog.c:231 1745 #: src/dialogs/save/save.c:361 src/dialogs/settings/dialog.c:231
1729 msgid "_Cancel" 1746 msgid "_Cancel"
@@ -1735,6 +1752,7 @@ msgstr &quot;Tabela de _Caracteres&quot; @@ -1735,6 +1752,7 @@ msgstr &quot;Tabela de _Caracteres&quot;
1735 1752
1736 #: src/trace/tracewindow.c:125 src/dialogs/transfer.c:163 1753 #: src/trace/tracewindow.c:125 src/dialogs/transfer.c:163
1737 #: src/dialogs/transfer.c:183 src/dialogs/security.c:235 1754 #: src/dialogs/transfer.c:183 src/dialogs/security.c:235
  1755 +#: src/dialogs/popups.c:77
1738 msgid "_Close" 1756 msgid "_Close"
1739 msgstr "_Close" 1757 msgstr "_Close"
1740 1758
@@ -1770,6 +1788,11 @@ msgstr &quot;Arquivo _local:&quot; @@ -1770,6 +1788,11 @@ msgstr &quot;Arquivo _local:&quot;
1770 msgid "_Model" 1788 msgid "_Model"
1771 msgstr "_Modelo" 1789 msgstr "_Modelo"
1772 1790
  1791 +#: src/dialogs/popups.c:53 src/dialogs/popups.c:61 src/dialogs/popups.c:69
  1792 +#: src/dialogs/popups.c:85
  1793 +msgid "_Ok"
  1794 +msgstr "_Ok"
  1795 +
1773 #: src/filetransfer/v3270ft.c:333 1796 #: src/filetransfer/v3270ft.c:333
1774 msgid "_Operation" 1797 msgid "_Operation"
1775 msgstr "_Operação:" 1798 msgstr "_Operação:"
@@ -2763,9 +2786,6 @@ msgstr &quot;Diminui o tamanho da fonte&quot; @@ -2763,9 +2786,6 @@ msgstr &quot;Diminui o tamanho da fonte&quot;
2763 #~ msgid "Incorrect request code: file transfer canceled" 2786 #~ msgid "Incorrect request code: file transfer canceled"
2764 #~ msgstr "Código de requisição incorreto, transferência cancelada" 2787 #~ msgstr "Código de requisição incorreto, transferência cancelada"
2765 2788
2766 -#~ msgid "Informations"  
2767 -#~ msgstr "Informações"  
2768 -  
2769 #~ msgid "Input method" 2789 #~ msgid "Input method"
2770 #~ msgstr "Método de entrada" 2790 #~ msgstr "Método de entrada"
2771 2791
@@ -2952,6 +2972,9 @@ msgstr &quot;Diminui o tamanho da fonte&quot; @@ -2952,6 +2972,9 @@ msgstr &quot;Diminui o tamanho da fonte&quot;
2952 #~ "Permitida apenas uma opção dentre TRACKS, CYLINDERS, AVBLOCK: " 2972 #~ "Permitida apenas uma opção dentre TRACKS, CYLINDERS, AVBLOCK: "
2953 #~ "Transferência cancelada" 2973 #~ "Transferência cancelada"
2954 2974
  2975 +#~ msgid "Operation failed"
  2976 +#~ msgstr "Operação falhou"
  2977 +
2955 #~ msgid "Option '%c:' is not supported" 2978 #~ msgid "Option '%c:' is not supported"
2956 #~ msgstr "Opção não suportada: '%c:'" 2979 #~ msgstr "Opção não suportada: '%c:'"
2957 2980
@@ -3349,9 +3372,6 @@ msgstr &quot;Diminui o tamanho da fonte&quot; @@ -3349,9 +3372,6 @@ msgstr &quot;Diminui o tamanho da fonte&quot;
3349 #~ msgid "Secure connection was successful." 3372 #~ msgid "Secure connection was successful."
3350 #~ msgstr "Conexão segura efetuada com sucesso." 3373 #~ msgstr "Conexão segura efetuada com sucesso."
3351 3374
3352 -#~ msgid "Security error"  
3353 -#~ msgstr "Erro de segurança"  
3354 -  
3355 #~ msgid "Security warning" 3375 #~ msgid "Security warning"
3356 #~ msgstr "Alerta de segurança" 3376 #~ msgstr "Alerta de segurança"
3357 3377
src/dialogs/popups.c
@@ -43,14 +43,14 @@ @@ -43,14 +43,14 @@
43 // Popup settings. 43 // Popup settings.
44 static const struct _settings { 44 static const struct _settings {
45 GtkMessageType type; 45 GtkMessageType type;
46 - GtkButtonsType buttons; 46 + const gchar *button;
47 const gchar *title; 47 const gchar *title;
48 } settings[LIB3270_NOTIFY_USER] = { 48 } settings[LIB3270_NOTIFY_USER] = {
49 49
50 // LIB3270_NOTIFY_INFO - Simple information dialog. 50 // LIB3270_NOTIFY_INFO - Simple information dialog.
51 { 51 {
52 .type = GTK_MESSAGE_INFO, 52 .type = GTK_MESSAGE_INFO,
53 - .buttons = GTK_BUTTONS_OK, 53 + .button = N_("_Ok"),
54 .title = N_("Information") 54 .title = N_("Information")
55 55
56 }, 56 },
@@ -58,7 +58,7 @@ @@ -58,7 +58,7 @@
58 // LIB3270_NOTIFY_WARNING - Warning message. 58 // LIB3270_NOTIFY_WARNING - Warning message.
59 { 59 {
60 .type = GTK_MESSAGE_WARNING, 60 .type = GTK_MESSAGE_WARNING,
61 - .buttons = GTK_BUTTONS_OK, 61 + .button = N_("_Ok"),
62 .title = N_("Warning") 62 .title = N_("Warning")
63 63
64 }, 64 },
@@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
66 // LIB3270_NOTIFY_ERROR - Error message. 66 // LIB3270_NOTIFY_ERROR - Error message.
67 { 67 {
68 .type = GTK_MESSAGE_ERROR, 68 .type = GTK_MESSAGE_ERROR,
69 - .buttons = GTK_BUTTONS_OK, 69 + .button = N_("_Ok"),
70 .title = N_("Error") 70 .title = N_("Error")
71 71
72 }, 72 },
@@ -74,7 +74,7 @@ @@ -74,7 +74,7 @@
74 // LIB3270_NOTIFY_CRITICAL - Critical error, user can abort application. 74 // LIB3270_NOTIFY_CRITICAL - Critical error, user can abort application.
75 { 75 {
76 .type = GTK_MESSAGE_ERROR, 76 .type = GTK_MESSAGE_ERROR,
77 - .buttons = GTK_BUTTONS_CLOSE, 77 + .button = N_("_Close"),
78 .title = N_("Critical Error") 78 .title = N_("Critical Error")
79 79
80 }, 80 },
@@ -82,12 +82,11 @@ @@ -82,12 +82,11 @@
82 // LIB3270_NOTIFY_SECURE - Secure host dialog. 82 // LIB3270_NOTIFY_SECURE - Secure host dialog.
83 { 83 {
84 .type = GTK_MESSAGE_OTHER, 84 .type = GTK_MESSAGE_OTHER,
85 - .buttons = GTK_BUTTONS_OK, 85 + .button = N_("_Ok"),
86 .title = N_("Security alert") 86 .title = N_("Security alert")
87 87
88 } 88 }
89 89
90 -  
91 }; 90 };
92 91
93 // Create dialog 92 // Create dialog
@@ -96,7 +95,7 @@ @@ -96,7 +95,7 @@
96 GTK_WINDOW(gtk_widget_get_toplevel(widget)), 95 GTK_WINDOW(gtk_widget_get_toplevel(widget)),
97 GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, 96 GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
98 settings[popup->type].type, 97 settings[popup->type].type,
99 - settings[popup->type].buttons, 98 + GTK_BUTTONS_NONE,
100 "%s",popup->summary 99 "%s",popup->summary
101 ); 100 );
102 101
@@ -114,6 +113,21 @@ @@ -114,6 +113,21 @@
114 if(wait) { 113 if(wait) {
115 114
116 // Wait for response. 115 // Wait for response.
  116 + if(popup->label) {
  117 +
  118 + gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
  119 + gtk_dialog_add_button(GTK_DIALOG(dialog), popup->label, GTK_RESPONSE_APPLY);
  120 + gtk_dialog_set_default_response(
  121 + GTK_DIALOG(dialog),
  122 + (popup->type == LIB3270_NOTIFY_SECURE ? GTK_RESPONSE_CANCEL : GTK_RESPONSE_APPLY)
  123 + );
  124 +
  125 + } else {
  126 +
  127 + gtk_dialog_add_button(GTK_DIALOG(dialog), g_dgettext(GETTEXT_PACKAGE,settings[popup->type].button), GTK_RESPONSE_OK);
  128 +
  129 + }
  130 +
117 gtk_widget_show_all(dialog); 131 gtk_widget_show_all(dialog);
118 gint rc = gtk_dialog_run(GTK_DIALOG(dialog)); 132 gint rc = gtk_dialog_run(GTK_DIALOG(dialog));
119 gtk_widget_destroy(dialog); 133 gtk_widget_destroy(dialog);
@@ -125,6 +139,8 @@ @@ -125,6 +139,8 @@
125 g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); 139 g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL);
126 g_signal_connect(dialog,"response",G_CALLBACK(gtk_widget_destroy),NULL); 140 g_signal_connect(dialog,"response",G_CALLBACK(gtk_widget_destroy),NULL);
127 141
  142 + gtk_dialog_add_button(GTK_DIALOG(dialog), settings[popup->type].button, GTK_RESPONSE_OK);
  143 +
128 gtk_widget_show_all(dialog); 144 gtk_widget_show_all(dialog);
129 145
130 return GTK_RESPONSE_NONE; 146 return GTK_RESPONSE_NONE;