diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2015-12-07 13:30:26 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2017-02-02 10:33:14 +0000 |
commit | efb5c1537de616826408660f8d9aca659d5297c3 (patch) | |
tree | d95b9acbe5c72d51927855e95ea60b75e5709d36 /extcap_parser.c | |
parent | bd3c2d2954e58829d44bc4319fbfa921f5bffc9f (diff) |
Qt: Add extcap placeholder parameter
Added a parameter to set placeholder text in textBox.
Change-Id: Iccf92fe60abc78be8f0fa112c0c9eb78890674b5
Reviewed-on: https://code.wireshark.org/review/12463
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap_parser.c')
-rw-r--r-- | extcap_parser.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/extcap_parser.c b/extcap_parser.c index 889dbbe309..3fac966e8a 100644 --- a/extcap_parser.c +++ b/extcap_parser.c @@ -171,6 +171,8 @@ static extcap_token_sentence *extcap_tokenize_sentence(const gchar *s) { param_type = EXTCAP_PARAM_RANGE; } else if (g_ascii_strcasecmp(arg, "tooltip") == 0) { param_type = EXTCAP_PARAM_TOOLTIP; + } else if (g_ascii_strcasecmp(arg, "placeholder") == 0) { + param_type = EXTCAP_PARAM_PLACEHOLDER; } else if (g_ascii_strcasecmp(arg, "mustexist") == 0) { param_type = EXTCAP_PARAM_FILE_MUSTEXIST; } else if (g_ascii_strcasecmp(arg, "fileext") == 0) { @@ -248,6 +250,7 @@ void extcap_free_arg(extcap_arg *a) { g_free(a->call); g_free(a->display); g_free(a->tooltip); + g_free(a->placeholder); g_free(a->fileextension); g_free(a->regexp); g_free(a->device_name); @@ -355,6 +358,11 @@ static extcap_arg *extcap_parse_arg_sentence(GList *args, extcap_token_sentence target_arg->tooltip = g_strdup(param_value); } + if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_PLACEHOLDER))) + != NULL) { + target_arg->placeholder = g_strdup(param_value); + } + if ((param_value = (gchar *)g_hash_table_lookup(s->param_list, ENUM_KEY(EXTCAP_PARAM_FILE_MUSTEXIST))) != NULL) { target_arg->fileexists = g_regex_match_simple(EXTCAP_BOOLEAN_REGEX, param_value, G_REGEX_CASELESS, (GRegexMatchFlags)0); |