Skip to content

401 project save - #344

Merged
rozyczko merged 4 commits into
developfrom
401-project-save
Sep 9, 2026
Merged

rozyczko merged 4 commits into
developfrom
401-project-save

Conversation

@rozyczko

@rozyczko rozyczko commented Sep 8, 2026

Copy link
Copy Markdown
Member

This pull request implements tracking of unsaved changes to projects, improves save feedback, and enhances user experience regarding project state and application closure.

Unsaved Changes Tracking and Save Feedback

  • Added hasUnsavedChanges and lastSaved properties, along with corresponding signals, to both the backend (project.py, Project.qml) and frontend (BackendWrapper.qml) to track and expose whether the project has unsaved changes and when it was last saved.
  • Modified setters and backend signals so that any change to project content marks the project as "dirty" (unsaved), and saving or loading clears this flag. The backend now has explicit logic for marking/clearing dirty state, including a context manager to suppress dirty tracking during create/load/reset operations.
  • Save operations now emit success or error signals, with detailed user-friendly error messages for common failure cases (e.g., permission denied, file exists).

User Interface and User Experience

  • The "Save" button in the main application window is only enabled when there are unsaved changes, and provides visual feedback (flashing icon) on successful save. Tooltips and button states are contextually updated.
  • Closing the application with unsaved changes now prompts the user to save, discard, or cancel, ensuring no accidental data loss. The dialog only allows quitting after a successful save.
  • The reset dialog now warns specifically about unsaved changes if present, rather than always warning about data loss.
  • Save errors are shown in a modal dialog, ensuring users are aware of failures and can take action.

Backend and QML Integration

  • Exposed new properties and signals (projectLastSaved, projectHasUnsavedChanges, projectSaved, projectSaveError) through the BackendWrapper for easy binding in QML.
  • Connected all relevant backend signals to dirty tracking, ensuring all meaningful changes are captured and the UI accurately reflects the save state.

@rozyczko rozyczko added [scope] enhancement Adds/improves features (major.MINOR.patch) [priority] high Should be prioritized soon labels Sep 8, 2026
@rozyczko
rozyczko merged commit 5db37c1 into develop Sep 9, 2026
16 checks passed
@rozyczko
rozyczko deleted the 401-project-save branch September 9, 2026 12:52
rozyczko added a commit that referenced this pull request Oct 19, 2026
* accordion groups.
combine layer editor with model editor

* added fixes to other lists

* PR review fixes

* fixed treatment of multilayers

* duplicate/add layer should not append after subphase

* force collapse explicitly

* fix for assembly removal (+test)

* more PR related fixes

* added two standard icons for docs/issues

* can't move subphase and superphase. Can't replace these as well.

* remove redundant section in the report

* Implement scatter series for measured data and synchronize colors with
current experiment

* missed file

* Fixed issue with Sample tab
Added different ways to show experimental data (dots, circles, line)

* properly scaled residuals display

* zero display for residuals, initialization errors fixed.

* replaced `undo` icon with `home` for chart axis reset

* react to changed resolution % in the exp tab

* use easyapplication

