From cfd5457ec0575be3b1b8726daf95fdc4da0e50fb Mon Sep 17 00:00:00 2001 From: Roland Knall Date: Tue, 29 Dec 2015 15:35:43 +0100 Subject: extcap: Add regular expression validation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regular expressions follow the Qt Regex syntax, which is formulated after the Perl Regex syntax. A more detailed overview of the possible rules can be found at: http://doc.qt.io/qt-4.8/qregexp.html If a required option is present, even the double-click on the interface will first start the options dialog (Qt only) Required fields are marked bold and put first in the dialog. Additionally if validation failes (which it will if a required field is kept empty, but also if a non-required textfield is violating the defined regex), the label of the field is marked with red. Change-Id: If04a1146d0dfa778332ab2a39122c7a6ee1e93d2 Reviewed-on: https://code.wireshark.org/review/12914 Petri-Dish: Stig Bjørlykke Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke --- extcap_parser.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'extcap_parser.h') diff --git a/extcap_parser.h b/extcap_parser.h index a730d200bc..158838c16f 100644 --- a/extcap_parser.h +++ b/extcap_parser.h @@ -69,7 +69,8 @@ typedef enum { EXTCAP_PARAM_FILE_MUSTEXIST, EXTCAP_PARAM_FILE_EXTENSION, EXTCAP_PARAM_PARENT, - EXTCAP_PARAM_REQUIRED + EXTCAP_PARAM_REQUIRED, + EXTCAP_PARAM_VALIDATION } extcap_param_type; /* Values for a given sentence; values are all stored as a call @@ -112,6 +113,8 @@ typedef struct _extcap_arg { gboolean is_required; + gchar * regexp; + extcap_arg_type arg_type; extcap_complex *range_start; -- cgit v1.2.3