diff --git a/src/core/properties/string.c b/src/core/properties/string.c index 1b20955..cdd78bd 100644 --- a/src/core/properties/string.c +++ b/src/core/properties/string.c @@ -68,6 +68,9 @@ { .name = "url", // Property name. +#ifdef LIB3270_DEFAULT_HOST + .default_value = LIB3270_DEFAULT_HOST, // Default value. +#endif // LIB3270_DEFAULT_HOST .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. .icon = "network-server", // Property icon. .description = N_( "URL of the current host" ), // Property description. @@ -106,11 +109,12 @@ }, { - .name = "host_charset", // Property name. + .name = "host_charset", // Property name. + .default_value = "bracket", // Default charset. .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. - .description = N_( "Host charset" ), // Property description. - .get = lib3270_get_host_charset, // Get value. - .set = lib3270_set_host_charset // Set value. + .description = N_( "Host charset" ), // Property description. + .get = lib3270_get_host_charset, // Get value. + .set = lib3270_set_host_charset // Set value. }, { diff --git a/src/core/properties/unsigned.c b/src/core/properties/unsigned.c index e48dc77..fb03b33 100644 --- a/src/core/properties/unsigned.c +++ b/src/core/properties/unsigned.c @@ -125,6 +125,11 @@ { .name = "unlock_delay", // Property name. +#ifdef UNLOCK_MS + .default_value = UNLOCK_MS, +#else + .default_value = 350, +#endif // UNLOCK_MS .description = N_( "The delay between the host unlocking the keyboard and the actual unlock" ), // Property description. .get = lib3270_get_unlock_delay, // Get value. .set = lib3270_set_unlock_delay // Set value. diff --git a/src/core/session.c b/src/core/session.c index 306d5aa..ccc9edf 100644 --- a/src/core/session.c +++ b/src/core/session.c @@ -413,7 +413,7 @@ H3270 * lib3270_session_new(const char *model) if(!default_session) default_session = hSession; - lib3270_session_init(hSession, model, _( "bracket" ) ); + lib3270_session_init(hSession, model, "bracket" ); if(screen_init(hSession)) return NULL; diff --git a/src/include/lib3270/properties.h b/src/include/lib3270/properties.h index 2cc7b8d..2e04876 100644 --- a/src/include/lib3270/properties.h +++ b/src/include/lib3270/properties.h @@ -51,6 +51,8 @@ int (*get)(const H3270 *hSession); ///< @brief Get value. int (*set)(H3270 *hSession, int value); ///< @brief Set value. + int default_value; ///< @brief Default value for the property. + } LIB3270_INT_PROPERTY; typedef struct _lib3270_uint_property @@ -70,8 +72,10 @@ { LIB3270_PROPERTY_HEAD - const char * (*get)(const H3270 *hSession); ///< @brief Get value. - int (*set)(H3270 *hSession, const char * value); ///< @brief Set value. + const char * (*get)(const H3270 *hSession); ///< @brief Get value. + int (*set)(H3270 *hSession, const char * value); ///< @brief Set value. + + const char * default_value; ///< @brief Default value } LIB3270_STRING_PROPERTY; -- libgit2 0.21.2