* moved to EasyApplication module (#305)

* moved to EasyApplication module

* fixed test

* 1.2.0 -> 1.3.0

* only released modules

* updated release date and changelog

* summary prettified (#308)

* summary prettified

* minor fixes after code review

* make links clickable (#310)

* Bayesian analysis (#309)

* initial version.

* updates to the parameter passing

* nice Bayesian sub-tabs display

* add parameter names, add cancellation of sampling, add number of steps
in status bar

* correct parenting

* added required dependencies and modified Fit Status dialog

* add save button to the plots

* added tests for bayesian logic

* attempt at getting posterior median and credibility intervals on the
main chart

* enable/disable legends on bayesian sampling

* reload bumps images on recalculation. Use different caption when running
sampling

* updates and changes, new unit tests and GUI elements. New colors

* fixed typo

* actually sample multiple experiments

* nicer plots

* trace plot - nice display

* updated plots

* changes for the new EasyList based reflectometry-lib

* changes after updates to core

* unit test fixed

* weird conflict

* Bayesian fixes (#332)

* removed MD file, fixed #312

* fixed #313

* Fixed issues #312 - #322
Temporarily commented out code signing

* Addressed issues #323, #324, #325, #326

* addressed #327, #328, #329

* update paths in the Summary textboxes

* minor updates based on the new ERL

* summary results now show correct GoF #375

* reparent to released lib

* fixes from code review (#334)

* updated versioning (#335)

* Preparation for the release (#333) (#336)

* Polar channels (#338)

* initial version - dirty

* reparent ERL

* Code review comments addressed

* fix for file load

* added magnetic layers

* Added polarized experiment import and display

* bugs and issues addressed

* make polarized channels more performant

* minor fixes for tabbed elements, improved wording

* code review changes

* update the sample page with fitting results

* arviz follies

* added control over reflectivity profiles for up-up and down-down cases

* Added Summary docs, added PICKLE option for saving MPL plots

* spin asymmetry should be positive

* don't show errors for dependent parameters

* show correct error value

* Improved constraints (#339)

* initial commit

* updated constraints

* code review comments addressed

* show tooltip on long parameter names

* reparent reflectometry-lib to develop

* Sample layer visualization (#341)

* initial version

* bugfix: single-layer sample is misclassified and reports zero total
thickness

* Updated docs (#342)

* initial version

* bugfix: single-layer sample is misclassified and reports zero total
thickness

* updated docs

* Refactor SLD and molecular weight dependency in app structure (#343)

* changes for SLD <-> molecular weight dependence

* reparent the app

* attached functionality to the material editor rows

* updated docs

* added github-instructions for easier maintenance

* code review issues addressed

* disable density/formula fields when not directly using them

* code review comments addressed

* make molecular weight a descriptor

* reparent the library

* 401 project save (#344)

* Improved project tracking, #401

* backend state added

* CR review fixes

* fixed density subdialog enablement. Reparented lib to develop

* attempt at fixing some visual issues with the model editor #407 (#345)

* HOTFIX for native Linux dialogs

* Minor fixes (#349)

* added testing workflow

* fix tests

* fixes to windows tests

* fixed stuck UI results in Bayesian

* remove Qt imports/deps from Logic (Backend)

* fixed constraints de/serialization

* maintain consistence after model/experiment deletion

* P1 level issues addressed. Point 7 in the 311-REMAINING-ISSUES.md list

* addressed 9. Circular Plotting1d ↔ Analysis coupling from the main doc

* reparent the library

* PR review fixes

* reparent lib dependency

* attempt at fixing visa-related opengl issues (#347)

* attempt at fixing visa-related opengl issues

* improved handling of QTWEBENGINE rendering types

* added fit settings controls (#350)

* added fit settings controls

* addressed code review comments

* update the library branch

* multiple contrasts #425, phase 2 (#351)

* Added fixes for multiple contrasts handling. Also, added example files
in examples/ directory

* CR review issues addressed

* added docs on multiple contrasts. Fixed issue with overflowing text

* back to `develop` for the lib

* Add spin arrows (#346)

* added arrows for magnetic moment visualization

* fixed reflectometry-lib branch

* removed arrow from SLD plot. Fixed smaller issues

* replace circular control with a slider

* removed dependence on reflectometry-lib modifications

* Variable resolution changes from #425, issue #3 (#352)

* Variable resolution changes from #425, issue #3

* CR fixes

* added fixes to magnetism as per #425, section 3 (#354)

* added fixes to magnetism as per #425, section 3

* code review comments addressed

* reparent to develop

* updated MD files (#353)

* preparations for the release (#357)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[priority] high Should be prioritized soon [scope] enhancement Adds/improves features (major.MINOR.patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant