From 63284d21a0bd58297321786bde2a39e5af9f1726 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 26 Jan 2014 15:22:31 +0100 Subject: [PATCH] Savegame dialog: 'Enter' while editing a name is equivalent to pressing the ok button --- apps/openmw/mwgui/savegamedialog.cpp | 6 ++++++ apps/openmw/mwgui/savegamedialog.hpp | 1 + 2 files changed, 7 insertions(+) diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index 17aaa1189..da0417e7b 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -35,6 +35,7 @@ namespace MWGui mCharacterSelection->eventComboChangePosition += MyGUI::newDelegate(this, &SaveGameDialog::onCharacterSelected); mSaveList->eventListChangePosition += MyGUI::newDelegate(this, &SaveGameDialog::onSlotSelected); mSaveList->eventListSelectAccept += MyGUI::newDelegate(this, &SaveGameDialog::onSlotActivated); + mSaveNameEdit->eventEditSelectAccept += MyGUI::newDelegate(this, &SaveGameDialog::onEditSelectAccept); } void SaveGameDialog::onSlotActivated(MyGUI::ListBox *sender, size_t pos) @@ -43,6 +44,11 @@ namespace MWGui onOkButtonClicked(mOkButton); } + void SaveGameDialog::onEditSelectAccept(MyGUI::EditBox *sender) + { + onOkButtonClicked(mOkButton); + } + void SaveGameDialog::open() { WindowModal::open(); diff --git a/apps/openmw/mwgui/savegamedialog.hpp b/apps/openmw/mwgui/savegamedialog.hpp index bf6fab73a..6743b00b9 100644 --- a/apps/openmw/mwgui/savegamedialog.hpp +++ b/apps/openmw/mwgui/savegamedialog.hpp @@ -25,6 +25,7 @@ namespace MWGui void onCharacterSelected (MyGUI::ComboBox* sender, size_t pos); void onSlotSelected (MyGUI::ListBox* sender, size_t pos); void onSlotActivated (MyGUI::ListBox* sender, size_t pos); + void onEditSelectAccept (MyGUI::EditBox* sender); void fillSaveList();