Commit fbcc078779df84054e3da4eccf8ce278521ccc59

Authored by perry.werneck@gmail.com
1 parent 6d9cb588

Ativando opção reselect

src/gtk/actions.c
... ... @@ -33,6 +33,7 @@
33 33 #include "uiparser/parser.h"
34 34 #include "v3270/v3270.h"
35 35 #include <lib3270/actions.h>
  36 + #include <lib3270/selection.h>
36 37  
37 38 /*--[ Implement ]------------------------------------------------------------------------------------*/
38 39  
... ... @@ -191,6 +192,11 @@ static void action_fullscreen(GtkAction *action, GtkWidget *widget)
191 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 200 static void action_unfullscreen(GtkAction *action, GtkWidget *widget)
195 201 {
196 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 225 g_signal_connect(action,"activate",G_CALLBACK(action_unfullscreen),widget);
220 226 break;
221 227  
  228 + case ACTION_RESELECT:
  229 + g_signal_connect(action,"activate",G_CALLBACK(action_reselect),widget);
  230 + break;
  231 +
222 232 default:
223 233 g_warning("Action \"%s\" has unexpected id %d",gtk_action_get_name(action),ix);
224 234 gtk_action_set_sensitive(action,FALSE);
... ...
src/lib3270/selection.c
... ... @@ -302,8 +302,8 @@ LIB3270_ACTION( reselect )
302 302 {
303 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 308 update_selection(hSession);
309 309 set_selected(hSession);
... ...
ui/00default.xml
... ... @@ -61,7 +61,7 @@
61 61 <menuitem action='selectall' key='<ctrl>a' icon='select-all' group='online' label='Select all' />
62 62  
63 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 65 <menuitem action='reselect' key='<Ctrl>r' group='online' label='Reselect' />
66 66  
67 67 <separator/>
... ...