diff --git a/src/pw3270/v3270ft/ftdialog.cbp b/src/pw3270/v3270ft/ftdialog.cbp
index ae9a6ae..071cacf 100644
--- a/src/pw3270/v3270ft/ftdialog.cbp
+++ b/src/pw3270/v3270ft/ftdialog.cbp
@@ -33,7 +33,8 @@
-
+
+
@@ -45,27 +46,26 @@
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
@@ -80,13 +80,13 @@
-
+
-
+
-
+
diff --git a/src/pw3270/v3270ft/load.c b/src/pw3270/v3270ft/load.c
index b16588e..ce009e5 100644
--- a/src/pw3270/v3270ft/load.c
+++ b/src/pw3270/v3270ft/load.c
@@ -38,6 +38,29 @@
/*--[ Implement ]------------------------------------------------------------------------------------*/
+static LIB3270_FT_OPTION getFlagByName(const gchar *option, const char *optval) {
+
+ LIB3270_FT_OPTION rc = 0;
+ int f;
+ gchar * key = g_strconcat(option,".",optval,NULL);
+
+ for(f=0;foptions &= ~(LIB3270_FT_RECORD_FORMAT_DEFAULT|LIB3270_FT_RECORD_FORMAT_FIXED|LIB3270_FT_RECORD_FORMAT_VARIABLE|LIB3270_FT_RECORD_FORMAT_UNDEFINED); // Reseta flags
+ info->options |= getFlagByName(option,optval);
+
+ } else if(!g_ascii_strcasecmp(option,"units")) {
- if( !g_ascii_strcasecmp(option,name)) {
+ // Units, limpo todas as flags correspondentes e remonto
+ info->options &= ~(LIB3270_FT_ALLOCATION_UNITS_DEFAULT|LIB3270_FT_ALLOCATION_UNITS_TRACKS|LIB3270_FT_ALLOCATION_UNITS_CYLINDERS|LIB3270_FT_ALLOCATION_UNITS_AVBLOCK);
+ info->options |= getFlagByName(option,optval);
- if(!value) {
+ } else {
- // Opção é boolean
+ for(f=0;foptions |= ft_option[f].opt;
+ } else if(!g_ascii_strcasecmp(optval,"no")) {
+ info->options &= ~ft_option[f].opt;
+ } else {
+ g_warning("Unexpected value for %s: %s",option,optval);
}
-
- } else if(!g_ascii_strcasecmp(value,optval)) {
-
- // Opção tem valor
-// debug("%s=%s",option,optval);
-
- info->options |= ft_option[f].opt;
-
+ break;
}
-
- g_free(name);
- return;
}
- g_free(name);
+
}
// Check for FT values
@@ -137,7 +156,6 @@ static void entry_start(GMarkupParseContext *context, const gchar *element_name,
}
}
-
}
diff --git a/src/pw3270/v3270ft/private.h b/src/pw3270/v3270ft/private.h
index 2f9844a..aff05e8 100644
--- a/src/pw3270/v3270ft/private.h
+++ b/src/pw3270/v3270ft/private.h
@@ -69,7 +69,6 @@
};
-
struct v3270ft_type {
LIB3270_FT_OPTION opt;
const gchar * name;
diff --git a/src/pw3270/v3270ft/save.c b/src/pw3270/v3270ft/save.c
index a22d422..908de17 100644
--- a/src/pw3270/v3270ft/save.c
+++ b/src/pw3270/v3270ft/save.c
@@ -30,12 +30,30 @@
#include "private.h"
-
/*--[ Statics ]--------------------------------------------------------------------------------------*/
/*--[ Implement ]------------------------------------------------------------------------------------*/
+static const gchar * getNameByFlag(LIB3270_FT_OPTION opt, LIB3270_FT_OPTION mask) {
+
+ const gchar * rc = "Default";
+ const gchar * ptr;
+ int f;
+
+ opt &= mask;
+
+ for(f=0;f\n","local",entry->local);
g_string_append_printf(str,"\t\t\n","remote",entry->remote);
- for(f=0;f\n",
+ "ascii", entry->options & LIB3270_FT_OPTION_ASCII ? "yes" : "no");
- if( (entry->options & ft_option[f].opt) == ft_option[f].opt) {
- char *name = g_strdup(ft_option[f].name);
- char *value = strchr(name,'.');
+ g_string_append_printf(str,"\t\t