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>
This commit is contained in:
Kim Bäckström 2017-02-25 23:44:15 +01:00 committed by Roland Knall
parent 9782d5596a
commit f3d52cb534
3 changed files with 16 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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() )