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
Use PanicAlertT/PanicAlert when appropriate #2213
Conversation
I think we really need a more principled approach to this sort of thing... there are sort of a few categories of places we use PanicAlert():
With better names and implementations, it becomes much more obvious what we want to call where. |
@@ -69,7 +69,8 @@ void* AllocateExecutableMemory(size_t size, bool low) | |||
{ | |||
ptr = nullptr; | |||
#endif | |||
PanicAlert("Failed to allocate executable memory. If you are running Dolphin in Valgrind, try '#undef MAP_32BIT'."); | |||
PanicAlertT("Failed to allocate executable memory.\n" | |||
"If you are running Dolphin in Valgrind, try '#undef MAP_32BIT'."); |
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 comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -87,12 +87,12 @@ UCodeInterface* UCodeFactory(u32 crc, DSPHLE* dsphle, bool wii) | |||
default: | |||
if (wii) | |||
{ | |||
PanicAlert("DSPHLE: Unknown ucode (CRC = %08x) - forcing AXWii.\n\nTry LLE emulator if this is homebrew.", crc); | |||
PanicAlertT("DSPHLE: Unknown ucode (CRC = %08x) - forcing AXWii.\n\nTry LLE emulator if this is homebrew.", crc); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@magumagu Thanks for all the comments. I'm working on fixing the message-specific problems. Your longer comment about a panic alert overhaul was great and made me interested in working on something like that in the future. It would be a bit complicated, with both a UI overhaul and changes in lots of small places, but it would be worth it. |
fc7ad99
to
40c61c0
Compare
Since the translation process for 5.0 seems to have started now and this PR adds and changes many translation strings, I don't think it should be merged until after 5.0. We should give the translators as much time as possible. |
@JosJuice It hasn't started right now, so we're fine to merge this. But you're right, we shouldn't delay this PR much longer. |
Okay, merging this soon sounds good to me then. I will rebase it right away. |
@@ -51,23 +51,22 @@ bool TextureToPng(u8* data, int row_stride, const std::string& filename, int wid | |||
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); | |||
if (png_ptr == nullptr) | |||
{ | |||
PanicAlert("Screenshot failed: Could not allocate write struct\n"); | |||
PanicAlertT("Screenshot failed: Could not allocate write struct"); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
lgtm |
I tried to change messages that contained instructions for users, while avoiding messages that are so technical that most users wouldn't understand them even if they were in the right language.
It means less work for the translators... But I'm not too sure about this, because most of these have already been translated.
Use PanicAlertT/PanicAlert when appropriate
Read the commit messages for the rationale. I'm not sure if the second commit is good, so if someone wants me to drop it, I'm fine with doing so.