summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorRachel Bryk <RachelBryk@gmail.com>2013-09-27 08:38:12 -0400
committerRachel Bryk <RachelBryk@gmail.com>2013-09-27 08:38:12 -0400
commitcbd366236aef8c68a5d05acfe3577b111f0818f1 (patch)
treefb142555389015192e1925458bc1a12eb896951f /Source
parent9a2c7df8dca3ed8e977dcc8df3d27216e5377981 (diff)
Allow loading save states via drag and drop.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinWX/Src/Frame.cpp13
-rw-r--r--Source/Core/DolphinWX/Src/Frame.h2
2 files changed, 15 insertions, 0 deletions
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