Commit Graph

49 Commits

Author SHA1 Message Date
Thierry Crozat 0b60fb0404 TOOLS: Improve handling of inputs for tools that expect a directory as input
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.
2020-10-25 14:35:52 +00:00
Thierry Crozat 6f89394c6b TOOLS: Make input files handling more robust
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.
2014-10-20 20:17:57 +01:00
Thierry Crozat ae75cf99f6 TOOLS: Add GUI option to run a tool on all the files with the same extension
By default the option is ignored. It needs to be enabled on a per tool basis.
2014-04-20 23:43:00 +01:00
Thierry Crozat d5c8077933 JANITORIAL: Move copyright notice to a separate file 2014-01-19 18:13:09 +00:00
Thierry Crozat fe2d3c2d71 JANITORIAL: Remove now useless SVN tags 2014-01-06 22:54:34 +00:00
Thierry Crozat adcdbafc33 TOOLS: Fix input files check when running the tool more than once
Also add a check on the number of inputs. This ensures the user has selected a file for each required input in the GUI.
2011-11-26 12:32:56 +00:00
Thierry Crozat 7314a7557b TOOLS: Improve input file check in the GUI Tools
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.
2011-11-26 12:06:45 +00:00
Thierry Crozat 9a505bf162 TOOLS: Add EOL in the Tool print, warning and error function
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.
2011-11-24 22:06:47 +00:00
Thierry Crozat ad4170337d TOOLS: Improve handling of input files and directories
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.
2011-11-21 21:37:21 +00:00
Thierry Crozat 560f807c28 TOOLS: Fix handling of input directory names
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).
2011-11-21 01:20:15 +00:00
Thierry Crozat 6877be5f8b Add missing new line at end of error message.
svn-id: r48609
2010-04-10 20:28:48 +00:00
Max Horn 2362d4d657 TOOLS: Add version information to tools
svn-id: r48576
2010-04-06 22:01:25 +00:00
Jordi Vilalta Prat eae07f9e8a TOOLS: Whitespace cleanup
svn-id: r46751
2009-12-30 15:34:00 +00:00
Max Horn b4225dcf2a Use stdio.h instead of cstdio etc.
svn-id: r46711
2009-12-29 17:30:38 +00:00
Max Horn a003aa6309 TOOLS: Move class File into namespace Common
svn-id: r46452
2009-12-20 23:02:50 +00:00
Joost Peters d8745a7047 add newlines
svn-id: r46448
2009-12-20 22:21:19 +00:00
Eugene Sandulenko 45fc7b6abc Fix double newlines at standard output
svn-id: r46441
2009-12-20 20:34:16 +00:00
Eugene Sandulenko 2a1a5cef37 Fix misleading behavior with temp file extention being always .mp3 when run via GUI.
svn-id: r46438
2009-12-20 19:42:02 +00:00
Eugene Sandulenko 6a74e8a5a8 Fix svn keywords
svn-id: r46433
2009-12-20 14:52:29 +00:00
Sven Hesse 19b30fda76 Adding needed standard includes to make the tools compile again for me
svn-id: r46401
2009-12-17 02:08:22 +00:00
Max Horn f918f6b473 Remove util.h
svn-id: r46400
2009-12-17 00:06:53 +00:00
Max Horn d5d2504087 TOOLS: Fix building, move around some files, cleanup
* 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
2009-12-13 20:09:16 +00:00
Max Horn 138a720019 GUI TOOLS: Some cleanup (e.g. move compression specific stuff to compress.h, where it belongs)
svn-id: r46359
2009-12-13 19:49:49 +00:00
Joost Peters 1ad577035c pop output path from arguments after setting it
svn-id: r46187
2009-11-29 00:48:33 +00:00
Joost Peters 67be6fe67b remove erroneous ; after if() in parseOutputArguments()
svn-id: r46186
2009-11-29 00:44:34 +00:00
Joost Peters 148867e54c fix crash when passing only 1 parameter (shouldn't keep/use a reference to a popped object)
svn-id: r45491
2009-10-28 21:57:19 +00:00
Max Horn dda1cf6a74 Fixed buggy argument handling in GSoC tools code
svn-id: r44368
2009-09-25 19:51:35 +00:00
Max Horn e1df1e3ddc Fix whitespaces / code formatting
svn-id: r44361
2009-09-25 16:53:18 +00:00
Joost Peters 861f33e595 Fix tools requiring more than 1 input file (e.g. compress_tinsel)
svn-id: r44280
2009-09-23 23:45:50 +00:00
Hampus Nilsson 074ce8134b *Cleaned up code, removed the duplicated File class, removed old, unused functions and added doxygen.
svn-id: r43079
2009-08-06 02:05:53 +00:00
Hampus Nilsson e43ee787d8 *Improved input recognition with information from the mailing list.
*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
2009-08-03 19:14:30 +00:00
Hampus Nilsson 4fe365c5e1 *Greatly increased robustness of parsing arguments, error messages should now make sense in most cases.
*Tool specific arguments are now entered before the filename, as intended.

svn-id: r42878
2009-07-29 02:09:01 +00:00
Hampus Nilsson 47b1147a93 *You can now use --help compress_agos instead of --tool compress_agos --help to get help about a specific tool.
*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
2009-07-27 23:28:06 +00:00
Hampus Nilsson 17db1d26c1 *Removed macro hack to display the common compression help message and replaced it with streams instead.
svn-id: r42833
2009-07-27 03:11:58 +00:00
Hampus Nilsson b35df38e84 *Added short help text to the GUI, displayed next to name of the tool in the CLI, and on the 'select tool' page in the GUI.
svn-id: r42831
2009-07-27 03:01:06 +00:00
Hampus Nilsson 1669ab6cff *Fixed faulty comments
*GUI now only displays supported audio formats as options (for tools that don't support all).

svn-id: r42703
2009-07-24 20:45:42 +00:00
Hampus Nilsson 168e91e076 *Started on CLI interface, already works but there are many edges to sort out.
*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
2009-07-23 01:41:14 +00:00
Hampus Nilsson 0cfce6f09f *Fixed bug with the tools not outputting to the correct directory.
*Choose Tool page is now skipped if there is only one possible choice.

svn-id: r42631
2009-07-20 18:04:44 +00:00
Hampus Nilsson 6af581fcc7 *Extensions are now case-insensitive for matching.
*Fixed bug with wizard always ending on the 'fail page'.
*Added ExtractScummMac

svn-id: r42629
2009-07-20 17:39:39 +00:00
Hampus Nilsson 9d60503957 *Tool inputs are now stored in the 'Tool' class, and not ToolGUI.
*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
2009-07-17 01:55:11 +00:00
Hampus Nilsson 1f8d15d811 *Added support for deducing tool based on input file. Right now it only checks extension, and only does so on some tools, so there is room for improvement.
*Fixed minor bugs / spelling mistakes / code formatting errors.

svn-id: r42520
2009-07-16 00:43:47 +00:00
Hampus Nilsson af3fc47fdc *Audio compression subprocess no longer spawn a console under windows, and as such does not freeze the entire desktop.
*Added support for progress bar to compress_queen.

svn-id: r42519
2009-07-16 00:06:15 +00:00
Hampus Nilsson 52dca746fd *Added a progress bar to the process page, no tool support procentual progress, so now it just bounces back and forth to indicate something is happening (exact look depends on OS).
*Added a failure page instead of finish page, to indicate that the wizard did _not_ finish properly.

svn-id: r42453
2009-07-13 21:20:24 +00:00
Hampus Nilsson 5f5e3ae0a7 *Added functions for notifying the GUI of progress.
*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
2009-07-12 01:00:36 +00:00
Max Horn d64bdda252 Fixed some warnings and formatting
svn-id: r42283
2009-07-09 09:12:54 +00:00
Hampus Nilsson 66c71c45ca *Converted another 6 tools.
*Added a "xormode" property for files, that allows automatic xoring when reading / writing to files.
*Some other small fixes / additions.

svn-id: r42253
2009-07-08 03:19:51 +00:00
Hampus Nilsson 5333795ad7 *Converted compress_gob, compress_kyra, compress_queen, compress_saga, compress_tinsel, compress_touche, compress_tucker to the new, C++ style format, and added them to the UI. Also added some small required features.
svn-id: r42195
2009-07-06 23:42:10 +00:00
Hampus Nilsson c1ffb6dc6e *Converted compress_agos to more C++ oriented format.
*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
2009-07-04 20:03:12 +00:00
Hampus Nilsson 5f86189724 *Created a common base class for conversion/extraction tools, this will make the tools much easier to integrate into the GUI.
*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
2009-07-04 01:07:12 +00:00