Previously, items such as audio, video, and widget items could not be
cut and pasted because when the page was saved, any item that had been
deleted was permanently removed (including its source file, in the case
of these mulitmedia items).
This commit prevents the deletion any item in the undoStack
(i.e, items that have been deleted) when the document is persisted,
meaning the source file is still available when pasting the item on
another page (or document).
Note that this can lead to cases where the source file is kept in the
document even when no item is present. This should be a relatively rare
occurence, however.
This fixes two related issues:
1) When taking a partial screenshot of the desktop, then copying it
(Ctrl-C) and pasting it in a new document, it was not saved
2) When a page of one document was copied into another (in document
mode, by dragging the page onto another document), media files
disappeared from the new page.
- The background selection palette now includes a slider to change the
size of the background grid. Default min/max values are 16 and 64px,
defined in UBSettings. Grid resizes dynamically as the slider is moved.
- Measuring tools' (ruler, triangle) markers follow grid size: 1 square
of the background grid corresponds to 1cm
- Grid size can be different for each page of a document
- Grid size is saved in the .svg
- Documents with a background grid but no specified grid size follow the
default size defined in UBSettings.
Previously, grid size was calculated based on DPI, which can vary from
one OS, computer or display to the next. This new setting allows
documents to be migrated from one machine to another with no unexpected
changes in grid size happening. It also makes it easy to correct any
problems importing old documents (whose grid size might be smaller or
larger than expected when imported on a new version of OpenBoard).
This should cut down on disk access. Instead of loading and saving
settings directly through QSettings instances (which occasionally
read and write to their associated file; but there is no way to control
how often this happens), they are now added to a QHash for in-app
access.
Save() and load() functions were also added to enable manually saving
the settings, and loading all settings from file, respectively.
- Moved all platform-specific code to UBPlatformUtils
- For now, removed support (on Linux) for checking whether onboard is
running when OpenBoard is started (it wasn't working anyway, but it needs a
cleaner solution for all 3 platforms)