Index: common/config-manager.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/config-manager.cpp,v
retrieving revision 1.17
diff -u -3 -p -r1.17 config-manager.cpp
--- common/config-manager.cpp	7 Feb 2004 04:53:59 -0000	1.17
+++ common/config-manager.cpp	12 Feb 2004 11:06:15 -0000
@@ -32,7 +32,7 @@
 #ifdef MACOSX
 #define DEFAULT_CONFIG_FILE "Library/Preferences/ScummVM Preferences"
 #else
-#define DEFAULT_CONFIG_FILE ".scummvmrc"
+#define DEFAULT_CONFIG_FILE ".scummvmrc-devel"
 #endif
 #else
 #define DEFAULT_CONFIG_FILE "scummvm.ini"
@@ -123,14 +123,19 @@ void ConfigManager::loadFile(const Strin
 			if (t[0] && t[0] != '#') {
 				if (t[0] == '[') {
 					// It's a new domain which begins here.
-					char *p = strchr(t, ']');
-					if (!p) {
+					char *p = t + 1;
+					while (*p && isalnum(*p))
+						p++;
+
+					switch (*p) {
+					case '\0':
 						error("Config file buggy: no ] at the end of the domain name.\n");
-					} else {
+					case ']':
 						*p = 0;
-						// TODO: Some kind of domain name verification might be nice.
-						// E.g. restrict to only a-zA-Z0-9 and maybe -_  or so...
 						domain = t + 1;
+						break;
+					default:
+						error("Config file buggy: %c is not a valid character of a domain name.\n", *p);
 					}
 				} else {
 					// Skip leading whitespaces
@@ -259,7 +264,7 @@ void ConfigManager::removeKey(const Stri
 	else if (_globalDomains.contains(dom))
 		_globalDomains[dom].remove(key);
 	else
-		error("Removing key '%s' from non-existent domain '%s'", key.c_str(), dom.c_str());
+		error("Removing key '%s' from non-existent domain '%s'.\n", key.c_str(), dom.c_str());
 }
 
 
@@ -293,9 +298,12 @@ const String & ConfigManager::get(const 
 
 int ConfigManager::getInt(const String &key, const String &dom) const {
 	String value(get(key, dom));
-	// Convert the string to an integer.
-	// TODO: We should perform some error checking.
-	return (int)strtol(value.c_str(), 0, 10);
+	char *errpos;
+	int ivalue = (int)strtol(value.c_str(), &errpos, 10);
+	if (value.c_str()==errpos)
+		error("Config file buggy: %s is not a valid integer.\n", errpos);
+			
+	return ivalue;
 }
 
 bool ConfigManager::getBool(const String &key, const String &dom) const {
@@ -403,6 +406,21 @@ void ConfigManager::renameGameDomain(con
 bool ConfigManager::hasGameDomain(const String &domain) const {
 	assert(!domain.isEmpty());
 	return _gameDomains.contains(domain);
+}
+
+void ConfigManager::swapDomains(const String &domain1, const String &domain2) {
+	assert(!domain1.isEmpty());
+	assert(!domain2.isEmpty());
+
+	if (domain1 == domain2)
+	    return;
+
+	Domain tmp;
+	tmp.merge(_gameDomains[domain1]);
+	_gameDomains[domain1].clear();
+	_gameDomains[domain1].merge(_gameDomains[domain2]);
+	_gameDomains[domain2].clear();
+	_gameDomains[domain2].merge(tmp);
 }
 
 }	// End of namespace Common
Index: common/config-manager.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/config-manager.h,v
retrieving revision 1.11
diff -u -3 -p -r1.11 config-manager.h
--- common/config-manager.h	7 Feb 2004 04:53:59 -0000	1.11
+++ common/config-manager.h	12 Feb 2004 11:06:15 -0000
@@ -92,7 +92,8 @@ public:
 	void				renameGameDomain(const String &oldName, const String &newName);
 	bool				hasGameDomain(const String &domain) const;
 	const DomainMap &	getGameDomains() const { return _gameDomains; }
-
+	int				numGameDomains() const { return _gameDomains.size(); }
+	void				swapDomains(const String &domain2, const String &domain1);
 /*
 	TODO: Callback/change notification system
 	typedef void (*ConfigCallback)(const ConstString &key, void *refCon);
Index: common/map.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/map.h,v
retrieving revision 1.22
diff -u -3 -p -r1.22 map.h
--- common/map.h	5 Feb 2004 00:19:54 -0000	1.22
+++ common/map.h	12 Feb 2004 11:06:15 -0000
@@ -215,6 +215,14 @@ public:
 	const_iterator	end() const {
 		return const_iterator();
 	}
+	
+	int size() const {
+		int s = 0;
+		for (const_iterator i = begin(); i != end(); ++i)
+		    s++;
+		return s;
+	}
+		
 
 protected:
 	/** Merge the content of the given tree into this tree. */
Index: gui/ListWidget.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/ListWidget.cpp,v
retrieving revision 1.35
diff -u -3 -p -r1.35 ListWidget.cpp
--- gui/ListWidget.cpp	5 Feb 2004 00:19:54 -0000	1.35
+++ gui/ListWidget.cpp	12 Feb 2004 11:06:16 -0000
@@ -51,6 +51,27 @@ ListWidget::ListWidget(GuiObject *boss, 
 ListWidget::~ListWidget() {
 }
 
+void ListWidget::setSelected(int item) {
+    assert( item>=-1 && item<(int)_list.size() );
+
+	if(isEnabled()) {
+		int oldSelectedItem = _selectedItem;
+		_selectedItem = item;
+
+		if (oldSelectedItem != _selectedItem) {
+			if (_editMode) {
+				// undo any changes made
+				_list[oldSelectedItem] = _backupString;
+				_editMode = false;
+				drawCaret(true);
+			}
+			sendCommand(kListSelectionChangedCmd, _selectedItem);
+		}
+		scrollToCurrent();
+		draw();
+	}
+}
+
 void ListWidget::setList(const StringList &list) {
 	if (_editMode && _caretVisible)
 		drawCaret(true);
Index: gui/ListWidget.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/ListWidget.h,v
retrieving revision 1.21
diff -u -3 -p -r1.21 ListWidget.h
--- gui/ListWidget.h	5 Feb 2004 00:19:54 -0000	1.21
+++ gui/ListWidget.h	12 Feb 2004 11:06:16 -0000
@@ -65,6 +65,7 @@ public:
 	void setList(const StringList& list);
 	const StringList& getList()	const			{ return _list; }
 	int getSelected() const						{ return _selectedItem; }
+	void setSelected(int item);
 	const String& getSelectedString() const		{ return _list[_selectedItem]; }
 	void setNumberingMode(NumberingMode numberingMode)	{ _numberingMode = numberingMode; }
 	bool isEditable() const						{ return _editable; }
