Commit 31f62bf644dc6c6d65d35a3ec8c2b43f356b75c9

Authored by Perry Werneck
Committed by GitHub
2 parents bf30a188 3f4315f0

Merge pull request #7 from PerryWerneck/keypads

Adding optional and customized keypads.
@@ -43,7 +43,8 @@ SOURCES= \ @@ -43,7 +43,8 @@ SOURCES= \
43 $(wildcard src/objects/@OSNAME@/*.c) \ 43 $(wildcard src/objects/@OSNAME@/*.c) \
44 $(wildcard src/main/*.c) \ 44 $(wildcard src/main/*.c) \
45 $(wildcard src/main/@OSNAME@/*.c) \ 45 $(wildcard src/main/@OSNAME@/*.c) \
46 - $(wildcard src/main/@OSNAME@/*.rc) 46 + $(wildcard src/main/@OSNAME@/*.rc) \
  47 + $(wildcard src/objects/keypad/*.c)
47 48
48 SCHEMAS= \ 49 SCHEMAS= \
49 $(wildcard schemas/@OSNAME@/*.gschema.xml) \ 50 $(wildcard schemas/@OSNAME@/*.gschema.xml) \
@@ -286,11 +287,19 @@ install-application: \ @@ -286,11 +287,19 @@ install-application: \
286 ui/*.xml \ 287 ui/*.xml \
287 $(DESTDIR)/$(datarootdir)/$(PRODUCT_NAME)/ui 288 $(DESTDIR)/$(datarootdir)/$(PRODUCT_NAME)/ui
288 289
  290 + @$(MKDIR) \
  291 + $(DESTDIR)/$(datarootdir)/$(PRODUCT_NAME)/keypad
  292 +
  293 + @$(INSTALL_DATA) \
  294 + keypad/*.xml \
  295 + $(DESTDIR)/$(datarootdir)/$(PRODUCT_NAME)/keypad
  296 +
289 #---[ Misc Targets ]--------------------------------------------------------------------- 297 #---[ Misc Targets ]---------------------------------------------------------------------
290 298
291 locale/$(PACKAGE_NAME).pot: \ 299 locale/$(PACKAGE_NAME).pot: \
292 $(foreach SRC, $(basename $(SOURCES)), $(POTDIR)/$(PACKAGE_NAME)/$(SRC).pot) \ 300 $(foreach SRC, $(basename $(SOURCES)), $(POTDIR)/$(PACKAGE_NAME)/$(SRC).pot) \
293 - $(foreach SRC, $(basename $(wildcard ui/*.xml)), $(POTDIR)/$(PACKAGE_NAME)/$(SRC).pot) 301 + $(foreach SRC, $(basename $(wildcard ui/*.xml)), $(POTDIR)/$(PACKAGE_NAME)/$(SRC).pot) \
  302 + $(foreach SRC, $(basename $(wildcard keypad/*.xml)), $(POTDIR)/$(PACKAGE_NAME)/$(SRC).pot)
294 303
295 @rm -f $@ 304 @rm -f $@
296 @$(MKDIR) $(@D) 305 @$(MKDIR) $(@D)
keypad/00-right.xml 0 → 100644
@@ -0,0 +1,183 @@ @@ -0,0 +1,183 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--
  3 +
  4 + Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  5 + (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  6 + aplicativos mainframe. Registro no INPI sob o nome G3270.
  7 +
  8 + Copyright (C) <2008> <Banco do Brasil S.A.>
  9 +
  10 + Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  11 + os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  12 + Free Software Foundation.
  13 +
  14 + Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  15 + GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  16 + A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  17 + obter mais detalhes.
  18 +
  19 + Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  20 + programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  21 + St, Fifth Floor, Boston, MA 02110-1301 USA
  22 +
  23 +
  24 + Contatos:
  25 +
  26 + perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  27 + erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  28 +
  29 +-->
  30 +<interface>
  31 +
  32 + <keypad name="keypad_right" position="right" width='6'>
  33 +
  34 + <attribute name='label' translatable='yes'>Right keypad</attribute>
  35 +
  36 + <button width='2'>
  37 + <attribute name="label" translatable="no">PF1</attribute>
  38 + <attribute name="action">win.pfkey(1)</attribute>
  39 + </button>
  40 +
  41 + <button width='2'>
  42 + <attribute name="label" translatable="no">PF2</attribute>
  43 + <attribute name="action">win.pfkey(2)</attribute>
  44 + </button>
  45 +
  46 + <button width='2'>
  47 + <attribute name="label" translatable="no">PF3</attribute>
  48 + <attribute name="action">win.pfkey(3)</attribute>
  49 + </button>
  50 +
  51 + <button width='2'>
  52 + <attribute name="label" translatable="no">PF4</attribute>
  53 + <attribute name="action">win.pfkey(4)</attribute>
  54 + </button>
  55 +
  56 + <button width='2'>
  57 + <attribute name="label" translatable="no">PF5</attribute>
  58 + <attribute name="action">win.pfkey(5)</attribute>
  59 + </button>
  60 +
  61 + <button width='2'>
  62 + <attribute name="label" translatable="no">PF6</attribute>
  63 + <attribute name="action">win.pfkey(6)</attribute>
  64 + </button>
  65 +
  66 + <button width='2'>
  67 + <attribute name="label" translatable="no">PF7</attribute>
  68 + <attribute name="action">win.pfkey(7)</attribute>
  69 + </button>
  70 +
  71 + <button width='2'>
  72 + <attribute name="label" translatable="no">PF8</attribute>
  73 + <attribute name="action">win.pfkey(8)</attribute>
  74 + </button>
  75 +
  76 + <button width='2'>
  77 + <attribute name="label" translatable="no">PF9</attribute>
  78 + <attribute name="action">win.pfkey(9)</attribute>
  79 + </button>
  80 +
  81 + <button width='2'>
  82 + <attribute name="label" translatable="no">PF10</attribute>
  83 + <attribute name="action">win.pfkey(10)</attribute>
  84 + </button>
  85 +
  86 + <button width='2'>
  87 + <attribute name="label" translatable="no">PF11</attribute>
  88 + <attribute name="action">win.pfkey(11)</attribute>
  89 + </button>
  90 +
  91 + <button width='2'>
  92 + <attribute name="label" translatable="no">PF12</attribute>
  93 + <attribute name="action">win.pfkey(12)</attribute>
  94 + </button>
  95 +
  96 + <button column='2' width='2'>
  97 + <attribute name="icon-name" translatable="no">gtk-go-up</attribute>
  98 + <attribute name="action">win.up</attribute>
  99 + </button>
  100 +
  101 + <button column='0' width='2'>
  102 + <attribute name="icon-name" translatable="no">gtk-go-back</attribute>
  103 + <attribute name="action">win.left</attribute>
  104 + </button>
  105 +
  106 + <button width='2'>
  107 + <attribute name="icon-name" translatable="no">gtk-goto-top</attribute>
  108 + <attribute name="action">win.first-field</attribute>
  109 + </button>
  110 +
  111 + <button width='2'>
  112 + <attribute name="icon-name" translatable="no">gtk-go-forward</attribute>
  113 + <attribute name="action">win.right</attribute>
  114 + </button>
  115 +
  116 + <button column='2' width='2'>
  117 + <attribute name="icon-name" translatable="no">gtk-go-down</attribute>
  118 + <attribute name="action">win.down</attribute>
  119 + </button>
  120 +
  121 + <button width='2' column='0'>
  122 + <attribute name="label" translatable="no">PA1</attribute>
  123 + <attribute name="action">win.pakey(1)</attribute>
  124 + </button>
  125 +
  126 + <button width='2'>
  127 + <attribute name="label" translatable="no">PA2</attribute>
  128 + <attribute name="action">win.pakey(2)</attribute>
  129 + </button>
  130 +
  131 + <button width='2'>
  132 + <attribute name="label" translatable="no">PA3</attribute>
  133 + <attribute name="action">win.pakey(3)</attribute>
  134 + </button>
  135 +
  136 + <button width='3'>
  137 + <attribute name="icon-name">go-first</attribute>
  138 + <attribute name="action">win.previous-field</attribute>
  139 + </button>
  140 +
  141 + <button width='3'>
  142 + <attribute name="icon-name">go-last</attribute>
  143 + <attribute name="action">win.next-field</attribute>
  144 + </button>
  145 +
  146 + <button width='3'>
  147 + <attribute name="label" translatable="Yes">Clear</attribute>
  148 + <attribute name="action">win.clear</attribute>
  149 + </button>
  150 +
  151 + <button width='3'>
  152 + <attribute name="label" translatable="Yes">Reset</attribute>
  153 + <attribute name="action">win.kybdreset</attribute>
  154 + </button>
  155 +
  156 + <button width='3'>
  157 + <attribute name="label" translatable="Yes">Erase\nEOF</attribute>
  158 + <attribute name="action">win.erase-eof</attribute>
  159 + </button>
  160 +
  161 + <button width='3'>
  162 + <attribute name="label" translatable="Yes">Erase\nInput</attribute>
  163 + <attribute name="action">win.erase-input</attribute>
  164 + </button>
  165 +
  166 + <button width='3'>
  167 + <attribute name="label" translatable="Yes">Attn</attribute>
  168 + <attribute name="action">win.attn</attribute>
  169 + </button>
  170 +
  171 + <button width='3'>
  172 + <attribute name="label" translatable="Yes">Break</attribute>
  173 + <attribute name="action">win.break</attribute>
  174 + </button>
  175 +
  176 + <button width='6'>
  177 + <attribute name="icon-name" translatable="no">gtk-ok</attribute>
  178 + <attribute name="action">win.enter</attribute>
  179 + </button>
  180 +
  181 + </keypad>
  182 +
  183 +</interface>
keypad/10-bottom.xml 0 → 100644
@@ -0,0 +1,158 @@ @@ -0,0 +1,158 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!--
  3 +
  4 + Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  5 + (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  6 + aplicativos mainframe. Registro no INPI sob o nome G3270.
  7 +
  8 + Copyright (C) <2008> <Banco do Brasil S.A.>
  9 +
  10 + Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  11 + os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  12 + Free Software Foundation.
  13 +
  14 + Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  15 + GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  16 + A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  17 + obter mais detalhes.
  18 +
  19 + Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  20 + programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  21 + St, Fifth Floor, Boston, MA 02110-1301 USA
  22 +
  23 +
  24 + Contatos:
  25 +
  26 + perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  27 + erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  28 +
  29 +-->
  30 +<interface>
  31 +
  32 + <keypad name="function_bar" position="bottom" width='12'>
  33 +
  34 + <attribute name='label' translatable='yes'>Function bar</attribute>
  35 +
  36 + <button>
  37 + <attribute name="label" translatable="no">PF1</attribute>
  38 + <attribute name="action">win.pfkey(1)</attribute>
  39 + </button>
  40 +
  41 + <button>
  42 + <attribute name="label" translatable="no">PF2</attribute>
  43 + <attribute name="action">win.pfkey(2)</attribute>
  44 + </button>
  45 +
  46 + <button>
  47 + <attribute name="label" translatable="no">PF3</attribute>
  48 + <attribute name="action">win.pfkey(3)</attribute>
  49 + </button>
  50 +
  51 + <button>
  52 + <attribute name="label" translatable="no">PF4</attribute>
  53 + <attribute name="action">win.pfkey(4)</attribute>
  54 + </button>
  55 +
  56 + <button>
  57 + <attribute name="label" translatable="no">PF5</attribute>
  58 + <attribute name="action">win.pfkey(5)</attribute>
  59 + </button>
  60 +
  61 + <button>
  62 + <attribute name="label" translatable="no">PF6</attribute>
  63 + <attribute name="action">win.pfkey(6)</attribute>
  64 + </button>
  65 +
  66 + <button>
  67 + <attribute name="label" translatable="no">PF7</attribute>
  68 + <attribute name="action">win.pfkey(7)</attribute>
  69 + </button>
  70 +
  71 + <button>
  72 + <attribute name="label" translatable="no">PF8</attribute>
  73 + <attribute name="action">win.pfkey(8)</attribute>
  74 + </button>
  75 +
  76 + <button>
  77 + <attribute name="label" translatable="no">PF9</attribute>
  78 + <attribute name="action">win.pfkey(9)</attribute>
  79 + </button>
  80 +
  81 + <button>
  82 + <attribute name="label" translatable="no">PF10</attribute>
  83 + <attribute name="action">win.pfkey(10)</attribute>
  84 + </button>
  85 +
  86 + <button>
  87 + <attribute name="label" translatable="no">PF11</attribute>
  88 + <attribute name="action">win.pfkey(11)</attribute>
  89 + </button>
  90 +
  91 + <button>
  92 + <attribute name="label" translatable="no">PF12</attribute>
  93 + <attribute name="action">win.pfkey(12)</attribute>
  94 + </button>
  95 +
  96 + <button>
  97 + <attribute name="label" translatable="no">PF13</attribute>
  98 + <attribute name="action">win.pfkey(13)</attribute>
  99 + </button>
  100 +
  101 + <button>
  102 + <attribute name="label" translatable="no">PF14</attribute>
  103 + <attribute name="action">win.pfkey(14)</attribute>
  104 + </button>
  105 +
  106 + <button>
  107 + <attribute name="label" translatable="no">PF15</attribute>
  108 + <attribute name="action">win.pfkey(15)</attribute>
  109 + </button>
  110 +
  111 + <button>
  112 + <attribute name="label" translatable="no">PF16</attribute>
  113 + <attribute name="action">win.pfkey(16)</attribute>
  114 + </button>
  115 +
  116 + <button>
  117 + <attribute name="label" translatable="no">PF17</attribute>
  118 + <attribute name="action">win.pfkey(17)</attribute>
  119 + </button>
  120 +
  121 + <button>
  122 + <attribute name="label" translatable="no">PF18</attribute>
  123 + <attribute name="action">win.pfkey(18)</attribute>
  124 + </button>
  125 +
  126 + <button>
  127 + <attribute name="label" translatable="no">PF19</attribute>
  128 + <attribute name="action">win.pfkey(19)</attribute>
  129 + </button>
  130 +
  131 + <button>
  132 + <attribute name="label" translatable="no">PF20</attribute>
  133 + <attribute name="action">win.pfkey(20)</attribute>
  134 + </button>
  135 +
  136 + <button>
  137 + <attribute name="label" translatable="no">PF21</attribute>
  138 + <attribute name="action">win.pfkey(21)</attribute>
  139 + </button>
  140 +
  141 + <button>
  142 + <attribute name="label" translatable="no">PF22</attribute>
  143 + <attribute name="action">win.pfkey(22)</attribute>
  144 + </button>
  145 +
  146 + <button>
  147 + <attribute name="label" translatable="no">PF23</attribute>
  148 + <attribute name="action">win.pfkey(23)</attribute>
  149 + </button>
  150 +
  151 + <button>
  152 + <attribute name="label" translatable="no">PF24</attribute>
  153 + <attribute name="action">win.pfkey(24)</attribute>
  154 + </button>
  155 +
  156 + </keypad>
  157 +
  158 +</interface>
locale/pt_BR.po
@@ -5,7 +5,7 @@ msgid &quot;&quot; @@ -5,7 +5,7 @@ msgid &quot;&quot;
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-05-08 00:40-0300\n" 8 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
9 "PO-Revision-Date: 2020-05-08 00:46-0300\n" 9 "PO-Revision-Date: 2020-05-08 00:46-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"
@@ -91,12 +91,12 @@ msgstr &quot;Negrito&quot; @@ -91,12 +91,12 @@ msgstr &quot;Negrito&quot;
91 msgid "Brazilian Public Software Portal" 91 msgid "Brazilian Public Software Portal"
92 msgstr "Portal do Software Público Brasileiro" 92 msgstr "Portal do Software Público Brasileiro"
93 93
94 -#: src/objects/window/terminal.c:173 94 +#: src/objects/window/terminal.c:174
95 #, c-format 95 #, c-format
96 msgid "Can't save file \"%s\"" 96 msgid "Can't save file \"%s\""
97 msgstr "Não foi possível salvar arquivo \"%s\"" 97 msgstr "Não foi possível salvar arquivo \"%s\""
98 98
99 -#: src/objects/window/terminal.c:178 99 +#: src/objects/window/terminal.c:179
100 msgid "Can't save session file" 100 msgid "Can't save session file"
101 msgstr "Não foi possível salvar arquivo de sessão" 101 msgstr "Não foi possível salvar arquivo de sessão"
102 102
@@ -151,7 +151,7 @@ msgstr &quot;Conectar ao iniciar&quot; @@ -151,7 +151,7 @@ msgstr &quot;Conectar ao iniciar&quot;
151 msgid "Connect to host" 151 msgid "Connect to host"
152 msgstr "Conectar ao servidor" 152 msgstr "Conectar ao servidor"
153 153
154 -#: src/objects/window/window.c:538 src/objects/window/page.c:218 154 +#: src/objects/window/window.c:555 src/objects/window/page.c:218
155 msgid "Connected to host" 155 msgid "Connected to host"
156 msgstr "Conectado no servidor" 156 msgstr "Conectado no servidor"
157 157
@@ -203,7 +203,7 @@ msgstr &quot;Ícone da área de trabalho&quot; @@ -203,7 +203,7 @@ msgstr &quot;Ícone da área de trabalho&quot;
203 msgid "Disconnect" 203 msgid "Disconnect"
204 msgstr "Desconectar" 204 msgstr "Desconectar"
205 205
206 -#: src/objects/window/window.c:538 src/objects/window/window.c:543 206 +#: src/objects/window/window.c:555 src/objects/window/window.c:560
207 #: src/objects/window/page.c:207 207 #: src/objects/window/page.c:207
208 msgid "Disconnected from host" 208 msgid "Disconnected from host"
209 msgstr "Desconectado do servidor" 209 msgstr "Desconectado do servidor"
@@ -212,6 +212,24 @@ msgstr &quot;Desconectado do servidor&quot; @@ -212,6 +212,24 @@ msgstr &quot;Desconectado do servidor&quot;
212 msgid "Dynamic font spacing" 212 msgid "Dynamic font spacing"
213 msgstr "Espaçamento dinâmico" 213 msgstr "Espaçamento dinâmico"
214 214
  215 +#: src/objects/keypad/element.c:128
  216 +msgid "Element col"
  217 +msgstr ""
  218 +
  219 +#: src/objects/keypad/element.c:152
  220 +#, fuzzy
  221 +msgid "Element height in rows"
  222 +msgstr "Altura atual da tela em linhas"
  223 +
  224 +#: src/objects/keypad/element.c:116
  225 +msgid "Element row"
  226 +msgstr ""
  227 +
  228 +#: src/objects/keypad/element.c:140
  229 +#, fuzzy
  230 +msgid "Element width in columns"
  231 +msgstr "Largura atua da tela em colunas"
  232 +
215 #: src/objects/actions/abstract.c:140 233 #: src/objects/actions/abstract.c:140
216 msgid "Enabled" 234 msgid "Enabled"
217 msgstr "habilitado" 235 msgstr "habilitado"
@@ -256,7 +274,7 @@ msgstr &quot;Ajuda&quot; @@ -256,7 +274,7 @@ msgstr &quot;Ajuda&quot;
256 msgid "Host properties" 274 msgid "Host properties"
257 msgstr "Propriedades do Servidor" 275 msgstr "Propriedades do Servidor"
258 276
259 -#: src/objects/window/window.c:306 277 +#: src/objects/window/window.c:323
260 msgid "IBM 3270 Terminal emulator" 278 msgid "IBM 3270 Terminal emulator"
261 msgstr "Emulador 3270" 279 msgstr "Emulador 3270"
262 280
@@ -292,6 +310,14 @@ msgstr &quot;Se a ação pode ser ativada&quot; @@ -292,6 +310,14 @@ msgstr &quot;Se a ação pode ser ativada&quot;
292 msgid "Insert" 310 msgid "Insert"
293 msgstr "Inserção" 311 msgstr "Inserção"
294 312
  313 +#: src/objects/keypad/attribute.c:116
  314 +msgid "Invalid or unknown property name"
  315 +msgstr ""
  316 +
  317 +#: src/objects/keypad/attribute.c:79
  318 +msgid "Invalid or unknown property type"
  319 +msgstr ""
  320 +
295 #: src/objects/toolbar/settings.c:108 321 #: src/objects/toolbar/settings.c:108
296 msgid "Itens" 322 msgid "Itens"
297 msgstr "Itens" 323 msgstr "Itens"
@@ -300,6 +326,24 @@ msgstr &quot;Itens&quot; @@ -300,6 +326,24 @@ msgstr &quot;Itens&quot;
300 msgid "Keep selected" 326 msgid "Keep selected"
301 msgstr "Manter selecionado" 327 msgstr "Manter selecionado"
302 328
  329 +#: src/objects/keypad/keypad.c:103
  330 +msgid "Keypad Label"
  331 +msgstr ""
  332 +
  333 +#: src/objects/keypad/keypad.c:93
  334 +msgid "Keypad Name"
  335 +msgstr ""
  336 +
  337 +#: src/objects/keypad/keypad.c:136
  338 +#, fuzzy
  339 +msgid "Keypad height in rows"
  340 +msgstr "Altura atual da tela em linhas"
  341 +
  342 +#: src/objects/keypad/keypad.c:124
  343 +#, fuzzy
  344 +msgid "Keypad width in columns"
  345 +msgstr "Largura atua da tela em colunas"
  346 +
303 #: src/objects/actions/view.c:98 347 #: src/objects/actions/view.c:98
304 msgid "Label" 348 msgid "Label"
305 msgstr "Etiqueta" 349 msgstr "Etiqueta"
@@ -456,6 +500,11 @@ msgstr &quot;Reselecionar&quot; @@ -456,6 +500,11 @@ msgstr &quot;Reselecionar&quot;
456 msgid "Resize on alternate screen" 500 msgid "Resize on alternate screen"
457 msgstr "Mudar tamanho do terminal em tela alternativa" 501 msgstr "Mudar tamanho do terminal em tela alternativa"
458 502
  503 +#: keypad/00-right.xml:34
  504 +#, fuzzy
  505 +msgid "Right keypad"
  506 +msgstr "Barra lateral"
  507 +
459 #: src/objects/toolbar/toolbar.c:286 508 #: src/objects/toolbar/toolbar.c:286
460 msgid "S_tyle" 509 msgid "S_tyle"
461 msgstr "E_stilo" 510 msgstr "E_stilo"
@@ -615,6 +664,11 @@ msgstr &quot;Fonte do terminal&quot; @@ -615,6 +664,11 @@ msgstr &quot;Fonte do terminal&quot;
615 msgid "Text only" 664 msgid "Text only"
616 msgstr "Apenas texto" 665 msgstr "Apenas texto"
617 666
  667 +#: src/objects/keypad/keypad.c:104 src/objects/keypad/element.c:106
  668 +#, fuzzy
  669 +msgid "The Label of the keypad"
  670 +msgstr "A etiqueta da ação"
  671 +
618 #: src/objects/actions/abstract.c:109 672 #: src/objects/actions/abstract.c:109
619 msgid "The action label" 673 msgid "The action label"
620 msgstr "A etiqueta da ação" 674 msgstr "A etiqueta da ação"
@@ -631,6 +685,11 @@ msgstr &quot;Código identificando o tipo de interface do usuário&quot; @@ -631,6 +685,11 @@ msgstr &quot;Código identificando o tipo de interface do usuário&quot;
631 msgid "The label for the action" 685 msgid "The label for the action"
632 msgstr "A etiqueta da ação" 686 msgstr "A etiqueta da ação"
633 687
  688 +#: src/objects/keypad/element.c:96
  689 +#, fuzzy
  690 +msgid "The name of associated action"
  691 +msgstr "Nome do ícone associado com a ação"
  692 +
634 #: src/objects/window/window.c:157 693 #: src/objects/window/window.c:157
635 msgid "The name of the actions in the header bar" 694 msgid "The name of the actions in the header bar"
636 msgstr "O nome das ações na barra de título" 695 msgstr "O nome das ações na barra de título"
@@ -639,14 +698,28 @@ msgstr &quot;O nome das ações na barra de título&quot; @@ -639,14 +698,28 @@ msgstr &quot;O nome das ações na barra de título&quot;
639 msgid "The name of the actions in the toolbar" 698 msgid "The name of the actions in the toolbar"
640 msgstr "O nome das ações na barra de ferramentas" 699 msgstr "O nome das ações na barra de ferramentas"
641 700
  701 +#: src/objects/keypad/element.c:86
  702 +#, fuzzy
  703 +msgid "The name of the icon"
  704 +msgstr "A etiqueta da ação"
  705 +
642 #: src/objects/actions/abstract.c:102 706 #: src/objects/actions/abstract.c:102
643 msgid "The name of the icon associated with the action" 707 msgid "The name of the icon associated with the action"
644 msgstr "Nome do ícone associado com a ação" 708 msgstr "Nome do ícone associado com a ação"
645 709
  710 +#: src/objects/keypad/keypad.c:94
  711 +#, fuzzy
  712 +msgid "The name used to identify the keypad"
  713 +msgstr "O nome usado para ativar a ação"
  714 +
646 #: src/objects/actions/abstract.c:94 715 #: src/objects/actions/abstract.c:94
647 msgid "The name used to invoke the action" 716 msgid "The name used to invoke the action"
648 msgstr "O nome usado para ativar a ação" 717 msgstr "O nome usado para ativar a ação"
649 718
  719 +#: src/objects/keypad/keypad.c:114
  720 +msgid "The position of the keypad"
  721 +msgstr ""
  722 +
650 #: src/objects/actions/abstract.c:153 723 #: src/objects/actions/abstract.c:153
651 msgid "The state the action is in" 724 msgid "The state the action is in"
652 msgstr "O estado em que a ação está" 725 msgstr "O estado em que a ação está"
@@ -730,7 +803,7 @@ msgstr &quot;Usar teclas +/- para navegar por campos&quot; @@ -730,7 +803,7 @@ msgstr &quot;Usar teclas +/- para navegar por campos&quot;
730 msgid "Version %s-%s" 803 msgid "Version %s-%s"
731 msgstr "Versão %s-%s" 804 msgstr "Versão %s-%s"
732 805
733 -#: ui/application.xml:63 806 +#: src/objects/window/header.c:66 ui/application.xml:63
734 msgid "View" 807 msgid "View"
735 msgstr "Exibir" 808 msgstr "Exibir"
736 809
@@ -794,6 +867,11 @@ msgstr &quot;_Salvar&quot; @@ -794,6 +867,11 @@ msgstr &quot;_Salvar&quot;
794 msgid "_View" 867 msgid "_View"
795 msgstr "_Exibir" 868 msgstr "_Exibir"
796 869
  870 +#: src/objects/keypad/keypad.c:102
  871 +#, fuzzy
  872 +msgid "label"
  873 +msgstr "Etiqueta"
  874 +
797 #: src/objects/application/actions/about.c:116 875 #: src/objects/application/actions/about.c:116
798 msgid "translator-credits" 876 msgid "translator-credits"
799 msgstr "translator-credits" 877 msgstr "translator-credits"
@@ -1490,12 +1568,6 @@ msgstr &quot;translator-credits&quot; @@ -1490,12 +1568,6 @@ msgstr &quot;translator-credits&quot;
1490 #~ msgid "Cross hair Cursor" 1568 #~ msgid "Cross hair Cursor"
1491 #~ msgstr "Cursor mira" 1569 #~ msgstr "Cursor mira"
1492 1570
1493 -#~ msgid "Current screen height in rows"  
1494 -#~ msgstr "Altura atual da tela em linhas"  
1495 -  
1496 -#~ msgid "Current screen width in columns"  
1497 -#~ msgstr "Largura atua da tela em colunas"  
1498 -  
1499 #~ msgid "Current:" 1571 #~ msgid "Current:"
1500 #~ msgstr "Atual:" 1572 #~ msgstr "Atual:"
1501 1573
@@ -2083,9 +2155,6 @@ msgstr &quot;translator-credits&quot; @@ -2083,9 +2155,6 @@ msgstr &quot;translator-credits&quot;
2083 #~ msgid "LRECL:" 2155 #~ msgid "LRECL:"
2084 #~ msgstr "LRECL:" 2156 #~ msgstr "LRECL:"
2085 2157
2086 -#~ msgid "Lateral keypad"  
2087 -#~ msgstr "Barra lateral"  
2088 -  
2089 #~ msgid "Latest program message" 2158 #~ msgid "Latest program message"
2090 #~ msgstr "Última mensagem de programa" 2159 #~ msgstr "Última mensagem de programa"
2091 2160
locale/pw3270.pot
@@ -6,9 +6,318 @@ @@ -6,9 +6,318 @@
6 #, fuzzy 6 #, fuzzy
7 msgid "" 7 msgid ""
8 msgstr "" 8 msgstr ""
  9 +"#-#-#-#-# view.pot (PACKAGE VERSION) #-#-#-#-#\n"
9 "Project-Id-Version: PACKAGE VERSION\n" 10 "Project-Id-Version: PACKAGE VERSION\n"
10 "Report-Msgid-Bugs-To: \n" 11 "Report-Msgid-Bugs-To: \n"
11 -"POT-Creation-Date: 2020-05-08 00:40-0300\n" 12 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  13 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  14 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  15 +"Language-Team: LANGUAGE <LL@li.org>\n"
  16 +"Language: \n"
  17 +"MIME-Version: 1.0\n"
  18 +"Content-Type: text/plain; charset=CHARSET\n"
  19 +"Content-Transfer-Encoding: 8bit\n"
  20 +"#-#-#-#-# save.pot (PACKAGE VERSION) #-#-#-#-#\n"
  21 +"Project-Id-Version: PACKAGE VERSION\n"
  22 +"Report-Msgid-Bugs-To: \n"
  23 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  24 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  25 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  26 +"Language-Team: LANGUAGE <LL@li.org>\n"
  27 +"Language: \n"
  28 +"MIME-Version: 1.0\n"
  29 +"Content-Type: text/plain; charset=CHARSET\n"
  30 +"Content-Transfer-Encoding: 8bit\n"
  31 +"#-#-#-#-# abstract.pot (PACKAGE VERSION) #-#-#-#-#\n"
  32 +"Project-Id-Version: PACKAGE VERSION\n"
  33 +"Report-Msgid-Bugs-To: \n"
  34 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  35 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  36 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  37 +"Language-Team: LANGUAGE <LL@li.org>\n"
  38 +"Language: \n"
  39 +"MIME-Version: 1.0\n"
  40 +"Content-Type: text/plain; charset=CHARSET\n"
  41 +"Content-Transfer-Encoding: 8bit\n"
  42 +"#-#-#-#-# application.pot (PACKAGE VERSION) #-#-#-#-#\n"
  43 +"Project-Id-Version: PACKAGE VERSION\n"
  44 +"Report-Msgid-Bugs-To: \n"
  45 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  46 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  47 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  48 +"Language-Team: LANGUAGE <LL@li.org>\n"
  49 +"Language: \n"
  50 +"MIME-Version: 1.0\n"
  51 +"Content-Type: text/plain; charset=CHARSET\n"
  52 +"Content-Transfer-Encoding: 8bit\n"
  53 +"#-#-#-#-# window.pot (PACKAGE VERSION) #-#-#-#-#\n"
  54 +"Project-Id-Version: PACKAGE VERSION\n"
  55 +"Report-Msgid-Bugs-To: \n"
  56 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  57 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  58 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  59 +"Language-Team: LANGUAGE <LL@li.org>\n"
  60 +"Language: \n"
  61 +"MIME-Version: 1.0\n"
  62 +"Content-Type: text/plain; charset=CHARSET\n"
  63 +"Content-Transfer-Encoding: 8bit\n"
  64 +"#-#-#-#-# preferences.pot (PACKAGE VERSION) #-#-#-#-#\n"
  65 +"Project-Id-Version: PACKAGE VERSION\n"
  66 +"Report-Msgid-Bugs-To: \n"
  67 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  68 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  69 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  70 +"Language-Team: LANGUAGE <LL@li.org>\n"
  71 +"Language: \n"
  72 +"MIME-Version: 1.0\n"
  73 +"Content-Type: text/plain; charset=CHARSET\n"
  74 +"Content-Transfer-Encoding: 8bit\n"
  75 +"#-#-#-#-# open.pot (PACKAGE VERSION) #-#-#-#-#\n"
  76 +"Project-Id-Version: PACKAGE VERSION\n"
  77 +"Report-Msgid-Bugs-To: \n"
  78 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  79 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  80 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  81 +"Language-Team: LANGUAGE <LL@li.org>\n"
  82 +"Language: \n"
  83 +"MIME-Version: 1.0\n"
  84 +"Content-Type: text/plain; charset=CHARSET\n"
  85 +"Content-Transfer-Encoding: 8bit\n"
  86 +"#-#-#-#-# about.pot (PACKAGE VERSION) #-#-#-#-#\n"
  87 +"Project-Id-Version: PACKAGE VERSION\n"
  88 +"Report-Msgid-Bugs-To: \n"
  89 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  90 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  91 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  92 +"Language-Team: LANGUAGE <LL@li.org>\n"
  93 +"Language: \n"
  94 +"MIME-Version: 1.0\n"
  95 +"Content-Type: text/plain; charset=CHARSET\n"
  96 +"Content-Transfer-Encoding: 8bit\n"
  97 +"#-#-#-#-# window.pot (PACKAGE VERSION) #-#-#-#-#\n"
  98 +"Project-Id-Version: PACKAGE VERSION\n"
  99 +"Report-Msgid-Bugs-To: \n"
  100 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  101 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  102 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  103 +"Language-Team: LANGUAGE <LL@li.org>\n"
  104 +"Language: \n"
  105 +"MIME-Version: 1.0\n"
  106 +"Content-Type: text/plain; charset=CHARSET\n"
  107 +"Content-Transfer-Encoding: 8bit\n"
  108 +"#-#-#-#-# terminal.pot (PACKAGE VERSION) #-#-#-#-#\n"
  109 +"Project-Id-Version: PACKAGE VERSION\n"
  110 +"Report-Msgid-Bugs-To: \n"
  111 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  112 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  113 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  114 +"Language-Team: LANGUAGE <LL@li.org>\n"
  115 +"Language: \n"
  116 +"MIME-Version: 1.0\n"
  117 +"Content-Type: text/plain; charset=CHARSET\n"
  118 +"Content-Transfer-Encoding: 8bit\n"
  119 +"#-#-#-#-# page.pot (PACKAGE VERSION) #-#-#-#-#\n"
  120 +"Project-Id-Version: PACKAGE VERSION\n"
  121 +"Report-Msgid-Bugs-To: \n"
  122 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  123 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  124 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  125 +"Language-Team: LANGUAGE <LL@li.org>\n"
  126 +"Language: \n"
  127 +"MIME-Version: 1.0\n"
  128 +"Content-Type: text/plain; charset=CHARSET\n"
  129 +"Content-Transfer-Encoding: 8bit\n"
  130 +"#-#-#-#-# header.pot (PACKAGE VERSION) #-#-#-#-#\n"
  131 +"Project-Id-Version: PACKAGE VERSION\n"
  132 +"Report-Msgid-Bugs-To: \n"
  133 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  134 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  135 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  136 +"Language-Team: LANGUAGE <LL@li.org>\n"
  137 +"Language: \n"
  138 +"MIME-Version: 1.0\n"
  139 +"Content-Type: text/plain; charset=CHARSET\n"
  140 +"Content-Transfer-Encoding: 8bit\n"
  141 +"#-#-#-#-# setcolors.pot (PACKAGE VERSION) #-#-#-#-#\n"
  142 +"Project-Id-Version: PACKAGE VERSION\n"
  143 +"Report-Msgid-Bugs-To: \n"
  144 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  145 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  146 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  147 +"Language-Team: LANGUAGE <LL@li.org>\n"
  148 +"Language: \n"
  149 +"MIME-Version: 1.0\n"
  150 +"Content-Type: text/plain; charset=CHARSET\n"
  151 +"Content-Transfer-Encoding: 8bit\n"
  152 +"#-#-#-#-# sessionproperties.pot (PACKAGE VERSION) #-#-#-#-#\n"
  153 +"Project-Id-Version: PACKAGE VERSION\n"
  154 +"Report-Msgid-Bugs-To: \n"
  155 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  156 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  157 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  158 +"Language-Team: LANGUAGE <LL@li.org>\n"
  159 +"Language: \n"
  160 +"MIME-Version: 1.0\n"
  161 +"Content-Type: text/plain; charset=CHARSET\n"
  162 +"Content-Transfer-Encoding: 8bit\n"
  163 +"#-#-#-#-# hostproperties.pot (PACKAGE VERSION) #-#-#-#-#\n"
  164 +"Project-Id-Version: PACKAGE VERSION\n"
  165 +"Report-Msgid-Bugs-To: \n"
  166 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  167 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  168 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  169 +"Language-Team: LANGUAGE <LL@li.org>\n"
  170 +"Language: \n"
  171 +"MIME-Version: 1.0\n"
  172 +"Content-Type: text/plain; charset=CHARSET\n"
  173 +"Content-Transfer-Encoding: 8bit\n"
  174 +"#-#-#-#-# filetransfer.pot (PACKAGE VERSION) #-#-#-#-#\n"
  175 +"Project-Id-Version: PACKAGE VERSION\n"
  176 +"Report-Msgid-Bugs-To: \n"
  177 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  178 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  179 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  180 +"Language-Team: LANGUAGE <LL@li.org>\n"
  181 +"Language: \n"
  182 +"MIME-Version: 1.0\n"
  183 +"Content-Type: text/plain; charset=CHARSET\n"
  184 +"Content-Transfer-Encoding: 8bit\n"
  185 +"#-#-#-#-# connect.pot (PACKAGE VERSION) #-#-#-#-#\n"
  186 +"Project-Id-Version: PACKAGE VERSION\n"
  187 +"Report-Msgid-Bugs-To: \n"
  188 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  189 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  190 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  191 +"Language-Team: LANGUAGE <LL@li.org>\n"
  192 +"Language: \n"
  193 +"MIME-Version: 1.0\n"
  194 +"Content-Type: text/plain; charset=CHARSET\n"
  195 +"Content-Transfer-Encoding: 8bit\n"
  196 +"#-#-#-#-# close.pot (PACKAGE VERSION) #-#-#-#-#\n"
  197 +"Project-Id-Version: PACKAGE VERSION\n"
  198 +"Report-Msgid-Bugs-To: \n"
  199 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  200 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  201 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  202 +"Language-Team: LANGUAGE <LL@li.org>\n"
  203 +"Language: \n"
  204 +"MIME-Version: 1.0\n"
  205 +"Content-Type: text/plain; charset=CHARSET\n"
  206 +"Content-Transfer-Encoding: 8bit\n"
  207 +"#-#-#-#-# toolbar.pot (PACKAGE VERSION) #-#-#-#-#\n"
  208 +"Project-Id-Version: PACKAGE VERSION\n"
  209 +"Report-Msgid-Bugs-To: \n"
  210 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  211 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  212 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  213 +"Language-Team: LANGUAGE <LL@li.org>\n"
  214 +"Language: \n"
  215 +"MIME-Version: 1.0\n"
  216 +"Content-Type: text/plain; charset=CHARSET\n"
  217 +"Content-Transfer-Encoding: 8bit\n"
  218 +"#-#-#-#-# settings.pot (PACKAGE VERSION) #-#-#-#-#\n"
  219 +"Project-Id-Version: PACKAGE VERSION\n"
  220 +"Report-Msgid-Bugs-To: \n"
  221 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  222 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  223 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  224 +"Language-Team: LANGUAGE <LL@li.org>\n"
  225 +"Language: \n"
  226 +"MIME-Version: 1.0\n"
  227 +"Content-Type: text/plain; charset=CHARSET\n"
  228 +"Content-Transfer-Encoding: 8bit\n"
  229 +"#-#-#-#-# dialog.pot (PACKAGE VERSION) #-#-#-#-#\n"
  230 +"Project-Id-Version: PACKAGE VERSION\n"
  231 +"Report-Msgid-Bugs-To: \n"
  232 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  233 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  234 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  235 +"Language-Team: LANGUAGE <LL@li.org>\n"
  236 +"Language: \n"
  237 +"MIME-Version: 1.0\n"
  238 +"Content-Type: text/plain; charset=CHARSET\n"
  239 +"Content-Transfer-Encoding: 8bit\n"
  240 +"#-#-#-#-# savedesktopicon.pot (PACKAGE VERSION) #-#-#-#-#\n"
  241 +"Project-Id-Version: PACKAGE VERSION\n"
  242 +"Report-Msgid-Bugs-To: \n"
  243 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  244 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  245 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  246 +"Language-Team: LANGUAGE <LL@li.org>\n"
  247 +"Language: \n"
  248 +"MIME-Version: 1.0\n"
  249 +"Content-Type: text/plain; charset=CHARSET\n"
  250 +"Content-Transfer-Encoding: 8bit\n"
  251 +"#-#-#-#-# tools.pot (PACKAGE VERSION) #-#-#-#-#\n"
  252 +"Project-Id-Version: PACKAGE VERSION\n"
  253 +"Report-Msgid-Bugs-To: \n"
  254 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  255 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  256 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  257 +"Language-Team: LANGUAGE <LL@li.org>\n"
  258 +"Language: \n"
  259 +"MIME-Version: 1.0\n"
  260 +"Content-Type: text/plain; charset=CHARSET\n"
  261 +"Content-Transfer-Encoding: 8bit\n"
  262 +"#-#-#-#-# keypad.pot (PACKAGE VERSION) #-#-#-#-#\n"
  263 +"Project-Id-Version: PACKAGE VERSION\n"
  264 +"Report-Msgid-Bugs-To: \n"
  265 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  266 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  267 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  268 +"Language-Team: LANGUAGE <LL@li.org>\n"
  269 +"Language: \n"
  270 +"MIME-Version: 1.0\n"
  271 +"Content-Type: text/plain; charset=CHARSET\n"
  272 +"Content-Transfer-Encoding: 8bit\n"
  273 +"#-#-#-#-# element.pot (PACKAGE VERSION) #-#-#-#-#\n"
  274 +"Project-Id-Version: PACKAGE VERSION\n"
  275 +"Report-Msgid-Bugs-To: \n"
  276 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  277 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  278 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  279 +"Language-Team: LANGUAGE <LL@li.org>\n"
  280 +"Language: \n"
  281 +"MIME-Version: 1.0\n"
  282 +"Content-Type: text/plain; charset=CHARSET\n"
  283 +"Content-Transfer-Encoding: 8bit\n"
  284 +"#-#-#-#-# attribute.pot (PACKAGE VERSION) #-#-#-#-#\n"
  285 +"Project-Id-Version: PACKAGE VERSION\n"
  286 +"Report-Msgid-Bugs-To: \n"
  287 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  288 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  289 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  290 +"Language-Team: LANGUAGE <LL@li.org>\n"
  291 +"Language: \n"
  292 +"MIME-Version: 1.0\n"
  293 +"Content-Type: text/plain; charset=CHARSET\n"
  294 +"Content-Transfer-Encoding: 8bit\n"
  295 +"#-#-#-#-# window.pot (PACKAGE VERSION) #-#-#-#-#\n"
  296 +"Project-Id-Version: PACKAGE VERSION\n"
  297 +"Report-Msgid-Bugs-To: \n"
  298 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  299 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  300 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  301 +"Language-Team: LANGUAGE <LL@li.org>\n"
  302 +"Language: \n"
  303 +"MIME-Version: 1.0\n"
  304 +"Content-Type: text/plain; charset=CHARSET\n"
  305 +"Content-Transfer-Encoding: 8bit\n"
  306 +"#-#-#-#-# application.pot (PACKAGE VERSION) #-#-#-#-#\n"
  307 +"Project-Id-Version: PACKAGE VERSION\n"
  308 +"Report-Msgid-Bugs-To: \n"
  309 +"POT-Creation-Date: 2020-05-29 11:55-0300\n"
  310 +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  311 +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  312 +"Language-Team: LANGUAGE <LL@li.org>\n"
  313 +"Language: \n"
  314 +"MIME-Version: 1.0\n"
  315 +"Content-Type: text/plain; charset=CHARSET\n"
  316 +"Content-Transfer-Encoding: 8bit\n"
  317 +"#-#-#-#-# 00-right.pot (PACKAGE VERSION) #-#-#-#-#\n"
  318 +"Project-Id-Version: PACKAGE VERSION\n"
  319 +"Report-Msgid-Bugs-To: \n"
  320 +"POT-Creation-Date: 2020-05-29 11:59-0300\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 321 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 322 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n" 323 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -88,12 +397,12 @@ msgstr &quot;&quot; @@ -88,12 +397,12 @@ msgstr &quot;&quot;
88 msgid "Brazilian Public Software Portal" 397 msgid "Brazilian Public Software Portal"
89 msgstr "" 398 msgstr ""
90 399
91 -#: src/objects/window/terminal.c:173 400 +#: src/objects/window/terminal.c:174
92 #, c-format 401 #, c-format
93 msgid "Can't save file \"%s\"" 402 msgid "Can't save file \"%s\""
94 msgstr "" 403 msgstr ""
95 404
96 -#: src/objects/window/terminal.c:178 405 +#: src/objects/window/terminal.c:179
97 msgid "Can't save session file" 406 msgid "Can't save session file"
98 msgstr "" 407 msgstr ""
99 408
@@ -148,7 +457,7 @@ msgstr &quot;&quot; @@ -148,7 +457,7 @@ msgstr &quot;&quot;
148 msgid "Connect to host" 457 msgid "Connect to host"
149 msgstr "" 458 msgstr ""
150 459
151 -#: src/objects/window/window.c:538 src/objects/window/page.c:218 460 +#: src/objects/window/window.c:555 src/objects/window/page.c:218
152 msgid "Connected to host" 461 msgid "Connected to host"
153 msgstr "" 462 msgstr ""
154 463
@@ -200,7 +509,7 @@ msgstr &quot;&quot; @@ -200,7 +509,7 @@ msgstr &quot;&quot;
200 msgid "Disconnect" 509 msgid "Disconnect"
201 msgstr "" 510 msgstr ""
202 511
203 -#: src/objects/window/window.c:538 src/objects/window/window.c:543 512 +#: src/objects/window/window.c:555 src/objects/window/window.c:560
204 #: src/objects/window/page.c:207 513 #: src/objects/window/page.c:207
205 msgid "Disconnected from host" 514 msgid "Disconnected from host"
206 msgstr "" 515 msgstr ""
@@ -209,6 +518,22 @@ msgstr &quot;&quot; @@ -209,6 +518,22 @@ msgstr &quot;&quot;
209 msgid "Dynamic font spacing" 518 msgid "Dynamic font spacing"
210 msgstr "" 519 msgstr ""
211 520
  521 +#: src/objects/keypad/element.c:128
  522 +msgid "Element col"
  523 +msgstr ""
  524 +
  525 +#: src/objects/keypad/element.c:152
  526 +msgid "Element height in rows"
  527 +msgstr ""
  528 +
  529 +#: src/objects/keypad/element.c:116
  530 +msgid "Element row"
  531 +msgstr ""
  532 +
  533 +#: src/objects/keypad/element.c:140
  534 +msgid "Element width in columns"
  535 +msgstr ""
  536 +
212 #: src/objects/actions/abstract.c:140 537 #: src/objects/actions/abstract.c:140
213 msgid "Enabled" 538 msgid "Enabled"
214 msgstr "" 539 msgstr ""
@@ -253,7 +578,7 @@ msgstr &quot;&quot; @@ -253,7 +578,7 @@ msgstr &quot;&quot;
253 msgid "Host properties" 578 msgid "Host properties"
254 msgstr "" 579 msgstr ""
255 580
256 -#: src/objects/window/window.c:306 581 +#: src/objects/window/window.c:323
257 msgid "IBM 3270 Terminal emulator" 582 msgid "IBM 3270 Terminal emulator"
258 msgstr "" 583 msgstr ""
259 584
@@ -289,6 +614,14 @@ msgstr &quot;&quot; @@ -289,6 +614,14 @@ msgstr &quot;&quot;
289 msgid "Insert" 614 msgid "Insert"
290 msgstr "" 615 msgstr ""
291 616
  617 +#: src/objects/keypad/attribute.c:116
  618 +msgid "Invalid or unknown property name"
  619 +msgstr ""
  620 +
  621 +#: src/objects/keypad/attribute.c:79
  622 +msgid "Invalid or unknown property type"
  623 +msgstr ""
  624 +
292 #: src/objects/toolbar/settings.c:108 625 #: src/objects/toolbar/settings.c:108
293 msgid "Itens" 626 msgid "Itens"
294 msgstr "" 627 msgstr ""
@@ -297,6 +630,22 @@ msgstr &quot;&quot; @@ -297,6 +630,22 @@ msgstr &quot;&quot;
297 msgid "Keep selected" 630 msgid "Keep selected"
298 msgstr "" 631 msgstr ""
299 632
  633 +#: src/objects/keypad/keypad.c:103
  634 +msgid "Keypad Label"
  635 +msgstr ""
  636 +
  637 +#: src/objects/keypad/keypad.c:93
  638 +msgid "Keypad Name"
  639 +msgstr ""
  640 +
  641 +#: src/objects/keypad/keypad.c:136
  642 +msgid "Keypad height in rows"
  643 +msgstr ""
  644 +
  645 +#: src/objects/keypad/keypad.c:124
  646 +msgid "Keypad width in columns"
  647 +msgstr ""
  648 +
300 #: src/objects/actions/view.c:98 649 #: src/objects/actions/view.c:98
301 msgid "Label" 650 msgid "Label"
302 msgstr "" 651 msgstr ""
@@ -453,6 +802,10 @@ msgstr &quot;&quot; @@ -453,6 +802,10 @@ msgstr &quot;&quot;
453 msgid "Resize on alternate screen" 802 msgid "Resize on alternate screen"
454 msgstr "" 803 msgstr ""
455 804
  805 +#: keypad/00-right.xml:34
  806 +msgid "Right keypad"
  807 +msgstr ""
  808 +
456 #: src/objects/toolbar/toolbar.c:286 809 #: src/objects/toolbar/toolbar.c:286
457 msgid "S_tyle" 810 msgid "S_tyle"
458 msgstr "" 811 msgstr ""
@@ -612,6 +965,10 @@ msgstr &quot;&quot; @@ -612,6 +965,10 @@ msgstr &quot;&quot;
612 msgid "Text only" 965 msgid "Text only"
613 msgstr "" 966 msgstr ""
614 967
  968 +#: src/objects/keypad/keypad.c:104 src/objects/keypad/element.c:106
  969 +msgid "The Label of the keypad"
  970 +msgstr ""
  971 +
615 #: src/objects/actions/abstract.c:109 972 #: src/objects/actions/abstract.c:109
616 msgid "The action label" 973 msgid "The action label"
617 msgstr "" 974 msgstr ""
@@ -628,6 +985,10 @@ msgstr &quot;&quot; @@ -628,6 +985,10 @@ msgstr &quot;&quot;
628 msgid "The label for the action" 985 msgid "The label for the action"
629 msgstr "" 986 msgstr ""
630 987
  988 +#: src/objects/keypad/element.c:96
  989 +msgid "The name of associated action"
  990 +msgstr ""
  991 +
631 #: src/objects/window/window.c:157 992 #: src/objects/window/window.c:157
632 msgid "The name of the actions in the header bar" 993 msgid "The name of the actions in the header bar"
633 msgstr "" 994 msgstr ""
@@ -636,14 +997,26 @@ msgstr &quot;&quot; @@ -636,14 +997,26 @@ msgstr &quot;&quot;
636 msgid "The name of the actions in the toolbar" 997 msgid "The name of the actions in the toolbar"
637 msgstr "" 998 msgstr ""
638 999
  1000 +#: src/objects/keypad/element.c:86
  1001 +msgid "The name of the icon"
  1002 +msgstr ""
  1003 +
639 #: src/objects/actions/abstract.c:102 1004 #: src/objects/actions/abstract.c:102
640 msgid "The name of the icon associated with the action" 1005 msgid "The name of the icon associated with the action"
641 msgstr "" 1006 msgstr ""
642 1007
  1008 +#: src/objects/keypad/keypad.c:94
  1009 +msgid "The name used to identify the keypad"
  1010 +msgstr ""
  1011 +
643 #: src/objects/actions/abstract.c:94 1012 #: src/objects/actions/abstract.c:94
644 msgid "The name used to invoke the action" 1013 msgid "The name used to invoke the action"
645 msgstr "" 1014 msgstr ""
646 1015
  1016 +#: src/objects/keypad/keypad.c:114
  1017 +msgid "The position of the keypad"
  1018 +msgstr ""
  1019 +
647 #: src/objects/actions/abstract.c:153 1020 #: src/objects/actions/abstract.c:153
648 msgid "The state the action is in" 1021 msgid "The state the action is in"
649 msgstr "" 1022 msgstr ""
@@ -715,7 +1088,7 @@ msgstr &quot;&quot; @@ -715,7 +1088,7 @@ msgstr &quot;&quot;
715 msgid "Version %s-%s" 1088 msgid "Version %s-%s"
716 msgstr "" 1089 msgstr ""
717 1090
718 -#: ui/application.xml:63 1091 +#: src/objects/window/header.c:66 ui/application.xml:63
719 msgid "View" 1092 msgid "View"
720 msgstr "" 1093 msgstr ""
721 1094
@@ -779,6 +1152,10 @@ msgstr &quot;&quot; @@ -779,6 +1152,10 @@ msgstr &quot;&quot;
779 msgid "_View" 1152 msgid "_View"
780 msgstr "" 1153 msgstr ""
781 1154
  1155 +#: src/objects/keypad/keypad.c:102
  1156 +msgid "label"
  1157 +msgstr ""
  1158 +
782 #: src/objects/application/actions/about.c:116 1159 #: src/objects/application/actions/about.c:116
783 msgid "translator-credits" 1160 msgid "translator-credits"
784 msgstr "" 1161 msgstr ""
@@ -46,6 +46,7 @@ @@ -46,6 +46,7 @@
46 <Unit filename="src/include/pw3270.h" /> 46 <Unit filename="src/include/pw3270.h" />
47 <Unit filename="src/include/pw3270/actions.h" /> 47 <Unit filename="src/include/pw3270/actions.h" />
48 <Unit filename="src/include/pw3270/application.h" /> 48 <Unit filename="src/include/pw3270/application.h" />
  49 + <Unit filename="src/include/pw3270/keypad.h" />
49 <Unit filename="src/include/pw3270/settings.h" /> 50 <Unit filename="src/include/pw3270/settings.h" />
50 <Unit filename="src/include/pw3270/toolbar.h" /> 51 <Unit filename="src/include/pw3270/toolbar.h" />
51 <Unit filename="src/include/pw3270/window.h" /> 52 <Unit filename="src/include/pw3270/window.h" />
@@ -109,6 +110,22 @@ @@ -109,6 +110,22 @@
109 <Option compilerVar="CC" /> 110 <Option compilerVar="CC" />
110 </Unit> 111 </Unit>
111 <Unit filename="src/objects/application/private.h" /> 112 <Unit filename="src/objects/application/private.h" />
  113 + <Unit filename="src/objects/keypad/attribute.c">
  114 + <Option compilerVar="CC" />
  115 + </Unit>
  116 + <Unit filename="src/objects/keypad/element.c">
  117 + <Option compilerVar="CC" />
  118 + </Unit>
  119 + <Unit filename="src/objects/keypad/load.c">
  120 + <Option compilerVar="CC" />
  121 + </Unit>
  122 + <Unit filename="src/objects/keypad/model.c">
  123 + <Option compilerVar="CC" />
  124 + </Unit>
  125 + <Unit filename="src/objects/keypad/private.h" />
  126 + <Unit filename="src/objects/keypad/widget.c">
  127 + <Option compilerVar="CC" />
  128 + </Unit>
112 <Unit filename="src/objects/linux/savedesktopicon.c"> 129 <Unit filename="src/objects/linux/savedesktopicon.c">
113 <Option compilerVar="CC" /> 130 <Option compilerVar="CC" />
114 </Unit> 131 </Unit>
@@ -168,9 +185,6 @@ @@ -168,9 +185,6 @@
168 <Unit filename="ui/application.xml" /> 185 <Unit filename="ui/application.xml" />
169 <Unit filename="ui/window.xml" /> 186 <Unit filename="ui/window.xml" />
170 <Extensions> 187 <Extensions>
171 - <code_completion />  
172 - <debugger />  
173 - <envvars set="default" />  
174 <DoxyBlocks> 188 <DoxyBlocks>
175 <comment_style block="0" line="0" /> 189 <comment_style block="0" line="0" />
176 <doxyfile_project /> 190 <doxyfile_project />
@@ -180,6 +194,7 @@ @@ -180,6 +194,7 @@
180 <doxyfile_dot /> 194 <doxyfile_dot />
181 <general /> 195 <general />
182 </DoxyBlocks> 196 </DoxyBlocks>
  197 + <envvars set="default" />
183 </Extensions> 198 </Extensions>
184 </Project> 199 </Project>
185 </CodeBlocks_project_file> 200 </CodeBlocks_project_file>
src/include/pw3270.h
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
52 #define I_(string) g_intern_static_string (string) 52 #define I_(string) g_intern_static_string (string)
53 53
54 54
55 - void pw3270_load_placeholders(GtkBuilder * builder); 55 + void pw3270_load_placeholders(GApplication *application, GtkBuilder * builder);
56 // GtkWidget * pw3270_frame_new(GtkWidget * child, const gchar *title); 56 // GtkWidget * pw3270_frame_new(GtkWidget * child, const gchar *title);
57 57
58 // Application settings widget 58 // Application settings widget
@@ -70,6 +70,7 @@ @@ -70,6 +70,7 @@
70 70
71 const gchar * v3270_get_session_filename(GtkWidget *widget); 71 const gchar * v3270_get_session_filename(GtkWidget *widget);
72 void v3270_set_session_filename(GtkWidget *widget, const gchar *filename); 72 void v3270_set_session_filename(GtkWidget *widget, const gchar *filename);
  73 + GKeyFile * v3270_get_session_keyfile(GtkWidget *widget);
73 74
74 /// @brief Check if the terminal has a customized session file. 75 /// @brief Check if the terminal has a customized session file.
75 gboolean v3270_allow_custom_settings(GtkWidget *widget); 76 gboolean v3270_allow_custom_settings(GtkWidget *widget);
src/include/pw3270/application.h
@@ -66,6 +66,7 @@ @@ -66,6 +66,7 @@
66 GtkApplication * pw3270_application_new(const gchar *application_id, GApplicationFlags flags); 66 GtkApplication * pw3270_application_new(const gchar *application_id, GApplicationFlags flags);
67 67
68 GSettings * pw3270_application_get_settings(GApplication *app); 68 GSettings * pw3270_application_get_settings(GApplication *app);
  69 + GList * pw3270_application_get_keypad_models(GApplication *app);
69 70
70 void pw3270_application_set_ui_style(GApplication *app, PW3270_UI_STYLE type); 71 void pw3270_application_set_ui_style(GApplication *app, PW3270_UI_STYLE type);
71 PW3270_UI_STYLE pw3270_application_get_ui_style(GApplication *app); 72 PW3270_UI_STYLE pw3270_application_get_ui_style(GApplication *app);
@@ -76,6 +77,7 @@ @@ -76,6 +77,7 @@
76 77
77 // Tools 78 // Tools
78 GtkBuilder * pw3270_application_get_builder(const gchar *name); 79 GtkBuilder * pw3270_application_get_builder(const gchar *name);
  80 +
79 void gtk_container_remove_all(GtkContainer *container); 81 void gtk_container_remove_all(GtkContainer *container);
80 82
81 // Actions 83 // Actions
src/include/pw3270/keypad.h 0 → 100644
@@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
  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 Declares the pw3270 Keypad objects.
  32 + *
  33 + */
  34 +
  35 +#ifndef PW3270_KEYPAD_H_INCLUDED
  36 +
  37 + #define PW3270_KEYPAD_H_INCLUDED
  38 +
  39 + #include <gtk/gtk.h>
  40 +
  41 + G_BEGIN_DECLS
  42 +
  43 + #define PW_TYPE_KEYPAD_MODEL (KeypadModel_get_type())
  44 + #define PW_KEYPAD_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PW_TYPE_KEYPAD_MODEL, KeypadModel))
  45 + #define PW_KEYPAD_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PW_TYPE_KEYPAD_MODEL, KeypadModelClass))
  46 + #define PW_IS_KEYPAD_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PW_TYPE_KEYPAD_MODEL))
  47 + #define PW_IS_KEYPAD_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PW_TYPE_KEYPAD_MODEL))
  48 + #define PW_KEYPAD_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PW_TYPE_KEYPAD_MODEL, KeypadModelClass))
  49 +
  50 + typedef struct _KeypadModel KeypadModel;
  51 + typedef struct _KeypadModelClass KeypadModelClass;
  52 +
  53 + GType KeypadModel_get_type(void) G_GNUC_CONST;
  54 +
  55 + GList * pw3270_keypad_model_new_from_xml(GList *keypads, const gchar *filename);
  56 + GtkWidget * pw3270_keypad_get_from_model(GObject *model);
  57 + const gchar * pw3270_keypad_model_get_name(GObject *model);
  58 + const gchar * pw3270_keypad_model_get_label(GObject *model);
  59 +
  60 + typedef enum _keypad_position {
  61 + KEYPAD_POSITION_TOP,
  62 + KEYPAD_POSITION_LEFT,
  63 + KEYPAD_POSITION_BOTTOM,
  64 + KEYPAD_POSITION_RIGHT
  65 + } KEYPAD_POSITION;
  66 +
  67 + KEYPAD_POSITION pw3270_keypad_get_position(GObject *model);
  68 +
  69 + G_END_DECLS
  70 +
  71 +#endif // PW3270_KEYPAD_H_INCLUDED
src/include/pw3270/window.h
@@ -82,6 +82,9 @@ @@ -82,6 +82,9 @@
82 /// @brief Get window settings. 82 /// @brief Get window settings.
83 GSettings * pw3270_application_window_settings_new(void); 83 GSettings * pw3270_application_window_settings_new(void);
84 84
  85 + /// @brief Get window keypads.
  86 + GList * pw3270_application_window_get_keypads(GtkWidget *window);
  87 +
85 G_END_DECLS 88 G_END_DECLS
86 89
87 90
src/main/placeholders.c
@@ -35,14 +35,42 @@ @@ -35,14 +35,42 @@
35 35
36 #include "private.h" 36 #include "private.h"
37 #include <pw3270/application.h> 37 #include <pw3270/application.h>
  38 + #include <pw3270/keypad.h>
38 #include <lib3270.h> 39 #include <lib3270.h>
39 #include <lib3270/log.h> 40 #include <lib3270/log.h>
40 41
41 /*---[ Implement ]----------------------------------------------------------------------------------*/ 42 /*---[ Implement ]----------------------------------------------------------------------------------*/
42 43
43 - void pw3270_load_placeholders(GtkBuilder * builder) { 44 + static GMenu * get_keypad_menu(GApplication *application) {
44 45
45 - GObject * placeholder = gtk_builder_get_object(builder, "font-select-placeholder"); 46 + GList * keypads = pw3270_application_get_keypad_models(application);
  47 +
  48 + if(!keypads)
  49 + return NULL;
  50 +
  51 + GMenu * menu = g_menu_new();
  52 +
  53 + // Create keypad items.
  54 + GList *item;
  55 + for(item = keypads;item;item = g_list_next(item)) {
  56 + GObject * model = G_OBJECT(item->data);
  57 + g_autofree gchar * action_name = g_strconcat("win.keypad.",pw3270_keypad_model_get_name(model),NULL);
  58 + g_menu_append(menu,pw3270_keypad_model_get_label(model),action_name);
  59 + }
  60 +
  61 + return menu;
  62 +
  63 + }
  64 +
  65 + void pw3270_load_placeholders(GApplication *application, GtkBuilder * builder) {
  66 +
  67 + GObject * placeholder;
  68 + size_t ix;
  69 +
  70 + //
  71 + // Load fonts
  72 + //
  73 + placeholder = gtk_builder_get_object(builder, "font-select-placeholder");
46 74
47 if(placeholder && G_IS_MENU(placeholder)) { 75 if(placeholder && G_IS_MENU(placeholder)) {
48 76
@@ -52,7 +80,6 @@ @@ -52,7 +80,6 @@
52 PangoFontFamily **families; 80 PangoFontFamily **families;
53 pango_context_list_families(gdk_pango_context_get_for_screen(gdk_screen_get_default()),&families, &n_families); 81 pango_context_list_families(gdk_pango_context_get_for_screen(gdk_screen_get_default()),&families, &n_families);
54 82
55 - size_t ix;  
56 for(ix=0; ix < (size_t) n_families; ix++) 83 for(ix=0; ix < (size_t) n_families; ix++)
57 { 84 {
58 if(!pango_font_family_is_monospace(families[ix])) 85 if(!pango_font_family_is_monospace(families[ix]))
@@ -66,5 +93,30 @@ @@ -66,5 +93,30 @@
66 93
67 } 94 }
68 95
  96 + //
  97 + // View options
  98 + //
  99 + GMenu * keypad_menu = get_keypad_menu(application);
  100 +
  101 + if(keypad_menu) {
  102 +
  103 + static const gchar * placeholders[] = {
  104 + "view-menu-placeholder",
  105 + "view-when-offline-placeholder",
  106 + "view-when-online-placeholder"
  107 + };
  108 +
  109 + for(ix = 0; ix < G_N_ELEMENTS(placeholders); ix++) {
  110 +
  111 + placeholder = gtk_builder_get_object(builder, placeholders[ix]);
  112 +
  113 + if(placeholder && G_IS_MENU(placeholder)) {
  114 + g_menu_append_item(G_MENU(placeholder), g_menu_item_new_submenu(_("Keypads"),G_MENU_MODEL(keypad_menu)));
  115 + }
  116 +
  117 + }
  118 +
  119 + g_object_unref(keypad_menu);
  120 + }
69 121
70 } 122 }
src/objects/application/application.c
@@ -35,6 +35,7 @@ @@ -35,6 +35,7 @@
35 #include <pw3270.h> 35 #include <pw3270.h>
36 #include <pw3270/application.h> 36 #include <pw3270/application.h>
37 #include <pw3270/actions.h> 37 #include <pw3270/actions.h>
  38 + #include <pw3270/keypad.h>
38 #include <stdlib.h> 39 #include <stdlib.h>
39 40
40 enum { 41 enum {
@@ -54,6 +55,7 @@ @@ -54,6 +55,7 @@
54 GtkApplication parent; 55 GtkApplication parent;
55 56
56 GSettings * settings; 57 GSettings * settings;
  58 + GList * keypads;
57 59
58 GSList * plugins; ///< @brief Handlers of the loaded plugins. 60 GSList * plugins; ///< @brief Handlers of the loaded plugins.
59 61
@@ -331,6 +333,7 @@ @@ -331,6 +333,7 @@
331 application->settings = NULL; 333 application->settings = NULL;
332 } 334 }
333 335
  336 + g_list_free_full(application->keypads,g_object_unref);
334 337
335 G_OBJECT_CLASS(pw3270Application_parent_class)->finalize(object); 338 G_OBJECT_CLASS(pw3270Application_parent_class)->finalize(object);
336 339
@@ -350,6 +353,8 @@ @@ -350,6 +353,8 @@
350 353
351 size_t ix; 354 size_t ix;
352 355
  356 + pw3270Application * app = PW3270_APPLICATION(application);
  357 +
353 G_APPLICATION_CLASS(pw3270Application_parent_class)->startup(application); 358 G_APPLICATION_CLASS(pw3270Application_parent_class)->startup(application);
354 359
355 GAction * actions[] = { 360 GAction * actions[] = {
@@ -379,12 +384,38 @@ @@ -379,12 +384,38 @@
379 } 384 }
380 #endif // DEBUG 385 #endif // DEBUG
381 386
  387 +
  388 + //
  389 + // Load keypad models
  390 + //
  391 + {
  392 +#ifdef DEBUG
  393 + const gchar * keypad_path = "keypad";
  394 +#else
  395 + lib3270_autoptr(char) keypad_path = lib3270_build_data_filename("keypad",NULL);
  396 +#endif // DEBUG
  397 +
  398 + g_autoptr(GError) error = NULL;
  399 + g_autoptr(GDir) dir = g_dir_open(keypad_path,0,&error);
  400 +
  401 + const gchar *name = g_dir_read_name(dir);
  402 + while(!error && name) {
  403 + g_autofree gchar * path = g_build_filename(keypad_path,name,NULL);
  404 + app->keypads = pw3270_keypad_model_new_from_xml(app->keypads,path);
  405 + name = g_dir_read_name(dir);
  406 + }
  407 +
  408 + if(error) {
  409 + g_message("Can't read %s: %s",keypad_path,error->message);
  410 + }
  411 + }
  412 +
382 if(gtk_application_prefers_app_menu(GTK_APPLICATION(application))) 413 if(gtk_application_prefers_app_menu(GTK_APPLICATION(application)))
383 gtk_application_set_app_menu(GTK_APPLICATION (application), G_MENU_MODEL(gtk_builder_get_object (builder, "app-menu"))); 414 gtk_application_set_app_menu(GTK_APPLICATION (application), G_MENU_MODEL(gtk_builder_get_object (builder, "app-menu")));
384 415
385 gtk_application_set_menubar(GTK_APPLICATION (application), G_MENU_MODEL(gtk_builder_get_object (builder, "menubar"))); 416 gtk_application_set_menubar(GTK_APPLICATION (application), G_MENU_MODEL(gtk_builder_get_object (builder, "menubar")));
386 417
387 - pw3270_load_placeholders(builder); 418 + pw3270_load_placeholders(application, builder);
388 419
389 g_object_unref(builder); 420 g_object_unref(builder);
390 421
@@ -475,12 +506,7 @@ @@ -475,12 +506,7 @@
475 return settings; 506 return settings;
476 } 507 }
477 508
478 -  
479 - /*  
480 - void pw3270_application_plugin_foreach(GApplication *app, GFunc func, gpointer user_data) {  
481 -  
482 - g_return_if_fail(PW3270_IS_APPLICATION(app));  
483 - g_slist_foreach(PW3270_APPLICATION(app)->plugins, func, user_data);  
484 - 509 + GList * pw3270_application_get_keypad_models(GApplication *app) {
  510 + g_return_val_if_fail(PW3270_IS_APPLICATION(app),NULL);
  511 + return PW3270_APPLICATION(app)->keypads;
485 } 512 }
486 - */  
src/objects/keypad/attribute.c 0 → 100644
@@ -0,0 +1,139 @@ @@ -0,0 +1,139 @@
  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 + #include "private.h"
  31 + #include <stdlib.h>
  32 +
  33 +/*---[ Globals & Object definition ]----------------------------------------------------------------*/
  34 +
  35 + struct Attribute {
  36 + GObject * object;
  37 + gboolean translatable;
  38 + GParamSpec *spec;
  39 + };
  40 +
  41 +/*---[ Implement ]----------------------------------------------------------------------------------*/
  42 +
  43 +
  44 + static void parse_error (GMarkupParseContext *context, GError *error, gpointer data) {
  45 + g_free(data);
  46 + }
  47 +
  48 + static void parse_text(GMarkupParseContext *context, const gchar *text, gsize text_len, gpointer user_data, GError **error) {
  49 +
  50 + if( ((struct Attribute *) user_data)->translatable ) {
  51 + text = gettext(text);
  52 + }
  53 +
  54 + GParamSpec *spec = ((struct Attribute *) user_data)->spec;
  55 +
  56 + debug("%s=\"%s\"",spec->name,text);
  57 +
  58 + GValue value = G_VALUE_INIT;
  59 + g_value_init(&value,spec->value_type);
  60 +
  61 + switch(spec->value_type) {
  62 + case G_TYPE_STRING:
  63 + g_value_set_string(&value,text);
  64 + break;
  65 +
  66 + case G_TYPE_UINT:
  67 + g_value_set_uint(&value,(unsigned int) atoi(text));
  68 + break;
  69 +
  70 + case G_TYPE_INT:
  71 + g_value_set_int(&value, atoi(text));
  72 + break;
  73 +
  74 + default:
  75 + g_set_error_literal(
  76 + error,
  77 + g_quark_from_static_string("keypad"),
  78 + ENOENT,
  79 + _( "Invalid or unknown property type" )
  80 + );
  81 +
  82 + g_value_unset(&value);
  83 + return;
  84 +
  85 + }
  86 +
  87 + g_object_set_property(((struct Attribute *) user_data)->object,spec->name,&value);
  88 + g_value_unset(&value);
  89 + }
  90 +
  91 + void attribute_element_start(GMarkupParseContext *context,const gchar **names,const gchar **values, GObject *parent, GError **error) {
  92 +
  93 + struct Attribute * data = g_new0(struct Attribute,1);
  94 + const gchar *name;
  95 +
  96 + data->object = parent;
  97 +
  98 + if(!g_markup_collect_attributes(
  99 + "attribute",names,values,error,
  100 + G_MARKUP_COLLECT_BOOLEAN|G_MARKUP_COLLECT_OPTIONAL, "translatable", &data->translatable,
  101 + G_MARKUP_COLLECT_STRING, "name", &name,
  102 + G_MARKUP_COLLECT_INVALID
  103 + )) {
  104 +
  105 + g_free(data);
  106 + return;
  107 +
  108 + }
  109 +
  110 + data->spec = g_object_class_find_property(G_OBJECT_GET_CLASS(parent),name);
  111 + if(!data->spec) {
  112 + g_set_error_literal(
  113 + error,
  114 + g_quark_from_static_string("keypad"),
  115 + ENOENT,
  116 + _( "Invalid or unknown property name" )
  117 + );
  118 + g_free(data);
  119 + return;
  120 + }
  121 +
  122 + static const GMarkupParser parser = {
  123 + NULL,
  124 + NULL,
  125 + parse_text,
  126 + NULL,
  127 + parse_error
  128 + };
  129 +
  130 + g_markup_parse_context_push(context, &parser, data);
  131 +
  132 + }
  133 +
  134 + void attribute_element_end(GMarkupParseContext *context, GObject *parent, GError **error) {
  135 +
  136 + struct Attribute * data = g_markup_parse_context_pop(context);
  137 + g_free(data);
  138 +
  139 + }
src/objects/keypad/element.c 0 → 100644
@@ -0,0 +1,293 @@ @@ -0,0 +1,293 @@
  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 + #include "private.h"
  31 +
  32 +/*---[ Globals & Object definition ]----------------------------------------------------------------*/
  33 +
  34 + enum {
  35 + PROP_NONE,
  36 + PROP_LABEL,
  37 + PROP_ACTION,
  38 + PROP_ICON_NAME,
  39 + PROP_ROW,
  40 + PROP_COL,
  41 + PROP_WIDTH,
  42 + PROP_HEIGHT,
  43 + };
  44 +
  45 + static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
  46 + static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
  47 +
  48 + G_DEFINE_TYPE(KeypadElement, KeypadElement, G_TYPE_OBJECT)
  49 +
  50 +/*---[ Implement ]----------------------------------------------------------------------------------*/
  51 +
  52 + static void finalize(GObject *object) {
  53 +
  54 + KeypadElement * element = PW_KEYPAD_ELEMENT(object);
  55 +
  56 + if(element->icon_name) {
  57 + g_free(element->icon_name);
  58 + element->icon_name = NULL;
  59 + }
  60 +
  61 + if(element->label) {
  62 + g_free(element->label);
  63 + element->label = NULL;
  64 + }
  65 +
  66 + if(element->action) {
  67 + g_free(element->action);
  68 + element->action = NULL;
  69 + }
  70 +
  71 + }
  72 +
  73 + static void KeypadElement_class_init(KeypadElementClass *klass) {
  74 +
  75 + GObjectClass *object_class = G_OBJECT_CLASS(klass);
  76 +
  77 + object_class->finalize = finalize;
  78 + object_class->get_property = get_property;
  79 + object_class->set_property = set_property;
  80 +
  81 + // Install properties
  82 + g_object_class_install_property(object_class, PROP_ICON_NAME,
  83 + g_param_spec_string (
  84 + I_("icon-name"),
  85 + I_("icon-name"),
  86 + N_("The name of the icon"),
  87 + NULL,
  88 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  89 + )
  90 + );
  91 +
  92 + g_object_class_install_property(object_class, PROP_ACTION,
  93 + g_param_spec_string (
  94 + I_("action"),
  95 + I_("action"),
  96 + N_("The name of associated action"),
  97 + NULL,
  98 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  99 + )
  100 + );
  101 +
  102 + g_object_class_install_property(object_class, PROP_LABEL,
  103 + g_param_spec_string (
  104 + I_("label"),
  105 + I_("label"),
  106 + N_("The Label of the keypad"),
  107 + NULL,
  108 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  109 + )
  110 + );
  111 +
  112 + g_object_class_install_property(object_class, PROP_WIDTH,
  113 + g_param_spec_uint(
  114 + I_("row"),
  115 + I_("width"),
  116 + _("Element row"),
  117 + 1,
  118 + 10,
  119 + 3,
  120 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  121 + )
  122 + );
  123 +
  124 + g_object_class_install_property(object_class, PROP_WIDTH,
  125 + g_param_spec_uint(
  126 + I_("col"),
  127 + I_("width"),
  128 + _("Element col"),
  129 + 1,
  130 + 10,
  131 + 3,
  132 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  133 + )
  134 + );
  135 +
  136 + g_object_class_install_property(object_class, PROP_WIDTH,
  137 + g_param_spec_uint(
  138 + I_("width"),
  139 + I_("width"),
  140 + _("Element width in columns"),
  141 + 1,
  142 + 10,
  143 + 3,
  144 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  145 + )
  146 + );
  147 +
  148 + g_object_class_install_property(object_class, PROP_HEIGHT,
  149 + g_param_spec_uint(
  150 + I_("height"),
  151 + I_("height"),
  152 + _("Element height in rows"),
  153 + 0,
  154 + 100,
  155 + 0,
  156 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  157 + )
  158 + );
  159 +
  160 + }
  161 +
  162 + static void KeypadElement_init(KeypadElement *object) {
  163 +
  164 +
  165 + }
  166 +
  167 + static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) {
  168 +
  169 + KeypadElement * element = PW_KEYPAD_ELEMENT(object);
  170 +
  171 + switch (prop_id) {
  172 + case PROP_LABEL:
  173 + g_value_set_string(value, element->label);
  174 + break;
  175 +
  176 + case PROP_ICON_NAME:
  177 + g_value_set_string(value, element->icon_name);
  178 + break;
  179 +
  180 + case PROP_ACTION:
  181 + g_value_set_string(value, element->action);
  182 + break;
  183 +
  184 + case PROP_ROW:
  185 + g_value_set_uint(value, element->row);
  186 + break;
  187 +
  188 + case PROP_COL:
  189 + g_value_set_uint(value, element->col);
  190 + break;
  191 +
  192 + case PROP_HEIGHT:
  193 + g_value_set_uint(value, element->height);
  194 + break;
  195 +
  196 + case PROP_WIDTH:
  197 + g_value_set_uint(value, element->width);
  198 + break;
  199 +
  200 + default:
  201 + g_assert_not_reached ();
  202 + }
  203 +
  204 + }
  205 +
  206 + static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) {
  207 +
  208 + KeypadElement * element = PW_KEYPAD_ELEMENT(object);
  209 +
  210 + switch (prop_id) {
  211 + case PROP_LABEL:
  212 +
  213 + if(element->label) {
  214 + g_free(element->label);
  215 + }
  216 + element->label = g_value_dup_string(value);
  217 + break;
  218 +
  219 + case PROP_ICON_NAME:
  220 +
  221 + if(element->icon_name) {
  222 + g_free(element->icon_name);
  223 + }
  224 + element->icon_name = g_value_dup_string(value);
  225 + break;
  226 +
  227 + case PROP_ACTION:
  228 +
  229 + if(element->action) {
  230 + g_free(element->action);
  231 + }
  232 + element->action = g_value_dup_string(value);
  233 + break;
  234 +
  235 + case PROP_ROW:
  236 + element->row = (unsigned short) g_value_get_uint(value);
  237 + break;
  238 +
  239 + case PROP_COL:
  240 + element->col = (unsigned short) g_value_get_uint(value);
  241 + break;
  242 +
  243 + case PROP_HEIGHT:
  244 + element->height = (unsigned short) g_value_get_uint(value);
  245 + break;
  246 +
  247 + case PROP_WIDTH:
  248 + element->width = (unsigned short) g_value_get_uint(value);
  249 + break;
  250 +
  251 + default:
  252 + g_assert_not_reached();
  253 + }
  254 + }
  255 +
  256 + static void element_start(GMarkupParseContext *context, const gchar *element_name, const gchar **names,const gchar **values, GObject *element, GError **error) {
  257 +
  258 + if(!g_ascii_strcasecmp(element_name,"attribute")) {
  259 + attribute_element_start(context,names,values,element,error);
  260 + return;
  261 + }
  262 +
  263 + debug("%s(%s)",__FUNCTION__,element_name);
  264 +
  265 + }
  266 +
  267 + static void element_end(GMarkupParseContext *context, const gchar *element_name, GObject *element, GError **error) {
  268 +
  269 + if(!g_ascii_strcasecmp(element_name,"attribute")) {
  270 + attribute_element_end(context,element,error);
  271 + return;
  272 + }
  273 +
  274 + debug("%s(%s)",__FUNCTION__,element_name);
  275 +
  276 + }
  277 +
  278 + void keypad_model_element_parse_context(GObject *element, GMarkupParseContext *context) {
  279 +
  280 + static const GMarkupParser parser = {
  281 + (void (*)(GMarkupParseContext *, const gchar *, const gchar **, const gchar **, gpointer, GError **))
  282 + element_start,
  283 +
  284 + (void (*)(GMarkupParseContext *, const gchar *, gpointer, GError **))
  285 + element_end,
  286 + NULL,
  287 + NULL,
  288 + NULL
  289 + };
  290 +
  291 + g_markup_parse_context_push(context, &parser, element);
  292 +
  293 + }
