Update the breakpoint list after an add from the parent

Doing it from the add dialogs instead would prevent the call to these dialogs outside of a breakpointWindow which would be necessary for hotkeys binding.
This commit is contained in:
aldelaro5 2017-01-02 15:39:02 -05:00
parent a447213420
commit 00e03f1436
5 changed files with 15 additions and 16 deletions

View File

@ -16,8 +16,7 @@
#include "DolphinWX/Debugger/BreakpointWindow.h"
#include "DolphinWX/WxUtils.h"
BreakPointDlg::BreakPointDlg(CBreakPointWindow* _Parent)
: wxDialog(_Parent, wxID_ANY, _("Add Breakpoint")), Parent(_Parent)
BreakPointDlg::BreakPointDlg(wxWindow* _Parent) : wxDialog(_Parent, wxID_ANY, _("Add Breakpoint"))
{
Bind(wxEVT_BUTTON, &BreakPointDlg::OnOK, this, wxID_OK);
@ -42,8 +41,7 @@ void BreakPointDlg::OnOK(wxCommandEvent& event)
if (AsciiToHex(WxStrToStr(AddressString), Address))
{
PowerPC::breakpoints.Add(Address);
Parent->NotifyUpdate();
Close();
EndModal(wxID_OK);
}
else
{

View File

@ -6,16 +6,14 @@
#include <wx/dialog.h>
class CBreakPointWindow;
class wxTextCtrl;
class BreakPointDlg : public wxDialog
{
public:
BreakPointDlg(CBreakPointWindow* _Parent);
BreakPointDlg(wxWindow* _Parent);
private:
CBreakPointWindow* Parent;
wxTextCtrl* m_pEditAddress;
void OnOK(wxCommandEvent& event);

View File

@ -146,13 +146,19 @@ void CBreakPointWindow::OnClear(wxCommandEvent& WXUNUSED(event))
void CBreakPointWindow::OnAddBreakPoint(wxCommandEvent& WXUNUSED(event))
{
BreakPointDlg bpDlg(this);
bpDlg.ShowModal();
if (bpDlg.ShowModal() == wxID_OK)
{
NotifyUpdate();
}
}
void CBreakPointWindow::OnAddMemoryCheck(wxCommandEvent& WXUNUSED(event))
{
MemoryCheckDlg memDlg(this);
memDlg.ShowModal();
if (memDlg.ShowModal() == wxID_OK)
{
NotifyUpdate();
}
}
void CBreakPointWindow::Event_SaveAll(wxCommandEvent& WXUNUSED(event))

View File

@ -16,8 +16,8 @@
#include "DolphinWX/Debugger/MemoryCheckDlg.h"
#include "DolphinWX/WxUtils.h"
MemoryCheckDlg::MemoryCheckDlg(CBreakPointWindow* parent)
: wxDialog(parent, wxID_ANY, _("Add a Memory Breakpoint")), m_parent(parent)
MemoryCheckDlg::MemoryCheckDlg(wxWindow* parent)
: wxDialog(parent, wxID_ANY, _("Add a Memory Breakpoint"))
{
Bind(wxEVT_BUTTON, &MemoryCheckDlg::OnOK, this, wxID_OK);
Bind(wxEVT_RADIOBUTTON, &MemoryCheckDlg::OnRadioButtonClick, this);
@ -165,8 +165,7 @@ void MemoryCheckDlg::OnOK(wxCommandEvent& event)
MemCheck.Break = Break;
PowerPC::memchecks.Add(MemCheck);
m_parent->NotifyUpdate();
Close();
EndModal(wxID_OK);
}
event.Skip();

View File

@ -6,7 +6,6 @@
#include <wx/dialog.h>
class CBreakPointWindow;
class wxRadioButton;
class wxStaticText;
class wxTextCtrl;
@ -14,10 +13,9 @@ class wxTextCtrl;
class MemoryCheckDlg : public wxDialog
{
public:
MemoryCheckDlg(CBreakPointWindow* parent);
MemoryCheckDlg(wxWindow* parent);
private:
CBreakPointWindow* m_parent;
wxStaticText* m_textAddress;
wxStaticText* m_textStartAddress;
wxStaticText* m_textEndAddress;