aboutsummaryrefslogtreecommitdiff
path: root/engines/testbed/config.h
diff options
context:
space:
mode:
authorNeeraj Kumar2010-07-22 17:59:59 +0000
committerNeeraj Kumar2010-07-22 17:59:59 +0000
commitc030858cf130a20179368fb231371ae348d8fda4 (patch)
treec7b9278aa67eb1ecd2e75269f562c8081b8f9f9e /engines/testbed/config.h
parentf6be0274df5c9dbdf6de262d310460e2d1d8b2e0 (diff)
downloadscummvm-rg350-c030858cf130a20179368fb231371ae348d8fda4.tar.gz
scummvm-rg350-c030858cf130a20179368fb231371ae348d8fda4.tar.bz2
scummvm-rg350-c030858cf130a20179368fb231371ae348d8fda4.zip
TESTBED: added deselect capabilty in GUI, removed redundant code, testsuites now all enabled by default
svn-id: r51155
Diffstat (limited to 'engines/testbed/config.h')
-rw-r--r--engines/testbed/config.h48
1 files changed, 16 insertions, 32 deletions
diff --git a/engines/testbed/config.h b/engines/testbed/config.h
index b141330b3b..bbb591d337 100644
--- a/engines/testbed/config.h
+++ b/engines/testbed/config.h
@@ -40,7 +40,8 @@ namespace Testbed {
enum {
kTestbedQuitCmd = 'Quit',
- kTestbedSelectAll = 'sAll'
+ kTestbedSelectAll = 'sAll',
+ kTestbedDeselectAll = 'dAll'
};
class TestbedConfigManager {
@@ -48,46 +49,29 @@ public:
TestbedConfigManager(Common::Array<Testsuite *> &tList) : _testsuiteList(tList) {}
~TestbedConfigManager() {}
void selectTestsuites();
- Testsuite *getTestsuiteByName(const Common::String &name);
- bool isEnabled(const Common::String &tsName);
private:
Common::Array<Testsuite *> &_testsuiteList;
- void enableTestsuite(const Common::String &name, bool enable);
void parseConfigFile() {}
};
class TestbedListWidget : public GUI::ListWidget {
public:
- TestbedListWidget(GUI::Dialog *boss, const Common::String &name, Common::StringArray &tsDescArr) : GUI::ListWidget(boss, name), _testSuiteDescArray(tsDescArr) {}
+ TestbedListWidget(GUI::Dialog *boss, const Common::String &name, Common::Array<Testsuite *> tsArray) : GUI::ListWidget(boss, name), _testSuiteArray(tsArray) {}
- void changeColor() {
- // Using Font Color Mechanism to highlight selected entries.
- // Might not be detectable with some themes
- if (_listColors.size() >= 2) {
- if (GUI::ThemeEngine::kFontColorNormal == _listColors[_selectedItem]) {
- _listColors[_selectedItem] = GUI::ThemeEngine::kFontColorAlternate;
- } else if (GUI::ThemeEngine::kFontColorAlternate == _listColors[_selectedItem]) {
- _listColors[_selectedItem] = GUI::ThemeEngine::kFontColorNormal;
- }
- }
-
- // Also append (selected) to each selected entry
- if (_list[_selectedItem].contains("selected")) {
- _list[_selectedItem] = _testSuiteDescArray[_selectedItem];
- } else {
- _list[_selectedItem] += " (selected)";
+ void markAsSelected(int i) {
+ if (!_list[i].contains("selected")) {
+ _list[i] += " (selected)";
}
+ _listColors[i] = GUI::ThemeEngine::kFontColorNormal;
draw();
}
-
- void setColorAll(GUI::ThemeEngine::FontColor color) {
- for (uint i = 0; i < _listColors.size(); i++) {
- if (!_list[i].contains("selected")) {
- _listColors[i] = color;
- _list[i] += " (selected)";
- }
+
+ void markAsDeselected(int i) {
+ if (_list[i].contains("selected")) {
+ _list[i] = _testSuiteArray[i]->getDescription();
}
- draw();;
+ _listColors[i] = GUI::ThemeEngine::kFontColorAlternate;
+ draw();
}
void setColor(uint32 indx, GUI::ThemeEngine::FontColor color) {
@@ -97,7 +81,7 @@ public:
}
private:
- const Common::StringArray _testSuiteDescArray;
+ Common::Array<Testsuite *> _testSuiteArray;
};
class TestbedOptionsDialog : public GUI::Dialog {
@@ -108,10 +92,10 @@ public:
private:
GUI::ListWidget::ColorList _colors;
- Common::StringArray _testSuiteArray;
+ GUI::ButtonWidget *_selectButton;
+ Common::Array<Testsuite *> _testSuiteArray;
Common::StringArray _testSuiteDescArray;
TestbedListWidget *_testListDisplay;
- TestbedConfigManager *_testbedConfMan;
};
} // End of namespace Testbed