src/objects/keypad/keypad.cbp 0 → 100644
@@ -0,0 +1,63 @@ @@ -0,0 +1,63 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
  2 +<CodeBlocks_project_file>
  3 + <FileVersion major="1" minor="6" />
  4 + <Project>
  5 + <Option title="PW3270 Keypad module" />
  6 + <Option pch_mode="2" />
  7 + <Option compiler="gcc" />
  8 + <Build>
  9 + <Target title="Debug">
  10 + <Option output=".bin/Debug/PW3270 Keypad module" prefix_auto="1" extension_auto="1" />
  11 + <Option object_output=".obj/Debug/" />
  12 + <Option type="1" />
  13 + <Option compiler="gcc" />
  14 + <Compiler>
  15 + <Add option="-g" />
  16 + <Add option="-DDEBUG=1" />
  17 + </Compiler>
  18 + </Target>
  19 + <Target title="Release">
  20 + <Option output=".bin/Release/PW3270 Keypad module" prefix_auto="1" extension_auto="1" />
  21 + <Option object_output=".obj/Release/" />
  22 + <Option type="1" />
  23 + <Option compiler="gcc" />
  24 + <Compiler>
  25 + <Add option="-O2" />
  26 + <Add option="-DNDEBUG=1" />
  27 + </Compiler>
  28 + <Linker>
  29 + <Add option="-s" />
  30 + </Linker>
  31 + </Target>
  32 + </Build>
  33 + <Compiler>
  34 + <Add option="-Wall" />
  35 + <Add option="`pkg-config --cflags libv3270 gtk+-3.0`" />
  36 + <Add directory="../../include" />
  37 + </Compiler>
  38 + <Linker>
  39 + <Add option="`pkg-config --libs libv3270 gtk+-3.0`" />
  40 + </Linker>
  41 + <Unit filename="../../include/pw3270/keypad.h" />
  42 + <Unit filename="attribute.c">
  43 + <Option compilerVar="CC" />
  44 + </Unit>
  45 + <Unit filename="element.c">
  46 + <Option compilerVar="CC" />
  47 + </Unit>
  48 + <Unit filename="keypad.c">
  49 + <Option compilerVar="CC" />
  50 + </Unit>
  51 + <Unit filename="load.c">
  52 + <Option compilerVar="CC" />
  53 + </Unit>
  54 + <Unit filename="private.h" />
  55 + <Unit filename="testprogram/testprogram.c">
  56 + <Option compilerVar="CC" />
  57 + </Unit>
  58 + <Unit filename="widget.c">
  59 + <Option compilerVar="CC" />
  60 + </Unit>
  61 + <Extensions />
  62 + </Project>
  63 +</CodeBlocks_project_file>
