New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PathConfigPane: Prevent an invalid index assert #5604
Conversation
Shouldn't the button just be disabled in that case? |
Ideally, it should be. I thought it was, though: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/DolphinWX/Config/PathConfigPane.cpp#L152 |
Maybe the need for this changed at some point and it's screwing things up now? |
@shuffle2 The only visual clue I have is the fact that the remove button is "blinking" when I do something that is triggering this function such as adding/removing paths. It seems it got disabled and then re-enabled somehow. |
Oh, I didn't look which function that code was in, thought it was init code :') |
https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/DolphinWX/Config/PathConfigPane.cpp#L147 |
this seems to fix it: ...
Bind(wxEVT_UPDATE_UI, &PathConfigPane::OnEnableIfCoreNotRunning, this);
}
void PathConfigPane::OnEnableIfCoreNotRunning(wxUpdateUIEvent& event)
{
if (event.GetId() != m_remove_iso_path_button->GetId())
WxEventUtils::OnEnableIfCoreNotRunning(event);
} |
lgtm |
|
||
void PathConfigPane::OnEnableIfCoreNotRunning(wxUpdateUIEvent& event) | ||
{ | ||
// Prevent the Remove button to be enabled via wxUpdateUIEvent |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This PR prevents the following assert to be triggered:
Ready to be reviewed & merged.