diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 00976965a8..a85e20f46d 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -108,6 +108,19 @@ CRenderFrame::CRenderFrame(wxFrame* parent, wxWindowID id, const wxString& title wxIcon IconTemp; IconTemp.CopyFromBitmap(wxGetBitmapFromMemory(Dolphin_png)); SetIcon(IconTemp); + + DragAcceptFiles(true); + Connect(wxEVT_DROP_FILES, wxDropFilesEventHandler(CRenderFrame::OnDropFiles), NULL, this); +} + +void CRenderFrame::OnDropFiles(wxDropFilesEvent& event) +{ + if (event.GetNumberOfFiles() != 1) + return; + if (File::IsDirectory(event.GetFiles()[0].ToStdString())) + return; + + State::LoadAs(event.GetFiles()[0].ToStdString()); } #ifdef _WIN32 diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 4870eb8f72..376ced5b10 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -74,10 +74,12 @@ class CRenderFrame : public wxFrame long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE); private: + void OnDropFiles(wxDropFilesEvent& event); #ifdef _WIN32 // Receive WndProc messages WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); #endif + }; class CFrame : public CRenderFrame