Skip to content
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

WX: Disable a few menu items when a Wii title is running #5185

Merged
merged 1 commit into from Apr 8, 2017

Conversation

leoetlino
Copy link
Member

Unsafe and keeping them enabled would allow inaccurate behaviour that can break games.

@sepalani
Copy link
Contributor

Can't we use WxEventUtils::OnEnableIfCoreNotRunning to handle them?

@leoetlino
Copy link
Member Author

No. For popups, that doesn't make sense; we could do this for the menu bar, but it wouldn't be any more efficient since RefreshWiiToolsLabels is already only called when needed.

And OnEnableIfCoreNotRunning doesn't give us everything we want ("is a Wii title running", not just "is Core running")

@JMC47
Copy link
Contributor

JMC47 commented Mar 30, 2017

I'm fine with this; I tried messing with a bunch of options in odd ways last month. It didn't work out.

And, as I've been made aware, this will stop working eventually anyway, and it's unsafe as is.

@@ -545,7 +545,7 @@ void MainMenuBar::RefreshSaveStateMenuLabels() const
}
}

void MainMenuBar::RefreshWiiSystemMenuLabel() const
void MainMenuBar::RefreshWiiToolsLabels() const

This comment was marked as off-topic.

// an inconsistent state; the emulated software can do *anything* to its data directory,
// and we definitely do not want the user to touch anything in there if it's running.
for (const int index : {IDM_OPEN_SAVE_FOLDER, IDM_EXPORT_SAVE})
popupMenu.FindItem(index)->Enable(!Core::IsRunning() || !SConfig::GetInstance().bWii);

This comment was marked as off-topic.

popupMenu.Append(IDM_LIST_INSTALL_WAD, _("Install to Wii Menu"));
// This should not be allowed while emulation is running, just like the Install WAD option.
popupMenu.FindItem(IDM_LIST_INSTALL_WAD)

This comment was marked as off-topic.

@leoetlino
Copy link
Member Author

Fixed.

// emulation is running, because this could result in the exported save being in
// an inconsistent state; the emulated software can do *anything* to its data directory,
// and we definitely do not want the user to touch anything in there if it's running.
for (auto* menu_item : {open_save_folder_item, export_save_item})

This comment was marked as off-topic.

This comment was marked as off-topic.

Unsafe and keeping them enabled would allow inaccurate behaviour that
can break games.
@lioncash lioncash merged commit 1e18270 into dolphin-emu:master Apr 8, 2017
@leoetlino leoetlino deleted the disable-nand-items branch June 3, 2017 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants