From 216bea793a47ea1b36afb93004ddb46984652619 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 28 Oct 2019 14:11:05 -0300 Subject: [PATCH] Fixing problem with the select/unselect notifications. --- src/core/actions/table.c | 4 ++-- src/include/lib3270/actions.h | 3 +-- src/selection/actions.c | 3 ++- src/selection/selection.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/actions/table.c b/src/core/actions/table.c index 0ee259a..653d1d4 100644 --- a/src/core/actions/table.c +++ b/src/core/actions/table.c @@ -232,7 +232,7 @@ .summary = N_( "Save selected area." ), .activate = save_selected, - .group = LIB3270_ACTION_GROUP_SELECTED, + .group = LIB3270_ACTION_GROUP_SELECTION, .activatable = lib3270_has_selection }, @@ -673,7 +673,7 @@ .summary = N_( "Print selected area." ), .activate = lib3270_print_selected, - .group = LIB3270_ACTION_GROUP_SELECTED, + .group = LIB3270_ACTION_GROUP_SELECTION, .activatable = lib3270_has_selection }, diff --git a/src/include/lib3270/actions.h b/src/include/lib3270/actions.h index 00713b8..c2e11ee 100644 --- a/src/include/lib3270/actions.h +++ b/src/include/lib3270/actions.h @@ -38,8 +38,7 @@ LIB3270_ACTION_GROUP_NONE, ///< @brief Simple action, no signals os special treatment. LIB3270_ACTION_GROUP_ONLINE, ///< @brief Action requires online state. LIB3270_ACTION_GROUP_OFFLINE, ///< @brief Action requires offline state. - LIB3270_ACTION_GROUP_SELECTED, ///< @brief Action requires an active selection. - LIB3270_ACTION_GROUP_UNSELECTED, ///< @brief Action fails if there has a selection. + LIB3270_ACTION_GROUP_SELECTION, ///< @brief Action depends on selection. LIB3270_ACTION_GROUP_CUSTOM ///< @brief Custom group/Number of groups. } LIB3270_ACTION_GROUP; diff --git a/src/selection/actions.c b/src/selection/actions.c index 6506768..cc1b472 100644 --- a/src/selection/actions.c +++ b/src/selection/actions.c @@ -63,7 +63,8 @@ LIB3270_EXPORT int lib3270_unselect(H3270 *hSession) hSession->cbk.set_selection(hSession,0); hSession->cbk.update_selection(hSession,-1,-1); - lib3270_notify_actions(hSession,LIB3270_ACTION_GROUP_UNSELECTED); + + lib3270_notify_actions(hSession,LIB3270_ACTION_GROUP_SELECTION); } diff --git a/src/selection/selection.c b/src/selection/selection.c index 262cf5c..87eccbe 100644 --- a/src/selection/selection.c +++ b/src/selection/selection.c @@ -193,10 +193,10 @@ void do_select(H3270 *hSession, unsigned int start, unsigned int end, unsigned i { hSession->selected = 1; hSession->cbk.set_selection(hSession,1); - lib3270_notify_actions(hSession,LIB3270_ACTION_GROUP_SELECTED); } hSession->cbk.update_selection(hSession,start,end); + lib3270_notify_actions(hSession,LIB3270_ACTION_GROUP_SELECTION); } -- libgit2 0.21.2