src/objects/keypad/keypad.xml 0 → 100644
@@ -0,0 +1,182 @@ @@ -0,0 +1,182 @@
  1 +<!-----------------------------------------------------------------------------
  2 +
  3 + "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
  4 + (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
  5 + aplicativos mainframe. Registro no INPI sob o nome G3270.
  6 +
  7 + Copyright (C) <2008> <Banco do Brasil S.A.>
  8 +
  9 + Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  10 + os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  11 + Free Software Foundation.
  12 +
  13 + Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  14 + GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  15 + A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  16 + obter mais detalhes.
  17 +
  18 + Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  19 + programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
  20 + Place, Suite 330, Boston, MA, 02111-1307, USA
  21 +
  22 + Contatos:
  23 +
  24 + perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  25 + erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  26 +
  27 +------------------------------------------------------------------------------>
  28 +
  29 +<ui>
  30 +
  31 + <keypad name="lateral_keypad" position="right" width='6'>
  32 +
  33 + <attribute name='label' translatable='yes'>Lateral keypad</attribute>
  34 +
  35 + <button width='2'>
  36 + <attribute name="label" translatable="no">PF1</attribute>
  37 + <attribute name="action"></attribute>
  38 + </button>
  39 +
  40 + <button width='2'>
  41 + <attribute name="label" translatable="no">PF2</attribute>
  42 + <attribute name="action"></attribute>
  43 + </button>
  44 +
  45 + <button width='2'>
  46 + <attribute name="label" translatable="no">PF3</attribute>
  47 + <attribute name="action"></attribute>
  48 + </button>
  49 +
  50 + <button width='2'>
  51 + <attribute name="label" translatable="no">PF4</attribute>
  52 + <attribute name="action"></attribute>
  53 + </button>
  54 +
  55 + <button width='2'>
  56 + <attribute name="label" translatable="no">PF5</attribute>
  57 + <attribute name="action"></attribute>
  58 + </button>
  59 +
  60 + <button width='2'>
  61 + <attribute name="label" translatable="no">PF6</attribute>
  62 + <attribute name="action"></attribute>
  63 + </button>
  64 +
  65 + <button width='2'>
  66 + <attribute name="label" translatable="no">PF7</attribute>
  67 + <attribute name="action"></attribute>
  68 + </button>
  69 +
  70 + <button width='2'>
  71 + <attribute name="label" translatable="no">PF8</attribute>
  72 + <attribute name="action"></attribute>
  73 + </button>
  74 +
  75 + <button width='2'>
  76 + <attribute name="label" translatable="no">PF9</attribute>
  77 + <attribute name="action"></attribute>
  78 + </button>
  79 +
  80 + <button width='2'>
  81 + <attribute name="label" translatable="no">PF10</attribute>
  82 + <attribute name="action"></attribute>
  83 + </button>
  84 +
  85 + <button width='2'>
  86 + <attribute name="label" translatable="no">PF11</attribute>
  87 + <attribute name="action"></attribute>
  88 + </button>
  89 +
  90 + <button width='2'>
  91 + <attribute name="label" translatable="no">PF12</attribute>
  92 + <attribute name="action"></attribute>
  93 + </button>
  94 +
  95 + <button column='2' width='2'>
  96 + <attribute name="icon-name" translatable="no">gtk-go-up</attribute>
  97 + <attribute name="action"></attribute>
  98 + </button>
  99 +
  100 + <button column='0' width='2'>
  101 + <attribute name="icon-name" translatable="no">gtk-go-back</attribute>
  102 + <attribute name="action"></attribute>
  103 + </button>
  104 +
  105 + <button width='2'>
  106 + <attribute name="icon-name" translatable="no">gtk-goto-top</attribute>
  107 + <attribute name="action"></attribute>
  108 + </button>
  109 +
  110 + <button width='2'>
  111 + <attribute name="icon-name" translatable="no">gtk-go-forward</attribute>
  112 + <attribute name="action"></attribute>
  113 + </button>
  114 +
  115 + <button column='2' width='2'>
  116 + <attribute name="icon-name" translatable="no">gtk-go-down</attribute>
  117 + <attribute name="action"></attribute>
  118 + </button>
  119 +
  120 + <button width='2' column='0'>
  121 + <attribute name="label" translatable="no">PA1</attribute>
  122 + <attribute name="action"></attribute>
  123 + </button>
  124 +
  125 + <button width='2'>
  126 + <attribute name="label" translatable="no">PA2</attribute>
  127 + <attribute name="action"></attribute>
  128 + </button>
  129 +
  130 + <button width='2'>
  131 + <attribute name="label" translatable="no">PA3</attribute>
  132 + <attribute name="action"></attribute>
  133 + </button>
  134 +
  135 + <button width='3'>
  136 + <attribute name="icon-name" translatable="no">go-first</attribute>
  137 + <attribute name="action"></attribute>
  138 + </button>
  139 +
  140 + <button width='3'>
  141 + <attribute name="icon-name" translatable="no">go-last</attribute>
  142 + <attribute name="action"></attribute>
  143 + </button>
  144 +
  145 + <button width='3'>
  146 + <attribute name="label" translatable="Yes">Clear</attribute>
  147 + <attribute name="action"></attribute>
  148 + </button>
  149 +
  150 + <button width='3'>
  151 + <attribute name="label" translatable="Yes">Reset</attribute>
  152 + <attribute name="action"></attribute>
  153 + </button>
  154 +
  155 + <button width='3'>
  156 + <attribute name="label" translatable="Yes">Erase\nEOF</attribute>
  157 + <attribute name="action"></attribute>
  158 + </button>
  159 +
  160 + <button width='3'>
  161 + <attribute name="label" translatable="Yes">Erase\nInput</attribute>
  162 + <attribute name="action"></attribute>
  163 + </button>
  164 +
  165 + <button width='3'>
  166 + <attribute name="label" translatable="Yes">Attn</attribute>
  167 + <attribute name="action"></attribute>
  168 + </button>
  169 +
  170 + <button width='3'>
  171 + <attribute name="label" translatable="Yes">Break</attribute>
  172 + <attribute name="action"></attribute>
  173 + </button>
  174 +
  175 + <button width='6'>
  176 + <attribute name="icon-name" translatable="no">gtk-ok</attribute>
  177 + <attribute name="action"></attribute>
  178 + </button>
  179 +
  180 + </keypad>
  181 +
  182 +</ui>
src/objects/keypad/load.c 0 → 100644
@@ -0,0 +1,130 @@ @@ -0,0 +1,130 @@
  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 + #include "private.h"
  31 + #include <stdlib.h>
  32 +
  33 +/*---[ Implement ]----------------------------------------------------------------------------------*/
  34 +
  35 + static void element_start(GMarkupParseContext *context, const gchar *element_name, const gchar **names,const gchar **values, GList **keypads, GError **error) {
  36 +
  37 + if(!g_ascii_strcasecmp(element_name,"keypad")) {
  38 +
  39 + const gchar *name, *label, *position, *width, *height;
  40 + GObject * keypad = g_object_new(PW_TYPE_KEYPAD_MODEL,NULL);
  41 +
  42 + if(!g_markup_collect_attributes(
  43 + element_name,names,values,error,
  44 + G_MARKUP_COLLECT_STRING, "name", &name,
  45 + G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "label", &label,
  46 + G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "position", &position,
  47 + G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "width", &width,
  48 + G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "height", &height,
  49 + G_MARKUP_COLLECT_INVALID
  50 + )) {
  51 +
  52 + g_object_unref(keypad);
  53 + return;
  54 +
  55 + }
  56 +
  57 + *keypads = g_list_append(*keypads,keypad);
  58 +
  59 + keypad_model_set_position(keypad,position);
  60 +
  61 + if(name) {
  62 + PW_KEYPAD_MODEL(keypad)->name = g_strdup(name);
  63 + }
  64 +
  65 + if(label) {
  66 + PW_KEYPAD_MODEL(keypad)->label = g_strdup(label);
  67 + }
  68 +
  69 + if(width) {
  70 + PW_KEYPAD_MODEL(keypad)->width = (unsigned short) atoi(width);
  71 + }
  72 +
  73 + if(height) {
  74 + PW_KEYPAD_MODEL(keypad)->height = (unsigned short) atoi(height);
  75 + }
  76 +
  77 + keypad_model_parse_context(keypad,context);
  78 +
  79 + }
  80 +
  81 + debug("%s(%s)",__FUNCTION__,element_name);
  82 +
  83 + }
  84 +
  85 + static void element_end(GMarkupParseContext *context, const gchar *element_name, GList **keypads, GError **error) {
  86 +
  87 + debug("%s(%s)",__FUNCTION__,element_name);
  88 +
  89 + if(!g_ascii_strcasecmp(element_name,"keypad")) {
  90 + g_markup_parse_context_pop(context);
  91 + }
  92 +
  93 + }
  94 +
  95 + GList * pw3270_keypad_model_new_from_xml(GList *keypads, const gchar *filename) {
  96 +
  97 + GError * error = NULL;
  98 + g_autofree gchar *text = NULL;
  99 +
  100 + if(g_file_get_contents(filename,&text,NULL,&error)) {
  101 +
  102 + g_message("Loading keypad from %s",filename);
  103 +
  104 + static const GMarkupParser parser = {
  105 + (void (*)(GMarkupParseContext *, const gchar *, const gchar **, const gchar **, gpointer, GError **))
  106 + element_start,
  107 +
  108 + (void (*)(GMarkupParseContext *, const gchar *, gpointer, GError **))
  109 + element_end,
  110 + NULL,
  111 + NULL,
  112 + NULL
  113 + };
  114 +
  115 + GMarkupParseContext * context = g_markup_parse_context_new(&parser,G_MARKUP_TREAT_CDATA_AS_TEXT,&keypads,NULL);
  116 + g_markup_parse_context_parse(context,text,strlen(text),&error);
  117 + g_markup_parse_context_free(context);
  118 + }
  119 +
  120 + if(error) {
  121 +
  122 + // TODO: Popup error message.
  123 + g_message("%s",error->message);
  124 + g_error_free(error);
  125 + error = NULL;
  126 + }
  127 +
  128 + return keypads;
  129 +
  130 + }
src/objects/keypad/model.c 0 → 100644
@@ -0,0 +1,363 @@ @@ -0,0 +1,363 @@
  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 + #include "private.h"
  31 + #include <stdlib.h>
  32 +
  33 +/*---[ Globals & Object definition ]----------------------------------------------------------------*/
  34 +
  35 + enum {
  36 + PROP_NONE,
  37 + PROP_NAME,
  38 + PROP_LABEL,
  39 + PROP_POSITION,
  40 + PROP_WIDTH,
  41 + PROP_HEIGHT,
  42 + };
  43 +
  44 + static const char * positions[] = {
  45 + "top",
  46 + "left",
  47 + "bottom",
  48 + "right"
  49 + };
  50 +
  51 + static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
  52 + static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
  53 +
  54 + G_DEFINE_TYPE(KeypadModel, KeypadModel, G_TYPE_OBJECT)
  55 +
  56 +/*---[ Implement ]----------------------------------------------------------------------------------*/
  57 +
  58 + static void finalize(GObject *object) {
  59 +
  60 + KeypadModel * model = PW_KEYPAD_MODEL(object);
  61 +
  62 + if(model->elements) {
  63 + g_list_free_full(model->elements,g_object_unref);
  64 + model->elements = NULL;
  65 + }
  66 +
  67 + if(model->name) {
  68 + g_free(model->name);
  69 + model->name = NULL;
  70 + }
  71 +
  72 + if(model->label) {
  73 + g_free(model->label);
  74 + model->label = NULL;
  75 + }
  76 +
  77 + }
  78 +
  79 + static void KeypadModel_class_init(KeypadModelClass *klass) {
  80 +
  81 + GObjectClass *object_class = G_OBJECT_CLASS(klass);
  82 +
  83 + klass->domain = g_quark_from_static_string("keypad");
  84 +
  85 + object_class->finalize = finalize;
  86 + object_class->get_property = get_property;
  87 + object_class->set_property = set_property;
  88 +
  89 + // Install properties
  90 + g_object_class_install_property(object_class, PROP_NAME,
  91 + g_param_spec_string (
  92 + I_("name"),
  93 + N_("Keypad Name"),
  94 + N_("The name used to identify the keypad"),
  95 + NULL,
  96 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  97 + )
  98 + );
  99 +
  100 + g_object_class_install_property(object_class, PROP_LABEL,
  101 + g_param_spec_string (
  102 + _("label"),
  103 + N_("Keypad Label"),
  104 + N_("The Label of the keypad"),
  105 + NULL,
  106 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  107 + )
  108 + );
  109 +
  110 + g_object_class_install_property(object_class, PROP_POSITION,
  111 + g_param_spec_string (
  112 + I_("position"),
  113 + I_("position"),
  114 + N_("The position of the keypad"),
  115 + NULL,
  116 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  117 + )
  118 + );
  119 +
  120 + g_object_class_install_property(object_class, PROP_WIDTH,
  121 + g_param_spec_uint(
  122 + I_("width"),
  123 + I_("width"),
  124 + _("Keypad width in columns"),
  125 + 1,
  126 + 10,
  127 + 3,
  128 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  129 + )
  130 + );
  131 +
  132 + g_object_class_install_property(object_class, PROP_WIDTH,
  133 + g_param_spec_uint(
  134 + I_("height"),
  135 + I_("height"),
  136 + _("Keypad height in rows"),
  137 + 0,
  138 + 100,
  139 + 0,
  140 + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE
  141 + )
  142 + );
  143 + }
  144 +
  145 + static void KeypadModel_init(KeypadModel *object) {
  146 +
  147 + object->position = (unsigned short) KEYPAD_POSITION_BOTTOM;
  148 +
  149 + }
  150 +
  151 + static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec G_GNUC_UNUSED(*pspec)) {
  152 +
  153 + KeypadModel * model = PW_KEYPAD_MODEL(object);
  154 +
  155 + switch (prop_id) {
  156 + case PROP_NAME:
  157 + g_value_set_string(value, model->name);
  158 + break;
  159 +
  160 + case PROP_LABEL:
  161 + g_value_set_string(value, model->label);
  162 + break;
  163 +
  164 + case PROP_POSITION:
  165 + g_value_set_static_string(value,keypad_model_get_position(object));
  166 + break;
  167 +
  168 + case PROP_HEIGHT:
  169 + g_value_set_uint(value, model->height);
  170 + break;
  171 +
  172 + case PROP_WIDTH:
  173 + g_value_set_uint(value, model->width);
  174 + break;
  175 +
  176 + default:
  177 + g_assert_not_reached ();
  178 + }
  179 +
  180 + }
  181 +
  182 + static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec G_GNUC_UNUSED(*pspec)) {
  183 +
  184 + KeypadModel * model = PW_KEYPAD_MODEL(object);
  185 +
  186 + switch (prop_id) {
  187 + case PROP_NAME:
  188 +
  189 + if(model->name) {
  190 + g_free(model->name);
  191 + }
  192 + model->name = g_value_dup_string(value);
  193 + break;
  194 +
  195 + case PROP_LABEL:
  196 +
  197 + if(model->label) {
  198 + g_free(model->label);
  199 + }
  200 + model->label = g_value_dup_string(value);
  201 + break;
  202 +
  203 + case PROP_POSITION:
  204 + keypad_model_set_position(object,g_value_get_string(value));
  205 + break;
  206 +
  207 + case PROP_HEIGHT:
  208 + model->height = (unsigned short) g_value_get_uint(value);
  209 + break;
  210 +
  211 + case PROP_WIDTH:
  212 + model->width = (unsigned short) g_value_get_uint(value);
  213 + break;
  214 +
  215 + default:
  216 + g_assert_not_reached();
  217 + }
  218 + }
  219 +
  220 + void keypad_model_set_position(GObject *model, const gchar *position) {
  221 +
  222 + if(position) {
  223 + size_t ix;
  224 + for(ix = 0; ix < G_N_ELEMENTS(positions); ix++) {
  225 + if(!g_ascii_strcasecmp(positions[ix],position)) {
  226 + PW_KEYPAD_MODEL(model)->position = (unsigned short) ix;
  227 + break;
  228 + }
  229 + }
  230 + }
  231 +
  232 + }
  233 +
  234 + const gchar * keypad_model_get_position(GObject *model) {
  235 +
  236 + size_t ix = (size_t) PW_KEYPAD_MODEL(model)->position;
  237 +
  238 + if(ix < G_N_ELEMENTS(positions))
  239 + return positions[ix];
  240 +
  241 + return "undefined";
  242 + }
  243 +
  244 + static void element_start(GMarkupParseContext *context, const gchar *element_name, const gchar **names,const gchar **values, KeypadModel *keypad, GError **error) {
  245 +
  246 + debug("%s(%s)",__FUNCTION__,element_name);
  247 +
  248 + if(!g_ascii_strcasecmp(element_name,"button")) {
  249 +
  250 + const gchar *row, *col, *width, *height;
  251 + KeypadElement * element = PW_KEYPAD_ELEMENT(g_object_new(PW_TYPE_KEYPAD_ELEMENT,NULL));
  252 +
  253 + if(!g_markup_collect_attributes(
  254 + element_name,names,values,error,
  255 + G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "row", &row,
  256 + G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "column", &col,
  257 + G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "width", &width,
  258 + G_MARKUP_COLLECT_STRING|G_MARKUP_COLLECT_OPTIONAL, "height", &height,
  259 + G_MARKUP_COLLECT_INVALID
  260 + )) {
  261 +
  262 + return;
  263 +
  264 + }
  265 +
  266 + if(col) {
  267 + element->col = (unsigned short) atoi(col);
  268 +
  269 + if(element->col < keypad->current.col) {
  270 + keypad->current.row++;
  271 + }
  272 +
  273 + } else {
  274 + element->col = keypad->current.col;
  275 + }
  276 +
  277 + if(row) {
  278 + element->row = (unsigned short) atoi(row);
  279 + } else {
  280 + element->row = keypad->current.row;
  281 + }
  282 +
  283 +
  284 + if(width) {
  285 + element->width = (unsigned short) atoi(width);
  286 + } else {
  287 + element->width = 1;
  288 + }
  289 +
  290 + if(height) {
  291 + element->height = (unsigned short) atoi(height);
  292 + } else {
  293 + element->height = 1;
  294 + }
  295 +
  296 + keypad->elements = g_list_prepend(keypad->elements,element);
  297 + keypad_model_element_parse_context(G_OBJECT(element),context);
  298 +
  299 + } else if(!g_ascii_strcasecmp(element_name,"attribute")) {
  300 + attribute_element_start(context,names,values,G_OBJECT(keypad),error);
  301 + }
  302 +
  303 + }
  304 +
  305 + static void element_end(GMarkupParseContext *context, const gchar *element_name, KeypadModel *keypad, GError G_GNUC_UNUSED(**error)) {
  306 +
  307 + debug("%s(%s)",__FUNCTION__,element_name);
  308 +
  309 + if(!g_ascii_strcasecmp(element_name,"button")) {
  310 + g_markup_parse_context_pop(context);
  311 +
  312 + KeypadElement * element = PW_KEYPAD_ELEMENT(g_list_first(keypad->elements)->data);
  313 +
  314 + keypad->current.row = element->row;
  315 + keypad->current.col = element->col + element->width;
  316 +
  317 + if(keypad->width && keypad->current.col >= keypad->width) {
  318 + keypad->current.col = 0;
  319 + keypad->current.row++;
  320 + }
  321 +
  322 + } else if(!g_ascii_strcasecmp(element_name,"attribute")) {
  323 + attribute_element_end(context,G_OBJECT(keypad),error);
  324 + }
  325 +
  326 + }
  327 +
  328 + void keypad_model_parse_context(GObject *object, GMarkupParseContext *context) {
  329 +
  330 + static const GMarkupParser parser = {
  331 + (void (*)(GMarkupParseContext *, const gchar *, const gchar **, const gchar **, gpointer, GError **))
  332 + element_start,
  333 +
  334 + (void (*)(GMarkupParseContext *, const gchar *, gpointer, GError **))
  335 + element_end,
  336 + NULL,
  337 + NULL,
  338 + NULL
  339 + };
  340 +
  341 + KeypadModel * model = PW_KEYPAD_MODEL(object);
  342 +
  343 + model->elements = g_list_reverse(model->elements);
  344 + g_markup_parse_context_push(context, &parser, model);
  345 + model->elements = g_list_reverse(model->elements);
  346 +
  347 + }
  348 +
  349 + KEYPAD_POSITION pw3270_keypad_get_position(GObject *model) {
  350 + g_return_val_if_fail(PW_IS_KEYPAD_MODEL(model), (KEYPAD_POSITION) -1);
  351 + return (KEYPAD_POSITION) PW_KEYPAD_MODEL(model)->position;
  352 + }
  353 +
  354 + const gchar * pw3270_keypad_model_get_name(GObject *model) {
  355 + g_return_val_if_fail(PW_IS_KEYPAD_MODEL(model), NULL);
  356 + return PW_KEYPAD_MODEL(model)->name;
  357 + }
  358 +
  359 + const gchar * pw3270_keypad_model_get_label(GObject *model) {
  360 + g_return_val_if_fail(PW_IS_KEYPAD_MODEL(model), NULL);
  361 + return PW_KEYPAD_MODEL(model)->label;
  362 + }
  363 +
