aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorFilippos Karapetis2007-07-17 21:59:44 +0000
committerFilippos Karapetis2007-07-17 21:59:44 +0000
commitd2d49e224b5aa0839a5636f1c751062dc9a613c7 (patch)
tree6a58b3f6c818fee3ef2cb5222de9ff12101ca53a /gui
parentd04b653378d92facccf597f80fb3911d7d22f5c9 (diff)
downloadscummvm-rg350-d2d49e224b5aa0839a5636f1c751062dc9a613c7.tar.gz
scummvm-rg350-d2d49e224b5aa0839a5636f1c751062dc9a613c7.tar.bz2
scummvm-rg350-d2d49e224b5aa0839a5636f1c751062dc9a613c7.zip
Implemented FR #1754616 - "GUI: Add option to delete games using the "Del" Key"
svn-id: r28131
Diffstat (limited to 'gui')
-rw-r--r--gui/ListWidget.cpp11
-rw-r--r--gui/ListWidget.h1
-rw-r--r--gui/launcher.cpp3
3 files changed, 15 insertions, 0 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 3d5c3dee62..1ca6846e86 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -243,6 +243,17 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
sendCommand(kListItemActivatedCmd, _selectedItem);
}
break;
+ case Common::KEYCODE_BACKSPACE:
+ case Common::KEYCODE_KP_PERIOD:
+ case Common::KEYCODE_DELETE:
+ if (_selectedItem >= 0) {
+ if (_editable) {
+ // Ignore delete and backspace when the list item is editable
+ } else {
+ sendCommand(kListItemRemovalRequestCmd, _selectedItem);
+ }
+ }
+ break;
case Common::KEYCODE_UP:
if (_selectedItem > 0)
_selectedItem--;
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index fe3dd4cd7e..50d16f494f 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -42,6 +42,7 @@ enum NumberingMode {
enum {
kListItemDoubleClickedCmd = 'LIdb', // double click on item - 'data' will be item index
kListItemActivatedCmd = 'LIac', // item activated by return/enter - 'data' will be item index
+ kListItemRemovalRequestCmd = 'LIrm', // request to remove the item with the delete/backspace keys - 'data' will be item index
kListSelectionChangedCmd = 'Lsch' // selection changed - 'data' will be item index
};
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 712cc78883..59404dfd74 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -839,6 +839,9 @@ void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
ConfMan.setActiveDomain(_domains[item]);
close();
break;
+ case kListItemRemovalRequestCmd:
+ removeGame(item);
+ break;
case kListSelectionChangedCmd:
updateButtons();
break;