summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorNeoBrainX <NeoBrainX@gmail.com>2012-10-22 12:25:41 +0200
committerNeoBrainX <NeoBrainX@gmail.com>2012-10-22 12:32:57 +0200
commitf7edfc0118afe02f06ddb5fe6a2462414c7edd79 (patch)
treee68c3625edaa62b69664b514b5de726cf39e575a /Source
parentaece5310f34ec17c967e62b73ec3c0616ba9298d (diff)
FifoPlayer: Copy selected object commands to clipboard when pressing ctrl+c
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp17
-rw-r--r--Source/Core/DolphinWX/Src/FifoPlayerDlg.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp b/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp
index cb467389ee..4579af762a 100644
--- a/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp
+++ b/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp
@@ -23,6 +23,7 @@
#include "FifoPlayer/FifoRecorder.h"
#include "OpcodeDecoding.h"
#include <wx/spinctrl.h>
+#include <wx/clipbrd.h>
DECLARE_EVENT_TYPE(RECORDING_FINISHED_EVENT, -1)
DEFINE_EVENT_TYPE(RECORDING_FINISHED_EVENT)
@@ -323,6 +324,13 @@ void FifoPlayerDlg::CreateGUIControls()
m_searchField->Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(FifoPlayerDlg::OnBeginSearch), NULL, this);
m_searchField->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(FifoPlayerDlg::OnSearchFieldTextChanged), NULL, this);
+ // Setup command copying
+ wxAcceleratorEntry entry;
+ entry.Set(wxACCEL_CTRL, (int)'C', wxID_COPY);
+ wxAcceleratorTable accel(1, &entry);
+ m_objectCmdList->SetAcceleratorTable(accel);
+ m_objectCmdList->Connect(wxID_COPY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FifoPlayerDlg::OnObjectCmdListSelectionCopy), NULL, this);
+
Connect(RECORDING_FINISHED_EVENT, wxCommandEventHandler(FifoPlayerDlg::OnRecordingFinished), NULL, this);
Connect(FRAME_WRITTEN_EVENT, wxCommandEventHandler(FifoPlayerDlg::OnFrameWritten), NULL, this);
@@ -763,6 +771,15 @@ void FifoPlayerDlg::OnObjectCmdListSelectionChanged(wxCommandEvent& event)
Fit();
}
+void FifoPlayerDlg::OnObjectCmdListSelectionCopy(wxCommandEvent& WXUNUSED(event))
+{
+ if (wxTheClipboard->Open())
+ {
+ wxTheClipboard->SetData(new wxTextDataObject(m_objectCmdList->GetStringSelection()));
+ wxTheClipboard->Close();
+ }
+}
+
void FifoPlayerDlg::OnCloseClick(wxCommandEvent& WXUNUSED(event))
{
Hide();
diff --git a/Source/Core/DolphinWX/Src/FifoPlayerDlg.h b/Source/Core/DolphinWX/Src/FifoPlayerDlg.h
index 4e2c24fdd6..eb5f9a33e9 100644
--- a/Source/Core/DolphinWX/Src/FifoPlayerDlg.h
+++ b/Source/Core/DolphinWX/Src/FifoPlayerDlg.h
@@ -57,6 +57,7 @@ private:
void OnFrameListSelectionChanged(wxCommandEvent& event);
void OnObjectListSelectionChanged(wxCommandEvent& event);
void OnObjectCmdListSelectionChanged(wxCommandEvent& event);
+ void OnObjectCmdListSelectionCopy(wxCommandEvent& WXUNUSED(event));
void UpdatePlayGui();
void UpdateRecorderGui();