Fix and issue with the escape button closing the hotkey dialog when trying to set a hotkey to escape.
Fix a few more dialogs to close with escape. Fix an issue with the pulse audio sound backend when the dsp emulation method is changed, and the frequency setting was not respected. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7358 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
aa19fa97d9
commit
52cb7fd4ca
|
@ -73,7 +73,8 @@ void PulseAudio::SoundLoop()
|
|||
bool PulseAudio::PulseInit()
|
||||
{
|
||||
// The Sample format to use
|
||||
static const pa_sample_spec ss = {
|
||||
const pa_sample_spec ss =
|
||||
{
|
||||
PA_SAMPLE_S16LE,
|
||||
m_mixer->GetSampleRate(),
|
||||
2
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
#include "ConfigManager.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(HotkeyConfigDialog,wxDialog)
|
||||
EVT_CLOSE(HotkeyConfigDialog::OnClose)
|
||||
EVT_BUTTON(wxID_OK, HotkeyConfigDialog::CloseClick)
|
||||
EVT_COMMAND_RANGE(0, NUM_HOTKEYS - 1,
|
||||
wxEVT_COMMAND_BUTTON_CLICKED, HotkeyConfigDialog::OnButtonClick)
|
||||
EVT_TIMER(wxID_ANY, HotkeyConfigDialog::OnButtonTimer)
|
||||
|
@ -49,18 +47,6 @@ HotkeyConfigDialog::~HotkeyConfigDialog()
|
|||
delete m_ButtonMappingTimer;
|
||||
}
|
||||
|
||||
void HotkeyConfigDialog::OnClose(wxCloseEvent& WXUNUSED(event))
|
||||
{
|
||||
m_ButtonMappingTimer->Stop();
|
||||
|
||||
EndModal(wxID_CLOSE);
|
||||
}
|
||||
|
||||
void HotkeyConfigDialog::CloseClick(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
// Save keyboard key mapping
|
||||
void HotkeyConfigDialog::SaveButtonMapping(int Id, int Key, int Modkey)
|
||||
{
|
||||
|
@ -77,6 +63,7 @@ void HotkeyConfigDialog::EndGetButtons(void)
|
|||
GetButtonWaitingTimer = 0;
|
||||
GetButtonWaitingID = 0;
|
||||
ClickedButton = NULL;
|
||||
SetEscapeId(wxID_OK);
|
||||
}
|
||||
|
||||
void HotkeyConfigDialog::OnKeyDown(wxKeyEvent& event)
|
||||
|
@ -172,6 +159,7 @@ void HotkeyConfigDialog::OnButtonClick(wxCommandEvent& event)
|
|||
|
||||
// Get the button
|
||||
ClickedButton = (wxButton *)event.GetEventObject();
|
||||
SetEscapeId(wxID_NONE);
|
||||
// Save old label so we can revert back
|
||||
OldLabel = ClickedButton->GetLabel();
|
||||
ClickedButton->SetWindowStyle(wxWANTS_CHARS);
|
||||
|
@ -300,9 +288,7 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void)
|
|||
wxBoxSizer *sMainSizer = new wxBoxSizer(wxVERTICAL);
|
||||
sMainSizer->Add(Notebook, 0, wxEXPAND | wxALL, 5);
|
||||
sMainSizer->Add(sButtons, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
||||
SetSizer(sMainSizer);
|
||||
Layout();
|
||||
Fit();
|
||||
Notebook->SetSelection(0);
|
||||
SetSizerAndFit(sMainSizer);
|
||||
SetFocus();
|
||||
}
|
||||
|
||||
|
|
|
@ -57,8 +57,6 @@ class HotkeyConfigDialog : public wxDialog
|
|||
|
||||
wxTimer *m_ButtonMappingTimer;
|
||||
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void CloseClick(wxCommandEvent& WXUNUSED(event));
|
||||
void OnButtonTimer(wxTimerEvent& WXUNUSED(event)) { DoGetButtons(GetButtonWaitingID); }
|
||||
void OnButtonClick(wxCommandEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
|
|
|
@ -26,10 +26,8 @@
|
|||
void GamepadPage::ConfigUDPWii(wxCommandEvent &event)
|
||||
{
|
||||
UDPWrapper* const wrp = ((UDPConfigButton*)event.GetEventObject())->wrapper;
|
||||
wxDialog * diag = new UDPConfigDiag(this, wrp);
|
||||
diag->Center();
|
||||
diag->ShowModal();
|
||||
diag->Destroy();
|
||||
UDPConfigDiag diag(this, wrp);
|
||||
diag.ShowModal();
|
||||
}
|
||||
|
||||
void GamepadPage::ConfigExtension(wxCommandEvent& event)
|
||||
|
@ -140,6 +138,7 @@ ControlDialog::ControlDialog(GamepadPage* const parent, InputPlugin& plugin, Con
|
|||
SetSizerAndFit(szr); // needed
|
||||
|
||||
UpdateGUI();
|
||||
SetFocus();
|
||||
}
|
||||
|
||||
ControlButton::ControlButton(wxWindow* const parent, ControllerInterface::ControlReference* const _ref, const unsigned int width, const std::string& label)
|
||||
|
@ -496,6 +495,7 @@ wxStaticBoxSizer* ControlDialog::CreateControlChooser(wxWindow* const parent, wx
|
|||
|
||||
wxButton* const clear_button = new wxButton(parent, -1, _("Clear"));
|
||||
wxButton* const set_button = new wxButton(parent, -1, _("Set"));
|
||||
wxButton* const ok_button = new wxButton(parent, wxID_OK, _("OK"));
|
||||
|
||||
wxButton* const select_button = new wxButton(parent, -1, _("Select"));
|
||||
_connect_macro_(select_button, ControlDialog::SetSelectedControl, wxEVT_COMMAND_BUTTON_CLICKED, parent);
|
||||
|
@ -548,8 +548,9 @@ wxStaticBoxSizer* ControlDialog::CreateControlChooser(wxWindow* const parent, wx
|
|||
|
||||
wxBoxSizer* const bottom_btns_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
bottom_btns_sizer->Add(clear_button, 0, wxLEFT, 5);
|
||||
bottom_btns_sizer->AddStretchSpacer(1);
|
||||
bottom_btns_sizer->Add(set_button, 0, wxRIGHT, 5);
|
||||
bottom_btns_sizer->AddStretchSpacer(1);
|
||||
bottom_btns_sizer->Add(ok_button, 0, wxRIGHT, 5);
|
||||
|
||||
main_szr->Add(range_sizer, 0, wxEXPAND|wxLEFT|wxRIGHT, 5);
|
||||
main_szr->Add(ctrls_sizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 5);
|
||||
|
|
|
@ -19,27 +19,26 @@ UDPConfigDiag::UDPConfigDiag(wxWindow * const parent, UDPWrapper * _wrp) :
|
|||
outer_sizer->Add(sizer1, 0, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, 5);
|
||||
outer_sizer->Add(sizer2, 1, wxLEFT | wxRIGHT | wxEXPAND, 10);
|
||||
|
||||
enable = new wxCheckBox(this,wxID_ANY,_("Enable"));
|
||||
butt = new wxCheckBox(this,wxID_ANY,_("Buttons"));
|
||||
accel = new wxCheckBox(this,wxID_ANY,_("Acceleration"));
|
||||
point = new wxCheckBox(this,wxID_ANY,_("IR Pointer"));
|
||||
nun = new wxCheckBox(this,wxID_ANY,_("Nunchuk"));
|
||||
nunaccel = new wxCheckBox(this,wxID_ANY,_("Nunchuk Acceleration"));
|
||||
enable = new wxCheckBox(this, wxID_ANY, _("Enable"));
|
||||
butt = new wxCheckBox(this, wxID_ANY, _("Buttons"));
|
||||
accel = new wxCheckBox(this, wxID_ANY, _("Acceleration"));
|
||||
point = new wxCheckBox(this, wxID_ANY, _("IR Pointer"));
|
||||
nun = new wxCheckBox(this, wxID_ANY, _("Nunchuk"));
|
||||
nunaccel = new wxCheckBox(this, wxID_ANY, _("Nunchuk Acceleration"));
|
||||
|
||||
wxButton *const ok_butt = new wxButton(this,wxID_ANY,_("OK"));
|
||||
wxButton *const ok_butt = new wxButton(this, wxID_OK, _("OK"));
|
||||
|
||||
wxBoxSizer *const port_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
port_sizer->Add(new wxStaticText(this, wxID_ANY, _("UDP Port:")), 0, wxALIGN_CENTER);
|
||||
port_tbox = new wxTextCtrl(this, wxID_ANY, wxString::FromUTF8(wrp->port.c_str()));
|
||||
port_sizer->Add(port_tbox, 1, wxLEFT | wxEXPAND , 5);
|
||||
port_sizer->Add(port_tbox, 1, wxLEFT | wxEXPAND, 5);
|
||||
|
||||
_connect_macro_(enable, UDPConfigDiag::ChangeState ,wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(butt, UDPConfigDiag::ChangeUpdateFlags ,wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(accel, UDPConfigDiag::ChangeUpdateFlags ,wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(point, UDPConfigDiag::ChangeUpdateFlags ,wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(nun, UDPConfigDiag::ChangeUpdateFlags ,wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(nunaccel, UDPConfigDiag::ChangeUpdateFlags ,wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(ok_butt, UDPConfigDiag::OKPressed, wxEVT_COMMAND_BUTTON_CLICKED, this);
|
||||
_connect_macro_(enable, UDPConfigDiag::ChangeState, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(butt, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(accel, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(point, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(nun, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(nunaccel, UDPConfigDiag::ChangeUpdateFlags, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(port_tbox, UDPConfigDiag::ChangeState, wxEVT_COMMAND_TEXT_UPDATED, this);
|
||||
|
||||
enable->SetValue(wrp->udpEn);
|
||||
|
@ -61,7 +60,8 @@ UDPConfigDiag::UDPConfigDiag(wxWindow * const parent, UDPWrapper * _wrp) :
|
|||
outer_sizer->Add(ok_butt, 0, wxALL | wxALIGN_RIGHT, 5);
|
||||
|
||||
SetSizerAndFit(outer_sizer);
|
||||
Layout();
|
||||
Center();
|
||||
SetFocus();
|
||||
}
|
||||
|
||||
void UDPConfigDiag::ChangeUpdateFlags(wxCommandEvent & WXUNUSED(event))
|
||||
|
@ -79,8 +79,3 @@ void UDPConfigDiag::ChangeState(wxCommandEvent & WXUNUSED(event))
|
|||
wrp->port=port_tbox->GetValue().mb_str(wxConvUTF8);
|
||||
wrp->Refresh();
|
||||
}
|
||||
|
||||
void UDPConfigDiag::OKPressed(wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue