Commit e0f66cff23775431d0c31fe7ea10e386bf501fb9

Authored by Perry Werneck
1 parent 1442dc55
Exists in master and in 1 other branch develop

Adding test para the save-selection action.

Showing 1 changed file with 7 additions and 3 deletions   Show diff stats
src/testprogram/toolbar.c
... ... @@ -103,9 +103,13 @@
103 103 lib3270_disconnect(v3270_get_session(terminal));
104 104 }
105 105  
106   - static void save_all_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal)
  106 + static void save_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal)
107 107 {
108   - lib3270_save_all(v3270_get_session(terminal),NULL);
  108 + H3270 *hSession = v3270_get_session(terminal);
  109 + if(lib3270_get_has_selection(hSession))
  110 + lib3270_save_selected(hSession,NULL);
  111 + else
  112 + lib3270_save_all(hSession,NULL);
109 113 }
110 114  
111 115 static void load_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal)
... ... @@ -226,7 +230,7 @@
226 230 { "gtk-harddisk", G_CALLBACK(ft_clicked), "Open file transfer dialog" },
227 231 { "gtk-copy", G_CALLBACK(copy_clicked), "Copy data" },
228 232 { "gtk-paste", G_CALLBACK(paste_clicked), "Paste data" },
229   - { "document-save", G_CALLBACK(save_all_clicked), "Save screen" },
  233 + { "document-save", G_CALLBACK(save_clicked), "Save screen or selection" },
230 234 { "document-open", G_CALLBACK(load_clicked), "Paste file" },
231 235  
232 236 { "applications-system", G_CALLBACK(preferences_clicked), "Session properties" },
... ...