Commit 5c269dc4a486ec63e827a2304a8fb36d30baedf8

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

Addin property with the OIA-Timer state.

locale/pt_BR.po
... ... @@ -5,7 +5,7 @@ msgid ""
5 5 msgstr ""
6 6 "Project-Id-Version: pw3270 5.0\n"
7 7 "Report-Msgid-Bugs-To: \n"
8   -"POT-Creation-Date: 2020-07-06 16:11-0300\n"
  8 +"POT-Creation-Date: 2020-07-16 15:51-0300\n"
9 9 "PO-Revision-Date: 2020-07-06 16:12-0300\n"
10 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 11 "Language-Team: Português <>\n"
... ... @@ -59,15 +59,15 @@ msgstr &quot;_Adicionar ao arquivo&quot;
59 59 msgid "About security"
60 60 msgstr "Sobre a segurança"
61 61  
62   -#: src/dialogs/settings/accelerator.c:191
  62 +#: src/dialogs/settings/accelerator.c:196
63 63 msgid "Accelerator"
64 64 msgstr "Atalho"
65 65  
66   -#: src/dialogs/settings/accelerator.c:329
  66 +#: src/dialogs/settings/accelerator.c:334
67 67 msgid "Accelerator is in use"
68 68 msgstr "Atalho está em uso"
69 69  
70   -#: src/dialogs/settings/accelerator.c:240
  70 +#: src/dialogs/settings/accelerator.c:245
71 71 msgid "Accelerators"
72 72 msgstr "Atalhos"
73 73  
... ... @@ -88,7 +88,7 @@ msgstr &quot;Adicionar à cópia&quot;
88 88 msgid "Address or name of the host to connect."
89 89 msgstr "Endereço ou nome do host a conectar."
90 90  
91   -#: src/dialogs/settings/accelerator.c:201
  91 +#: src/dialogs/settings/accelerator.c:206
92 92 msgid "Alternative"
93 93 msgstr "Alternativa"
94 94  
... ... @@ -120,7 +120,7 @@ msgstr &quot;Adiciona seleção na área de transferência&quot;
120 120 msgid "Appends the source file to the destination file."
121 121 msgstr "Adiciona conteúdo do arquivo origem ao final do arquivo destino."
122 122  
123   -#: src/dialogs/settings/accelerator.c:311
  123 +#: src/dialogs/settings/accelerator.c:316
124 124 #, c-format
125 125 msgid "Assign it to action (<b>%s</b>)?"
126 126 msgstr "Associar com a ação (<b>%s</b>)?"
... ... @@ -613,8 +613,8 @@ msgstr &quot;Escopo de mapeamento inválido&quot;
613 613 msgid "Invalid state"
614 614 msgstr "Estado inválido"
615 615  
616   -#: src/dialogs/settings/accelerator.c:145
617   -#: src/dialogs/settings/accelerator.c:239
  616 +#: src/dialogs/settings/accelerator.c:150
  617 +#: src/dialogs/settings/accelerator.c:244
618 618 msgid "Keyboard accelerators"
619 619 msgstr "Atalhos de teclado"
620 620  
... ... @@ -670,7 +670,7 @@ msgstr &quot;Monocromático&quot;
670 670 msgid "Mustard"
671 671 msgstr "Mostarda"
672 672  
673   -#: src/dialogs/settings/accelerator.c:153
  673 +#: src/dialogs/settings/accelerator.c:158
674 674 msgid "Name"
675 675 msgstr "Nome"
676 676  
... ... @@ -950,7 +950,7 @@ msgstr &quot;Formato de registro&quot;
950 950 msgid "Red"
951 951 msgstr "Vermelho"
952 952  
953   -#: src/dialogs/settings/accelerator.c:454
  953 +#: src/dialogs/settings/accelerator.c:459
954 954 msgid "Rejected by action"
955 955 msgstr "Rejeitado pela ação"
956 956  
... ... @@ -1257,7 +1257,7 @@ msgstr &quot;Tipo de situação&quot;
1257 1257 msgid "State of the dynamic font spacing"
1258 1258 msgstr "Estado do espaçamento dinâmico"
1259 1259  
1260   -#: src/dialogs/settings/accelerator.c:171
  1260 +#: src/dialogs/settings/accelerator.c:176
1261 1261 msgid "Summary"
1262 1262 msgstr "Sumário"
1263 1263  
... ... @@ -1304,7 +1304,7 @@ msgstr &quot;&quot;
1304 1304 msgid "The EBCDIC host character set. "
1305 1305 msgstr "A tabela de caracteres EBCDIC."
1306 1306  
1307   -#: src/dialogs/settings/accelerator.c:450
  1307 +#: src/dialogs/settings/accelerator.c:455
