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.
This was observed in some cases on low-resolution screens, at least on
Linux and Windows.
The previously hardcoded value for the width of the text items' titlebar
(consisting of the buttons for formatting text) was replaced by a
method calculating its width (which varies based on screen resolution).
- Selecting multiple media items then grouping them didn't behave as it
should for other items => fixed by adding type tests
- A group containing several media items wasn't saved to SVG with those media
items as children, due to incorrect UUID copying in the mediaItems's
deepCopy() methods
This allows users to change the color of the background grid e.g if they
are using a projector or other low-contrast display.
The settings are in the `Board` category and are named `CrossColorDarkBackground`
and `CrossColorLightBackground`. They take strings representing the
color in any of the following formats:
- #RGB (Hexadecimal digits)
- #RRGGBB
- #AARRGGBB
- #RRRGGGBBB
- #RRRRGGGGBBBB
- Any SVG color keyword name (as defined by W3C)
- 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.
- Removed inheritance of UBGraphicsProxyWidget; cleaned up related code
- Added two children classes: UBGraphicsVideoItem and
UBGraphicsAudioItem. UBGraphicsMediaItem is now an abstract class.
- Better encapsulation; the Scene and other external classes no longer
access the mediaObject directly
There is now less distinction between audio and video items to outside
code: apart from the UBSvgSubsetAdaptor, there is no need to know
whether a media item holds a video or audio file. Creation is handled
through the static function `UBGraphicsMediaItem::createMediaItem(URL,
parent)`
- When clicking a stroke, they aren't moved immediately anymore; a
certain drag distance is necessary, which makes it easy (again) to
select a stroke with a stylus (which tends to move a little as it is
clicked, hence the problem).
- Removed duplicate code; the movement is now managed by
QGraphicsItemGroup::mouseMoveEvent. This prevents use of the transform()
method to get the stroke's transformation matrix; so sceneTransform() is
used instead when copying a strokes group.
- Also fixed an oversight in UBBoardView: Media items couldn't be moved
directly anymore.
This makes it possible e.g to use the colorPicker app in conjunction
with the compass.
Colors will still be updated when one clicks the pen or marker tools.
- Modified UBvgSubsetAdaptor to correctly save and load strokes, so the
transform matrices that were saved are now loaded correctly.
- Added handling of mousePress / Move / Release events to
UBGraphicsStrokesGroup, so that the transform matrix is calculated and
stored after moving a pen stroke directly (by clicking on it, and not on
its frame). Note: this duplicates quite a bit of code that is in
UBGraphicsDelegateFrame. It may be best to go back and modify both
classes so that the same functions can be called when moving a stroke.
- 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)
Application compiles and runs, with some caveats. Full list of changes:
- minor changes related to Qt4->Qt5 API differences
- Replaced calls to Carbon framework by Cocoa
- Removed registering of AE event handler. Seems to be done
automatically in Qt5.
- temporarily removed Podcast functionality, pending (presumably)
complete re-write due to Quicktime being obsolete in newer OS X
versions.
- Created OBCocoa namespace, and associated files src/core/OBCocoa.h/.mm, to
handle OS X - specific system calls. Currently used only by
UBApplication, but can in the future provide a useful interface between
the cocoa framework and OB, to avoid having too much OSX-specific code
in various files