diff options
| author | Neeraj Kumar | 2010-07-18 07:53:05 +0000 | 
|---|---|---|
| committer | Neeraj Kumar | 2010-07-18 07:53:05 +0000 | 
| commit | 07a9a03587ff0df916ac77b9518fdae97ecc4c64 (patch) | |
| tree | aeaa39fa61629487203d6066e8af5bb682c2e535 | |
| parent | fd157b47a3ac31cd2d22875b7d0f7bf5c3c0bf49 (diff) | |
| download | scummvm-rg350-07a9a03587ff0df916ac77b9518fdae97ecc4c64.tar.gz scummvm-rg350-07a9a03587ff0df916ac77b9518fdae97ecc4c64.tar.bz2 scummvm-rg350-07a9a03587ff0df916ac77b9518fdae97ecc4c64.zip | |
a few more modifications in the testsuite selection widget
svn-id: r50983
| -rw-r--r-- | engines/testbed/config.cpp | 29 | ||||
| -rw-r--r-- | engines/testbed/config.h | 17 | ||||
| -rw-r--r-- | engines/testbed/testbed.cpp | 7 | 
3 files changed, 43 insertions, 10 deletions
| diff --git a/engines/testbed/config.cpp b/engines/testbed/config.cpp index 44f9faffd7..66fd6fdb7a 100644 --- a/engines/testbed/config.cpp +++ b/engines/testbed/config.cpp @@ -22,8 +22,8 @@   * $Id$   */ -#include "testbed/config.h"  #include "engines/engine.h" +#include "testbed/config.h"  namespace Testbed { @@ -31,7 +31,8 @@ TestbedOptionsDialog::TestbedOptionsDialog(Common::Array<Testsuite *> &tsList, T  	_testbedConfMan = tsConfMan; -	new GUI::StaticTextWidget(this, "Browser.Headline", "Select testsuites to Execute, selected entries are shown in dark"); +	new GUI::StaticTextWidget(this, "Browser.Headline", "Select Testsuites to Execute"); +	new GUI::StaticTextWidget(this, "Browser.Path", "Selected entries shown in dark, click to select");  	_testListDisplay = new TestbedListWidget(this, "Browser.List");  	_testListDisplay->setNumberingMode(GUI::kListNumberingOff); @@ -45,9 +46,10 @@ TestbedOptionsDialog::TestbedOptionsDialog(Common::Array<Testsuite *> &tsList, T  	_testListDisplay->setList(_testSuiteArray, &_colors); -	new GUI::ButtonWidget(this, "Browser.Cancel", "Continue", GUI::kCloseCmd, 'C'); +	new GUI::ButtonWidget(this, "Browser.Up", "Select All", kTestbedSelectAll, 0); +	new GUI::ButtonWidget(this, "Browser.Cancel", "Continue", GUI::kCloseCmd);  	// XXX: Add more commands for this -	new GUI::ButtonWidget(this, "Browser.Choose", "Exit", GUI::kCloseCmd, 'X'); +	new GUI::ButtonWidget(this, "Browser.Choose", "Exit Testbed", kTestbedQuitCmd);  }  TestbedOptionsDialog::~TestbedOptionsDialog() {} @@ -61,6 +63,20 @@ void TestbedOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd,  			ts->enable(!ts->isEnabled());  			_testListDisplay->changeColor();  		} +		break; +	case kTestbedQuitCmd: +		Engine::quitGame(); +		close(); +		break; +	case kTestbedSelectAll: +		for (uint i = 0; i < _testSuiteArray.size(); i++) { +			ts  = _testbedConfMan->getTestsuiteByName(_testSuiteArray[i]); +			if (ts) { +				ts->enable(true); +			} +		} +		_testListDisplay->setColorAll(GUI::ThemeEngine::kFontColorNormal); +		break;  	default:  		GUI::Dialog::handleCommand(sender, cmd, data);  	} @@ -121,10 +137,7 @@ void TestbedConfigManager::selectTestsuites() {  		TestbedOptionsDialog tbd(_testsuiteList, this);  		tbd.runModal(); -		// check if user wanted to exit. -		if (Engine::shouldQuit()) { -			return; -		} +		  	}  } diff --git a/engines/testbed/config.h b/engines/testbed/config.h index 656f2f8b89..b981d25070 100644 --- a/engines/testbed/config.h +++ b/engines/testbed/config.h @@ -39,7 +39,9 @@  namespace Testbed {  enum { -	kSelectionToggle = 99 // Some random Number +	kSelectionToggle = 16799, // Some random Number (A better way to do this?) +	kTestbedQuitCmd, +	kTestbedSelectAll  };  class TestbedConfigManager { @@ -76,6 +78,19 @@ public:  		}  	} +	void setColorAll(GUI::ThemeEngine::FontColor color) { +		for (uint i = 0; i < _listColors.size(); i++) { +			_listColors[i] = color; +		} +		draw();; +	} +	 +	void setColor(uint32 indx, GUI::ThemeEngine::FontColor color) { +		assert(indx < _listColors.size()); +		_listColors[indx] = color; +		draw(); +	} +  };  class TestbedOptionsDialog : public GUI::Dialog { diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp index bb3655a557..7785bd1a17 100644 --- a/engines/testbed/testbed.cpp +++ b/engines/testbed/testbed.cpp @@ -104,7 +104,12 @@ Common::Error TestbedEngine::run() {  	TestbedConfigManager cfMan(_testsuiteList);  	cfMan.selectTestsuites(); - +	 +	// check if user wanted to exit. +	if (Engine::shouldQuit()) { +		return Common::kNoError; +	} +	  	invokeTestsuites();  	return Common::kNoError;  } | 
