From 1900a4d5990558206633398ddc60b36552c83299 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Tue, 3 Dec 2013 16:48:51 +0000 Subject: [PATCH] Radio buttons do dialogo não estavam respeitando as opções pré-definidas --- po/pt_BR.po | 2 +- src/pw3270/ft/ftdialog.c | 8 ++++---- src/pw3270/ft/testprogram.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index cac79a3..00e0c79 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-03 13:26-0200\n" +"POT-Creation-Date: 2013-12-03 13:44-0200\n" "PO-Revision-Date: 2013-12-03 13:26-0200\n" "Last-Translator: Perry Werneck \n" "Language-Team: Portugues <>\n" diff --git a/src/pw3270/ft/ftdialog.c b/src/pw3270/ft/ftdialog.c index 8a41b63..f2d8f3b 100644 --- a/src/pw3270/ft/ftdialog.c +++ b/src/pw3270/ft/ftdialog.c @@ -231,7 +231,7 @@ static GtkWidget * ftvalue_new(v3270FTD *dialog, GtkGrid *grid, int r, const str } -static GtkWidget * ftradio_new(v3270FTD *dialog, GtkToggleButton **button, const gchar *title, const gchar *tooltip, const struct rdoptions *opt) +static GtkWidget * ftradio_new(v3270FTD *dialog, GtkToggleButton **button, LIB3270_FT_OPTION option, const gchar *title, const gchar *tooltip, const struct rdoptions *opt) { GtkContainer * frame = GTK_CONTAINER(gtk_frame_new(title)); GtkBox * box = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL,2)); @@ -241,7 +241,7 @@ static GtkWidget * ftradio_new(v3270FTD *dialog, GtkToggleButton **button, const for(f=0;opt[f].label;f++) { button[f] = GTK_TOGGLE_BUTTON(gtk_radio_button_new_with_label(lst,gettext(opt[f].label))); - gtk_toggle_button_set_active(button[f],(dialog->options & opt[f].flag) != 0); + gtk_toggle_button_set_active(button[f],(dialog->options & opt[f].flag) == opt[f].flag); if(opt[f].tooltip) gtk_widget_set_tooltip_text(GTK_WIDGET(button[f]),gettext(opt[f].tooltip)); @@ -528,7 +528,7 @@ GtkWidget * v3270_ft_dialog_new(GtkWidget *parent, LIB3270_FT_OPTION options) }; gtk_grid_attach( grid, - ftradio_new(dialog,dialog->recfm,_("Record format"),_("Specifies the record format of the data set."),recfm), + ftradio_new(dialog,dialog->recfm,dialog->options,_("Record format"),_("Specifies the record format of the data set."),recfm), 0,0,2,1 ); @@ -563,7 +563,7 @@ GtkWidget * v3270_ft_dialog_new(GtkWidget *parent, LIB3270_FT_OPTION options) } }; - dialog->units = ftradio_new(dialog,dialog->btnUnits,_("Space allocation units"),_("Specifies the units for the TSO host primary and secondary space options."),units); + dialog->units = ftradio_new(dialog,dialog->btnUnits,dialog->options,_("Space allocation units"),_("Specifies the units for the TSO host primary and secondary space options."),units); gtk_grid_attach( grid, dialog->units, diff --git a/src/pw3270/ft/testprogram.c b/src/pw3270/ft/testprogram.c index 602ea08..f105858 100644 --- a/src/pw3270/ft/testprogram.c +++ b/src/pw3270/ft/testprogram.c @@ -47,7 +47,7 @@ int main (int argc, char *argv[]) */ { - GtkWidget *win = v3270_ft_dialog_new(NULL,LIB3270_FT_OPTION_SEND); + GtkWidget *win = v3270_ft_dialog_new(NULL,LIB3270_FT_OPTION_SEND|LIB3270_FT_RECORD_FORMAT_VARIABLE); v3270_ft_dialog_set_tso(win,FALSE); gtk_dialog_run(GTK_DIALOG(win)); } -- libgit2 0.21.2