Skip to content

Pagescene: identify if changes made this session

Colin Macdonald requested to merge dirty_scene into main

A bug:

  1. Annotate a paper.
  2. close annotator
  3. open to reannotator
  4. but don't change anything
  5. try to close annotator

In step 5 you will get a message like "There are annotations, are you sure want to close?" which isn't quite right b/c there are annotations but they are saved. The state is "clean". So instead we should just close. This doesn't seem too serious but is annoying for some UI experiments I'm trying.

This MR tries to fix this bug by adding a "is_dirty()" concept to PageScene . Its feels like a bit of hack, but does obey the campsite rule: added a Mixin class to remove some itemChanged code duplication.

I found out after I did this that QUndoStack has a clean concept which could probably could be used here to remove the _dirty instance variable. Maybe later: a TODO has been left perfectly solves this problem.

Edited by Colin Macdonald

Merge request reports