src/objects/keypad/private.h 0 → 100644
@@ -0,0 +1,119 @@ @@ -0,0 +1,119 @@
  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 +#ifndef PRIVATE_H_INCLUDED
  31 +
  32 + #define PRIVATE_H_INCLUDED
  33 +
  34 + #include <config.h>
  35 +
  36 + #ifndef GETTEXT_PACKAGE
  37 + #define GETTEXT_PACKAGE PACKAGE_NAME
  38 + #endif
  39 +
  40 + #include <libintl.h>
  41 + #include <glib/gi18n.h>
  42 + #include <gtk/gtk.h>
  43 +
  44 + #include <lib3270.h>
  45 + #include <lib3270/log.h>
  46 +
  47 + #include <pw3270/keypad.h>
  48 +
  49 + G_BEGIN_DECLS
  50 +
  51 + #define I_(string) g_intern_static_string (string)
  52 +
  53 + #define PW_TYPE_KEYPAD_ELEMENT (KeypadElement_get_type())
  54 + #define PW_KEYPAD_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PW_TYPE_KEYPAD_ELEMENT, KeypadElement))
  55 + #define PW_KEYPAD_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PW_TYPE_KEYPAD_ELEMENT, KeypadModelClass))
  56 + #define PW_IS_KEYPAD_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PW_TYPE_KEYPAD_ELEMENT))
  57 + #define PW_IS_KEYPAD_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PW_TYPE_KEYPAD_ELEMENT))
  58 + #define PW_KEYPAD_ELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PW_TYPE_KEYPAD_ELEMENT, KeypadElementClass))
  59 +
  60 + typedef struct _KeypadElement {
  61 + GObject parent;
  62 +
  63 + unsigned short row;
  64 + unsigned short col;
  65 + unsigned short width;
  66 + unsigned short height;
  67 +
  68 + gchar * icon_name;
  69 + gchar * label;
  70 + gchar * action;
  71 +
  72 + } KeypadElement;
  73 +
  74 + typedef struct _KeypadElementClass {
  75 + GObjectClass parent;
  76 +
  77 + } KeypadElementClass;
  78 +
  79 + GType KeypadElement_get_type(void) G_GNUC_CONST;
  80 +
  81 + struct _KeypadModel {
  82 + GObject parent;
  83 +
  84 + unsigned short width;
  85 + unsigned short height;
  86 + unsigned short position;
  87 +
  88 + struct {
  89 + unsigned short row;
  90 + unsigned short col;
  91 + } current;
  92 +
  93 + gchar *name;
  94 + gchar *label;
  95 +
  96 + GList *elements;
  97 + GList *widgets;
  98 +
  99 + };
  100 +
  101 + struct _KeypadModelClass {
  102 + GObjectClass parent;
  103 + GQuark domain;
  104 +
  105 + };
  106 +
  107 + G_GNUC_INTERNAL void keypad_model_set_position(GObject *model, const gchar *position);
  108 + G_GNUC_INTERNAL void keypad_model_parse_context(GObject *model, GMarkupParseContext *context);
  109 +
  110 + G_GNUC_INTERNAL const gchar * keypad_model_get_position(GObject *mode);
  111 +
  112 + G_GNUC_INTERNAL void keypad_model_element_parse_context(GObject *element, GMarkupParseContext *context);
  113 +
  114 + G_GNUC_INTERNAL void attribute_element_start(GMarkupParseContext *context,const gchar **names,const gchar **values, GObject *parent, GError **error);
  115 + G_GNUC_INTERNAL void attribute_element_end(GMarkupParseContext *context, GObject *parent, GError **error);
  116 +
  117 + G_END_DECLS
  118 +
  119 +#endif // PRIVATE_H_INCLUDED
