The main issue here is that the GUI Tools, if we use the default
wizard and do not first select a tool, has a file selector for
the input. It then tries to handle the case where the tool expect
a directory as input, but this was not properly handled and did
not work. The user had to manually stip the file name from the
input after selecting a file. It now works properly when giving
a file as input to a tool that expects a directory.
Some tools have a very generic input file format (e.g. *.*) but
reimplement inspectInput() to restrict the acceptable inputs.
However this was only used when working out which tool can
process a given input (when the tool is not specified). Now this
is also used when checking the inputs given to a specific tool.
It now uses the same check that as been recently added when parsing
the input files in the CLI Tools. This is the first part of a fix for tools
expecting multiple inputs, as depending on the first file selected by
the user it could crash the application when trying to run the tool.
This is consistent with the Common warning and error functions from
both ScummVM and the tools. Only the functions from the class Tool
didn't add EOL automatically. Unsurprisingly the End Of Line was
then missing in many places were these functions were called.
There are three main changes:
Properly handle directory detection.
Improve inspectInput() when there is more than one input to the tool.
Rewrote input arguments parsing to match them with the expected inputs.
The code was supposed to add a '/' at the end of the input directories
provided by the user (if there wasn't one already) but it didn't due to
two different bugs. std::string::operator[] does not change the length
of the string, so it is not a good idea to overwrite '\0' with it. Also the
check to know if the path ended with a '/' was the wrong way out).
* Fix the build system by adding gui/ to the list of module directories,
so that dependencies for source files in it are tracked correctly
* Fixed compilation of the GUI code
* Move some files from utils/ to common/ to get more in sync with the
main ScummVM code base
svn-id: r46360
*A tool can now either match input perfectly, possibly or awful. So less options are displayed to the user (meaning the ChooseTool page can now be skipped most of the time).
*Improved layout.
*The Line Label at the bottom now show the name of the tool that's 'running'.
svn-id: r43031
*Avoided some nasty use of char ** by converting old parse functions to accept std::vector<std::string> instead. Avoided crash from ugly typecasts as well.
svn-id: r42853
*Added a common 'Tools' class to be used by both the CLI and the GUI, right now it's NOT in use by the GUI, so there is some code clutter.
*Rename gui/tools.h to gui/tools.cpp
*Tools now know their own type.
*Some other small changes.
svn-id: r42670
*Changed how auto-detection works, now, there is a default implementation which automatically matches against the tool input format, so there is no need to provide inspectInput in most cases.
*The Tool class itself now also parses input arguments, so the correct amount of input files are guaranteed when Tool::execute is called.
svn-id: r42557
*You can now abort execution of a running tool, the tool will be halted the next time it prints something (or calls notifyProgress, which no tool does yet).
*Fixed bug where output paths with spaces would not open on the last page.
*Fixed bug with buttons not updating.
*Some other minor fixes.
svn-id: r42399
*Added a "xormode" property for files, that allows automatic xoring when reading / writing to files.
*Some other small fixes / additions.
svn-id: r42253
*Minor fixes to some other files, especially a nasty bug with Filename::getFullName, and linker error with both Gob tools having a 'Chunk' class.
svn-id: r42108
*Converted extract_agos and extract_gob_stk to use this new Tool class.
*Changed Filename to use std::string rather than char array, to integrate better with the new classes.
*Small fixes to File & Filename classes
*Small backstep on the GUI as it only supports two tools now (the converted one's), however the new tool format has many gains, the actual tool is not run yet as arguments are not passed between the UI and the tool itself.
[Due to the change of char to std::string, many files were modified, the interesting files are in addition to the new files extract_gob_stk.cpp, extract_agos.cpp, gui/pages.cpp, compress.cpp, compress.h, util.cpp and util.h]
svn-id: r42082