Commit 06041c1126c0435c0554cb7af780d0aacf41dbed
1 parent
b3e32ca6
Exists in
master
and in
3 other branches
Fixing "formatted-screen" actions.
Showing
4 changed files
with
16 additions
and
11 deletions
Show diff stats
src/core/actions/table.c
... | ... | @@ -291,7 +291,7 @@ |
291 | 291 | .summary = N_( "Remove selection" ), |
292 | 292 | .activate = lib3270_unselect, |
293 | 293 | |
294 | - .group = LIB3270_ACTION_GROUP_ONLINE, | |
294 | + .group = LIB3270_ACTION_GROUP_SELECTION, | |
295 | 295 | .activatable = lib3270_has_selection |
296 | 296 | }, |
297 | 297 | |
... | ... | @@ -322,7 +322,7 @@ |
322 | 322 | .summary = N_( "Select Field" ), |
323 | 323 | .activate = lib3270_select_field, |
324 | 324 | |
325 | - .group = LIB3270_ACTION_GROUP_ONLINE, | |
325 | + .group = LIB3270_ACTION_GROUP_FORMATTED, | |
326 | 326 | .activatable = lib3270_is_formatted |
327 | 327 | }, |
328 | 328 | |
... | ... | @@ -337,7 +337,7 @@ |
337 | 337 | .summary = N_( "Move the cursor to the first blank after the last nonblank in the field." ), |
338 | 338 | .activate = lib3270_fieldend, |
339 | 339 | |
340 | - .group = LIB3270_ACTION_GROUP_ONLINE, | |
340 | + .group = LIB3270_ACTION_GROUP_FORMATTED, | |
341 | 341 | .activatable = lib3270_is_formatted |
342 | 342 | }, |
343 | 343 | |
... | ... | @@ -351,7 +351,7 @@ |
351 | 351 | .summary = N_( "Move to first unprotected field on screen." ), |
352 | 352 | .activate = lib3270_firstfield, |
353 | 353 | |
354 | - .group = LIB3270_ACTION_GROUP_ONLINE, | |
354 | + .group = LIB3270_ACTION_GROUP_FORMATTED, | |
355 | 355 | .activatable = lib3270_is_formatted |
356 | 356 | }, |
357 | 357 | |
... | ... | @@ -365,7 +365,7 @@ |
365 | 365 | .summary = N_( "Tab forward to next field." ), |
366 | 366 | .activate = lib3270_nextfield, |
367 | 367 | |
368 | - .group = LIB3270_ACTION_GROUP_ONLINE, | |
368 | + .group = LIB3270_ACTION_GROUP_FORMATTED, | |
369 | 369 | .activatable = lib3270_is_formatted |
370 | 370 | }, |
371 | 371 | |
... | ... | @@ -379,7 +379,7 @@ |
379 | 379 | .summary = N_( "Tab backward to previous field." ), |
380 | 380 | .activate = lib3270_previousfield, |
381 | 381 | |
382 | - .group = LIB3270_ACTION_GROUP_ONLINE, | |
382 | + .group = LIB3270_ACTION_GROUP_FORMATTED, | |
383 | 383 | .activatable = lib3270_is_formatted |
384 | 384 | }, |
385 | 385 | |
... | ... | @@ -411,8 +411,8 @@ |
411 | 411 | .summary = N_( "Delete field" ), |
412 | 412 | .activate = lib3270_deletefield, |
413 | 413 | |
414 | - .group = LIB3270_ACTION_GROUP_LOCK_STATE, | |
415 | - .activatable = lib3270_is_unlocked | |
414 | + .group = LIB3270_ACTION_GROUP_FORMATTED, | |
415 | + .activatable = lib3270_is_formatted | |
416 | 416 | }, |
417 | 417 | |
418 | 418 | |
... | ... | @@ -440,7 +440,7 @@ |
440 | 440 | .summary = N_( "Erase End Of Field Key." ), |
441 | 441 | .activate = lib3270_eraseeof, |
442 | 442 | |
443 | - .group = LIB3270_ACTION_GROUP_ONLINE, | |
443 | + .group = LIB3270_ACTION_GROUP_FORMATTED, | |
444 | 444 | .activatable = lib3270_is_formatted |
445 | 445 | }, |
446 | 446 | ... | ... |
src/core/ctlr.c
... | ... | @@ -246,7 +246,11 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) |
246 | 246 | |
247 | 247 | static void set_formatted(H3270 *hSession, int state) |
248 | 248 | { |
249 | - hSession->formatted = state; | |
249 | + if(state != hSession->formatted) | |
250 | + { | |
251 | + hSession->formatted = state; | |
252 | + lib3270_notify_actions(hSession, LIB3270_ACTION_GROUP_LOCK_STATE); | |
253 | + } | |
250 | 254 | } |
251 | 255 | |
252 | 256 | /** | ... | ... |
src/core/screen.c
... | ... | @@ -839,7 +839,7 @@ void mcursor_set(H3270 *hSession,LIB3270_POINTER m) |
839 | 839 | hSession->cbk.cursor(hSession,m & 0x03); |
840 | 840 | |
841 | 841 | // Notify lock state change. |
842 | - lib3270_notify_actions(hSession, LIB3270_ACTION_GROUP_LOCK_STATE); | |
842 | + lib3270_notify_actions(hSession, LIB3270_ACTION_GROUP_FORMATTED); | |
843 | 843 | |
844 | 844 | } |
845 | 845 | } | ... | ... |
src/include/lib3270/actions.h
... | ... | @@ -40,6 +40,7 @@ |
40 | 40 | LIB3270_ACTION_GROUP_OFFLINE, ///< @brief Action requires offline state. |
41 | 41 | LIB3270_ACTION_GROUP_SELECTION, ///< @brief Action depends on selection. |
42 | 42 | LIB3270_ACTION_GROUP_LOCK_STATE, ///< @brief Action depends on keyboard lock state. |
43 | + LIB3270_ACTION_GROUP_FORMATTED, ///< @brief Action depends on a formatted screen. | |
43 | 44 | |
44 | 45 | LIB3270_ACTION_GROUP_CUSTOM ///< @brief Custom group/Number of groups. |
45 | 46 | } LIB3270_ACTION_GROUP; | ... | ... |