1308 1308 #, c-format
1309 1309 msgid "The action \"%s\" can't manage alternative keys"
1310 1310 msgstr "A ação \"%s\" não permite uso de atalho alternativo"
... ... @@ -1389,12 +1389,12 @@ msgstr &quot;Operação de impressão está em andamento&quot;
1389 1389 msgid "The print settings should be stored."
1390 1390 msgstr "Configuração de impressão deve ser armazenada"
1391 1391  
1392   -#: src/dialogs/settings/accelerator.c:304
  1392 +#: src/dialogs/settings/accelerator.c:309
1393 1393 #, c-format
1394 1394 msgid "The selected accelerator is in use by action <b>%s</b> (<b>%s</b>)"
1395 1395 msgstr "O atalho selecionado está em uso pela ação <b>%s</b> (<b>%s</b>)"
1396 1396  
1397   -#: src/dialogs/settings/accelerator.c:324
  1397 +#: src/dialogs/settings/accelerator.c:329
1398 1398 msgid "The selected accelerator is in use by the same action"
1399 1399 msgstr "O atalho selecionado está em uso na mesma ação"
1400 1400  
... ...
src/include/terminal.h
... ... @@ -78,6 +78,7 @@ G_BEGIN_DECLS
78 78 GParamSpec * session_name;
79 79 GParamSpec * trace;
80 80 GParamSpec * has_copy;
  81 + GParamSpec * has_timer;
81 82  
82 83 struct
83 84 {
... ...
src/terminal/drawing/oia.c
... ... @@ -827,6 +827,7 @@ struct timer_info
827 827 static void release_timer(struct timer_info *info)
828 828 {
829 829 info->terminal->timer = NULL;
  830 + g_object_notify_by_pspec(G_OBJECT(info->terminal),GTK_V3270_GET_CLASS(info->terminal)->properties.has_timer);
830 831  
831 832 if(info->terminal->surface)
832 833 {
... ... @@ -1051,6 +1052,8 @@ void v3270_start_timer(GtkWidget *widget)
1051 1052 terminal->timer = g_timeout_source_new(100);
1052 1053 g_source_set_callback(terminal->timer,(GSourceFunc) update_timer, info, (GDestroyNotify) release_timer);
1053 1054  
  1055 + g_object_notify_by_pspec(G_OBJECT(terminal),GTK_V3270_GET_CLASS(widget)->properties.has_timer);
  1056 +
1054 1057 g_source_attach(terminal->timer,NULL);
1055 1058 g_source_unref(terminal->timer);
1056 1059  
... ...
src/terminal/properties/get.c
... ... @@ -146,6 +146,11 @@
146 146 case V3270_PROPERTY_HAS_COPY:
147 147 g_value_set_boolean(value,window->selection.blocks != NULL);
148 148 break;
  149 +
  150 + case V3270_PROPERTY_HAS_TIMER:
  151 + g_value_set_boolean(value,window->timer != NULL);
  152 + break;
  153 +
149 154 default:
150 155 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
151 156  
... ...
src/terminal/properties/init.c
... ... @@ -242,7 +242,6 @@
242 242 klass->properties.settings[V3270_SETTING_SELECTION_OPTIONS]
243 243 );
244 244  
245   -
246 245 klass->properties.has_copy =
247 246 g_param_spec_boolean(
248 247 "has_copy",
... ... @@ -258,6 +257,20 @@
258 257 klass->properties.has_copy
259 258 );
260 259  
  260 + klass->properties.has_timer =
  261 + g_param_spec_boolean(
  262 + "has_timer",
  263 + "has_timer",
  264 + _( "True if the timer indicator is active" ),
  265 + FALSE,
  266 + G_PARAM_READABLE
  267 + );
  268 +
  269 + g_object_class_install_property(
  270 + gobject_class,
  271 + V3270_PROPERTY_HAS_TIMER,
  272 + klass->properties.has_timer
  273 + );
261 274  
262 275 //
263 276 // Create dynamic properties
... ...
src/terminal/properties/private.h
... ... @@ -59,8 +59,9 @@
59 59 V3270_PROPERTY_TERMINAL_COLORS = 10, ///< @brief Terminal colors.
60 60 V3270_PROPERTY_SELECTION_OPTIONS = 11,
61 61 V3270_PROPERTY_HAS_COPY = 12, ///< @brief Terminal has copy.
  62 + V3270_PROPERTY_HAS_TIMER = 13, ///< @brief Timer indicator state.
62 63  
63   - V3270_PROPERTY_DYNAMIC = 13 ///< @brief Id of the first LIB3270 internal property.
  64 + V3270_PROPERTY_DYNAMIC = 14 ///< @brief Id of the first LIB3270 internal property.
64 65 };
65 66  
66 67 G_GNUC_INTERNAL void v3270_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
... ...