When a connection dropped, the listener thread deleted all of that
server's controllers immediately, before anything else was notified, so
the GUI, ResourceManager, and plugins kept dereferencing freed
controllers. Clicking Disconnect had the same problem and also ran the
teardown inline on the GUI thread, where UpdateDeviceList's
DEVICE_LIST_UPDATED is a BlockingQueuedConnection back to that thread,
so the device pages were not torn down before the controllers were
freed and a later queued onDetectionEnded dereferenced them.
Neither path frees controllers inline now. NetworkClient moves them to
an orphaned list and a dedicated teardown thread frees them: plugins
are warned first, then the same DETECTION_STARTED, UpdateDeviceList,
DETECTION_COMPLETE sequence a rescan runs tears down the device pages
that still reference the controllers, and only then are they freed, so
a controller always outlives its page. Both the connection-loss path
and the disconnect button queue to that thread, so the blocking handler
runs on the GUI thread while the controllers are still alive, and
StopClient's join stays off the GUI and listener threads.
* Add JSON string configuration field to RGBController to store device-specific configurations
* This JSON string holds both configuration and schema
* Add settings schema tracking to SettingsManager
* Implement dynamic settings widget that generates a settings UI based on a JSON schema
* Implement SettingsManager callback for notifying of settings changes and settings schema updates
* Always enable Entire Device zone option and use it to enable Edit Device
* Rename SaveSizes to SaveConfiguration in ProfileManager and Sizes.json to Configuration.json
* Add zone flag for indicating that a zone's geometry may change, informing profile manager to ignore this check
* Remove Theme setting and Theme Manager, as this didn't work on most setups anyways and Qt6 has proper Windows dark theming
* Only create server instance if server is actually needed
* Pass initial server host and port through ResourceManager
* Allow setting default server host and port in Server settings
* Split detection system out into its own class, DetectionManager
* Clean up ResourceManger's many callbacks into just two, one for detection and one general purpose
* SDK Protocol
* Server sends its name to client
* ProfileManager
* Rename existing profile commands
* Add Upload Profile, Download Profile, and Get Active Profile commands
* SettingsManager
* Add Get, Set, and Save Settings commands
* Add zone::active_mode, zone::mode fields for zone-specific modes
* Add NET_PACKET_ID_RGBCONTROLLER_UPDATEZONEMODE packet for updating zone modes
* Add segment::matrix_map to segment packet
* Add NET_PACKET_ID_RGBCONTROLLER_SIGNALUPDATE packet for passing SignalUpdate signal from server to clients
* NetworkServer
* Formatting cleanup
* Use per-controller threads for handling NetworkServer controller-specific packets to avoid delays from controller mutexes
* NetworkClient
* Formatting cleanup
* RGBController
* Clean up and modularize descriptor functions
* Update OpenRGB Plugin Interface to include functions for loading/saving profile JSON data into OpenRGB profiles
* Update ProfileManager to handle auto-load profiles (Exit, Open, Resume, Suspend) and move their settings to ProfileManager section
* Update ProfileManager to store profiles in "profiles" folder in .json format
* Update ProfileManager to store size profile in sizes.json
* Update ProfileManager to perform device UpdateMode/UpdateColors when loading profile
* Code cleanup of ProfileManager and profile-related code