src/objects/keypad/testprogram/testprogram.c 0 → 100644
@@ -0,0 +1,90 @@ @@ -0,0 +1,90 @@
  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. Registro no INPI sob
  5 + * o nome G3270.
  6 + *
  7 + * Copyright (C) <2008> <Banco do Brasil S.A.>
  8 + *
  9 + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
  10 + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
  11 + * Free Software Foundation.
  12 + *
  13 + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
  14 + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
  15 + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
  16 + * obter mais detalhes.
  17 + *
  18 + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
  19 + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin
  20 + * St, Fifth Floor, Boston, MA 02110-1301 USA
  21 + *
  22 + * Este programa está nomeado como testprogram.c e possui - linhas de código.
  23 + *
  24 + * Contatos:
  25 + *
  26 + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
  27 + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
  28 + *
  29 + */
  30 +
  31 + /**
  32 + * @brief PW3270 Keypad module test program.
  33 + *
  34 + */
  35 +
  36 + #include <config.h>
  37 + #include <lib3270/properties.h>
  38 + #include <pw3270/keypad.h>
  39 + #include <v3270.h>
  40 + #include <v3270/trace.h>
  41 +
  42 + /*---[ Implement ]----------------------------------------------------------------------------------*/
  43 +
  44 + static void activate(GtkApplication* app, G_GNUC_UNUSED gpointer user_data) {
  45 +
  46 + GtkWidget * window = gtk_application_window_new(app);
  47 +
  48 + // Load keypad
  49 + GList *keypads = pw3270_keypad_model_new_from_xml(NULL,"keypad.xml");
  50 +
  51 + if(!keypads) {
  52 + g_message("No keypad");
  53 + g_application_quit(G_APPLICATION(app));
  54 + }
  55 +
  56 + // Create keypad widget
  57 + GObject * model = G_OBJECT(g_list_first(keypads)->data);
  58 + if(model) {
  59 + gtk_container_add(GTK_CONTAINER(window),pw3270_keypad_get_from_model(model));
  60 + }
  61 +
  62 + // Setup and show main window
  63 + gtk_window_set_title(GTK_WINDOW(window),"PW3270 Keypad test");
  64 + // gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER);
  65 + // gtk_window_set_default_size (GTK_WINDOW (window), 800, 500);
  66 + gtk_widget_show_all(window);
  67 +
  68 + g_list_free_full(keypads,g_object_unref);
  69 +
  70 +}
  71 +
  72 +int main (int argc, char **argv) {
  73 +
  74 + GtkApplication *app;
  75 + int status;
  76 +
  77 + app = gtk_application_new ("br.com.bb.pw3270.keypad",G_APPLICATION_FLAGS_NONE);
  78 +
  79 + g_signal_connect (app, "activate", G_CALLBACK(activate), NULL);
  80 +
  81 + status = g_application_run (G_APPLICATION (app), argc, argv);
  82 + g_object_unref (app);
  83 +
  84 + g_message("rc=%d",status);
  85 +
  86 + return 0;
  87 +
  88 +}
  89 +
  90 +
src/objects/keypad/widget.c 0 → 100644
@@ -0,0 +1,93 @@ @@ -0,0 +1,93 @@
  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 + #include "private.h"
  31 +
  32 +/*---[ Implement ]----------------------------------------------------------------------------------*/
  33 +
  34 + static void create_child(const KeypadElement *element, GtkGrid *grid) {
  35 +
  36 + GtkWidget * button;
  37 +
  38 + if(element->icon_name) {
  39 + button = gtk_button_new_from_icon_name(element->icon_name,GTK_ICON_SIZE_SMALL_TOOLBAR);
  40 + } else if(element->label) {
  41 + g_autofree gchar * label = g_strcompress(element->label);
  42 + button = gtk_button_new_with_label(label);
  43 + } else {
  44 + button = gtk_button_new();
  45 + }
  46 +
  47 + if(element->action && *element->action) {
  48 + gtk_actionable_set_detailed_action_name(GTK_ACTIONABLE(button),element->action);
  49 + }
  50 +
  51 + gtk_button_set_relief(GTK_BUTTON(button),GTK_RELIEF_NORMAL);
  52 + gtk_widget_set_can_focus(button,FALSE);
  53 + gtk_widget_set_can_default(button,FALSE);
  54 + gtk_widget_set_focus_on_click(button,FALSE);
  55 +
  56 + gtk_widget_show_all(button);
  57 +
  58 + gtk_grid_attach(
  59 + grid,
  60 + button,
  61 + element->col,element->row,
  62 + element->width,element->height
  63 + );
  64 +
  65 + }
  66 +
  67 + static void destroy(GtkWidget *grid, KeypadModel * keypad) {
  68 +
  69 + keypad->widgets = g_list_remove(keypad->widgets,grid);
  70 + g_object_unref(keypad);
  71 +
  72 + }
  73 +
  74 + GtkWidget * pw3270_keypad_get_from_model(GObject *model) {
  75 +
  76 + g_return_val_if_fail(PW_IS_KEYPAD_MODEL(model),NULL);
  77 +
  78 + GtkWidget * grid = gtk_grid_new();
  79 + gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
  80 + gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
  81 +
  82 + KeypadModel * keypad = PW_KEYPAD_MODEL(model);
  83 +
  84 + keypad->widgets = g_list_prepend(keypad->widgets,grid);
  85 + g_object_ref_sink(keypad);
  86 + g_signal_connect(G_OBJECT(grid),"destroy", G_CALLBACK(destroy),keypad);
  87 +
  88 + g_list_foreach(keypad->elements,(GFunc) create_child, grid);
  89 +
  90 + gtk_widget_show(grid); // FIX-ME
  91 +
  92 + return grid;
  93 + }
