88: Fix empty UI when a project is opened under a different mode#92
Merged
Conversation
than it was created in Task-Url: #88 A project saved under one mode (Portable vs Local) resolved its ledspicer.conf to the other mode's location on reload, so ConfigFile threw and openProject silently wiped the UI — project name in the title, nothing populated. - Derive a project's origin from disk (project-local ledspicer.conf => Portable, absent => Local) and refuse to open or save it under a mismatching mode, with a clear message and no state change. - On an unreadable/corrupt config, report and stay idle instead of entering an empty, editable project. - Validate new project names before creating: require a projects directory, a unique name, and a non-reserved ".bak" suffix; flag the entry inline. Add read-only Defaults::comboBoxHasId for the lookup. - Stop the color-combo refresh from marking the project dirty with no project open. - Add Settings::getModeLabels for the mismatch messages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opening a project while the app's execution mode differs from the mode the
project was created in left the UI responsive with the project name in the
title bar but no devices, inputs, animations, or profiles, and no error.
Root cause
Settings::getActiveConfigPath() resolves ledspicer.conf to a mode-dependent
location (system path for Local/Interactive, projectDir/ledspicer.conf for
Portable). A project saved under one mode was read from the wrong location
under the other, so ConfigFile threw (MainWindow.cpp:645) and openProject's
catch silently wiped every collection while still enabling the tabs.
Changes
under a mismatching mode is refused with a message, before any state change.
the UI idle instead of showing an empty, editable project.
and a non-reserved ".bak" suffix, with an inline error on the name entry.
Testing
Built clean; manually verified: Local project opened in Portable (and vice
versa) is refused with the message; corrupt config lands idle; new-project
name validation for empty projects dir, duplicate, and ".bak"; mid-session
mode switch blocks save instead of duplicating the config.
Related
Follow-ups tracked separately: #89 (restrictor-only save validation),
#91 (restrictor-only load), #90 (migration / read-only config).
Closes #88