Repository navigation
Replies: 2 comments
|
Built this: #640 Matches the scope above: two Verified via a real Xvfb session, including the actual scenario: exported the live config, simulated drift by hand-editing a setting on disk while QET was closed, relaunched, loaded the earlier export back in, confirmed the restart-confirmation dialog, and confirmed after restart (genuinely a new process, different PID) the drifted setting reverted to exactly what was in the loaded file. Details on the PR. |
Uh oh!
There was an error while loading. Please reload this page.
Forum request: https://qelectrotech.org/forum/viewtopic.php?pid=8830#p8830
Problem
Nuri (translator, working with multiple clients) reports needing different QET configurations per client, and currently switches between them by manually renaming OS-level settings files (
qelectrotech.conf_A/qelectrotech.conf_B) before relaunching. Requested: a menu option to load a saved configuration, accepting that QET would need to restart. scorpio810 confirmed it's feasible but labor-intensive (Linux/macOS store settings as text files, Windows uses the registry); Joshua later reported finding a cross-platform-compatible approach.What exists today
QSettingswith organization/application name "QElectroTech" (sources/main.cpp:208,210), using Qt's native per-platform backend — a text file at~/.config/QElectroTech/QElectroTech.confon Linux, the registry underHKEY_CURRENT_USER\Software\QElectroTech\QElectroTechon Windows, a plist on macOS. This is exactly the split scorpio810 described.--config-dir=DIRCLI flag (QETApp::overrideConfigDir(),sources/qetapp.cpp:1221-1230, enabled by default in both build systems —cmake/start_options.cmake:26), but it doesn't actually solve this:QETApp::configDir()is only consulted for a handful of specific paths — element text patterns (sources/elementtextpattern.cpp:47,132,205), the custom stylesheet (sources/qetapp.cpp:1748), and directory creation at startup (sources/qetapp.cpp:2312-2313). It never touchesQSettingsitself, which uses Qt's own OS-native storage independent of this override. So the bulk of actual preferences — shortcuts, autosave interval, recent files, UI layout, etc. — aren't affected by--config-dirat all today.QSettingsanywhere in the codebase. Nuri's manual file-renaming workaround is the only option there is, which matches exactly what's missing.Proposed scope
Two new entries under the Configuration menu:
QSettingsout to a chosen.conffile, viaQSettings(path, QSettings::IniFormat)rather than the platform-native backend..conffile the same way and copy its keys into the liveQSettings, then prompt to restart (the same restart Nuri already said was acceptable).Using
QSettings::IniFormatfor the saved/loaded file specifically (regardless of what the live settings backend is on that platform) is what makes this portable: the export/import is a plain key/value copy loop (allKeys()+value()/setValue()), identical code on Windows, Linux, and macOS, without needing to touch the registry format at all — this is the shape Joshua's "cross-platform-compatible" comment on the thread points at.Why this shape
A full live-reload-without-restart is out of scope: QET doesn't have a settings-changed signal wired through every consumer (autosave timer, shortcuts, docks, etc.), so faking that would be far riskier than asking for the restart the original request already anticipated. Scoping this to plain export/load also means it directly replaces Nuri's existing manual workaround (renaming files) with an in-app equivalent, rather than trying to solve a broader "live profile switching" feature nobody asked for yet.
Not proposed here
Happy to build this if the scope above sounds right.
All reactions