diff options
author | Kim Bäckström <kim.backstrom@gmail.com> | 2017-02-25 23:44:15 +0100 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2017-02-26 09:22:25 +0000 |
commit | f3d52cb534c67df8a811578d9387c41c05b714dd (patch) | |
tree | fbb75c6f819efbb5ceaaf6bfca20594bdc029862 | |
parent | 9782d5596a123c812a932965bd2c708829b7d90e (diff) |
Bugfix for extcap fileselect functionality, start button in extcap options dialog wouldn't
get enabled if the user had selected a file (and mustexist=true wasn't specified).
This commit also contains minor fixes to doc/README.extcap, it's now more aligned to the
actual implementation.
Added example usage of fileselect, radio and multiselect to doc/extcap_example.py.
Change-Id: Ibfe40a35a26f49322fbe64c0594506a2163f7e20
Reviewed-on: https://code.wireshark.org/review/20274
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
-rw-r--r-- | doc/README.extcap | 8 | ||||
-rwxr-xr-x | doc/extcap_example.py | 9 | ||||
-rw-r--r-- | ui/qt/extcap_argument_file.cpp | 4 |
3 files changed, 16 insertions, 5 deletions
diff --git a/doc/README.extcap b/doc/README.extcap index 025c3ffb71..94ca73584b 100644 --- a/doc/README.extcap +++ b/doc/README.extcap @@ -85,7 +85,7 @@ capture. To allow an end-user to specify certain options, such options may be provided using the extcap config argument. To share which options are available for an interface, the extcap responds to -the command --config, that shows all the available options (aka additional command +the command --extcap-config, that shows all the available options (aka additional command line options). Those options are automatically presented via a dialog to the user for the individual @@ -167,10 +167,10 @@ These options do have types, for which the following types are being supported: arg {number=2}{call=--verify}{display=Verify}{tooltip=Verify package content}{type=boolflag} - * LOGFILE - Let the user provide a filepath to the capture. If FILE_MUSTEXIST is - being provided, the GUI checks if the file exists + * FILESELECT - Let the user provide a filepath to the capture. If MUSTEXIST is + being provided, the GUI checks if the file exists. - arg {number=3}{call=--logfile}{display=Logfile}{tooltip=A file for log messages}{type=fileselect}{file_mustexist=false} + arg {number=3}{call=--logfile}{display=Logfile}{tooltip=A file for log messages}{type=fileselect}{mustexist=false} * SELECTOR, RADIO, MULTICHECK - an optionfield, where the user may choose one or more options from. If PARENT is provided for the value items, the option fields diff --git a/doc/extcap_example.py b/doc/extcap_example.py index 3a3fde7aa7..6ab5699afb 100755 --- a/doc/extcap_example.py +++ b/doc/extcap_example.py @@ -107,10 +107,19 @@ def extcap_config(interface): args.append ( (7, '--d2test', 'Double 2 Test', 'Long Test Value', 'double', '{default= 123,456}')) args.append ( (8, '--password', 'Password', 'Package message password', 'password', '') ) args.append ( (9, '--ts', 'Start Time', 'Capture start time', 'timestamp', '') ) + args.append ( (10, '--logfile', 'Log File Test', 'The Log File Test', 'fileselect', '') ) + args.append ( (11, '--radio', 'Radio Test', 'Radio Test Value', 'radio', '') ) + args.append ( (12, '--multi', 'MultiCheck Test', 'MultiCheck Test Value', 'multicheck', '') ) values.append ( (3, "if1", "Remote1", "true" ) ) values.append ( (3, "if2", "Remote2", "false" ) ) + values.append ( (11, "r1", "Radio1", "false" ) ) + values.append ( (11, "r2", "Radio2", "true" ) ) + + values.append ( (12, "m1", "MultiCheck1", "false" ) ) + values.append ( (12, "m2", "MultiCheck2", "false" ) ) + for arg in args: print ("arg {number=%d}{call=%s}{display=%s}{tooltip=%s}{type=%s}%s" % arg) diff --git a/ui/qt/extcap_argument_file.cpp b/ui/qt/extcap_argument_file.cpp index 5d7df3f5b5..bff5ea0ea5 100644 --- a/ui/qt/extcap_argument_file.cpp +++ b/ui/qt/extcap_argument_file.cpp @@ -135,7 +135,9 @@ bool ExtcapArgumentFileSelection::isValid() if ( textBox->text().length() > 0 ) { - if ( QFileInfo(textBox->text()).exists() && _argument->fileexists ) + if (_argument->fileexists) + valid = QFileInfo(textBox->text()).exists(); + else valid = true; } else if ( ! isRequired() ) |