diff options
| author | Cameron Cawley | 2019-03-23 22:35:23 +0000 |
|---|---|---|
| committer | Thierry Crozat | 2019-04-30 22:17:04 +0100 |
| commit | d7b2b1b8f94c15437eb2c1b46c345ebc44f9588e (patch) | |
| tree | 27b36c7dac96991eac33fe374ef3bb37dca9c09d /gui | |
| parent | fb26f21d0478a29da16bd7daa10110aa97a2b604 (diff) | |
| download | scummvm-rg350-d7b2b1b8f94c15437eb2c1b46c345ebc44f9588e.tar.gz scummvm-rg350-d7b2b1b8f94c15437eb2c1b46c345ebc44f9588e.tar.bz2 scummvm-rg350-d7b2b1b8f94c15437eb2c1b46c345ebc44f9588e.zip | |
GUI: Support adding games via Drag and Drop
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/dialog.cpp | 6 | ||||
| -rw-r--r-- | gui/dialog.h | 4 | ||||
| -rw-r--r-- | gui/gui-manager.cpp | 2 | ||||
| -rw-r--r-- | gui/launcher.cpp | 7 | ||||
| -rw-r--r-- | gui/launcher.h | 1 |
5 files changed, 9 insertions, 11 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 560c29174a..781de330e2 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -21,10 +21,7 @@ */ #include "common/rect.h" - -#ifdef ENABLE_KEYMAPPER #include "common/events.h" -#endif #include "gui/gui-manager.h" #include "gui/dialog.h" @@ -359,9 +356,8 @@ void Dialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { } } -#ifdef ENABLE_KEYMAPPER void Dialog::handleOtherEvent(Common::Event evt) { } -#endif + /* * Determine the widget at location (x,y) if any. Assumes the coordinates are * in the local coordinate system, i.e. relative to the top left of the dialog. diff --git a/gui/dialog.h b/gui/dialog.h index efa6f76e03..70b17910fa 100644 --- a/gui/dialog.h +++ b/gui/dialog.h @@ -30,11 +30,9 @@ #include "gui/object.h" #include "gui/ThemeEngine.h" -#ifdef ENABLE_KEYMAPPER namespace Common { struct Event; } -#endif namespace GUI { @@ -105,9 +103,7 @@ protected: virtual void handleKeyUp(Common::KeyState state); virtual void handleMouseMoved(int x, int y, int button); virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); -#ifdef ENABLE_KEYMAPPER virtual void handleOtherEvent(Common::Event evt); -#endif Widget *findWidget(int x, int y); // Find the widget at pos x,y if any Widget *findWidget(const char *name); diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 5e27eb66ef..cff8e8c5cd 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -597,9 +597,7 @@ void GuiManager::processEvent(const Common::Event &event, Dialog *const activeDi screenChange(); break; default: - #ifdef ENABLE_KEYMAPPER activeDialog->handleOtherEvent(event); - #endif break; } } diff --git a/gui/launcher.cpp b/gui/launcher.cpp index fd65e37cdd..14e0e96a3b 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -528,6 +528,13 @@ void LauncherDialog::handleKeyUp(Common::KeyState state) { updateButtons(); } +void LauncherDialog::handleOtherEvent(Common::Event evt) { + Dialog::handleOtherEvent(evt); + if (evt.type == Common::EVENT_DROP_FILE) { + doGameDetection(evt.path); + } +} + bool LauncherDialog::doGameDetection(const Common::String &path) { // Allow user to add a new game to the list. // 2) try to auto detect which game is in the directory, if we cannot diff --git a/gui/launcher.h b/gui/launcher.h index 9f0a1c8e95..5bb386f9a0 100644 --- a/gui/launcher.h +++ b/gui/launcher.h @@ -51,6 +51,7 @@ public: virtual void handleKeyDown(Common::KeyState state); virtual void handleKeyUp(Common::KeyState state); + virtual void handleOtherEvent(Common::Event evt); bool doGameDetection(const Common::String &path); protected: EditTextWidget *_searchWidget; |
