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,7 +291,7 @@ | ||
291 | .summary = N_( "Remove selection" ), | 291 | .summary = N_( "Remove selection" ), |
292 | .activate = lib3270_unselect, | 292 | .activate = lib3270_unselect, |
293 | 293 | ||
294 | - .group = LIB3270_ACTION_GROUP_ONLINE, | 294 | + .group = LIB3270_ACTION_GROUP_SELECTION, |
295 | .activatable = lib3270_has_selection | 295 | .activatable = lib3270_has_selection |
296 | }, | 296 | }, |
297 | 297 | ||
@@ -322,7 +322,7 @@ | @@ -322,7 +322,7 @@ | ||
322 | .summary = N_( "Select Field" ), | 322 | .summary = N_( "Select Field" ), |
323 | .activate = lib3270_select_field, | 323 | .activate = lib3270_select_field, |
324 | 324 | ||
325 | - .group = LIB3270_ACTION_GROUP_ONLINE, | 325 | + .group = LIB3270_ACTION_GROUP_FORMATTED, |
326 | .activatable = lib3270_is_formatted | 326 | .activatable = lib3270_is_formatted |
327 | }, | 327 | }, |
328 | 328 | ||
@@ -337,7 +337,7 @@ | @@ -337,7 +337,7 @@ | ||
337 | .summary = N_( "Move the cursor to the first blank after the last nonblank in the field." ), | 337 | .summary = N_( "Move the cursor to the first blank after the last nonblank in the field." ), |
338 | .activate = lib3270_fieldend, | 338 | .activate = lib3270_fieldend, |
339 | 339 | ||
340 | - .group = LIB3270_ACTION_GROUP_ONLINE, | 340 | + .group = LIB3270_ACTION_GROUP_FORMATTED, |
341 | .activatable = lib3270_is_formatted | 341 | .activatable = lib3270_is_formatted |
342 | }, | 342 | }, |
343 | 343 | ||
@@ -351,7 +351,7 @@ | @@ -351,7 +351,7 @@ | ||
351 | .summary = N_( "Move to first unprotected field on screen." ), | 351 | .summary = N_( "Move to first unprotected field on screen." ), |
352 | .activate = lib3270_firstfield, | 352 | .activate = lib3270_firstfield, |
353 | 353 | ||
354 | - .group = LIB3270_ACTION_GROUP_ONLINE, | 354 | + .group = LIB3270_ACTION_GROUP_FORMATTED, |
355 | .activatable = lib3270_is_formatted | 355 | .activatable = lib3270_is_formatted |
356 | }, | 356 | }, |
357 | 357 | ||
@@ -365,7 +365,7 @@ | @@ -365,7 +365,7 @@ | ||
365 | .summary = N_( "Tab forward to next field." ), | 365 | .summary = N_( "Tab forward to next field." ), |
366 | .activate = lib3270_nextfield, | 366 | .activate = lib3270_nextfield, |
367 | 367 | ||
368 | - .group = LIB3270_ACTION_GROUP_ONLINE, | 368 | + .group = LIB3270_ACTION_GROUP_FORMATTED, |
369 | .activatable = lib3270_is_formatted | 369 | .activatable = lib3270_is_formatted |
370 | }, | 370 | }, |
371 | 371 | ||
@@ -379,7 +379,7 @@ | @@ -379,7 +379,7 @@ | ||
379 | .summary = N_( "Tab backward to previous field." ), | 379 | .summary = N_( "Tab backward to previous field." ), |
380 | .activate = lib3270_previousfield, | 380 | .activate = lib3270_previousfield, |
381 | 381 | ||
382 | - .group = LIB3270_ACTION_GROUP_ONLINE, | 382 | + .group = LIB3270_ACTION_GROUP_FORMATTED, |
383 | .activatable = lib3270_is_formatted | 383 | .activatable = lib3270_is_formatted |
384 | }, | 384 | }, |
385 | 385 | ||
@@ -411,8 +411,8 @@ | @@ -411,8 +411,8 @@ | ||
411 | .summary = N_( "Delete field" ), | 411 | .summary = N_( "Delete field" ), |
412 | .activate = lib3270_deletefield, | 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,7 +440,7 @@ | ||
440 | .summary = N_( "Erase End Of Field Key." ), | 440 | .summary = N_( "Erase End Of Field Key." ), |
441 | .activate = lib3270_eraseeof, | 441 | .activate = lib3270_eraseeof, |
442 | 442 | ||
443 | - .group = LIB3270_ACTION_GROUP_ONLINE, | 443 | + .group = LIB3270_ACTION_GROUP_FORMATTED, |
444 | .activatable = lib3270_is_formatted | 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,7 +246,11 @@ void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) | ||
246 | 246 | ||
247 | static void set_formatted(H3270 *hSession, int state) | 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,7 +839,7 @@ void mcursor_set(H3270 *hSession,LIB3270_POINTER m) | ||
839 | hSession->cbk.cursor(hSession,m & 0x03); | 839 | hSession->cbk.cursor(hSession,m & 0x03); |
840 | 840 | ||
841 | // Notify lock state change. | 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,6 +40,7 @@ | ||
40 | LIB3270_ACTION_GROUP_OFFLINE, ///< @brief Action requires offline state. | 40 | LIB3270_ACTION_GROUP_OFFLINE, ///< @brief Action requires offline state. |
41 | LIB3270_ACTION_GROUP_SELECTION, ///< @brief Action depends on selection. | 41 | LIB3270_ACTION_GROUP_SELECTION, ///< @brief Action depends on selection. |
42 | LIB3270_ACTION_GROUP_LOCK_STATE, ///< @brief Action depends on keyboard lock state. | 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 | LIB3270_ACTION_GROUP_CUSTOM ///< @brief Custom group/Number of groups. | 45 | LIB3270_ACTION_GROUP_CUSTOM ///< @brief Custom group/Number of groups. |
45 | } LIB3270_ACTION_GROUP; | 46 | } LIB3270_ACTION_GROUP; |