src/objects/window/page.c
@@ -136,7 +136,6 @@ @@ -136,7 +136,6 @@
136 g_signal_connect(G_OBJECT(label), "destroy", G_CALLBACK(label_disconnect),terminal); 136 g_signal_connect(G_OBJECT(label), "destroy", G_CALLBACK(label_disconnect),terminal);
137 137
138 // Setup tab 138 // Setup tab
139 -  
140 GtkWidget * tab = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,2); 139 GtkWidget * tab = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,2);
141 GtkWidget * button = gtk_button_new_from_icon_name("window-close-symbolic",GTK_ICON_SIZE_MENU); 140 GtkWidget * button = gtk_button_new_from_icon_name("window-close-symbolic",GTK_ICON_SIZE_MENU);
142 GtkNotebook * notebook = PW3270_APPLICATION_WINDOW(window)->notebook; 141 GtkNotebook * notebook = PW3270_APPLICATION_WINDOW(window)->notebook;
@@ -155,13 +154,13 @@ @@ -155,13 +154,13 @@
155 154
156 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(close_page), terminal); 155 g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(close_page), terminal);
157 156
158 -  
159 gtk_box_pack_start(GTK_BOX(tab),label,FALSE,FALSE,0); 157 gtk_box_pack_start(GTK_BOX(tab),label,FALSE,FALSE,0);
160 gtk_box_pack_end(GTK_BOX(tab),button,FALSE,FALSE,0); 158 gtk_box_pack_end(GTK_BOX(tab),button,FALSE,FALSE,0);
161 159
162 gtk_widget_show_all(terminal); 160 gtk_widget_show_all(terminal);
163 gtk_widget_show_all(tab); 161 gtk_widget_show_all(tab);
164 162
  163 + // Add page
165 gint page = gtk_notebook_append_page(notebook,terminal,tab); 164 gint page = gtk_notebook_append_page(notebook,terminal,tab);
166 165
167 gtk_notebook_set_tab_detachable(notebook,terminal,TRUE); 166 gtk_notebook_set_tab_detachable(notebook,terminal,TRUE);
src/objects/window/private.h
@@ -65,6 +65,8 @@ @@ -65,6 +65,8 @@
65 GtkNotebook * notebook; 65 GtkNotebook * notebook;
66 GtkToolbar * toolbar; 66 GtkToolbar * toolbar;
67 67
  68 + GList * keypads; ///< @brief Keypads.
  69 +
68 struct { 70 struct {
69 int width; ///< @brief Window width. 71 int width; ///< @brief Window width.
70 int height; ///< @brief Window height. 72 int height; ///< @brief Window height.
src/objects/window/terminal.c
@@ -82,6 +82,29 @@ @@ -82,6 +82,29 @@
82 v3270_to_key_file(terminal,session->key_file,"terminal"); 82 v3270_to_key_file(terminal,session->key_file,"terminal");
83 v3270_accelerator_map_to_key_file(terminal, session->key_file, "accelerators"); 83 v3270_accelerator_map_to_key_file(terminal, session->key_file, "accelerators");
84 84
  85 + /*
  86 + GtkWidget * window = gtk_widget_get_toplevel(terminal);
  87 +
  88 + if(PW3270_IS_APPLICATION_WINDOW(window) && pw3270_application_window_get_active_terminal(window) == terminal) {
  89 +
  90 + debug("%s on active terminal, saving window settings",__FUNCTION__);
  91 + GList * keypad = pw3270_application_window_get_keypads(window);
  92 +
  93 + while(keypad) {
  94 +
  95 + g_key_file_set_boolean(
  96 + session->key_file,
  97 + "keypads",
  98 + gtk_widget_get_name(GTK_WIDGET(keypad->data)),
  99 + gtk_widget_get_visible(GTK_WIDGET(keypad->data))
  100 + );
  101 + keypad = g_list_next(keypad);
  102 +
  103 + }
  104 +
  105 + }
  106 + */
  107 +
85 g_key_file_save_to_file(session->key_file,session->filename,NULL); 108 g_key_file_save_to_file(session->key_file,session->filename,NULL);
86 109
87 } 110 }
@@ -197,10 +220,24 @@ @@ -197,10 +220,24 @@
197 220
198 } 221 }
199 222
  223 + GKeyFile * v3270_get_session_keyfile(GtkWidget *widget) {
  224 +
  225 + g_return_val_if_fail(GTK_IS_V3270(widget),NULL);
  226 +
  227 + const struct SessionDescriptor * descriptor = (const struct SessionDescriptor *) g_object_get_data(G_OBJECT(widget),"session-descriptor");
  228 +
  229 + if(descriptor)
  230 + return descriptor->key_file;
  231 +
  232 + return NULL;
  233 + }
  234 +
200 GtkWidget * pw3270_terminal_new(const gchar *session_file) { 235 GtkWidget * pw3270_terminal_new(const gchar *session_file) {
201 236
202 GtkWidget * terminal = v3270_new(); 237 GtkWidget * terminal = v3270_new();
203 238
  239 + gtk_widget_show_all(terminal);
  240 +
204 struct SessionDescriptor * descriptor = NULL; 241 struct SessionDescriptor * descriptor = NULL;
205 242
206 if(session_file) { 243 if(session_file) {
src/objects/window/window.c
@@ -32,6 +32,8 @@ @@ -32,6 +32,8 @@
32 #include <pw3270/toolbar.h> 32 #include <pw3270/toolbar.h>
33 #include <pw3270/application.h> 33 #include <pw3270/application.h>
34 #include <pw3270/actions.h> 34 #include <pw3270/actions.h>
  35 + #include <pw3270/keypad.h>
  36 + #include <v3270/settings.h>
35 37
36 static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); 38 static void get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
37 static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); 39 static void set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
@@ -69,6 +71,11 @@ @@ -69,6 +71,11 @@
69 g_settings_set_boolean(settings, "is-fullscreen", window->state.is_fullscreen); 71 g_settings_set_boolean(settings, "is-fullscreen", window->state.is_fullscreen);
70 } 72 }
71 73
  74 + if(window->keypads) {
  75 + g_list_free(window->keypads);
  76 + window->keypads = NULL;
  77 + }
  78 +
72 GTK_WIDGET_CLASS(pw3270ApplicationWindow_parent_class)->destroy(widget); 79 GTK_WIDGET_CLASS(pw3270ApplicationWindow_parent_class)->destroy(widget);
73 80
74 } 81 }
@@ -178,6 +185,70 @@ @@ -178,6 +185,70 @@
178 185
179 } 186 }
180 187
  188 + static void save_keypad_state(GtkWidget *keypad, GtkWidget *window, gboolean visible) {
  189 +
  190 + GtkWidget * terminal = pw3270_application_window_get_active_terminal(window);
  191 + if(!terminal)
  192 + return;
  193 +
  194 + GKeyFile * keyfile = v3270_get_session_keyfile(terminal);
  195 + if(!terminal)
  196 + return;
  197 +
  198 + g_key_file_set_boolean(
  199 + keyfile,
  200 + "keypads",
  201 + gtk_widget_get_name(keypad),
  202 + visible
  203 + );
  204 +
  205 + v3270_emit_save_settings(terminal);
  206 +
  207 + }
  208 +
  209 + static void keypad_hide(GtkWidget *keypad, GtkWidget *window) {
  210 + save_keypad_state(keypad,window,FALSE);
  211 + }
  212 +
  213 + static void keypad_show(GtkWidget *keypad, GtkWidget *window) {
  214 + save_keypad_state(keypad,window,TRUE);
  215 + }
  216 +
  217 + static GtkWidget * setup_keypad(pw3270ApplicationWindow *window, GObject * model) {
  218 +
  219 + GtkWidget * widget = pw3270_keypad_get_from_model(model);
  220 +
  221 + if(!widget) {
  222 + return NULL;
  223 + }
  224 +
  225 + window->keypads = g_list_prepend(window->keypads,widget);
  226 +
  227 + const gchar * name = pw3270_keypad_model_get_name(model);
  228 +
  229 + gtk_widget_set_name(widget,name);
  230 +
  231 + g_signal_connect(widget,"hide",G_CALLBACK(keypad_hide),window);
  232 + g_signal_connect(widget,"show",G_CALLBACK(keypad_show),window);
  233 +
  234 + g_autofree gchar * action_name = g_strconcat("keypad.",name,NULL);
  235 +
  236 + GPropertyAction * action =
  237 + g_property_action_new(
  238 + action_name,
  239 + widget,
  240 + "visible"
  241 + );
  242 +
  243 + g_action_map_add_action(
  244 + G_ACTION_MAP(window),
  245 + G_ACTION(action)
  246 + );
  247 +
  248 + return widget;
  249 +
  250 + }
  251 +
181 static void pw3270ApplicationWindow_init(pw3270ApplicationWindow *widget) { 252 static void pw3270ApplicationWindow_init(pw3270ApplicationWindow *widget) {
182 253
183 // Setup defaults 254 // Setup defaults
@@ -187,7 +258,7 @@ @@ -187,7 +258,7 @@
187 widget->state.is_fullscreen = 0; 258 widget->state.is_fullscreen = 0;
188 259
189 // Create contents 260 // Create contents
190 - GtkBox * vBox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL,0)); 261 + GtkBox * container = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL,0));
191 262
192 widget->notebook = GTK_NOTEBOOK(gtk_notebook_new()); 263 widget->notebook = GTK_NOTEBOOK(gtk_notebook_new());
193 gtk_notebook_set_scrollable(widget->notebook,TRUE); 264 gtk_notebook_set_scrollable(widget->notebook,TRUE);
@@ -197,10 +268,9 @@ @@ -197,10 +268,9 @@
197 268
198 { 269 {
199 // Create new tab action widget 270 // Create new tab action widget
200 - //GtkWidget * new_tab = gtk_image_new_from_icon_name("tab-new-symbolic",GTK_ICON_SIZE_LARGE_TOOLBAR);  
201 GtkWidget * new_tab = gtk_button_new_from_icon_name("tab-new-symbolic",GTK_ICON_SIZE_LARGE_TOOLBAR); 271 GtkWidget * new_tab = gtk_button_new_from_icon_name("tab-new-symbolic",GTK_ICON_SIZE_LARGE_TOOLBAR);
202 gtk_button_set_relief(GTK_BUTTON(new_tab),GTK_RELIEF_NONE); 272 gtk_button_set_relief(GTK_BUTTON(new_tab),GTK_RELIEF_NONE);
203 - gtk_actionable_set_action_name(GTK_ACTIONABLE(new_tab),"app.new.tab"); 273 + gtk_actionable_set_action_name(GTK_ACTIONABLE(new_tab),g_intern_static_string("app.new.tab"));
204 274
205 gtk_widget_set_margin_start(new_tab,6); 275 gtk_widget_set_margin_start(new_tab,6);
206 gtk_widget_set_margin_end(new_tab,6); 276 gtk_widget_set_margin_end(new_tab,6);
@@ -212,12 +282,88 @@ @@ -212,12 +282,88 @@
212 gtk_notebook_set_action_widget(widget->notebook,new_tab,GTK_PACK_START); 282 gtk_notebook_set_action_widget(widget->notebook,new_tab,GTK_PACK_START);
213 } 283 }
214 284
215 - widget->toolbar = GTK_TOOLBAR(pw3270_toolbar_new());  
216 - gtk_box_pack_start(vBox,GTK_WIDGET(widget->toolbar),FALSE,TRUE,0);  
217 - gtk_box_pack_start(vBox,GTK_WIDGET(widget->notebook),TRUE,TRUE,0); 285 + widget->toolbar = GTK_TOOLBAR(pw3270_toolbar_new());
  286 + gtk_box_pack_start(container,GTK_WIDGET(widget->toolbar),FALSE,TRUE,0);
  287 +
  288 + //
  289 + // Do we have keypads?
  290 + //
  291 + GList * keypads = pw3270_application_get_keypad_models(g_application_get_default());
  292 + if(keypads) {
  293 +
  294 + GtkBox * hBox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0));
  295 + GtkBox * vBox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_VERTICAL,0));
  296 + GList * keypad;
  297 +
  298 + // Add top Keypads
  299 + for(keypad = keypads;keypad;keypad = g_list_next(keypad)) {
  300 +
  301 + if(pw3270_keypad_get_position(G_OBJECT(keypad->data)) == KEYPAD_POSITION_TOP) {
  302 + gtk_box_pack_start(
  303 + vBox,
  304 + setup_keypad(widget, G_OBJECT(keypad->data)),
  305 + FALSE,FALSE,0
  306 + );
  307 + }
  308 + }
  309 +
  310 +
  311 + // Add left keypads
  312 + for(keypad = keypads;keypad;keypad = g_list_next(keypad)) {
  313 +
  314 + if(pw3270_keypad_get_position(G_OBJECT(keypad->data)) == KEYPAD_POSITION_LEFT) {
  315 + gtk_box_pack_start(
  316 + hBox,
  317 + setup_keypad(widget, G_OBJECT(keypad->data)),
  318 + FALSE,FALSE,0
  319 + );
  320 + }
  321 + }
  322 +
  323 + // Add center notebook
  324 + gtk_box_pack_start(vBox,GTK_WIDGET(widget->notebook),TRUE,TRUE,0);
  325 + gtk_box_pack_start(hBox,GTK_WIDGET(vBox),TRUE,TRUE,0);
  326 +
  327 + // Add bottom keypads
  328 + for(keypad = keypads;keypad;keypad = g_list_next(keypad)) {
  329 +
  330 + if(pw3270_keypad_get_position(G_OBJECT(keypad->data)) == KEYPAD_POSITION_BOTTOM) {
  331 + gtk_box_pack_end(
  332 + vBox,
  333 + setup_keypad(widget, G_OBJECT(keypad->data)),
  334 + FALSE,FALSE,0
  335 + );
  336 + }
  337 + }
  338 +
  339 +
  340 + // Add right keypads
  341 + for(keypad = keypads;keypad;keypad = g_list_next(keypad)) {
  342 +
  343 + if(pw3270_keypad_get_position(G_OBJECT(keypad->data)) == KEYPAD_POSITION_RIGHT) {
  344 + gtk_box_pack_end(
  345 + hBox,
  346 + setup_keypad(widget, G_OBJECT(keypad->data)),
  347 + FALSE,FALSE,0
  348 + );
  349 + }
  350 + }
  351 +
  352 + // Add it to the container
  353 + gtk_widget_show(GTK_WIDGET(hBox));
  354 + gtk_widget_show(GTK_WIDGET(vBox));
  355 + gtk_box_pack_start(container,GTK_WIDGET(hBox),TRUE,TRUE,0);
  356 +
  357 + } else {
  358 +
  359 + gtk_box_pack_start(container,GTK_WIDGET(widget->notebook),TRUE,TRUE,0);
  360 +
  361 + }
  362 +
  363 + gtk_widget_show_all(GTK_WIDGET(widget->notebook));
218 364
219 - gtk_widget_show_all(GTK_WIDGET(vBox));  
220 - gtk_container_add(GTK_CONTAINER(widget),GTK_WIDGET(vBox)); 365 + gtk_widget_show(GTK_WIDGET(container));
  366 + gtk_container_add(GTK_CONTAINER(widget),GTK_WIDGET(container));
221 367
222 // 368 //
223 // Setup tn3270 actions. 369 // Setup tn3270 actions.
@@ -340,6 +486,7 @@ @@ -340,6 +486,7 @@
340 // Get builder 486 // Get builder
341 // 487 //
342 g_autoptr(GtkBuilder) builder = pw3270_application_get_builder("window.xml"); 488 g_autoptr(GtkBuilder) builder = pw3270_application_get_builder("window.xml");
  489 + pw3270_load_placeholders(G_APPLICATION(application), builder);
