[Scummvm-cvs-logs] SF.net SVN: scummvm:[42631] tools/branches/gsoc2009-gui

Remere at users.sourceforge.net Remere at users.sourceforge.net
Mon Jul 20 20:04:44 CEST 2009


Revision: 42631
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42631&view=rev
Author:   Remere
Date:     2009-07-20 18:04:44 +0000 (Mon, 20 Jul 2009)

Log Message:
-----------
*Fixed bug with the tools not outputting to the correct directory.
*Choose Tool page is now skipped if there is only one possible choice.

Modified Paths:
--------------
    tools/branches/gsoc2009-gui/gui/pages.cpp
    tools/branches/gsoc2009-gui/tool.cpp

Modified: tools/branches/gsoc2009-gui/gui/pages.cpp
===================================================================
--- tools/branches/gsoc2009-gui/gui/pages.cpp	2009-07-20 17:46:19 UTC (rev 42630)
+++ tools/branches/gsoc2009-gui/gui/pages.cpp	2009-07-20 18:04:44 UTC (rev 42631)
@@ -209,10 +209,13 @@
 }
 
 void ChooseToolPage::onNext(wxWindow *panel) {
+	const ToolGUI *tool = g_tools.get(static_cast<wxChoice *>(panel->FindWindowByName(wxT("ToolSelection")))->GetStringSelection());
+
 	if (_configuration.advanced)
 		switchPage(new ChooseInPage(_topframe));
+	else if (tool && tool->getInputList().size() > 1)
+		switchPage(new ChooseExtraInPage(_topframe));
 	else
-		// TODO: Display extra input page
 		switchPage(new ChooseOutPage(_topframe));
 }
 
@@ -346,8 +349,10 @@
 	} else {
 		wxArrayString ls = g_tools.getToolList(filename,
 			_configuration.compressing? TOOLTYPE_COMPRESSION : TOOLTYPE_EXTRACTION);
-		// TODO: If only one input, skip this page and go right to ExtraInput
-		switchPage(new ChooseToolPage(_topframe, ls));
+		if(ls.size() == 1)
+			switchPage(new ChooseOutPage(_topframe));
+		else
+			switchPage(new ChooseToolPage(_topframe, ls));
 	}
 }
 

Modified: tools/branches/gsoc2009-gui/tool.cpp
===================================================================
--- tools/branches/gsoc2009-gui/tool.cpp	2009-07-20 17:46:19 UTC (rev 42630)
+++ tools/branches/gsoc2009-gui/tool.cpp	2009-07-20 18:04:44 UTC (rev 42631)
@@ -124,6 +124,16 @@
 	// Reset abort state
 	_abort = false;
 	
+
+	// Change output to directory if necessary
+	if (_outputToDirectory) {
+		// Ensure last character is a /, this way we force directory output
+		char lastchr = _outputPath.getFullPath()[_outputPath.getFullPath().size() - 1];
+		if (lastchr != '/' && lastchr != '\\') {
+			_outputPath._path += '/';
+		}
+	}
+
 	execute();
 }
 
@@ -246,14 +256,6 @@
 
 		if (_arguments_parsed + 1 < _arguments.size()) {
 			_outputPath = _arguments[_arguments_parsed + 1];
-
-			if (_outputToDirectory) {
-				// Ensure last character is a /, this way we force directory output
-				char lastchr = _outputPath.getFullPath()[_outputPath.getFullPath().size() - 1];
-				if (lastchr != '/' && lastchr != '\\') {
-					_outputPath._path += '/';
-				}
-			}
 			_arguments_parsed += 2;
 		} else {
 			throw ToolException("Could not parse arguments: Expected path after '-o' or '--output'.");


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list