-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add Qt-based config editor #3982
Conversation
Thank you so much for this! 🥇 |
Source/Tools/CMakeLists.txt
Outdated
find_package(Qt5 COMPONENTS Qml Quick Widgets) | ||
if (Qt5_FOUND) | ||
add_subdirectory(FEXQonfig/) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please use Qt 6 instead here? Qt 5 OSS is effectively EOL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sadly Kubuntu 24.04 LTS ships Qt 5 by default and figuring out what Qt 6 packages must be installed to compile FEXQonfig (and to not make it use the fallback theme!) seems to be nontrivial.
Supporting both simultaneously (and preferring Qt 6 over 5) should hopefully be possible without too much extra work though. The main breaking changes are in the Dialog APIs, which we should be able to handle via abstraction however.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a compatibility module to deal with the dialogs (surprisingly tricky to make Qt conditionally import the right one). Both Qt 5 and Qt 6 are supported now!
My testing with Qt 6 was limited due to what Ubuntu currently packages, so feel free to give it a spin if you want :)
Source/Tools/FEXQonfig/main.qml
Outdated
id: openFileDialog | ||
title: qsTr("Open FEX configuration") | ||
nameFilters: [ "Config files(*.json)", "All files(*)" ] | ||
// TODO: Set default folder to ~/.fex-emu? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or even better, ~/.config/fex-emu/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're not wrong. I'm not actually sure why we aren't yet using XDG_CONFIG_HOME
for the config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ currently FEX uses it if it's explicitly set, but defaults to ~/.fex-emu
} | ||
} | ||
|
||
// Advanced settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be nice to add a small help/description for them I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, though for now I'm just aiming to rebuild functionality that already exists (plus some things that were easy to add).
We already have descriptions written down in the Config.json file, but they're not readily available in C++ code yet, so this would need more work.
297c7a5
to
ed0c045
Compare
clear() emits the modelReset signal, which is redundant since we're about to add new data anyway.
@@ -3,6 +3,14 @@ add_subdirectory(CommonTools) | |||
if (NOT MINGW_BUILD) | |||
if (BUILD_FEXCONFIG) | |||
add_subdirectory(FEXConfig/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a conditional so that we can only build this variant and not the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds reasonable. BUILD_FEXCONFIG
is now called USE_FEXCONFIG_TOOLKIT
and can be set to either ""/"qt"/"imgui". Since it's an exclusive choice, FEXQonfig has been renamed to FEXConfig.
d55ed06
to
ca9a94d
Compare
This is on feature-parity with the existing FEXConfig now. We could make it the default already but the CI runners don't have Qt libraries installed (qtdeclarative5-dev). |
This provides better visibility when the RootFS list is large.
This orders the entries more like a normal file browser would.
Ah yes, I limited the list's maximum height to around 4-6 items now (depending on the system theme). After that, it will display a scroll bar while leaving the two buttons visible. |
@@ -7,7 +7,7 @@ CHECK_INCLUDE_FILES ("gdb/jit-reader.h" HAVE_GDB_JIT_READER_H) | |||
option(BUILD_TESTS "Build unit tests to ensure sanity" TRUE) | |||
option(BUILD_FEX_LINUX_TESTS "Build FEXLinuxTests, requires x86 compiler" FALSE) | |||
option(BUILD_THUNKS "Build thunks" FALSE) | |||
option(BUILD_FEXCONFIG "Build FEXConfig, requires SDL2 and X11" TRUE) | |||
set(USE_FEXCONFIG_TOOLKIT "imgui" CACHE STRING "If set, build FEXConfig (qt or imgui)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to make qt
the default before merging it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to update our CI machines before it can be switched to default. Setting the cmake option until then should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also probably doesn't hurt to ship this as opt-in for one release, just in case edge case bugs come up :)
Background
(Screenshots below)
Dear ImGui can be a great tool for quick prototyping and overlay GUIs. Conversely, it's also an unsuitable option for creating GUIs of moderate complexity without sacrificing usability and accessibility. This is acknowledged by the author of Dear ImGui himself, and will likely never change:
Historically Dear ImGui may have been a suitable tool for FEX when there was still a built-in debugger. Nowdays we only use it for FEXConfig, for which it provides no benefit over other desktop toolkits, while having all of the downsides of an immediate-mode framework.
This PR adds a rewrite of FEXConfig based on Qt, a widely available framework with decades of development progress. During the rewrite, I've also cleaned up and restructured some of the settings to make things easier to configure overall. The new application
ships as its own binary, called FEXQonfigmust be enabled by settingUSE_FEXCONFIG_TOOLKIT=qt
via CMake.Improvements over current FEXConfig
Übersetzungendes traductionstranslations!Current state
FEXQonfig is
roughlyon feature-parity with FEXConfig while already offering a much more polished UX.Some things (documented via TODOs) still need to be implemented, and I haven't done much testing yet, so backing up Config.json is advised. For now, I figured I'd throw it out there to see whether it's worth finishing.To test the Qt6 build on Ubuntu, I had to install the following packages:
Screenshots
Paths selectable via file dialog; special logging targets are selectable from a combobox;
TSO options are restructured:
The settings list is now type-aware and provides checkboxes/spinboxes where appropriate:
Tri-state buttons are used to highlight settings deleted from a config. Other controls (like comboboxes) are deselected or disabled: