[Scummvm-cvs-logs] scummvm master -> 38dea529e8bfa3ae88011751f6c35c02dfe61668

tsoliman tarek at bashasoliman.com
Thu Feb 9 09:16:43 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
38dea529e8 KEYMAPPER: Display active keymap stack in remap dialog popup list


Commit: 38dea529e8bfa3ae88011751f6c35c02dfe61668
    https://github.com/scummvm/scummvm/commit/38dea529e8bfa3ae88011751f6c35c02dfe61668
Author: Tarek Soliman (tsoliman at scummvm.org)
Date: 2012-02-09T00:15:35-08:00

Commit Message:
KEYMAPPER: Display active keymap stack in remap dialog popup list

This should make it clear what keymaps are on the stack and in
what order.

Also renamed the label of the top "special" entry in the list to
"(Effective)" since it displays the top keymap's action and also
displays reachable mapped actions from other active keymaps.

Changed paths:
    backends/keymapper/remap-dialog.cpp



diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 8f18777..bf4144a 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -61,7 +61,7 @@ void RemapDialog::open() {
 	const Stack<Keymapper::MapRecord> &activeKeymaps = _keymapper->getActiveStack();
 
 	if (activeKeymaps.size() > 0) {
-		_kmPopUp->appendEntry(activeKeymaps.top().keymap->getName() + _(" (Active)"));
+		_kmPopUp->appendEntry(activeKeymaps.top().keymap->getName() + _(" (Effective)"));
 		divider = true;
 	}
 
@@ -84,6 +84,10 @@ void RemapDialog::open() {
 			keymapCount += _gameKeymaps->size();
 	}
 
+	if (activeKeymaps.size() > 1) {
+		keymapCount += activeKeymaps.size() - 1;
+	}
+
 	debug(3, "RemapDialog::open keymaps: %d", keymapCount);
 
 	_keymapTable = (Keymap **)malloc(sizeof(Keymap*) * keymapCount);
@@ -91,6 +95,18 @@ void RemapDialog::open() {
 	Keymapper::Domain::iterator it;
 	uint32 idx = 0;
 
+	if (activeKeymaps.size() > 1) {
+		if (divider)
+			_kmPopUp->appendEntry("");
+		int topIndex = activeKeymaps.size() - 1;
+		for (int i = topIndex - 1; i >= 0; --i) {
+			Keymapper::MapRecord mr = activeKeymaps[i];
+			_kmPopUp->appendEntry(mr.keymap->getName() + _(" (Active)"), idx);
+			_keymapTable[idx++] = mr.keymap;
+		}
+		divider = true;
+	}
+
 	if (_globalKeymaps) {
 		if (divider)
 			_kmPopUp->appendEntry("");
@@ -108,6 +124,7 @@ void RemapDialog::open() {
 			_kmPopUp->appendEntry(it->_value->getName() + _(" (Game)"), idx);
 			_keymapTable[idx++] = it->_value;
 		}
+		divider = true;
 	}
 
 	_changes = false;






More information about the Scummvm-git-logs mailing list