Isolate wxWidgets code from non-GUI code#1633
Conversation
|
First of all thank you for submitting this, it's definitively a huge step in the right direction. Just a heads up, but there is an earlier PR that will conflict with these changes #1519, which out of fairness I have to merge first. They have been waiting a while.
I think on paper this sounds like the right move but in practice it comes with many downsides. Some strings are formatted and translated in the backend by necessity. Of course there is always a workaround be it via error enums or more complex callback functions, but the simplicity of the I think the preferable solution would be to define a custom helper function in the backend aka
If it's only logged it means the user will not be made aware of those errors unless they explicitly search the log for it. I think it makes more sense to have a callback that can be used to forward error box messages to the UI frontend. I believe that on Android you don't want message pop ups for most of the stuff because thats bad UI design there? As a potential solution you could pass an additional error id enum (but optional, so we dont have to define it for every single message box, no need to over-engineer) so that the front end can decide to instead handle it some other way if a message box isn't wanted. On a related note since I saw it while skimming the changes, it's safe to drop the |
…wing error dialogs
f9d118e to
e6e6e16
Compare
I've updated the code. The backend can now translate strings using the I've also added a new function in the GUI interface for showing error dialogs ( |
bfb69c0 to
0d1c6bd
Compare
0d1c6bd to
b95f833
Compare
4a01ac5 to
c038e19
Compare
| } | ||
|
|
||
| void CemuConfig::Load(XMLConfigParser& parser) | ||
| XMLConfigParser CemuConfig::Load(XMLConfigParser& parser) |
There was a problem hiding this comment.
I couldn't really make sense of this change. Why are CemuConfig::Load and CemuConfig::Save returning a copy of the XMLConfigParser thats passed by reference?
There was a problem hiding this comment.
The intent was to return a parser for a subtree XML element where child settings would read/store their settings.
And CemuConfig returns a parser for the content XML element instead of the original parser.
XMLConfigParser CemuConfig::Load(XMLConfigParser& parser)
{
auto new_parser = parser.get("content");
if (new_parser.valid())
parser = new_parser;
// ...
return parser;
}
XMLConfigParser CemuConfig::Save(XMLConfigParser& parser)
{
auto config = parser.set("content");
// ...
return config;
}
There was a problem hiding this comment.
Ah I didn't see the reassignment. Thanks
|
All looking good. Thanks again for working on this |
This PR refactors the core code to remove its dependency on wxWidgets. These changes should make it easier to add a different frontend to Cemu. A new frontend would only need to implement the interface defined in
src/gui/interface/WindowSystem.h.Changes:
src/gui/interface/WindowSystem.h, which the core code will use to communicate with the UI code. The wxWidgets implementation is insrc/gui/wxgui/wxWindowSystem.cpp(which replaces the old guiWrapper.cpp).GLCanvas,LoggingWindow, andDebuggerWindowto register with the core using callbacks.wxTRANSLATEor_()) to the wxWidgets subproject.wxMessageBoxin non-GUI code to just log the errors, or just removed them.