Commit 6f3309d56cf23a0181fbd9d5ad7fb89989f3b0ac
1 parent
5ea502f6
Exists in
master
and in
1 other branch
Updating transfer settings dialog.
Showing
7 changed files
with
46 additions
and
15 deletions
Show diff stats
src/dialogs/settingsdialog.c
| @@ -495,4 +495,6 @@ LIB3270_EXPORT void v3270_ft_settings_dialog_set_session(GtkWidget *widget, H327 | @@ -495,4 +495,6 @@ LIB3270_EXPORT void v3270_ft_settings_dialog_set_session(GtkWidget *widget, H327 | ||
| 495 | 495 | ||
| 496 | gtk_widget_set_sensitive(dialog->button.begin,lib3270_is_connected(hSession) ? TRUE : FALSE); | 496 | gtk_widget_set_sensitive(dialog->button.begin,lib3270_is_connected(hSession) ? TRUE : FALSE); |
| 497 | 497 | ||
| 498 | + v3270_ft_settings_set_tso(dialog->settings,lib3270_is_tso(hSession)); | ||
| 499 | + | ||
| 498 | } | 500 | } |
src/dialogs/tools.c
| @@ -62,11 +62,15 @@ | @@ -62,11 +62,15 @@ | ||
| 62 | return GTK_WIDGET(frame); | 62 | return GTK_WIDGET(frame); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | - GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding) | 65 | + GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, const gchar *tooltip, GtkAlign align, gboolean expand, gboolean fill, guint padding) |
| 66 | { | 66 | { |
| 67 | GtkWidget * frame = v3270_dialog_create_frame(child,title); | 67 | GtkWidget * frame = v3270_dialog_create_frame(child,title); |
| 68 | gtk_widget_set_halign(GTK_WIDGET(frame),align); | 68 | gtk_widget_set_halign(GTK_WIDGET(frame),align); |
| 69 | gtk_box_pack_start(GTK_BOX(box),frame,expand,fill,padding); | 69 | gtk_box_pack_start(GTK_BOX(box),frame,expand,fill,padding); |
| 70 | + | ||
| 71 | + if(tooltip) | ||
| 72 | + gtk_widget_set_tooltip_markup(frame,tooltip); | ||
| 73 | + | ||
| 70 | return child; | 74 | return child; |
| 71 | } | 75 | } |
| 72 | 76 |
src/filetransfer/settings.c
| @@ -76,6 +76,7 @@ | @@ -76,6 +76,7 @@ | ||
| 76 | GtkComboBox * type; | 76 | GtkComboBox * type; |
| 77 | GtkWidget * recordFormatBox; | 77 | GtkWidget * recordFormatBox; |
| 78 | GtkWidget * spaceAllocationBox; | 78 | GtkWidget * spaceAllocationBox; |
| 79 | + GtkWidget * units; | ||
| 79 | 80 | ||
| 80 | GtkWidget * options[NUM_OPTIONS_WIDGETS]; | 81 | GtkWidget * options[NUM_OPTIONS_WIDGETS]; |
| 81 | GtkWidget * spins[LIB3270_FT_VALUE_COUNT]; | 82 | GtkWidget * spins[LIB3270_FT_VALUE_COUNT]; |
| @@ -430,6 +431,7 @@ static void open_select_file_dialog(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconP | @@ -430,6 +431,7 @@ static void open_select_file_dialog(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconP | ||
| 430 | options, | 431 | options, |
| 431 | gtk_box_new(GTK_ORIENTATION_VERTICAL,6), | 432 | gtk_box_new(GTK_ORIENTATION_VERTICAL,6), |
| 432 | _("Transfer options"), | 433 | _("Transfer options"), |
| 434 | + NULL, | ||
| 433 | GTK_ALIGN_START, | 435 | GTK_ALIGN_START, |
| 434 | FALSE, | 436 | FALSE, |
| 435 | FALSE, | 437 | FALSE, |
| @@ -456,6 +458,7 @@ static void open_select_file_dialog(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconP | @@ -456,6 +458,7 @@ static void open_select_file_dialog(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconP | ||
| 456 | options, | 458 | options, |
| 457 | gtk_box_new(GTK_ORIENTATION_VERTICAL,6), | 459 | gtk_box_new(GTK_ORIENTATION_VERTICAL,6), |
| 458 | _("Record format"), | 460 | _("Record format"), |
| 461 | + _("Specifies the record format of the data set."), | ||
| 459 | GTK_ALIGN_CENTER, | 462 | GTK_ALIGN_CENTER, |
| 460 | FALSE, | 463 | FALSE, |
| 461 | FALSE, | 464 | FALSE, |
| @@ -481,6 +484,7 @@ static void open_select_file_dialog(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconP | @@ -481,6 +484,7 @@ static void open_select_file_dialog(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconP | ||
| 481 | options, | 484 | options, |
| 482 | gtk_box_new(GTK_ORIENTATION_VERTICAL,6), | 485 | gtk_box_new(GTK_ORIENTATION_VERTICAL,6), |
| 483 | _("Space allocation units"), | 486 | _("Space allocation units"), |
| 487 | + _("Specifies the units for the TSO host primary and secondary space options."), | ||
| 484 | GTK_ALIGN_END, | 488 | GTK_ALIGN_END, |
| 485 | FALSE, | 489 | FALSE, |
| 486 | FALSE, | 490 | FALSE, |
| @@ -640,3 +644,23 @@ static void open_select_file_dialog(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconP | @@ -640,3 +644,23 @@ static void open_select_file_dialog(GtkEntry *entry, G_GNUC_UNUSED GtkEntryIconP | ||
| 640 | 644 | ||
| 641 | 645 | ||
| 642 | } | 646 | } |
| 647 | + | ||
| 648 | + LIB3270_EXPORT void v3270_ft_settings_set_tso(GtkWidget *widget, gboolean tso) | ||
| 649 | + { | ||
| 650 | + V3270FTSettings * settings = GTK_V3270_FT_SETTINGS(widget); | ||
| 651 | + debug("Host is %s",(tso ? "TSO" : "not TSO")); | ||
| 652 | + | ||
| 653 | + GtkWidget *widgets[] = | ||
| 654 | + { | ||
| 655 | + GTK_WIDGET(settings->spins[LIB3270_FT_VALUE_PRIMSPACE]), | ||
| 656 | + GTK_WIDGET(settings->spins[LIB3270_FT_VALUE_SECSPACE]), | ||
| 657 | + GTK_WIDGET(settings->options[7]), | ||
| 658 | + GTK_WIDGET(settings->spaceAllocationBox) | ||
| 659 | + }; | ||
| 660 | + | ||
| 661 | + size_t ix; | ||
| 662 | + | ||
| 663 | + for(ix = 0; ix < G_N_ELEMENTS(widgets); ix++) | ||
| 664 | + gtk_widget_set_sensitive(widgets[ix],tso); | ||
| 665 | + | ||
| 666 | + } |
src/filetransfer/tables.c
| @@ -161,14 +161,6 @@ const struct v3270ft_value ft_value[] = { | @@ -161,14 +161,6 @@ const struct v3270ft_value ft_value[] = { | ||
| 161 | 161 | ||
| 162 | { | 162 | { |
| 163 | // LIB3270_FT_VALUE_BLKSIZE | 163 | // LIB3270_FT_VALUE_BLKSIZE |
| 164 | - "primary", | ||
| 165 | - 0,99999, | ||
| 166 | - N_( "Primary space:" ), | ||
| 167 | - N_( "Primary allocation for a file created on a TSO host.\nThe units are given by the space allocation units option." ) | ||
| 168 | - }, | ||
| 169 | - | ||
| 170 | - { | ||
| 171 | - // LIB3270_FT_VALUE_PRIMSPACE | ||
| 172 | "blksize", | 164 | "blksize", |
| 173 | 0,32760, | 165 | 0,32760, |
| 174 | N_( "Block size:" ), | 166 | N_( "Block size:" ), |
| @@ -180,6 +172,14 @@ const struct v3270ft_value ft_value[] = { | @@ -180,6 +172,14 @@ const struct v3270ft_value ft_value[] = { | ||
| 180 | }, | 172 | }, |
| 181 | 173 | ||
| 182 | { | 174 | { |
| 175 | + // LIB3270_FT_VALUE_PRIMSPACE | ||
| 176 | + "primary", | ||
| 177 | + 0,99999, | ||
| 178 | + N_( "Primary space:" ), | ||
| 179 | + N_( "Primary allocation for a file created on a TSO host.\nThe units are given by the space allocation units option." ) | ||
| 180 | + }, | ||
| 181 | + | ||
| 182 | + { | ||
| 183 | // LIB3270_FT_VALUE_SECSPACE | 183 | // LIB3270_FT_VALUE_SECSPACE |
| 184 | "secondary", | 184 | "secondary", |
| 185 | 0,99999, | 185 | 0,99999, |
src/include/internals.h
| @@ -49,8 +49,7 @@ | @@ -49,8 +49,7 @@ | ||
| 49 | 49 | ||
| 50 | G_GNUC_INTERNAL GtkWidget * v3270_box_pack_start(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding); | 50 | G_GNUC_INTERNAL GtkWidget * v3270_box_pack_start(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding); |
| 51 | G_GNUC_INTERNAL GtkWidget * v3270_box_pack_end(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding); | 51 | G_GNUC_INTERNAL GtkWidget * v3270_box_pack_end(GtkWidget *box, GtkWidget *child, gboolean expand, gboolean fill, guint padding); |
| 52 | - G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding); | ||
| 53 | - G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, GtkAlign align, gboolean expand, gboolean fill, guint padding); | 52 | + G_GNUC_INTERNAL GtkWidget * v3270_box_pack_frame(GtkWidget *box, GtkWidget *child, const gchar *title, const gchar *tooltip, GtkAlign align, gboolean expand, gboolean fill, guint padding); |
| 54 | G_GNUC_INTERNAL GtkWidget * v3270_dialog_create_grid(GtkAlign align); | 53 | G_GNUC_INTERNAL GtkWidget * v3270_dialog_create_grid(GtkAlign align); |
| 55 | G_GNUC_INTERNAL GtkWidget * v3270_dialog_create_frame(GtkWidget * child, const gchar *title); | 54 | G_GNUC_INTERNAL GtkWidget * v3270_dialog_create_frame(GtkWidget * child, const gchar *title); |
| 56 | 55 |
src/include/v3270/filetransfer.h
| @@ -92,6 +92,8 @@ | @@ -92,6 +92,8 @@ | ||
| 92 | 92 | ||
| 93 | LIB3270_EXPORT GtkWidget * v3270_ft_settings_new(); | 93 | LIB3270_EXPORT GtkWidget * v3270_ft_settings_new(); |
| 94 | 94 | ||
| 95 | + LIB3270_EXPORT void v3270_ft_settings_set_tso(GtkWidget *widget, gboolean tso); | ||
| 96 | + | ||
| 95 | LIB3270_EXPORT void v3270_ft_settings_set_activity(GtkWidget *widget, GObject *activity); | 97 | LIB3270_EXPORT void v3270_ft_settings_set_activity(GtkWidget *widget, GObject *activity); |
| 96 | LIB3270_EXPORT GObject * v3270_ft_settings_get_activity(GtkWidget *widget); | 98 | LIB3270_EXPORT GObject * v3270_ft_settings_get_activity(GtkWidget *widget); |
| 97 | 99 |
src/testprogram/testprogram.c
| @@ -156,6 +156,7 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) | @@ -156,6 +156,7 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) | ||
| 156 | gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),trace,TRUE,TRUE,2); | 156 | gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),trace,TRUE,TRUE,2); |
| 157 | */ | 157 | */ |
| 158 | 158 | ||
| 159 | + /* | ||
| 159 | // | 160 | // |
| 160 | // Test transfer dialog. | 161 | // Test transfer dialog. |
| 161 | // | 162 | // |
| @@ -170,6 +171,7 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) | @@ -170,6 +171,7 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) | ||
| 170 | 0, | 171 | 0, |
| 171 | 4096 | 172 | 4096 |
| 172 | ); | 173 | ); |
| 174 | + */ | ||
| 173 | 175 | ||
| 174 | /* | 176 | /* |
| 175 | // | 177 | // |
| @@ -182,13 +184,11 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) | @@ -182,13 +184,11 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) | ||
| 182 | v3270_ft_activity_set_options(activity,LIB3270_FT_OPTION_RECEIVE|LIB3270_FT_OPTION_ASCII|LIB3270_FT_OPTION_REMAP); | 184 | v3270_ft_activity_set_options(activity,LIB3270_FT_OPTION_RECEIVE|LIB3270_FT_OPTION_ASCII|LIB3270_FT_OPTION_REMAP); |
| 183 | */ | 185 | */ |
| 184 | 186 | ||
| 185 | - /* | ||
| 186 | // | 187 | // |
| 187 | // Test settings dialog | 188 | // Test settings dialog |
| 188 | // | 189 | // |
| 189 | GtkWidget * dialog = v3270_ft_settings_dialog_new(terminal); | 190 | GtkWidget * dialog = v3270_ft_settings_dialog_new(terminal); |
| 190 | - v3270_ft_settings_dialog_append_activity(dialog,activity,NULL); | ||
| 191 | - */ | 191 | + // v3270_ft_settings_dialog_append_activity(dialog,activity,NULL); |
| 192 | 192 | ||
| 193 | /* | 193 | /* |
| 194 | // | 194 | // |
| @@ -200,11 +200,11 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) | @@ -200,11 +200,11 @@ static void ft_clicked(GtkButton G_GNUC_UNUSED(*button), GtkWidget *terminal) | ||
| 200 | v3270_ft_worker_set_session(worker,v3270_get_session(terminal)); | 200 | v3270_ft_worker_set_session(worker,v3270_get_session(terminal)); |
| 201 | v3270_ft_worker_set_activity(worker,activity); | 201 | v3270_ft_worker_set_activity(worker,activity); |
| 202 | v3270_ft_worker_start(worker); | 202 | v3270_ft_worker_start(worker); |
| 203 | + */ | ||
| 203 | 204 | ||
| 204 | gtk_widget_show_all(dialog); | 205 | gtk_widget_show_all(dialog); |
| 205 | gtk_dialog_run(GTK_DIALOG(dialog)); | 206 | gtk_dialog_run(GTK_DIALOG(dialog)); |
| 206 | gtk_widget_destroy(dialog); | 207 | gtk_widget_destroy(dialog); |
| 207 | - */ | ||
| 208 | 208 | ||
| 209 | } | 209 | } |
| 210 | 210 |