Commit fbcc078779df84054e3da4eccf8ce278521ccc59
1 parent
6d9cb588
Exists in
master
and in
5 other branches
Ativando opção reselect
Showing
3 changed files
with
13 additions
and
3 deletions
Show diff stats
src/gtk/actions.c
@@ -33,6 +33,7 @@ | @@ -33,6 +33,7 @@ | ||
33 | #include "uiparser/parser.h" | 33 | #include "uiparser/parser.h" |
34 | #include "v3270/v3270.h" | 34 | #include "v3270/v3270.h" |
35 | #include <lib3270/actions.h> | 35 | #include <lib3270/actions.h> |
36 | + #include <lib3270/selection.h> | ||
36 | 37 | ||
37 | /*--[ Implement ]------------------------------------------------------------------------------------*/ | 38 | /*--[ Implement ]------------------------------------------------------------------------------------*/ |
38 | 39 | ||
@@ -191,6 +192,11 @@ static void action_fullscreen(GtkAction *action, GtkWidget *widget) | @@ -191,6 +192,11 @@ static void action_fullscreen(GtkAction *action, GtkWidget *widget) | ||
191 | lib3270_set_toggle(GTK_V3270(widget)->host,LIB3270_TOGGLE_FULL_SCREEN,1); | 192 | lib3270_set_toggle(GTK_V3270(widget)->host,LIB3270_TOGGLE_FULL_SCREEN,1); |
192 | } | 193 | } |
193 | 194 | ||
195 | +static void action_reselect(GtkAction *action, GtkWidget *widget) | ||
196 | +{ | ||
197 | + lib3270_reselect(GTK_V3270(widget)->host); | ||
198 | +} | ||
199 | + | ||
194 | static void action_unfullscreen(GtkAction *action, GtkWidget *widget) | 200 | static void action_unfullscreen(GtkAction *action, GtkWidget *widget) |
195 | { | 201 | { |
196 | lib3270_set_toggle(GTK_V3270(widget)->host,LIB3270_TOGGLE_FULL_SCREEN,0); | 202 | lib3270_set_toggle(GTK_V3270(widget)->host,LIB3270_TOGGLE_FULL_SCREEN,0); |
@@ -219,6 +225,10 @@ void ui_connect_index_action(GtkAction *action, GtkWidget *widget, int ix, GtkAc | @@ -219,6 +225,10 @@ void ui_connect_index_action(GtkAction *action, GtkWidget *widget, int ix, GtkAc | ||
219 | g_signal_connect(action,"activate",G_CALLBACK(action_unfullscreen),widget); | 225 | g_signal_connect(action,"activate",G_CALLBACK(action_unfullscreen),widget); |
220 | break; | 226 | break; |
221 | 227 | ||
228 | + case ACTION_RESELECT: | ||
229 | + g_signal_connect(action,"activate",G_CALLBACK(action_reselect),widget); | ||
230 | + break; | ||
231 | + | ||
222 | default: | 232 | default: |
223 | g_warning("Action \"%s\" has unexpected id %d",gtk_action_get_name(action),ix); | 233 | g_warning("Action \"%s\" has unexpected id %d",gtk_action_get_name(action),ix); |
224 | gtk_action_set_sensitive(action,FALSE); | 234 | gtk_action_set_sensitive(action,FALSE); |
src/lib3270/selection.c
@@ -302,8 +302,8 @@ LIB3270_ACTION( reselect ) | @@ -302,8 +302,8 @@ LIB3270_ACTION( reselect ) | ||
302 | { | 302 | { |
303 | CHECK_SESSION_HANDLE(hSession); | 303 | CHECK_SESSION_HANDLE(hSession); |
304 | 304 | ||
305 | - if(hSession->selected || hSession->select.begin == hSession->select.end) | ||
306 | - return 0; | 305 | + if(!lib3270_connected(hSession) || hSession->select.begin == hSession->select.end || hSession->selected) |
306 | + return; | ||
307 | 307 | ||
308 | update_selection(hSession); | 308 | update_selection(hSession); |
309 | set_selected(hSession); | 309 | set_selected(hSession); |
ui/00default.xml
@@ -61,7 +61,7 @@ | @@ -61,7 +61,7 @@ | ||
61 | <menuitem action='selectall' key='<ctrl>a' icon='select-all' group='online' label='Select all' /> | 61 | <menuitem action='selectall' key='<ctrl>a' icon='select-all' group='online' label='Select all' /> |
62 | 62 | ||
63 | <menuitem action='selectfield' key='<Ctrl>f' group='online' label='Select Field' /> | 63 | <menuitem action='selectfield' key='<Ctrl>f' group='online' label='Select Field' /> |
64 | - <menuitem action='unselect' group='selection' label='unselect' /> | 64 | + <menuitem action='unselect' group='selection' label='Remove selection' /> |
65 | <menuitem action='reselect' key='<Ctrl>r' group='online' label='Reselect' /> | 65 | <menuitem action='reselect' key='<Ctrl>r' group='online' label='Reselect' /> |
66 | 66 | ||
67 | <separator/> | 67 | <separator/> |