343 490
344 // Load popup menus. 491 // Load popup menus.
345 const gchar * popup_menus[PW3270_APP_WINDOW_POPUP_COUNT] = { 492 const gchar * popup_menus[PW3270_APP_WINDOW_POPUP_COUNT] = {
@@ -554,6 +701,28 @@ @@ -554,6 +701,28 @@
554 701
555 pw3270_window_set_subtitle(GTK_WIDGET(window), v3270_is_connected(terminal) ? _("Connected to host") : _("Disconnected from host")); 702 pw3270_window_set_subtitle(GTK_WIDGET(window), v3270_is_connected(terminal) ? _("Connected to host") : _("Disconnected from host"));
556 703
  704 + // Setup keypads
  705 + if(window->keypads) {
  706 +
  707 + GKeyFile * keyfile = v3270_get_session_keyfile(terminal);
  708 +
  709 + if(keyfile) {
  710 +
  711 + GList * keypad;
  712 + for(keypad = window->keypads; keypad; keypad = g_list_next(keypad)) {
  713 +
  714 + GtkWidget *kWidget = GTK_WIDGET(keypad->data);
  715 + if(g_key_file_get_boolean(keyfile,"keypads",gtk_widget_get_name(kWidget),NULL)) {
  716 + gtk_widget_show(kWidget);
  717 + } else {
  718 + gtk_widget_hide(kWidget);
  719 + }
  720 + }
  721 +
  722 + }
  723 +
  724 + }
  725 +
557 } else { 726 } else {
558 727
559 terminal = NULL; 728 terminal = NULL;
@@ -641,3 +810,9 @@ @@ -641,3 +810,9 @@
641 810
642 } 811 }
643 812
  813 + GList * pw3270_application_window_get_keypads(GtkWidget *window) {
  814 +
  815 + g_return_val_if_fail(PW3270_IS_APPLICATION_WINDOW(window),NULL);
  816 + return PW3270_APPLICATION_WINDOW(window)->keypads;
  817 +
  818 + }
ui/application.xml
@@ -79,7 +79,6 @@ @@ -79,7 +79,6 @@
79 79
80 </submenu> 80 </submenu>
81 81
82 -  
83 <item> 82 <item>
84 <attribute name="label" translatable="yes">Application preferences</attribute> 83 <attribute name="label" translatable="yes">Application preferences</attribute>
85 <attribute name="action">app.preferences</attribute> 84 <attribute name="action">app.preferences</attribute>
@@ -274,181 +274,191 @@ @@ -274,181 +274,191 @@
274 274
275 <menu id="popup-over-unselected-area"> 275 <menu id="popup-over-unselected-area">
276 276
277 - <submenu>  
278 -  
279 - <attribute name='label' translatable='yes'>_Edit</attribute>  
280 -  
281 - <section>  
282 -  
283 - <item>  
284 - <attribute name="label" translatable="yes">Paste from clipboard</attribute>  
285 - <attribute name="action">win.paste</attribute>  
286 - </item>  
287 -  
288 - <item>  
289 - <attribute name="label" translatable="yes">Paste next</attribute>  
290 - <attribute name="action">win.paste-next</attribute>  
291 - </item>  
292 -  
293 - <item>  
294 - <attribute name="label" translatable="yes">Paste from text file</attribute>  
295 - <attribute name="action">win.paste-file</attribute>  
296 - </item>  
297 -  
298 - </section>  
299 -  
300 - <section>  
301 -  
302 - <item>  
303 - <attribute name="label" translatable="yes">Select all</attribute>  
304 - <attribute name="action">win.select-all</attribute>  
305 - </item>  
306 -  
307 - <item>  
308 - <attribute name="label" translatable="yes">Select Field</attribute>  
309 - <attribute name="action">win.select-field</attribute>  
310 - </item>  
311 -  
312 - <item>  
313 - <attribute name="label" translatable="yes">Reselect</attribute>  
314 - <attribute name="action">win.reselect</attribute>  
315 - </item>  
316 -  
317 - </section>  
318 -  
319 - <section> 277 + <submenu>
320 278
321 - <item>  
322 - <attribute name="label" translatable="yes">Clear</attribute>  
323 - <attribute name="action">win.clear</attribute>  
324 - </item> 279 + <attribute name='label' translatable='yes'>_Edit</attribute>
325 280
326 - <item>  
327 - <attribute name="label" translatable="yes">Erase input</attribute>  
328 - <attribute name="action">win.erase_input</attribute>  
329 - </item> 281 + <section>
330 282
331 <item> 283 <item>
332 - <attribute name="label" translatable="yes">Delete Field</attribute>  
333 - <attribute name="action">win.delete_field</attribute> 284 + <attribute name="label" translatable="yes">Paste from clipboard</attribute>
  285 + <attribute name="action">win.paste</attribute>
334 </item> 286 </item>
335 287
336 <item> 288 <item>
337 - <attribute name="label" translatable="yes">Erase to end of field</attribute>  
338 - <attribute name="action">win.erase_eof</attribute> 289 + <attribute name="label" translatable="yes">Paste next</attribute>
  290 + <attribute name="action">win.paste-next</attribute>
339 </item> 291 </item>
340 292
341 <item> 293 <item>
342 - <attribute name="label" translatable="yes">Erase to end of line</attribute>  
343 - <attribute name="action">win.erase_eol</attribute> 294 + <attribute name="label" translatable="yes">Paste from text file</attribute>
  295 + <attribute name="action">win.paste-file</attribute>
344 </item> 296 </item>
345 297
346 - </section>  
347 -  
348 - </submenu> 298 + </section>
349 299
350 - <item>  
351 - <attribute name="label" translatable="yes">Save screen</attribute>  
352 - <attribute name="action">win.save.screen</attribute>  
353 - </item> 300 + <section>
354 301
355 - <item>  
356 - <attribute name="label" translatable="yes">Print screen</attribute>  
357 - <attribute name="action">win.print.screen</attribute>  
358 - </item> 302 + <item>
  303 + <attribute name="label" translatable="yes">Select all</attribute>
  304 + <attribute name="action">win.select-all</attribute>
  305 + </item>
359 306
360 - <item>  
361 - <attribute name="label" translatable="yes">Send/Receive files</attribute>  
362 - <attribute name="action">win.file.transfer</attribute>  
363 - </item> 307 + <item>
  308 + <attribute name="label" translatable="yes">Select Field</attribute>
  309 + <attribute name="action">win.select-field</attribute>
  310 + </item>
364 311
365 - <submenu> 312 + <item>
  313 + <attribute name="label" translatable="yes">Reselect</attribute>
  314 + <attribute name="action">win.reselect</attribute>
  315 + </item>
366 316
367 - <attribute name='label' translatable='yes'>Options</attribute> 317 + </section>
368 318
369 - <section> 319 + <section>
370 320
371 <item> 321 <item>
372 - <attribute name="label" translatable="yes">Cross hair cursor</attribute>  
373 - <attribute name="action">win.crosshair</attribute> 322 + <attribute name="label" translatable="yes">Clear</attribute>
  323 + <attribute name="action">win.clear</attribute>
374 </item> 324 </item>
375 325
376 <item> 326 <item>
377 - <attribute name="label" translatable="yes">Resize on alternate screen</attribute>  
378 - <attribute name="action">win.altscreen</attribute> 327 + <attribute name="label" translatable="yes">Erase input</attribute>
  328 + <attribute name="action">win.erase_input</attribute>
379 </item> 329 </item>
380 330
381 <item> 331 <item>
382 - <attribute name="label" translatable="yes">Alert sound</attribute>  
383 - <attribute name="action">win.beep</attribute> 332 + <attribute name="label" translatable="yes">Delete Field</attribute>
  333 + <attribute name="action">win.delete_field</attribute>
384 </item> 334 </item>
385 335
386 - </section>  
387 -  
388 <item> 336 <item>
389 - <attribute name="label" translatable="yes">Monocase</attribute>  
390 - <attribute name="action">win.monocase</attribute> 337 + <attribute name="label" translatable="yes">Erase to end of field</attribute>
  338 + <attribute name="action">win.erase_eof</attribute>
391 </item> 339 </item>
392 340
393 <item> 341 <item>
394 - <attribute name="label" translatable="yes">Dynamic font spacing</attribute>  
395 - <attribute name="action">win.dynamic-font-spacing</attribute> 342 + <attribute name="label" translatable="yes">Erase to end of line</attribute>
  343 + <attribute name="action">win.erase_eol</attribute>
396 </item> 344 </item>
  345 +
  346 + </section>
  347 +
  348 + </submenu>
  349 +
  350 + <submenu>
  351 +
  352 + <attribute name='label' translatable='yes'>Options</attribute>
  353 +
  354 + <section>
  355 +
  356 + <item>
  357 + <attribute name="label" translatable="yes">Cross hair cursor</attribute>
  358 + <attribute name="action">win.crosshair</attribute>
  359 + </item>
  360 +
  361 + <item>
  362 + <attribute name="label" translatable="yes">Resize on alternate screen</attribute>
  363 + <attribute name="action">win.altscreen</attribute>
  364 + </item>
  365 +
  366 + <item>
  367 + <attribute name="label" translatable="yes">Alert sound</attribute>
  368 + <attribute name="action">win.beep</attribute>
  369 + </item>
  370 +
  371 + </section>
  372 +
  373 + <item>
  374 + <attribute name="label" translatable="yes">Monocase</attribute>
  375 + <attribute name="action">win.monocase</attribute>
  376 + </item>
  377 +
  378 + <item>
  379 + <attribute name="label" translatable="yes">Dynamic font spacing</attribute>
  380 + <attribute name="action">win.dynamic-font-spacing</attribute>
  381 + </item>
397 382
398 - <section> 383 + <section>
399 384
400 - </section> 385 + <item>
  386 + <attribute name="label" translatable="yes">Smart paste</attribute>
  387 + <attribute name="action">win.smartpaste</attribute>
  388 + </item>
401 389
402 - <section> 390 + <item>
  391 + <attribute name="label" translatable="yes">Paste with left margin</attribute>
  392 + <attribute name="action">win.marginedpaste</attribute>
  393 + </item>
403 394
404 - <item>  
405 - <attribute name="label" translatable="yes">Smart paste</attribute>  
406 - <attribute name="action">win.smartpaste</attribute>  
407 - </item> 395 + <item>
  396 + <attribute name="label" translatable="yes">Blank Fill</attribute>
  397 + <attribute name="action">win.blankfill</attribute>
  398 + </item>
408 399
409 - <item>  
410 - <attribute name="label" translatable="yes">Paste with left margin</attribute>  
411 - <attribute name="action">win.marginedpaste</attribute>  
412 - </item> 400 + </section>
  401 +
  402 + <section>
413 403
414 <item> 404 <item>
415 - <attribute name="label" translatable="yes">Blank Fill</attribute>  
416 - <attribute name="action">win.blankfill</attribute> 405 + <attribute name="label" translatable="yes">Full screen</attribute>
  406 + <attribute name="action">win.fullscreen</attribute>
417 </item> 407 </item>
418 408
419 - </section> 409 + </section>
420 410
421 - <section> 411 + </submenu>
  412 +
  413 + <submenu id="view-when-online-placeholder">
  414 +
  415 + <attribute name='label' translatable='yes'>View</attribute>
422 416
423 <item> 417 <item>
424 - <attribute name="label" translatable="yes">Show toolbar</attribute> 418 + <attribute name="label" translatable="yes">Toolbar</attribute>
425 <attribute name="action">win.toolbar</attribute> 419 <attribute name="action">win.toolbar</attribute>
426 </item> 420 </item>
427 421
428 <item> 422 <item>
429 - <attribute name="label" translatable="yes">Show menu</attribute> 423 + <attribute name="label" translatable="yes">Top menu</attribute>
430 <attribute name="action">win.menubar</attribute> 424 <attribute name="action">win.menubar</attribute>
431 </item> 425 </item>
432 426
  427 + </submenu>
  428 +
  429 + <section>
  430 +
433 <item> 431 <item>
434 - <attribute name="label" translatable="yes">Full screen</attribute>  
435 - <attribute name="action">win.fullscreen</attribute> 432 + <attribute name="label" translatable="yes">Save screen</attribute>
  433 + <attribute name="action">win.save.screen</attribute>
  434 + </item>
  435 +
  436 + <item>
  437 + <attribute name="label" translatable="yes">Print screen</attribute>
  438 + <attribute name="action">win.print.screen</attribute>
  439 + </item>
  440 +
  441 + <item>
  442 + <attribute name="label" translatable="yes">Send/Receive files</attribute>
  443 + <attribute name="action">win.file.transfer</attribute>
436 </item> 444 </item>
437 445
438 </section> 446 </section>
439 447
440 - </submenu> 448 + <section>
441 449
442 - <item>  
443 - <attribute name="label" translatable="yes">Disconnect</attribute>  
444 - <attribute name="action">win.disconnect</attribute>  
445 - </item> 450 + <item>
  451 + <attribute name="label" translatable="yes">Disconnect</attribute>
  452 + <attribute name="action">win.disconnect</attribute>
  453 + </item>
446 454
447 - <item>  
448 - <attribute name="label" translatable="yes">Close window</attribute>  
449 - <attribute name="action">win.close</attribute>  
450 - </item> 455 + <item>
  456 + <attribute name="label" translatable="yes">Close window</attribute>
  457 + <attribute name="action">win.close</attribute>
  458 + </item>
451 459
  460 + </section>
  461 +
452 </menu> 462 </menu>
453 463
454 <menu id="popup-over-oia"> 464 <menu id="popup-over-oia">
@@ -472,73 +482,84 @@ @@ -472,73 +482,84 @@
472 482
473 <menu id="popup-when-offline"> 483 <menu id="popup-when-offline">
474 484
475 - <item>  
476 - <attribute name="label" translatable="yes">_Connect</attribute>  
477 - <attribute name="action">win.connect</attribute>  
478 - </item>  
479 -  
480 - <item>  
481 - <attribute name="label" translatable="yes">Session properties</attribute>  
482 - <attribute name="action">win.session.properties</attribute>  
483 - </item>  
484 -  
485 <submenu> 485 <submenu>
486 486
487 - <attribute name="label" translatable="yes">Screen size</attribute> 487 + <attribute name='label' translatable='yes'>Options</attribute>
488 488
489 <item> 489 <item>
490 - <attribute name="label" translatable="yes">Model 2 - 80x24</attribute>  
491 - <attribute name="action">win.model-number</attribute>  
492 - <attribute name="target">2</attribute>  
493 - </item>  
494 - <item>  
495 - <attribute name="label" translatable="yes">Model 3 - 80x32</attribute>  
496 - <attribute name="action">win.model-number</attribute>  
497 - <attribute name="target">3</attribute>  
498 - </item>  
499 - <item>  
500 - <attribute name="label" translatable="yes">Model 4 - 80x43</attribute>  
501 - <attribute name="action">win.model-number</attribute>  
502 - <attribute name="target">4</attribute> 490 + <attribute name="label" translatable="yes">Dynamic font spacing</attribute>
  491 + <attribute name="action">win.dynamic-font-spacing</attribute>
503 </item> 492 </item>
  493 +
504 <item> 494 <item>
505 - <attribute name="label" translatable="yes">Model 5 - 132x27</attribute>  
506 - <attribute name="action">win.model-number</attribute>  
507 - <attribute name="target">5</attribute> 495 + <attribute name="label" translatable="yes">Full screen</attribute>
  496 + <attribute name="action">win.fullscreen</attribute>
508 </item> 497 </item>
509 498
  499 + <submenu>
  500 +
  501 + <attribute name="label" translatable="yes">Screen size</attribute>
  502 +
  503 + <item>
  504 + <attribute name="label" translatable="yes">Model 2 - 80x24</attribute>
  505 + <attribute name="action">win.model-number</attribute>
  506 + <attribute name="target">2</attribute>
  507 + </item>
  508 + <item>
  509 + <attribute name="label" translatable="yes">Model 3 - 80x32</attribute>
  510 + <attribute name="action">win.model-number</attribute>
  511 + <attribute name="target">3</attribute>
  512 + </item>
  513 + <item>
  514 + <attribute name="label" translatable="yes">Model 4 - 80x43</attribute>
  515 + <attribute name="action">win.model-number</attribute>
  516 + <attribute name="target">4</attribute>
  517 + </item>
  518 + <item>
  519 + <attribute name="label" translatable="yes">Model 5 - 132x27</attribute>
  520 + <attribute name="action">win.model-number</attribute>
  521 + <attribute name="target">5</attribute>
  522 + </item>
  523 +
  524 + </submenu>
  525 +
510 </submenu> 526 </submenu>
511 527
512 - <submenu> 528 + <submenu id="view-when-offline-placeholder">
513 529
514 - <attribute name='label' translatable='yes'>Options</attribute> 530 + <attribute name='label' translatable='yes'>View</attribute>
515 531
516 <item> 532 <item>
517 - <attribute name="label" translatable="yes">Dynamic font spacing</attribute>  
518 - <attribute name="action">win.dynamic-font-spacing</attribute> 533 + <attribute name="label" translatable="yes">Toolbar</attribute>
  534 + <attribute name="action">win.toolbar</attribute>
519 </item> 535 </item>
520 536
521 <item> 537 <item>
522 - <attribute name="label" translatable="yes">Show toolbar</attribute>  
523 - <attribute name="action">win.toolbar</attribute> 538 + <attribute name="label" translatable="yes">Main menu</attribute>
  539 + <attribute name="action">win.menubar</attribute>
524 </item> 540 </item>
525 541
  542 + </submenu>
  543 +
  544 + <section>
  545 +
526 <item> 546 <item>
527 - <attribute name="label" translatable="yes">Show menu</attribute>  
528 - <attribute name="action">win.menubar</attribute> 547 + <attribute name="label" translatable="yes">_Connect</attribute>
  548 + <attribute name="action">win.connect</attribute>
529 </item> 549 </item>
530 550
531 <item> 551 <item>
532 - <attribute name="label" translatable="yes">Full screen</attribute>  
533 - <attribute name="action">win.fullscreen</attribute> 552 + <attribute name="label" translatable="yes">Session properties</attribute>
  553 + <attribute name="action">win.session.properties</attribute>
534 </item> 554 </item>
535 555
536 - </submenu>  
537 556
538 - <item>  
539 - <attribute name="label" translatable="yes">Close window</attribute>  
540 - <attribute name="action">win.close</attribute>  
541 - </item> 557 + <item>
  558 + <attribute name="label" translatable="yes">Close window</attribute>
  559 + <attribute name="action">win.close</attribute>
  560 + </item>
  561 +
  562 + </section>
542 563
543 </menu> 564 </menu>
544 565