diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro
index 273cc9e8..722a9f79 100644
--- a/Sankore_3.1.pro
+++ b/Sankore_3.1.pro
@@ -7,8 +7,8 @@ CONFIG += debug_and_release \
no_include_pwd
VERSION_MAJ = 1
-VERSION_MIN = 20
-VERSION_TYPE = r # a = alpha, b = beta, r = release, other => error
+VERSION_MIN = 26
+VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 00
VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
diff --git a/resources/forms/mainWindow.ui b/resources/forms/mainWindow.ui
index 790c01fc..22f94ccb 100644
--- a/resources/forms/mainWindow.ui
+++ b/resources/forms/mainWindow.ui
@@ -1,1646 +1,1631 @@
-
-
- MainWindow
-
-
-
- 0
- 0
- 1342
- 334
-
-
-
- Uniboard
-
-
-
- :/images/uniboard.png:/images/uniboard.png
-
-
-
- 32
- 32
-
-
-
- Qt::ToolButtonTextUnderIcon
-
-
- false
-
-
-
-
- Qt::PreventContextMenu
-
-
- Board
-
-
- false
-
-
- Qt::BottomToolBarArea|Qt::TopToolBarArea
-
-
-
- 48
- 32
-
-
-
- false
-
-
- TopToolBarArea
-
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Qt::PreventContextMenu
-
-
- Web
-
-
- false
-
-
- Qt::BottomToolBarArea|Qt::TopToolBarArea
-
-
-
- 48
- 32
-
-
-
- false
-
-
- TopToolBarArea
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Qt::PreventContextMenu
-
-
- Documents
-
-
- false
-
-
- Qt::BottomToolBarArea|Qt::TopToolBarArea
-
-
-
- 48
- 32
-
-
-
- false
-
-
- TopToolBarArea
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Qt::PreventContextMenu
-
-
- Tutorial
-
-
- Qt::LeftToRight
-
-
- false
-
-
- Qt::BottomToolBarArea|Qt::TopToolBarArea
-
-
-
- 48
- 32
-
-
-
- false
-
-
- TopToolBarArea
-
-
- true
-
-
-
-
-
-
-
-
- true
-
-
- true
-
-
-
- :/images/toolbar/stylus.png:/images/toolbar/stylus.png
-
-
- Stylus
-
-
- Stylus
-
-
- Ctrl+T
-
-
-
-
- true
-
-
-
- :/images/toolbar/background.png:/images/toolbar/background.png
-
-
- Backgrounds
-
-
- Change Background
-
-
-
-
-
- :/images/toolbar/undoOn.png:/images/toolbar/undoOn.png
-
-
- Undo
-
-
- Ctrl+Z
-
-
-
-
-
- :/images/toolbar/redoOn.png:/images/toolbar/redoOn.png
-
-
- Redo
-
-
- Ctrl+Y
-
-
-
-
-
- :/images/toolbar/previousPageOn.png:/images/toolbar/previousPageOn.png
-
-
- Previous
-
-
- Previous Page
-
-
- PgUp
-
-
-
-
-
- :/images/toolbar/nextPageOn.png:/images/toolbar/nextPageOn.png
-
-
- Next
-
-
- Next Page
-
-
- PgDown
-
-
-
-
- false
-
-
-
- :/images/toolbar/documents.png:/images/toolbar/documents.png
-
-
- Documents
-
-
- Manage Documents
-
-
- Ctrl+D
-
-
-
-
-
- :/images/toolbar/web.png:/images/toolbar/web.png
-
-
- Web
-
-
- Web Browsing
-
-
- Ctrl+W
-
-
-
-
- true
-
-
- true
-
-
-
- :/images/toolbar/smallPen.png:/images/toolbar/smallPen.png
-
-
- Line
-
-
- Small Line
-
-
-
-
- true
-
-
-
- :/images/toolbar/mediumPen.png:/images/toolbar/mediumPen.png
-
-
- Line
-
-
- Medium Line
-
-
-
-
- true
-
-
-
- :/images/toolbar/largePen.png:/images/toolbar/largePen.png
-
-
- Line
-
-
- Large Line
-
-
-
-
-
- :/images/toolbar/quitOn.png:/images/toolbar/quitOn.png
-
-
- Quit
-
-
- Quit Uniboard
-
-
- Qt::WindowShortcut
-
-
- QAction::NoRole
-
-
-
-
- true
-
-
-
- :/images/toolbar/smallEraser.png:/images/toolbar/smallEraser.png
-
-
- Eraser
-
-
- Smalle Eraser
-
-
-
-
- true
-
-
- true
-
-
-
- :/images/toolbar/mediumEraser.png:/images/toolbar/mediumEraser.png
-
-
- Eraser
-
-
- Medium Eraser
-
-
-
-
- true
-
-
-
- :/images/toolbar/largeEraser.png:/images/toolbar/largeEraser.png
-
-
- Eraser
-
-
- Large Eraser
-
-
-
-
-
- :/images/toolbar/color.png:/images/toolbar/color.png
-
-
- Color
-
-
- Color
-
-
-
-
-
- :/images/toolbar/color.png:/images/toolbar/color.png
-
-
- Color
-
-
-
-
-
- :/images/toolbar/color.png:/images/toolbar/color.png
-
-
- Color
-
-
-
-
-
- :/images/toolbar/color.png:/images/toolbar/color.png
-
-
- Color
-
-
-
-
-
- :/images/toolbar/previousPageOn.png:/images/toolbar/previousPageOn.png
-
-
- Back
-
-
- Previous Page
-
-
- Left
-
-
-
-
-
- :/images/toolbar/nextPageOn.png:/images/toolbar/nextPageOn.png
-
-
- Forward
-
-
- Next Page
-
-
- Right
-
-
-
-
-
- :/images/toolbar/reload.png:/images/toolbar/reload.png
-
-
- Reload
-
-
- Reload Current Page
-
-
-
-
-
- :/images/toolbar/home.png:/images/toolbar/home.png
-
-
- Home
-
-
- Load Home Page
-
-
-
-
-
- :/images/toolbar/bookmarks.png:/images/toolbar/bookmarks.png
-
-
- Bookmarks
-
-
- Show Bookmarks
-
-
-
-
-
- :/images/toolbar/addBookmark.png:/images/toolbar/addBookmark.png
-
-
- Bookmark
-
-
- Add Bookmark
-
-
-
-
-
- :/images/toolbar/board.png:/images/toolbar/board.png
-
-
- Board
-
-
- Display Board
-
-
- Ctrl+B
-
-
-
-
- true
-
-
-
- :/images/toolbar/clearPage.png:/images/toolbar/clearPage.png
-
-
- Erase
-
-
- Erase Content
-
-
-
-
-
- :/images/toolbar/settings.png:/images/toolbar/settings.png
-
-
- Preferences
-
-
- Display Preferences
-
-
-
-
- true
-
-
-
- :/images/toolbar/library.png:/images/toolbar/library.png
-
-
- Library
-
-
- Show Library
-
-
- Ctrl+L
-
-
-
-
-
- :/images/toolbar/menu.png:/images/toolbar/menu.png
-
-
- Sankoré 3.1
-
-
- Sankore 3.1
-
-
-
-
-
- :/images/toolbar/display.png:/images/toolbar/display.png
-
-
- Show Desktop
-
-
- Show Computer Desktop
-
-
- Ctrl+Shift+H
-
-
-
-
-
- :/images/stylusPalette/zoomIn.png:/images/stylusPalette/zoomIn.png
-
-
- Bigger
-
-
- Zoom In
-
-
- Ctrl++
-
-
-
-
-
- :/images/stylusPalette/zoomOut.png:/images/stylusPalette/zoomOut.png
-
-
- Smaller
-
-
- Zoom Out
-
-
- Ctrl+-
-
-
-
-
-
- :/images/toolbar/newFolder.png:/images/toolbar/newFolder.png
-
-
- New Folder
-
-
- Create a New Folder
-
-
-
-
-
- :/images/toolbar/newDocument.png:/images/toolbar/newDocument.png
-
-
- New Document
-
-
- Create a New Document
-
-
-
-
-
- :/images/toolbar/import.png:/images/toolbar/import.png
-
-
- Import
-
-
- Import a Document
-
-
-
-
-
- :/images/toolbar/export.png:/images/toolbar/export.png
-
-
- Export
-
-
- Export a Document
-
-
-
-
-
- :/images/toolbar/open.png:/images/toolbar/open.png
-
-
- Open in Board
-
-
- Open Page in Board
-
-
- Ctrl+O
-
-
-
-
-
- :/images/toolbar/duplicate.png:/images/toolbar/duplicate.png
-
-
- Duplicate
-
-
- Duplicate Selected Content
-
-
-
-
-
- :/images/toolbar/deleteDocument.png:/images/toolbar/deleteDocument.png
-
-
- Delete
-
-
- Delete Selected Content
-
-
- Del
-
-
-
-
-
- :/images/toolbar/addToWorkingDoc.png:/images/toolbar/addToWorkingDoc.png
-
-
- Add to Working Document
-
-
- Add Selected Content to Open Document
-
-
-
-
-
- :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
-
-
- Add
-
-
- Add Content to Document
-
-
-
-
-
- :/images/toolbar/rename.png:/images/toolbar/rename.png
-
-
- Rename
-
-
- Rename Content
-
-
- QAction::TextHeuristicRole
-
-
-
-
-
- :/images/toolbar/tools.png:/images/toolbar/tools.png
-
-
- Tools
-
-
- Display Tools
-
-
-
-
- true
-
-
-
- :/images/toolbar/tools.png:/images/toolbar/tools.png
-
-
- Tools
-
-
- Display Tools
-
-
-
-
- true
-
-
- true
-
-
-
- :/images/toolbar/display.png:/images/toolbar/display.png
-
-
- Multi Screen
-
-
-
-
- true
-
-
-
- :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
-
-
- Wide Size (16/9)
-
-
- Wide Size (16/9)
-
-
- Use Document Wide Size (16/9)
-
-
- false
-
-
-
-
- true
-
-
-
- :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
-
-
- Regular Size (4/3)
-
-
- Regular Size (4/3)
-
-
- Use Document Regular Size (4/3)
-
-
- false
-
-
-
-
- true
-
-
- false
-
-
-
- :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
-
-
- Custom Size
-
-
- Custom Size
-
-
- Use Custom Document Size
-
-
- false
-
-
-
-
-
- :/images/toolbar/deleteDocument.png:/images/toolbar/deleteDocument.png
-
-
- Stop Loading
-
-
- Stop Loading Web Page
-
-
-
-
-
- :/images/toolbar/cut.png:/images/toolbar/cut.png
-
-
- Cut
-
-
- Qt::ApplicationShortcut
-
-
-
-
-
- :/images/toolbar/copy.png:/images/toolbar/copy.png
-
-
- Copy
-
-
- Qt::ApplicationShortcut
-
-
-
-
-
- :/images/toolbar/paste.png:/images/toolbar/paste.png
-
-
- Paste
-
-
- Qt::ApplicationShortcut
-
-
- QAction::TextHeuristicRole
-
-
-
-
-
- :/images/extraPalette/blackout.png
- :/images/extraPalette/blackoutOn.png:/images/extraPalette/blackout.png
-
-
- Sleep
-
-
- Put Presentation to Sleep
-
-
-
-
- true
-
-
-
- :/images/extraPalette/keyboard.png
- :/images/extraPalette/keyboardOn.png:/images/extraPalette/keyboard.png
-
-
- Virtual Keyboard
-
-
- Display Virtual Keyboard
-
-
-
-
- true
-
-
-
- :/images/backgroundPalette/background1.svg
- :/images/backgroundPalette/background1On.svg:/images/backgroundPalette/background1.svg
-
-
- Plain Light Background
-
-
- Light
-
-
- Plain Light Background
-
-
-
-
- true
-
-
-
- :/images/backgroundPalette/background2.svg
- :/images/backgroundPalette/background2On.svg:/images/backgroundPalette/background2.svg
-
-
- Grid Light Background
-
-
- Light
-
-
- Grid Light Background
-
-
-
-
- true
-
-
-
- :/images/backgroundPalette/background3.svg
- :/images/backgroundPalette/background3On.svg:/images/backgroundPalette/background3.svg
-
-
- Plain Dark Background
-
-
- Dark
-
-
- Plain Dark Background
-
-
-
-
- true
-
-
-
- :/images/backgroundPalette/background4.svg
- :/images/backgroundPalette/background4On.svg:/images/backgroundPalette/background4.svg
-
-
- Grid Dark Background
-
-
- Dark
-
-
- Grid Dark Background
-
-
-
-
- true
-
-
-
- :/images/toolbar/record.png:/images/toolbar/record.png
-
-
- Podcast
-
-
- Record Presentation to Video
-
-
-
-
- true
-
-
-
- :/images/toolbar/record.png
- :/images/toolbar/stop.png:/images/toolbar/record.png
-
-
- Record
-
-
- Start Screen Recording
-
-
-
-
-
- :/images/erasePalette/eraseItem.svg:/images/erasePalette/eraseItem.svg
-
-
- Erase Items
-
-
- Erase All Items
-
-
-
-
-
- :/images/erasePalette/eraseAnnotation.svg:/images/erasePalette/eraseAnnotation.svg
-
-
- Erase Annotations
-
-
- Erase All Annotations
-
-
-
-
-
- :/images/erasePalette/eraseAll.svg:/images/erasePalette/eraseAll.svg
-
-
- Clear Page
-
-
- Clear All Elements
-
-
-
-
-
- :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
-
-
- Add
-
-
-
-
- true
-
-
- true
-
-
-
- :/images/stylusPalette/pen.png
- :/images/stylusPalette/penOn.png:/images/stylusPalette/pen.png
-
-
- Pen
-
-
- Annotate Document
-
-
- Ctrl+I
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/eraser.png
- :/images/stylusPalette/eraserOn.png:/images/stylusPalette/eraser.png
-
-
- Eraser
-
-
- Erase Annotation
-
-
- Ctrl+E
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/marker.png
- :/images/stylusPalette/markerOn.png:/images/stylusPalette/marker.png
-
-
- Marker
-
-
- Highlight
-
-
- Ctrl+M
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/arrow.png
- :/images/stylusPalette/arrowOn.png:/images/stylusPalette/arrow.png
-
-
- Selector
-
-
- Select And Modify Objects
-
-
- Ctrl+F
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/hand.png
- :/images/stylusPalette/handOn.png:/images/stylusPalette/hand.png
-
-
- Hand
-
-
- Scroll Page
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/zoomIn.png
- :/images/stylusPalette/zoomInOn.png:/images/stylusPalette/zoomIn.png
-
-
- Zoom In
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/zoomOut.png
- :/images/stylusPalette/zoomOutOn.png:/images/stylusPalette/zoomOut.png
-
-
- Zoom Out
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/laser.png
- :/images/stylusPalette/laserOn.png:/images/stylusPalette/laser.png
-
-
- Laser Pointer
-
-
- Virtual Laser Pointer
-
-
- Ctrl+G
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/line.png
- :/images/stylusPalette/lineOn.png:/images/stylusPalette/line.png
-
-
- Line
-
-
- Draw Lines
-
-
- Ctrl+J
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/text.png
- :/images/stylusPalette/textOn.png:/images/stylusPalette/text.png
-
-
- Text
-
-
- Write Text
-
-
- Ctrl+K
-
-
-
-
- true
-
-
-
- :/images/stylusPalette/captureArea.png
- :/images/stylusPalette/captureAreaOn.png:/images/stylusPalette/captureArea.png
-
-
- Capture
-
-
- Capture Part of the Screen
-
-
-
-
-
- :/images/addItemToCurrentPage.svg:/images/addItemToCurrentPage.svg
-
-
- Add To Current Page
-
-
- Add To Current Page
-
-
- Add Item To Current Page
-
-
-
-
-
- :/images/addItemToNewPage.svg:/images/addItemToNewPage.svg
-
-
- Add To New Page
-
-
- Add Item To New Page
-
-
-
-
-
- :/images/addItemToLibrary.svg:/images/addItemToLibrary.svg
-
-
- Add To Library
-
-
- Add Item To Library
-
-
-
-
- false
-
-
-
- :/images/toolbar/newDocument.png:/images/toolbar/newDocument.png
-
-
- Pages
-
-
- Create a New Page
-
-
-
-
-
- :/images/addItemToCurrentPage.svg:/images/addItemToCurrentPage.svg
-
-
- New Page
-
-
- Create a New Page
-
-
-
-
-
- :/images/addItemToNewPage.svg:/images/addItemToNewPage.svg
-
-
- Duplicate Page
-
-
- Duplicate the Current Page
-
-
-
-
-
- :/images/addItemToLibrary.svg:/images/addItemToLibrary.svg
-
-
- Import Page
-
-
- Import an External Page
-
-
-
-
- true
-
-
- false
-
-
-
- :/images/toolbar/pause.png:/images/toolbar/pause.png
-
-
- Pause
-
-
- Pause Podcast Recording
-
-
-
-
-
- :/images/toolbar/settings.png:/images/toolbar/settings.png
-
-
- Podcast Config
-
-
- Configure Podcast Recording
-
-
-
-
-
- :/images/toolbar/addToolToLibrary.png:/images/toolbar/addToolToLibrary.png
-
-
- Flash Trap
-
-
- Trap Flash Content
-
-
-
-
- true
-
-
-
- :/images/extraPalette/webTrap.png
- :/images/extraPalette/webTrapEnabled.png:/images/extraPalette/webTrap.png
-
-
- Web Trap
-
-
- Trap Web Content
-
-
-
-
-
- :/images/toolbar/captureArea.png:/images/toolbar/captureArea.png
-
-
- Custom Capture
-
-
- Capture Part of the Screen
-
-
-
-
-
- :/images/toolbar/captureWindow.png:/images/toolbar/captureWindow.png
-
-
- Window Capture
-
-
- Capture a Window
-
-
-
-
- false
-
-
-
- :/images/extraPalette/oEmbed.png:/images/extraPalette/oEmbed.png
-
-
- Embed Web Content
-
-
- Capture Embeddable Web Content
-
-
-
-
- true
-
-
-
- :/images/toolbar/eyeClosed.png
- :/images/toolbar/eyeOpened.png:/images/toolbar/eyeClosed.png
-
-
- Show on Display
-
-
- Show Main Screen on Display Screen
-
-
- false
-
-
- QAction::TextHeuristicRole
-
-
-
-
- true
-
-
-
- :/images/toolbar/tools.png:/images/toolbar/tools.png
-
-
- Tools
-
-
- Define Drawing Options
-
-
-
-
-
- :/images/erasePalette/eraseAnnotation.svg:/images/erasePalette/eraseAnnotation.svg
-
-
- Erase Annotations
-
-
- Erase all Annotations
-
-
-
-
-
- :/images/toolbar/addToolToLibrary.png:/images/toolbar/addToolToLibrary.png
-
-
- eduMedia
-
-
- Import eduMedia simulation
-
-
-
-
-
- :/images/toolbar/tutorial.png:/images/toolbar/tutorial.png
-
-
- Tutorial
-
-
- Open the tutorial
-
-
-
-
-
- :/images/toolbar/updates.png:/images/toolbar/updates.png
-
-
- Check Update
-
-
-
-
-
- :/images/toolbar/paraschool.png:/images/toolbar/paraschool.png
-
-
- Sankoré Editor
-
-
- Show Sankore Widgets Editor
-
-
-
-
-
- :/images/toolbar/hide.png:/images/toolbar/hide.png
-
-
- Hide Sankoré
-
-
- Hide Sankoré Application
-
-
- Ctrl+H
-
-
-
-
-
-
-
-
+
+
+ MainWindow
+
+
+
+ 0
+ 0
+ 1342
+ 334
+
+
+
+ Uniboard
+
+
+
+ :/images/uniboard.png:/images/uniboard.png
+
+
+
+ 32
+ 32
+
+
+
+ Qt::ToolButtonTextUnderIcon
+
+
+ false
+
+
+
+
+ Qt::PreventContextMenu
+
+
+ Board
+
+
+ false
+
+
+ Qt::BottomToolBarArea|Qt::TopToolBarArea
+
+
+
+ 48
+ 32
+
+
+
+ false
+
+
+ TopToolBarArea
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Qt::PreventContextMenu
+
+
+ Web
+
+
+ false
+
+
+ Qt::BottomToolBarArea|Qt::TopToolBarArea
+
+
+
+ 48
+ 32
+
+
+
+ false
+
+
+ TopToolBarArea
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Qt::PreventContextMenu
+
+
+ Documents
+
+
+ false
+
+
+ Qt::BottomToolBarArea|Qt::TopToolBarArea
+
+
+
+ 48
+ 32
+
+
+
+ false
+
+
+ TopToolBarArea
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Qt::PreventContextMenu
+
+
+ Tutorial
+
+
+ Qt::LeftToRight
+
+
+ false
+
+
+ Qt::BottomToolBarArea|Qt::TopToolBarArea
+
+
+
+ 48
+ 32
+
+
+
+ false
+
+
+ TopToolBarArea
+
+
+ true
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+
+ :/images/toolbar/stylus.png:/images/toolbar/stylus.png
+
+
+ Stylus
+
+
+ Stylus
+
+
+ Ctrl+T
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/background.png:/images/toolbar/background.png
+
+
+ Backgrounds
+
+
+ Change Background
+
+
+
+
+
+ :/images/toolbar/undoOn.png:/images/toolbar/undoOn.png
+
+
+ Undo
+
+
+ Ctrl+Z
+
+
+
+
+
+ :/images/toolbar/redoOn.png:/images/toolbar/redoOn.png
+
+
+ Redo
+
+
+ Ctrl+Y
+
+
+
+
+
+ :/images/toolbar/previousPageOn.png:/images/toolbar/previousPageOn.png
+
+
+ Previous
+
+
+ Previous Page
+
+
+ PgUp
+
+
+
+
+
+ :/images/toolbar/nextPageOn.png:/images/toolbar/nextPageOn.png
+
+
+ Next
+
+
+ Next Page
+
+
+ PgDown
+
+
+
+
+ false
+
+
+
+ :/images/toolbar/documents.png:/images/toolbar/documents.png
+
+
+ Documents
+
+
+ Manage Documents
+
+
+ Ctrl+D
+
+
+
+
+
+ :/images/toolbar/web.png:/images/toolbar/web.png
+
+
+ Web
+
+
+ Web Browsing
+
+
+ Ctrl+W
+
+
+
+
+ true
+
+
+ true
+
+
+
+ :/images/toolbar/smallPen.png:/images/toolbar/smallPen.png
+
+
+ Line
+
+
+ Small Line
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/mediumPen.png:/images/toolbar/mediumPen.png
+
+
+ Line
+
+
+ Medium Line
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/largePen.png:/images/toolbar/largePen.png
+
+
+ Line
+
+
+ Large Line
+
+
+
+
+
+ :/images/toolbar/quitOn.png:/images/toolbar/quitOn.png
+
+
+ Quit
+
+
+ Quit Uniboard
+
+
+ Qt::WindowShortcut
+
+
+ QAction::NoRole
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/smallEraser.png:/images/toolbar/smallEraser.png
+
+
+ Eraser
+
+
+ Smalle Eraser
+
+
+
+
+ true
+
+
+ true
+
+
+
+ :/images/toolbar/mediumEraser.png:/images/toolbar/mediumEraser.png
+
+
+ Eraser
+
+
+ Medium Eraser
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/largeEraser.png:/images/toolbar/largeEraser.png
+
+
+ Eraser
+
+
+ Large Eraser
+
+
+
+
+
+ :/images/toolbar/color.png:/images/toolbar/color.png
+
+
+ Color
+
+
+ Color
+
+
+
+
+
+ :/images/toolbar/color.png:/images/toolbar/color.png
+
+
+ Color
+
+
+
+
+
+ :/images/toolbar/color.png:/images/toolbar/color.png
+
+
+ Color
+
+
+
+
+
+ :/images/toolbar/color.png:/images/toolbar/color.png
+
+
+ Color
+
+
+
+
+
+ :/images/toolbar/previousPageOn.png:/images/toolbar/previousPageOn.png
+
+
+ Back
+
+
+ Previous Page
+
+
+ Left
+
+
+
+
+
+ :/images/toolbar/nextPageOn.png:/images/toolbar/nextPageOn.png
+
+
+ Forward
+
+
+ Next Page
+
+
+ Right
+
+
+
+
+
+ :/images/toolbar/reload.png:/images/toolbar/reload.png
+
+
+ Reload
+
+
+ Reload Current Page
+
+
+
+
+
+ :/images/toolbar/home.png:/images/toolbar/home.png
+
+
+ Home
+
+
+ Load Home Page
+
+
+
+
+
+ :/images/toolbar/bookmarks.png:/images/toolbar/bookmarks.png
+
+
+ Bookmarks
+
+
+ Show Bookmarks
+
+
+
+
+
+ :/images/toolbar/addBookmark.png:/images/toolbar/addBookmark.png
+
+
+ Bookmark
+
+
+ Add Bookmark
+
+
+
+
+
+ :/images/toolbar/board.png:/images/toolbar/board.png
+
+
+ Board
+
+
+ Display Board
+
+
+ Ctrl+B
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/clearPage.png:/images/toolbar/clearPage.png
+
+
+ Erase
+
+
+ Erase Content
+
+
+
+
+
+ :/images/toolbar/settings.png:/images/toolbar/settings.png
+
+
+ Preferences
+
+
+ Display Preferences
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/library.png:/images/toolbar/library.png
+
+
+ Library
+
+
+ Show Library
+
+
+ Ctrl+L
+
+
+
+
+
+ :/images/toolbar/menu.png:/images/toolbar/menu.png
+
+
+ Sankoré 3.1
+
+
+ Sankore 3.1
+
+
+
+
+
+ :/images/toolbar/display.png:/images/toolbar/display.png
+
+
+ Show Desktop
+
+
+ Show Computer Desktop
+
+
+ Ctrl+Shift+H
+
+
+
+
+
+ :/images/stylusPalette/zoomIn.png:/images/stylusPalette/zoomIn.png
+
+
+ Bigger
+
+
+ Zoom In
+
+
+ Ctrl++
+
+
+
+
+
+ :/images/stylusPalette/zoomOut.png:/images/stylusPalette/zoomOut.png
+
+
+ Smaller
+
+
+ Zoom Out
+
+
+ Ctrl+-
+
+
+
+
+
+ :/images/toolbar/newFolder.png:/images/toolbar/newFolder.png
+
+
+ New Folder
+
+
+ Create a New Folder
+
+
+
+
+
+ :/images/toolbar/newDocument.png:/images/toolbar/newDocument.png
+
+
+ New Document
+
+
+ Create a New Document
+
+
+
+
+
+ :/images/toolbar/import.png:/images/toolbar/import.png
+
+
+ Import
+
+
+ Import a Document
+
+
+
+
+
+ :/images/toolbar/export.png:/images/toolbar/export.png
+
+
+ Export
+
+
+ Export a Document
+
+
+
+
+
+ :/images/toolbar/open.png:/images/toolbar/open.png
+
+
+ Open in Board
+
+
+ Open Page in Board
+
+
+ Ctrl+O
+
+
+
+
+
+ :/images/toolbar/duplicate.png:/images/toolbar/duplicate.png
+
+
+ Duplicate
+
+
+ Duplicate Selected Content
+
+
+
+
+
+ :/images/toolbar/deleteDocument.png:/images/toolbar/deleteDocument.png
+
+
+ Delete
+
+
+ Delete Selected Content
+
+
+ Del
+
+
+
+
+
+ :/images/toolbar/addToWorkingDoc.png:/images/toolbar/addToWorkingDoc.png
+
+
+ Add to Working Document
+
+
+ Add Selected Content to Open Document
+
+
+
+
+
+ :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
+
+
+ Add
+
+
+ Add Content to Document
+
+
+
+
+
+ :/images/toolbar/rename.png:/images/toolbar/rename.png
+
+
+ Rename
+
+
+ Rename Content
+
+
+ QAction::TextHeuristicRole
+
+
+
+
+
+ :/images/toolbar/tools.png:/images/toolbar/tools.png
+
+
+ Tools
+
+
+ Display Tools
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/tools.png:/images/toolbar/tools.png
+
+
+ Tools
+
+
+ Display Tools
+
+
+
+
+ true
+
+
+ true
+
+
+
+ :/images/toolbar/display.png:/images/toolbar/display.png
+
+
+ Multi Screen
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
+
+
+ Wide Size (16/9)
+
+
+ Wide Size (16/9)
+
+
+ Use Document Wide Size (16/9)
+
+
+ false
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
+
+
+ Regular Size (4/3)
+
+
+ Regular Size (4/3)
+
+
+ Use Document Regular Size (4/3)
+
+
+ false
+
+
+
+
+ true
+
+
+ false
+
+
+
+ :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
+
+
+ Custom Size
+
+
+ Custom Size
+
+
+ Use Custom Document Size
+
+
+ false
+
+
+
+
+
+ :/images/toolbar/deleteDocument.png:/images/toolbar/deleteDocument.png
+
+
+ Stop Loading
+
+
+ Stop Loading Web Page
+
+
+
+
+
+ :/images/toolbar/cut.png:/images/toolbar/cut.png
+
+
+ Cut
+
+
+ Qt::ApplicationShortcut
+
+
+
+
+
+ :/images/toolbar/copy.png:/images/toolbar/copy.png
+
+
+ Copy
+
+
+ Qt::ApplicationShortcut
+
+
+
+
+
+ :/images/toolbar/paste.png:/images/toolbar/paste.png
+
+
+ Paste
+
+
+ Qt::ApplicationShortcut
+
+
+ QAction::TextHeuristicRole
+
+
+
+
+
+ :/images/extraPalette/blackout.png
+ :/images/extraPalette/blackoutOn.png:/images/extraPalette/blackout.png
+
+
+ Sleep
+
+
+ Put Presentation to Sleep
+
+
+
+
+ true
+
+
+
+ :/images/extraPalette/keyboard.png
+ :/images/extraPalette/keyboardOn.png:/images/extraPalette/keyboard.png
+
+
+ Virtual Keyboard
+
+
+ Display Virtual Keyboard
+
+
+
+
+ true
+
+
+
+ :/images/backgroundPalette/background1.svg
+ :/images/backgroundPalette/background1On.svg:/images/backgroundPalette/background1.svg
+
+
+ Plain Light Background
+
+
+ Light
+
+
+ Plain Light Background
+
+
+
+
+ true
+
+
+
+ :/images/backgroundPalette/background2.svg
+ :/images/backgroundPalette/background2On.svg:/images/backgroundPalette/background2.svg
+
+
+ Grid Light Background
+
+
+ Light
+
+
+ Grid Light Background
+
+
+
+
+ true
+
+
+
+ :/images/backgroundPalette/background3.svg
+ :/images/backgroundPalette/background3On.svg:/images/backgroundPalette/background3.svg
+
+
+ Plain Dark Background
+
+
+ Dark
+
+
+ Plain Dark Background
+
+
+
+
+ true
+
+
+
+ :/images/backgroundPalette/background4.svg
+ :/images/backgroundPalette/background4On.svg:/images/backgroundPalette/background4.svg
+
+
+ Grid Dark Background
+
+
+ Dark
+
+
+ Grid Dark Background
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/record.png:/images/toolbar/record.png
+
+
+ Podcast
+
+
+ Record Presentation to Video
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/record.png
+ :/images/toolbar/stop.png:/images/toolbar/record.png
+
+
+ Record
+
+
+ Start Screen Recording
+
+
+
+
+
+ :/images/erasePalette/eraseItem.svg:/images/erasePalette/eraseItem.svg
+
+
+ Erase Items
+
+
+ Erase All Items
+
+
+
+
+
+ :/images/erasePalette/eraseAnnotation.svg:/images/erasePalette/eraseAnnotation.svg
+
+
+ Erase Annotations
+
+
+ Erase All Annotations
+
+
+
+
+
+ :/images/erasePalette/eraseAll.svg:/images/erasePalette/eraseAll.svg
+
+
+ Clear Page
+
+
+ Clear All Elements
+
+
+
+
+
+ :/images/toolbar/addToPage.png:/images/toolbar/addToPage.png
+
+
+ Add
+
+
+
+
+ true
+
+
+ true
+
+
+
+ :/images/stylusPalette/pen.png
+ :/images/stylusPalette/penOn.png:/images/stylusPalette/pen.png
+
+
+ Pen
+
+
+ Annotate Document
+
+
+ Ctrl+I
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/eraser.png
+ :/images/stylusPalette/eraserOn.png:/images/stylusPalette/eraser.png
+
+
+ Eraser
+
+
+ Erase Annotation
+
+
+ Ctrl+E
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/marker.png
+ :/images/stylusPalette/markerOn.png:/images/stylusPalette/marker.png
+
+
+ Marker
+
+
+ Highlight
+
+
+ Ctrl+M
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/arrow.png
+ :/images/stylusPalette/arrowOn.png:/images/stylusPalette/arrow.png
+
+
+ Selector
+
+
+ Select And Modify Objects
+
+
+ Ctrl+F
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/hand.png
+ :/images/stylusPalette/handOn.png:/images/stylusPalette/hand.png
+
+
+ Hand
+
+
+ Scroll Page
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/zoomIn.png
+ :/images/stylusPalette/zoomInOn.png:/images/stylusPalette/zoomIn.png
+
+
+ Zoom In
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/zoomOut.png
+ :/images/stylusPalette/zoomOutOn.png:/images/stylusPalette/zoomOut.png
+
+
+ Zoom Out
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/laser.png
+ :/images/stylusPalette/laserOn.png:/images/stylusPalette/laser.png
+
+
+ Laser Pointer
+
+
+ Virtual Laser Pointer
+
+
+ Ctrl+G
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/line.png
+ :/images/stylusPalette/lineOn.png:/images/stylusPalette/line.png
+
+
+ Line
+
+
+ Draw Lines
+
+
+ Ctrl+J
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/text.png
+ :/images/stylusPalette/textOn.png:/images/stylusPalette/text.png
+
+
+ Text
+
+
+ Write Text
+
+
+ Ctrl+K
+
+
+
+
+ true
+
+
+
+ :/images/stylusPalette/captureArea.png
+ :/images/stylusPalette/captureAreaOn.png:/images/stylusPalette/captureArea.png
+
+
+ Capture
+
+
+ Capture Part of the Screen
+
+
+
+
+
+ :/images/addItemToCurrentPage.svg:/images/addItemToCurrentPage.svg
+
+
+ Add To Current Page
+
+
+ Add To Current Page
+
+
+ Add Item To Current Page
+
+
+
+
+
+ :/images/addItemToNewPage.svg:/images/addItemToNewPage.svg
+
+
+ Add To New Page
+
+
+ Add Item To New Page
+
+
+
+
+
+ :/images/addItemToLibrary.svg:/images/addItemToLibrary.svg
+
+
+ Add To Library
+
+
+ Add Item To Library
+
+
+
+
+ false
+
+
+
+ :/images/toolbar/newDocument.png:/images/toolbar/newDocument.png
+
+
+ Pages
+
+
+ Create a New Page
+
+
+
+
+
+ :/images/addItemToCurrentPage.svg:/images/addItemToCurrentPage.svg
+
+
+ New Page
+
+
+ Create a New Page
+
+
+
+
+
+ :/images/addItemToNewPage.svg:/images/addItemToNewPage.svg
+
+
+ Duplicate Page
+
+
+ Duplicate the Current Page
+
+
+
+
+
+ :/images/addItemToLibrary.svg:/images/addItemToLibrary.svg
+
+
+ Import Page
+
+
+ Import an External Page
+
+
+
+
+ true
+
+
+ false
+
+
+
+ :/images/toolbar/pause.png:/images/toolbar/pause.png
+
+
+ Pause
+
+
+ Pause Podcast Recording
+
+
+
+
+
+ :/images/toolbar/settings.png:/images/toolbar/settings.png
+
+
+ Podcast Config
+
+
+ Configure Podcast Recording
+
+
+
+
+
+ :/images/toolbar/addToolToLibrary.png:/images/toolbar/addToolToLibrary.png
+
+
+ Flash Trap
+
+
+ Trap Flash Content
+
+
+
+
+ true
+
+
+
+ :/images/extraPalette/webTrap.png
+ :/images/extraPalette/webTrapEnabled.png:/images/extraPalette/webTrap.png
+
+
+ Web Trap
+
+
+ Trap Web Content
+
+
+
+
+
+ :/images/toolbar/captureArea.png:/images/toolbar/captureArea.png
+
+
+ Custom Capture
+
+
+ Capture Part of the Screen
+
+
+
+
+
+ :/images/toolbar/captureWindow.png:/images/toolbar/captureWindow.png
+
+
+ Window Capture
+
+
+ Capture a Window
+
+
+
+
+ false
+
+
+
+ :/images/extraPalette/oEmbed.png:/images/extraPalette/oEmbed.png
+
+
+ Embed Web Content
+
+
+ Capture Embeddable Web Content
+
+
+
+
+ true
+
+
+
+ :/images/toolbar/eyeClosed.png
+ :/images/toolbar/eyeOpened.png:/images/toolbar/eyeClosed.png
+
+
+ Show on Display
+
+
+ Show Main Screen on Display Screen
+
+
+ false
+
+
+ QAction::TextHeuristicRole
+
+
+
+
+
+ :/images/erasePalette/eraseAnnotation.svg:/images/erasePalette/eraseAnnotation.svg
+
+
+ Erase Annotations
+
+
+ Erase all Annotations
+
+
+
+
+
+ :/images/toolbar/addToolToLibrary.png:/images/toolbar/addToolToLibrary.png
+
+
+ eduMedia
+
+
+ Import eduMedia simulation
+
+
+
+
+
+ :/images/toolbar/tutorial.png:/images/toolbar/tutorial.png
+
+
+ Tutorial
+
+
+ Open the tutorial
+
+
+
+
+
+ :/images/toolbar/updates.png:/images/toolbar/updates.png
+
+
+ Check Update
+
+
+
+
+
+ :/images/toolbar/paraschool.png:/images/toolbar/paraschool.png
+
+
+ Sankoré Editor
+
+
+ Show Sankore Widgets Editor
+
+
+
+
+
+ :/images/toolbar/hide.png:/images/toolbar/hide.png
+
+
+ Hide Sankoré
+
+
+ Hide Sankoré Application
+
+
+ Ctrl+H
+
+
+
+
+
+
+
+
diff --git a/resources/images/cache_circle.png b/resources/images/cache_circle.png
new file mode 100644
index 00000000..58342c56
Binary files /dev/null and b/resources/images/cache_circle.png differ
diff --git a/resources/images/cache_close.png b/resources/images/cache_close.png
new file mode 100644
index 00000000..b5341287
Binary files /dev/null and b/resources/images/cache_close.png differ
diff --git a/resources/images/cache_open.png b/resources/images/cache_open.png
new file mode 100644
index 00000000..ceef7ed2
Binary files /dev/null and b/resources/images/cache_open.png differ
diff --git a/resources/images/cache_square.png b/resources/images/cache_square.png
new file mode 100644
index 00000000..78306b40
Binary files /dev/null and b/resources/images/cache_square.png differ
diff --git a/resources/sankore.qrc b/resources/sankore.qrc
index ebd0fc91..5b7fa1aa 100644
--- a/resources/sankore.qrc
+++ b/resources/sankore.qrc
@@ -317,5 +317,10 @@
images/library_open.png
images/pages_close.png
images/pages_open.png
+ images/cache_close.png
+ images/cache_open.png
+ style.qss
+ images/cache_circle.png
+ images/cache_square.png
diff --git a/resources/style.qss b/resources/style.qss
new file mode 100644
index 00000000..57e2b47d
--- /dev/null
+++ b/resources/style.qss
@@ -0,0 +1,52 @@
+QWidget#DockPaletteWidgetBox
+{
+ background: #EEEEEE;
+ border-radius: 10px;
+ border: 2px solid #999999;
+}
+
+QColorDialog
+{
+ background: #EEEEEE;
+}
+
+QLabel#DockPaletteWidgetTitle
+{
+ color: #FFFFFF;
+ font-size : 18px;
+ font-weight:bold;
+}
+
+QPushButton#DockPaletteWidgetButton
+{
+ background-color : #DDDDDD;
+ color : #555555;
+ border-radius : 6px;
+ padding : 5px;
+ font-weight : bold;
+ font-size : 12px;
+}
+
+QPushButton#DockPaletteWidgetButton::checked
+{
+ background-color: #BBBBBB;
+}
+
+QSlider::handle::horizontal
+{
+ background-color:#EEEEEE;
+ margin-top:-5px;
+ margin-bottom:-5px;
+ height:20px;
+ width:18px;
+ border-radius:10px;
+ border:1px solid #555555;
+}
+
+QSlider::groove::horizontal
+{
+ background-color:#999999;
+ height:10px;
+ border-radius:5px;
+ border:1px solid #555555;
+}
\ No newline at end of file
diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp
index acfdce99..ee5c1aae 100644
--- a/src/adaptors/UBSvgSubsetAdaptor.cpp
+++ b/src/adaptors/UBSvgSubsetAdaptor.cpp
@@ -48,6 +48,7 @@
#include "core/UBSettings.h"
#include "core/UBSetting.h"
#include "core/UBPersistenceManager.h"
+#include "core/UBApplication.h"
#include "pdf/PDFRenderer.h"
@@ -672,6 +673,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
{
scene->addItem(cache);
scene->registerTool(cache);
+ UBApplication::boardController->notifyCache(true);
}
}
else if (mXmlReader.name() == "foreignObject")
@@ -2680,7 +2682,24 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
UBGraphicsCache* UBSvgSubsetAdaptor::UBSvgSubsetReader::cacheFromSvg()
{
UBGraphicsCache* pCache = new UBGraphicsCache();
+ //pCache->setZValue(UBGraphicsScene::toolLayerStart + UBGraphicsScene::toolOffsetCache);
pCache->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Tool));
+
+ graphicsItemFromSvg(pCache);
+
+ QStringRef colorR = mXmlReader.attributes().value("colorR");
+ QStringRef colorG = mXmlReader.attributes().value("colorG");
+ QStringRef colorB = mXmlReader.attributes().value("colorB");
+ QStringRef colorA = mXmlReader.attributes().value("colorA");
+ QStringRef shape = mXmlReader.attributes().value("shape");
+ QStringRef shapeSize = mXmlReader.attributes().value("shapeSize");
+
+ QColor color(colorR.toString().toInt(), colorG.toString().toInt(), colorB.toString().toInt(), colorA.toString().toInt());
+
+ pCache->setMaskColor(color);
+ pCache->setShapeWidth(shapeSize.toString().toInt());
+ pCache->setMaskShape(static_cast(shape.toString().toInt()));
+
pCache->setVisible(true);
return pCache;
@@ -2694,6 +2713,12 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::cacheToSvg(UBGraphicsCache* item)
mXmlWriter.writeAttribute("y", QString("%1").arg(item->rect().y()));
mXmlWriter.writeAttribute("width", QString("%1").arg(item->rect().width()));
mXmlWriter.writeAttribute("height", QString("%1").arg(item->rect().height()));
+ mXmlWriter.writeAttribute("colorR", QString("%1").arg(item->maskColor().red()));
+ mXmlWriter.writeAttribute("colorG", QString("%1").arg(item->maskColor().green()));
+ mXmlWriter.writeAttribute("colorB", QString("%1").arg(item->maskColor().blue()));
+ mXmlWriter.writeAttribute("colorA", QString("%1").arg(item->maskColor().alpha()));
+ mXmlWriter.writeAttribute("shape", QString("%1").arg(item->maskshape()));
+ mXmlWriter.writeAttribute("shapeSize", QString("%1").arg(item->shapeWidth()));
QString zs;
zs.setNum(item->zValue(), 'f'); // 'f' keeps precision
diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp
index 867ddac4..cd1a4fed 100644
--- a/src/board/UBBoardController.cpp
+++ b/src/board/UBBoardController.cpp
@@ -484,6 +484,7 @@ void UBBoardController::addScene(UBDocumentProxy* proxy, int sceneIndex, bool re
if (scene)
{
addScene(scene, replaceActiveIfEmpty);
+ emit pageChanged();
}
}
@@ -501,6 +502,8 @@ void UBBoardController::duplicateScene()
setActiveDocumentScene(mActiveDocument, mActiveSceneIndex + 1);
QApplication::restoreOverrideCursor();
+
+ emit pageChanged();
}
@@ -669,6 +672,7 @@ void UBBoardController::previousScene()
}
updateActionStates();
+ emit pageChanged();
}
@@ -683,7 +687,7 @@ void UBBoardController::nextScene()
}
updateActionStates();
-
+ emit pageChanged();
}
@@ -698,6 +702,7 @@ void UBBoardController::firstScene()
}
updateActionStates();
+ emit pageChanged();
}
@@ -712,6 +717,7 @@ void UBBoardController::lastScene()
}
updateActionStates();
+ emit pageChanged();
}
@@ -1017,6 +1023,11 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
mActiveScene->addTriangle(pPos);
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
}
+ else if (sourceUrl.toString() == UBToolsManager::manager()->cache.id)
+ {
+ mActiveScene->addCache();
+ UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
+ }
else if (sourceUrl.toString() == UBToolsManager::manager()->magnifier.id)
{
UBMagnifierParams params;
@@ -1145,7 +1156,7 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy,
}
// Notify the navigator palette that the document has changed
- mPaletteManager->leftPalette()->pageNavigator()->setDocument(pDocumentProxy);
+ mPaletteManager->leftPalette()->pageNavigator()->setDocument(pDocumentProxy);
if (sceneChange)
emit activeSceneChanged();
@@ -1516,6 +1527,17 @@ void UBBoardController::setPageSize(QSize newSize)
}
}
+void UBBoardController::notifyCache(bool visible)
+{
+ if(visible)
+ {
+ emit cacheEnabled();
+ }
+ else
+ {
+ emit cacheDisabled();
+ }
+}
void UBBoardController::updatePageSizeState()
{
@@ -1928,7 +1950,6 @@ void UBBoardController::addItem()
}
}
-
void UBBoardController::importPage()
{
int pageCount = mActiveDocument->pageCount();
@@ -1939,7 +1960,10 @@ void UBBoardController::importPage()
}
}
-
+void UBBoardController::notifyPageChanged()
+{
+ emit pageChanged();
+}
diff --git a/src/board/UBBoardController.h b/src/board/UBBoardController.h
index 68961fa6..0ddb0412 100644
--- a/src/board/UBBoardController.h
+++ b/src/board/UBBoardController.h
@@ -157,6 +157,9 @@ class UBBoardController : public QObject
return mPaletteManager;
}
+ void notifyCache(bool visible);
+ void notifyPageChanged();
+
public slots:
void setActiveDocumentScene(UBDocumentProxy* pDocumentProxy, int pSceneIndex = 0);
@@ -255,6 +258,9 @@ class UBBoardController : public QObject
void controlViewportChanged();
void backgroundChanged();
+ void cacheEnabled();
+ void cacheDisabled();
+ void pageChanged();
protected:
diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp
index 86cb4736..7762cd1b 100755
--- a/src/board/UBBoardPaletteManager.cpp
+++ b/src/board/UBBoardPaletteManager.cpp
@@ -25,9 +25,7 @@
#include "gui/UBMainWindow.h"
#include "gui/UBStylusPalette.h"
-#include "gui/UBClockPalette.h"
#include "gui/UBKeyboardPalette.h"
-#include "gui/UBPageNumberPalette.h"
#include "gui/UBToolWidget.h"
#include "gui/UBZoomPalette.h"
#include "gui/UBActionPalette.h"
@@ -138,10 +136,6 @@ void UBBoardPaletteManager::setupPalettes()
mZoomPalette = new UBZoomPalette(mContainer);
- //mClockPalette->addAssociatedPalette(mKeyboardPalette);
- //mKeyboardPalette->addAssociatedPalette(mClockPalette);
-
-
QList backgroundsActions;
backgroundsActions << UBApplication::mainWindow->actionPlainLightBackground;
@@ -568,7 +562,9 @@ void UBBoardPaletteManager::addItemToLibrary()
, Qt::KeepAspectRatio, Qt::SmoothTransformation);
}
QImage image = mPixmap.toImage();
- //UBApplication::boardController->libraryController()->importImageOnLibrary(image);
+ // TODO:Claudio
+ // This is a wrong way of calling importImageOnLibrary but for the moment it works because element on mRightPalette are predefined.
+ mRightPalette->libWidget()->libNavigator()->libraryWidget()->libraryController()->importImageOnLibrary(image);
}
else
diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp
index 90e2dfd3..c72ccfdd 100644
--- a/src/core/UBApplication.cpp
+++ b/src/core/UBApplication.cpp
@@ -600,3 +600,19 @@ void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment,
if (textRole != QPalette::NoRole)
painter->setPen(savedPen);
}
+
+QString UBApplication::globalStyleSheet()
+{
+ QString style;
+
+ QFile f(":style.qss");
+ if(f.exists())
+ {
+ if(f.open(QIODevice::ReadOnly))
+ {
+ style = QString(f.readAll());
+ }
+ }
+
+ return style;
+}
diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h
index 88fe7969..a68d928a 100644
--- a/src/core/UBApplication.h
+++ b/src/core/UBApplication.h
@@ -78,6 +78,7 @@ class UBApplication : public QtSingleApplication
static void setDisabled(bool disable);
static QObject* staticMemoryCleaner;
+ static QString globalStyleSheet();
void decorateActionMenu(QAction* action);
void insertSpaceToToolbarBeforeAction(QToolBar* toolbar, QAction* action, int width = -1);
diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp
index cb44c140..ca70f989 100644
--- a/src/desktop/UBDesktopAnnotationController.cpp
+++ b/src/desktop/UBDesktopAnnotationController.cpp
@@ -37,7 +37,6 @@
#include "UBCustomCaptureWindow.h"
#include "UBWindowCapture.h"
#include "UBDesktopPalette.h"
-#include "UBDesktopToolsPalette.h"
#include "UBDesktopPenPalette.h"
#include "UBDesktopMarkerPalette.h"
#include "UBDesktopEraserPalette.h"
@@ -52,7 +51,6 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, mTransparentDrawingScene(0)
, mDesktopPalette(NULL)
, mKeyboardPalette(0)
- , mDesktopToolsPalette(NULL)
, mDesktopPenPalette(NULL)
, mDesktopMarkerPalette(NULL)
, mDesktopEraserPalette(NULL)
@@ -106,6 +104,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool)));
#ifdef Q_WS_X11
connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask()));
+ connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask()));
#endif
}
@@ -124,7 +123,6 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
, this, SLOT(stylusToolChanged(int)));
// Add the desktop associated palettes
- mDesktopToolsPalette = new UBDesktopToolsPalette(mTransparentDrawingView);
mDesktopPenPalette = new UBDesktopPenPalette(mTransparentDrawingView);
connect(mDesktopPalette, SIGNAL(maximized()), mDesktopPenPalette, SLOT(onParentMaximized()));
@@ -134,12 +132,10 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mDesktopEraserPalette = new UBDesktopEraserPalette(mTransparentDrawingView);
mDesktopPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
- mDesktopToolsPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopPenPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopMarkerPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
mDesktopEraserPalette->setBackgroundBrush(UBSettings::settings()->opaquePaletteColor);
- mDesktopToolsPalette->setVisible(UBApplication::mainWindow->actionDesktopTools->isChecked());
// Hack : the size of the property palettes is computed the first time the palette is visible
// In order to prevent palette overlap on if the desktop palette is on the right of the
@@ -151,7 +147,6 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mDesktopMarkerPalette->setVisible(false);
mDesktopEraserPalette->setVisible(false);
- connect(UBApplication::mainWindow->actionDesktopTools, SIGNAL(triggered(bool)), this, SLOT(desktopToolsActionToogled(bool)));
connect(UBApplication::mainWindow->actionEraseDesktopAnnotations, SIGNAL(triggered()), this, SLOT(eraseDesktopAnnotations()));
connect(&mHoldTimerPen, SIGNAL(timeout()), this, SLOT(penActionReleased()));
@@ -226,23 +221,6 @@ UBDesktopPalette* UBDesktopAnnotationController::desktopPalette()
return mDesktopPalette;
}
-
-void UBDesktopAnnotationController::desktopToolsActionToogled(bool checked)
-{
- if (!mDesktopToolsPalettePositioned)
- {
- QPoint pos = mDesktopPalette->geometry().bottomLeft();
- pos += QPoint(0, 10);
-
- mDesktopToolsPalette->setCustomPosition(true);
- mDesktopToolsPalette->move(pos);
-
- mDesktopToolsPalettePositioned = true;
- }
-
- mDesktopToolsPalette->setVisible(checked);
-}
-
/**
* \brief Toggle the visibility of the pen associated palette
* @param checked as the visibility state
diff --git a/src/desktop/UBDesktopAnnotationController.h b/src/desktop/UBDesktopAnnotationController.h
index f569332a..42043e32 100644
--- a/src/desktop/UBDesktopAnnotationController.h
+++ b/src/desktop/UBDesktopAnnotationController.h
@@ -23,7 +23,6 @@
#include "gui/UBRightPalette.h"
class UBDesktopPalette;
-class UBDesktopToolsPalette;
class UBBoardView;
class UBGraphicsScene;
class UBDesktopPenPalette;
@@ -89,7 +88,6 @@ class UBDesktopAnnotationController : public QObject
UBGraphicsScene* mTransparentDrawingScene;
private slots:
- void desktopToolsActionToogled(bool);
void desktopPenActionToggled(bool checked);
void desktopMarkerActionToggled(bool checked);
void desktopEraserActionToggled(bool checked);
@@ -112,7 +110,6 @@ class UBDesktopAnnotationController : public QObject
UBDesktopPalette *mDesktopPalette;
UBKeyboardPalette *mKeyboardPalette;
- UBDesktopToolsPalette *mDesktopToolsPalette;
UBDesktopPenPalette* mDesktopPenPalette;
UBDesktopMarkerPalette* mDesktopMarkerPalette;
UBDesktopEraserPalette* mDesktopEraserPalette;
diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp
index 8a054169..d3641157 100644
--- a/src/desktop/UBDesktopPalette.cpp
+++ b/src/desktop/UBDesktopPalette.cpp
@@ -136,8 +136,11 @@ void UBDesktopPalette::minimizeMe(eMinimizedLocation location)
actions << mMaximizeAction;
setActions(actions);
- QSize newSize = preferredSize();
- this->resize(newSize);
+ adjustSizeAndPosition();
+
+#ifdef Q_WS_X11
+ emit refreshMask();
+#endif
}
// Called when the user wants to maximize the palette
@@ -159,15 +162,15 @@ void UBDesktopPalette::maximizeMe()
actions << mDisplaySelectAction;
actions << mShowHideAction;
- //actions << UBApplication::mainWindow->actionDesktopTools;
-
setActions(actions);
- QSize newSize = preferredSize();
- this->resize(newSize);
+ adjustSizeAndPosition();
// Notify that the maximization has been done
emit maximized();
+#ifdef Q_WS_X11
+ emit refreshMask();
+#endif
}
void UBDesktopPalette::showEvent(QShowEvent *event)
diff --git a/src/desktop/UBDesktopPalette.h b/src/desktop/UBDesktopPalette.h
index 83c01eab..cd22d43e 100644
--- a/src/desktop/UBDesktopPalette.h
+++ b/src/desktop/UBDesktopPalette.h
@@ -33,7 +33,10 @@ class UBDesktopPalette : public UBActionPalette
void customClick();
void windowClick();
void screenClick();
-// void showVirtualKeyboard(bool);
+
+#ifdef Q_WS_X11
+ void refreshMask();
+#endif
public slots:
diff --git a/src/desktop/UBDesktopToolsPalette.cpp b/src/desktop/UBDesktopToolsPalette.cpp
deleted file mode 100644
index ed2ab4d5..00000000
--- a/src/desktop/UBDesktopToolsPalette.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-#include "UBDesktopToolsPalette.h"
-
-#include "core/UBApplication.h"
-#include "core/UBSettings.h"
-
-#include "board/UBBoardController.h"
-#include "board/UBDrawingController.h"
-
-#include "gui/UBMainWindow.h"
-#include "gui/UBToolbarButtonGroup.h"
-
-#include "core/memcheck.h"
-
-UBDesktopToolsPalette::UBDesktopToolsPalette(QWidget *parent)
- : UBActionPalette(Qt::Horizontal, parent)
-{
- // Setup color choice widget
- QList colorActions;
- colorActions.append(UBApplication::mainWindow->actionColor0);
- colorActions.append(UBApplication::mainWindow->actionColor1);
- colorActions.append(UBApplication::mainWindow->actionColor2);
- colorActions.append(UBApplication::mainWindow->actionColor3);
-
- UBToolbarButtonGroup *colorChoice =
- new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, colorActions);
-
- colorChoice->displayText(false);
-
- //connect(colorChoice, SIGNAL(activated(int)), this, SLOT(UBApplication::boardController->setColorIndex(int)));
- connect(UBDrawingController::drawingController(), SIGNAL(colorIndexChanged(int)), colorChoice, SLOT(setCurrentIndex(int)));
- connect(UBDrawingController::drawingController(), SIGNAL(colorPaletteChanged()), colorChoice, SLOT(colorPaletteChanged()));
-
- layout()->addWidget(colorChoice);
-
- // Setup line width choice widget
- QList lineWidthActions;
- lineWidthActions.append(UBApplication::mainWindow->actionLineSmall);
- lineWidthActions.append(UBApplication::mainWindow->actionLineMedium);
- lineWidthActions.append(UBApplication::mainWindow->actionLineLarge);
-
- UBToolbarButtonGroup *lineWidthChoice =
- new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, lineWidthActions);
- lineWidthChoice->displayText(false);
-
- connect(lineWidthChoice, SIGNAL(activated(int))
- , UBDrawingController::drawingController(), SLOT(setLineWidthIndex(int)));
-
- connect(UBDrawingController::drawingController(), SIGNAL(lineWidthIndexChanged(int))
- , lineWidthChoice, SLOT(setCurrentIndex(int)));
-
- layout()->addWidget(lineWidthChoice);
-
- // Setup eraser width choice widget
- QList eraserWidthActions;
- eraserWidthActions.append(UBApplication::mainWindow->actionEraserSmall);
- eraserWidthActions.append(UBApplication::mainWindow->actionEraserMedium);
- eraserWidthActions.append(UBApplication::mainWindow->actionEraserLarge);
-
- UBToolbarButtonGroup *eraserWidthChoice =
- new UBToolbarButtonGroup(UBApplication::mainWindow->boardToolBar, eraserWidthActions);
-
- connect(eraserWidthChoice, SIGNAL(activated(int)), UBDrawingController::drawingController(), SLOT(setEraserWidthIndex(int)));
-
- eraserWidthChoice->displayText(false);
- eraserWidthChoice->setCurrentIndex(UBSettings::settings()->eraserWidthIndex());
-
- layout()->addWidget(eraserWidthChoice);
-
- addAction(UBApplication::mainWindow->actionEraseDesktopAnnotations);
-
-}
diff --git a/src/desktop/UBDesktopToolsPalette.h b/src/desktop/UBDesktopToolsPalette.h
deleted file mode 100644
index f6867f3c..00000000
--- a/src/desktop/UBDesktopToolsPalette.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-#ifndef UBDESKTOPTOOLSPALETTE_H
-#define UBDESKTOPTOOLSPALETTE_H
-
-#include
-
-#include "gui/UBActionPalette.h"
-
-class UBDesktopToolsPalette : public UBActionPalette
-{
- public:
- UBDesktopToolsPalette(QWidget *parent = 0);
- virtual ~UBDesktopToolsPalette(){}
-};
-
-#endif // UBDESKTOPTOOLSPALETTE_H
diff --git a/src/desktop/desktop.pri b/src/desktop/desktop.pri
index eda60eb0..37600cd2 100644
--- a/src/desktop/desktop.pri
+++ b/src/desktop/desktop.pri
@@ -2,7 +2,6 @@ HEADERS += src/desktop/UBDesktopPalette.h \
src/desktop/UBDesktopAnnotationController.h \
src/desktop/UBCustomCaptureWindow.h \
src/desktop/UBWindowCapture.h \
- src/desktop/UBDesktopToolsPalette.h \
src/desktop/UBDesktopPenPalette.h \
src/desktop/UBDesktopMarkerPalette.h \
src/desktop/UBDesktopEraserPalette.h
@@ -10,7 +9,6 @@ HEADERS += src/desktop/UBDesktopPalette.h \
SOURCES += src/desktop/UBDesktopPalette.cpp \
src/desktop/UBDesktopAnnotationController.cpp \
src/desktop/UBCustomCaptureWindow.cpp \
- src/desktop/UBDesktopToolsPalette.cpp \
src/desktop/UBDesktopPenPalette.cpp \
src/desktop/UBDesktopMarkerPalette.cpp \
src/desktop/UBDesktopEraserPalette.cpp
diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp
index f908c9e6..78d33d8e 100644
--- a/src/domain/UBGraphicsScene.cpp
+++ b/src/domain/UBGraphicsScene.cpp
@@ -36,6 +36,7 @@
#include "tools/UBGraphicsCompass.h"
#include "tools/UBGraphicsTriangle.h"
#include "tools/UBGraphicsCurtainItem.h"
+#include "tools/UBGraphicsCache.h"
#include "document/UBDocumentProxy.h"
@@ -1626,6 +1627,25 @@ void UBGraphicsScene::addCompass(QPointF center)
setModified(true);
}
+void UBGraphicsScene::addCache()
+{
+ UBGraphicsCache* cache = new UBGraphicsCache();
+ mTools << cache;
+ QGraphicsView* view;
+
+ if(UBApplication::applicationController->displayManager()->hasDisplay())
+ {
+ view = (QGraphicsView*)(UBApplication::boardController->displayView());
+ }
+ else
+ {
+ view = (QGraphicsView*)(UBApplication::boardController->controlView());
+ }
+ addItem(cache);
+ cache->setVisible(true);
+ cache->setSelected(true);
+ UBApplication::boardController->notifyCache(true);
+}
void UBGraphicsScene::addMask()
{
diff --git a/src/domain/UBGraphicsScene.h b/src/domain/UBGraphicsScene.h
index 5a5ffe2e..9e622e39 100644
--- a/src/domain/UBGraphicsScene.h
+++ b/src/domain/UBGraphicsScene.h
@@ -46,6 +46,7 @@ class UBGraphicsCurtainItem;
class UBGraphicsStroke;
class UBMagnifierParams;
class UBMagnifier;
+class UBGraphicsCache;
const double PI = 4.0 * atan(1.0);
@@ -172,6 +173,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void addMagnifier(UBMagnifierParams params);
void addMask();
+ void addCache();
class SceneViewState
{
@@ -247,6 +249,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
static qreal toolOffsetCompass;
static qreal toolOffsetCurtain;
static qreal toolOffsetTriangle;
+ static qreal toolOffsetCache;
QSet tools(){ return mTools;}
@@ -358,6 +361,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
//int mMesure1Ms, mMesure2Ms;
+ bool mHasCache;
UBMagnifier *magniferControlViewWidget;
UBMagnifier *magniferDisplayViewWidget;
};
diff --git a/src/gui/UBCachePropertiesWidget.cpp b/src/gui/UBCachePropertiesWidget.cpp
new file mode 100644
index 00000000..6b7062f8
--- /dev/null
+++ b/src/gui/UBCachePropertiesWidget.cpp
@@ -0,0 +1,317 @@
+#include
+#include
+#include
+#include
+
+#include "UBCachePropertiesWidget.h"
+
+#include "core/UBApplication.h"
+#include "board/UBBoardController.h"
+#include "domain/UBGraphicsScene.h"
+
+static QVector mCaches;
+
+UBCachePropertiesWidget::UBCachePropertiesWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent)
+ , mpLayout(NULL)
+ , mpCachePropertiesLabel(NULL)
+ , mpColorLabel(NULL)
+ , mpShapeLabel(NULL)
+ , mpSizeLabel(NULL)
+ , mpColor(NULL)
+ , mpSquareButton(NULL)
+ , mpCircleButton(NULL)
+ , mpCloseButton(NULL)
+ , mpSizeSlider(NULL)
+ , mpColorLayout(NULL)
+ , mpShapeLayout(NULL)
+ , mpSizeLayout(NULL)
+ , mpCloseLayout(NULL)
+ , mpProperties(NULL)
+ , mpPropertiesLayout(NULL)
+ , mpCurrentCache(NULL)
+{
+ setObjectName(name);
+ setAttribute(Qt::WA_StyledBackground, true);
+ setStyleSheet(UBApplication::globalStyleSheet());
+
+ mName = "CachePropWidget";
+ mIconToLeft = QPixmap(":images/cache_open.png");
+ mIconToRight = QPixmap(":images/cache_close.png");
+ setContentsMargins(10, 10, 10, 10);
+
+ // Build the UI
+ mpLayout = new QVBoxLayout();
+ setLayout(mpLayout);
+
+ // Title
+ mpCachePropertiesLabel = new QLabel(tr("Cache Properties"), this);
+ mpCachePropertiesLabel->setObjectName("DockPaletteWidgetTitle");
+ mpLayout->addWidget(mpCachePropertiesLabel, 0);
+
+ // Properties Box
+ mpProperties = new QWidget(this);
+ mpProperties->setObjectName("DockPaletteWidgetBox");
+ mpLayout->addWidget(mpProperties, 1);
+ mpPropertiesLayout = new QVBoxLayout();
+ mpProperties->setLayout(mpPropertiesLayout);
+
+
+ // Color
+ mpColorLayout = new QHBoxLayout();
+ mpColorLabel = new QLabel(tr("Color:"), mpProperties);
+ mpColor = new QPushButton(mpProperties);
+ mpColor->setObjectName("DockPaletteWidgetButton");
+ // TODO: Check in the document if the page has a color and assign it to this cache
+ // else set the black color by default
+ updateCacheColor(Qt::black);
+ mpColorLayout->addWidget(mpColorLabel, 0);
+ mpColorLayout->addWidget(mpColor, 0);
+ mpColorLayout->addStretch(1);
+ mpPropertiesLayout->addLayout(mpColorLayout, 0);
+
+ // Shape
+ mpShapeLayout = new QHBoxLayout();
+ mpShapeLabel = new QLabel(tr("Shape:"), mpProperties);
+ mpSquareButton = new QPushButton(mpProperties);
+ mpSquareButton->setIcon(QIcon(":images/cache_square.png"));
+ mpSquareButton->setObjectName("DockPaletteWidgetButton");
+ mpSquareButton->setCheckable(true);
+ mpCircleButton = new QPushButton(mpProperties);
+ mpCircleButton->setIcon(QIcon(":images/cache_circle.png"));
+ mpCircleButton->setObjectName("DockPaletteWidgetButton");
+ mpCircleButton->setCheckable(true);
+ mpShapeLayout->addWidget(mpShapeLabel, 0);
+ mpShapeLayout->addWidget(mpSquareButton, 0);
+ mpShapeLayout->addWidget(mpCircleButton, 0);
+ mpShapeLayout->addStretch(1);
+ mpPropertiesLayout->addLayout(mpShapeLayout, 0);
+
+ // TODO: Check in the document which shape is saved and check the corresponding button
+ mpCircleButton->setChecked(true);
+
+ // Shape Size
+ mpSizeLayout = new QHBoxLayout();
+ mpSizeLabel = new QLabel(tr("Size:"), mpProperties);
+ mpSizeSlider = new QSlider(Qt::Horizontal, mpProperties);
+ mpSizeSlider->setMinimumHeight(20);
+ mpSizeSlider->setMinimum(0);
+ mpSizeSlider->setMaximum(MAX_SHAPE_WIDTH);
+ mpSizeLayout->addWidget(mpSizeLabel, 0);
+ mpSizeLayout->addWidget(mpSizeSlider, 1);
+ mpPropertiesLayout->addLayout(mpSizeLayout, 0);
+
+ // Close
+ mpCloseLayout = new QHBoxLayout();
+ mpCloseButton = new QPushButton(tr("Close"), mpProperties);
+ mpCloseButton->setObjectName("DockPaletteWidgetButton");
+ mpCloseLayout->addWidget(mpCloseButton, 0);
+ mpCloseLayout->addStretch(1);
+ mpPropertiesLayout->addLayout(mpCloseLayout, 0);
+
+ // Fill the empty space
+ mpPropertiesLayout->addStretch(1);
+
+ // Connect signals / slots
+ connect(mpCloseButton, SIGNAL(clicked()), this, SLOT(onCloseClicked()));
+ connect(mpColor, SIGNAL(clicked()), this, SLOT(onColorClicked()));
+ connect(mpCircleButton, SIGNAL(clicked()), this, SLOT(updateShapeButtons()));
+ connect(mpSquareButton, SIGNAL(clicked()), this, SLOT(updateShapeButtons()));
+ connect(mpSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(onSizeChanged(int)));
+ connect(UBApplication::boardController, SIGNAL(pageChanged()), this, SLOT(updateCurrentCache()));
+}
+
+UBCachePropertiesWidget::~UBCachePropertiesWidget()
+{
+ if(NULL != mpCachePropertiesLabel)
+ {
+ delete mpCachePropertiesLabel;
+ mpCachePropertiesLabel = NULL;
+ }
+ if(NULL != mpColorLabel)
+ {
+ delete mpColorLabel;
+ mpColorLabel = NULL;
+ }
+ if(NULL != mpShapeLabel)
+ {
+ delete mpShapeLabel;
+ mpShapeLabel = NULL;
+ }
+ if(NULL != mpSizeLabel)
+ {
+ delete mpSizeLabel;
+ mpSizeLabel = NULL;
+ }
+ if(NULL != mpColor)
+ {
+ delete mpColor;
+ mpColor = NULL;
+ }
+ if(NULL != mpSquareButton)
+ {
+ delete mpSquareButton;
+ mpSquareButton = NULL;
+ }
+ if(NULL != mpCircleButton)
+ {
+ delete mpCircleButton;
+ mpCircleButton = NULL;
+ }
+ if(NULL != mpCloseButton)
+ {
+ delete mpCloseButton;
+ mpCloseButton = NULL;
+ }
+ if(NULL != mpSizeSlider)
+ {
+ delete mpSizeSlider;
+ mpSizeSlider = NULL;
+ }
+ if(NULL != mpColorLayout)
+ {
+ delete mpColorLayout;
+ mpColorLayout = NULL;
+ }
+ if(NULL != mpShapeLayout)
+ {
+ delete mpShapeLayout;
+ mpShapeLayout = NULL;
+ }
+ if(NULL != mpSizeLayout)
+ {
+ delete mpSizeLayout;
+ mpSizeLayout = NULL;
+ }
+ if(NULL != mpCloseLayout)
+ {
+ delete mpCloseLayout;
+ mpCloseLayout = NULL;
+ }
+ if(NULL != mpPropertiesLayout)
+ {
+ delete mpPropertiesLayout;
+ mpPropertiesLayout = NULL;
+ }
+ if(NULL != mpProperties)
+ {
+ delete mpProperties;
+ mpProperties = NULL;
+ }
+ if(NULL != mpLayout)
+ {
+ delete mpLayout;
+ mpLayout = NULL;
+ }
+}
+
+void UBCachePropertiesWidget::onCloseClicked()
+{
+ // Remove the current cache from the list
+ mCaches.remove(mCaches.indexOf(mpCurrentCache));
+
+ // Remove the cache from the board
+ UBApplication::boardController->activeScene()->removeItem(mpCurrentCache);
+ mpCurrentCache = NULL;
+
+ if(mCaches.empty())
+ {
+ emit cacheListEmpty();
+ }
+}
+
+void UBCachePropertiesWidget::updateCacheColor(QColor color)
+{
+ mActualColor = color;
+
+ // Update the color on the color button
+ QPixmap pix(32, 32);
+ QPainter p;
+
+ p.begin(&pix);
+
+ p.setBackground(Qt::transparent);
+ p.setBrush(color); // The current color
+ p.drawRect(0, 0, 32, 32);
+
+ p.end();
+
+ mpColor->setIcon(QIcon(pix));
+
+ if(NULL != mpCurrentCache)
+ {
+ mpCurrentCache->setMaskColor(mActualColor);
+ }
+}
+
+void UBCachePropertiesWidget::onColorClicked()
+{
+ // Show the color picker
+ QColor newColor = QColorDialog::getColor(mActualColor,this);
+ updateCacheColor(newColor);
+}
+
+void UBCachePropertiesWidget::updateShapeButtons()
+{
+ if(mpCircleButton->hasFocus())
+ {
+ mActualShape = eMaskShape_Circle;
+ mpSquareButton->setChecked(false);
+ }
+ else if(mpSquareButton->hasFocus())
+ {
+ mActualShape = eMaskShap_Rectangle;
+ mpCircleButton->setChecked(false);
+ }
+
+ if(NULL != mpCurrentCache)
+ {
+ mpCurrentCache->setMaskShape(mActualShape);
+ }
+}
+
+void UBCachePropertiesWidget::updateCurrentCache()
+{
+ // Get the current page cache
+ QList items = UBApplication::boardController->activeScene()->items();
+ foreach(QGraphicsItem* it, items)
+ {
+ if("Cache" == it->data(Qt::UserRole).toString())
+ {
+ setEnabled(true);
+ mpCurrentCache = dynamic_cast(it);
+ if((NULL != mpCurrentCache) && (!mCaches.contains(mpCurrentCache)))
+ {
+ mCaches.append(mpCurrentCache);
+ }
+
+ // Update the values of the cache properties
+ mpSizeSlider->setValue(mpCurrentCache->shapeWidth());
+ updateCacheColor(mpCurrentCache->maskColor());
+ switch(mpCurrentCache->maskshape())
+ {
+ case eMaskShape_Circle:
+ mpCircleButton->setChecked(true);
+ mpSquareButton->setChecked(false);
+ break;
+ case eMaskShap_Rectangle:
+ mpCircleButton->setChecked(false);
+ mpSquareButton->setChecked(true);
+ break;
+ }
+
+ return;
+ }
+ }
+
+ // If we fall here, that means that this page has no cache
+ mpCurrentCache = NULL;
+ setDisabled(true);
+}
+
+void UBCachePropertiesWidget::onSizeChanged(int newSize)
+{
+ if(NULL != mpCurrentCache)
+ {
+ mpCurrentCache->setShapeWidth(newSize);
+ }
+}
diff --git a/src/gui/UBCachePropertiesWidget.h b/src/gui/UBCachePropertiesWidget.h
new file mode 100644
index 00000000..e347b033
--- /dev/null
+++ b/src/gui/UBCachePropertiesWidget.h
@@ -0,0 +1,60 @@
+#ifndef UBCACHEPROPERTIESWIDGET_H
+#define UBCACHEPROPERTIESWIDGET_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "UBDockPaletteWidget.h"
+#include "tools/UBGraphicsCache.h"
+
+#define MAX_SHAPE_WIDTH 200
+
+class UBCachePropertiesWidget : public UBDockPaletteWidget
+{
+ Q_OBJECT
+public:
+ UBCachePropertiesWidget(QWidget* parent=0, const char* name="UBCachePropertiesWidget");
+ ~UBCachePropertiesWidget();
+
+public slots:
+ void updateCurrentCache();
+
+signals:
+ void cacheListEmpty();
+
+private slots:
+ void onCloseClicked();
+ void updateCacheColor(QColor color);
+ void onColorClicked();
+ void updateShapeButtons();
+ void onSizeChanged(int newSize);
+
+private:
+ QVBoxLayout* mpLayout;
+ QLabel* mpCachePropertiesLabel;
+ QLabel* mpColorLabel;
+ QLabel* mpShapeLabel;
+ QLabel* mpSizeLabel;
+ QPushButton* mpColor;
+ QPushButton* mpSquareButton;
+ QPushButton* mpCircleButton;
+ QPushButton* mpCloseButton;
+ QSlider* mpSizeSlider;
+ QHBoxLayout* mpColorLayout;
+ QHBoxLayout* mpShapeLayout;
+ QHBoxLayout* mpSizeLayout;
+ QHBoxLayout* mpCloseLayout;
+ QWidget* mpProperties;
+ QVBoxLayout* mpPropertiesLayout;
+ QColor mActualColor;
+ eMaskShape mActualShape;
+ UBGraphicsCache* mpCurrentCache;
+
+};
+
+#endif // UBCACHEPROPERTIESWIDGET_H
diff --git a/src/gui/UBClockPalette.cpp b/src/gui/UBClockPalette.cpp
deleted file mode 100644
index 7197cd9e..00000000
--- a/src/gui/UBClockPalette.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include
-
-
-#include "UBClockPalette.h"
-#include "core/memcheck.h"
-
-UBClockPalette::UBClockPalette(QWidget *parent)
- : UBFloatingPalette(Qt::TopRightCorner, parent)
- , mTimeLabel(0)
-{
- setLayout(new QHBoxLayout());
- mTimeLabel = new QLabel(parent);
- mTimeLabel->setStyleSheet(QString("QLabel {color: white; background-color: transparent; font-family: Arial; font-weight: bold; font-size: 20px}"));
-
- layout()->setContentsMargins(radius() + 15, 4, radius() + 15, 4);
- layout()->addWidget(mTimeLabel);
-
- mTimeFormat = QLocale::system().timeFormat(QLocale::ShortFormat);
-
- //strip seconds
- mTimeFormat = mTimeFormat.remove(":ss");
- mTimeFormat = mTimeFormat.remove(":s");
-
-}
-
-
-UBClockPalette::~UBClockPalette()
-{
- // NOOP
-}
-
-
-int UBClockPalette::radius()
-{
- return 10;
-}
-
-
-void UBClockPalette::updateTime()
-{
- if (mTimeLabel)
- {
- mTimeLabel->setText(QLocale::system().toString (QTime::currentTime(), mTimeFormat));
- }
- adjustSizeAndPosition();
-}
-
-
-void UBClockPalette::timerEvent(QTimerEvent *event)
-{
- Q_UNUSED(event);
- updateTime();
-}
-
-
-void UBClockPalette::showEvent ( QShowEvent * event )
-{
- Q_UNUSED(event);
- updateTime();
- mTimerID = startTimer(1000);
-}
-
-
-void UBClockPalette::hideEvent ( QShowEvent * event )
-{
- Q_UNUSED(event);
- killTimer(mTimerID);
-}
-
diff --git a/src/gui/UBDockPalette.cpp b/src/gui/UBDockPalette.cpp
index b342bc6a..1eaece2d 100644
--- a/src/gui/UBDockPalette.cpp
+++ b/src/gui/UBDockPalette.cpp
@@ -515,9 +515,12 @@ int UBDockPalette::customMargin()
void UBDockPalette::addTabWidget(UBDockPaletteWidget *widget)
{
- mTabWidgets.append(widget);
- mpStackWidget->addWidget(widget);
- update();
+ if(!mTabWidgets.contains(widget))
+ {
+ mTabWidgets.append(widget);
+ mpStackWidget->addWidget(widget);
+ update();
+ }
}
void UBDockPalette::removeTab(const QString &widgetName)
diff --git a/src/gui/UBDockPalette.h b/src/gui/UBDockPalette.h
index 34c3ee2b..438eab7b 100644
--- a/src/gui/UBDockPalette.h
+++ b/src/gui/UBDockPalette.h
@@ -61,6 +61,7 @@ public:
eUBDockOrientation orientation();
void setOrientation(eUBDockOrientation orientation);
void setTabsOrientation(eUBDockTabOrientation orientation);
+ void showTabWidget(int tabIndex);
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
@@ -127,7 +128,7 @@ private slots:
private:
void tabClicked(int tabIndex);
int tabSpacing();
- void showTabWidget(int tabIndex);
+
void toggleCollapseExpand();
};
diff --git a/src/gui/UBPageNavigationWidget.cpp b/src/gui/UBPageNavigationWidget.cpp
index 8c4c20c6..6f598fd0 100644
--- a/src/gui/UBPageNavigationWidget.cpp
+++ b/src/gui/UBPageNavigationWidget.cpp
@@ -127,6 +127,9 @@ void UBPageNavigationWidget::changeCurrentPage()
{
// Display the selected page
UBApplication::boardController->setActiveDocumentScene(mNavigator->currentDoc(), iPage);
+
+ // emit here the signal to indicate that page change
+ UBApplication::boardController->notifyPageChanged();
}
}
diff --git a/src/gui/UBPageNumberPalette.cpp b/src/gui/UBPageNumberPalette.cpp
deleted file mode 100644
index 6f964383..00000000
--- a/src/gui/UBPageNumberPalette.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#include
-
-#include "UBPageNumberPalette.h"
-
-#include "core/memcheck.h"
-
-UBPageNumberPalette::UBPageNumberPalette(QWidget *parent)
- : UBFloatingPalette(Qt::BottomRightCorner, parent)
-{
- mLayout = new QHBoxLayout(this);
- mButton = new QPushButton(parent);
- mButton->setStyleSheet(QString("QPushButton { color: white; background-color: transparent; border: none; font-family: Arial; font-weight: bold; font-size: 20px }"));
- mButton->setFocusPolicy(Qt::NoFocus);
- connect(mButton, SIGNAL(clicked(bool)), this, SLOT(buttonClicked(bool)));
-
- mLayout->setContentsMargins(radius() + 15, 4, radius() + 15, 4);
-
- mLayout->addWidget(mButton);
-
- setPageNumber(0, 0);
-}
-
-UBPageNumberPalette::~UBPageNumberPalette()
-{
- delete mButton;
- delete mLayout;
-}
-
-void UBPageNumberPalette::buttonClicked(bool checked)
-{
- Q_UNUSED(checked);
-
- emit clicked();
-}
-
-int UBPageNumberPalette::radius()
-{
- return 10;
-}
-
-void UBPageNumberPalette::setPageNumber(int current, int total)
-{
- mButton->setText(QString("%1 / %2").arg(current).arg(total));
- adjustSizeAndPosition();
-}
diff --git a/src/gui/UBPageNumberPalette.h b/src/gui/UBPageNumberPalette.h
deleted file mode 100644
index f1ebba86..00000000
--- a/src/gui/UBPageNumberPalette.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-#ifndef UBPAGENUMBERPALLETTE_H_
-#define UBPAGENUMBERPALLETTE_H_
-
-class QHBoxLayout;
-class QPushButton;
-
-#include "UBFloatingPalette.h"
-
-
-class UBPageNumberPalette : public UBFloatingPalette
-{
- Q_OBJECT;
-
- public:
- UBPageNumberPalette(QWidget *parent = 0);
- virtual ~UBPageNumberPalette();
-
- protected:
- int radius();
-
- private:
- QHBoxLayout *mLayout;
- QPushButton *mButton;
-
- private slots:
- void buttonClicked(bool checked);
-
- public slots:
- void setPageNumber(int current, int total);
-
- signals:
- void clicked();
-
-};
-
-#endif /* UBPAGENUMBERPALLETTE_H_ */
diff --git a/src/gui/UBRightPalette.cpp b/src/gui/UBRightPalette.cpp
index c7f8a765..ee673ac8 100644
--- a/src/gui/UBRightPalette.cpp
+++ b/src/gui/UBRightPalette.cpp
@@ -12,8 +12,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
+#include "core/UBApplication.h"
+#include "board/UBBoardController.h"
+
#include "UBRightPalette.h"
+
UBRightPalette::UBRightPalette(QWidget *parent, const char *name):UBDockPalette(parent)
, mpLibWidget(NULL)
{
@@ -25,8 +29,16 @@ UBRightPalette::UBRightPalette(QWidget *parent, const char *name):UBDockPalette(
resize(UBSettings::settings()->libPaletteWidth->get().toInt(), parentWidget()->height());
mpLayout->setContentsMargins(2*border() + customMargin(), customMargin(), customMargin(), customMargin());
+ // Add the tab widgets
mpLibWidget = new UBLibWidget(this);
addTabWidget(mpLibWidget);
+
+ mpCachePropWidget = new UBCachePropertiesWidget(this);
+ mpCachePropWidget->hide();
+
+ // Connect signals/slots
+ connect(UBApplication::boardController, SIGNAL(cacheEnabled()), this, SLOT(onCacheEnabled()));
+ connect(mpCachePropWidget, SIGNAL(cacheListEmpty()), this, SLOT(onCacheDisabled()));
}
UBRightPalette::~UBRightPalette()
@@ -36,6 +48,11 @@ UBRightPalette::~UBRightPalette()
delete mpLibWidget;
mpLibWidget = NULL;
}
+ if(NULL != mpCachePropWidget)
+ {
+ delete mpCachePropWidget;
+ mpCachePropWidget = NULL;
+ }
}
UBLibWidget* UBRightPalette::libWidget()
@@ -62,12 +79,39 @@ void UBRightPalette::resizeEvent(QResizeEvent *event)
emit resized();
}
-/**
- * \brief Update the maximum width
- */
void UBRightPalette::updateMaxWidth()
{
setMaximumWidth((int)((parentWidget()->width() * 2)/3));
setMaximumHeight(parentWidget()->height());
setMinimumHeight(parentWidget()->height());
}
+
+void UBRightPalette::onCacheEnabled()
+{
+ if(mpCachePropWidget->isHidden())
+ {
+ mpCachePropWidget->setVisible(true);
+ // Add the cache tab
+ addTabWidget(mpCachePropWidget);
+ }
+
+ // Set the cache of the current page as the active one for the properties widget
+ mpCachePropWidget->updateCurrentCache();
+
+ // Show the cache properties widget
+ for(int i = 0; i < mTabWidgets.size(); i++)
+ {
+ if((NULL != mTabWidgets.at(i)) && ("CachePropWidget" == mTabWidgets.at(i)->name()))
+ {
+ showTabWidget(i);
+ break;
+ }
+ }
+
+}
+
+void UBRightPalette::onCacheDisabled()
+{
+ removeTab(mpCachePropWidget->name());
+ mpCachePropWidget->hide();
+}
diff --git a/src/gui/UBRightPalette.h b/src/gui/UBRightPalette.h
index 7d99cd4c..6919acf9 100644
--- a/src/gui/UBRightPalette.h
+++ b/src/gui/UBRightPalette.h
@@ -17,6 +17,7 @@
#include "UBDockPalette.h"
#include "UBLibWidget.h"
+#include "UBCachePropertiesWidget.h"
class UBRightPalette : public UBDockPalette
{
@@ -35,8 +36,13 @@ protected:
void mouseMoveEvent(QMouseEvent *event);
void resizeEvent(QResizeEvent *event);
+private slots:
+ void onCacheEnabled();
+ void onCacheDisabled();
+
private:
UBLibWidget* mpLibWidget;
+ UBCachePropertiesWidget* mpCachePropWidget;
};
#endif // UBRIGHTPALETTE_H
diff --git a/src/gui/gui.pri b/src/gui/gui.pri
index 530421d1..3dae376c 100644
--- a/src/gui/gui.pri
+++ b/src/gui/gui.pri
@@ -4,8 +4,6 @@ HEADERS += src/gui/UBThumbnailView.h \
src/gui/UBToolbarButtonGroup.h \
src/gui/UBStylusPalette.h \
src/gui/UBIconButton.h \
- src/gui/UBClockPalette.h \
- src/gui/UBPageNumberPalette.h \
src/gui/UBThumbnailWidget.h \
src/gui/UBCircleFrame.h \
src/gui/UBColorPicker.h \
@@ -43,15 +41,14 @@ HEADERS += src/gui/UBThumbnailView.h \
src/gui/UBRightPalette.h \
src/gui/UBPageNavigationWidget.h \
src/gui/UBLibWidget.h \
- src/gui/UBMagnifer.h
+ src/gui/UBMagnifer.h \
+ src/gui/UBCachePropertiesWidget.h
SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBFloatingPalette.cpp \
src/gui/UBToolbarButtonGroup.cpp \
src/gui/UBStylusPalette.cpp \
src/gui/UBIconButton.cpp \
- src/gui/UBClockPalette.cpp \
- src/gui/UBPageNumberPalette.cpp \
src/gui/UBThumbnailWidget.cpp \
src/gui/UBCircleFrame.cpp \
src/gui/UBColorPicker.cpp \
@@ -89,7 +86,8 @@ SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBRightPalette.cpp \
src/gui/UBPageNavigationWidget.cpp \
src/gui/UBLibWidget.cpp \
- src/gui/UBMagnifer.cpp
+ src/gui/UBMagnifer.cpp \
+ src/gui/UBCachePropertiesWidget.cpp
win32 {
diff --git a/src/tools/UBGraphicsCache.cpp b/src/tools/UBGraphicsCache.cpp
index b226132c..af82f45d 100644
--- a/src/tools/UBGraphicsCache.cpp
+++ b/src/tools/UBGraphicsCache.cpp
@@ -33,6 +33,7 @@ UBGraphicsCache::UBGraphicsCache():QGraphicsRectItem()
QRect boardRect = UBApplication::boardController->displayView()->rect();
setRect(-15*boardRect.width(), -15*boardRect.height(), 30*boardRect.width(), 30*boardRect.height());
setZValue(CACHE_ZVALUE);
+ setData(Qt::UserRole, QVariant("Cache"));
}
UBGraphicsCache::~UBGraphicsCache()
@@ -62,6 +63,7 @@ QColor UBGraphicsCache::maskColor()
void UBGraphicsCache::setMaskColor(QColor color)
{
mMaskColor = color;
+ update();
}
eMaskShape UBGraphicsCache::maskshape()
@@ -72,6 +74,7 @@ eMaskShape UBGraphicsCache::maskshape()
void UBGraphicsCache::setMaskShape(eMaskShape shape)
{
mMaskShape = shape;
+ update();
}
void UBGraphicsCache::init()
@@ -102,7 +105,7 @@ void UBGraphicsCache::paint(QPainter *painter, const QStyleOptionGraphicsItem *o
}
else if(eMaskShap_Rectangle == mMaskShape)
{
- path.addRect(mShapePos.x(), mShapePos.y(), mShapeWidth, mShapeWidth);
+ path.addRect(mShapePos.x() - mShapeWidth / 2, mShapePos.y() - mShapeWidth / 2, mShapeWidth, mShapeWidth);
}
path.setFillRule(Qt::OddEvenFill);
}
@@ -139,4 +142,5 @@ int UBGraphicsCache::shapeWidth()
void UBGraphicsCache::setShapeWidth(int width)
{
mShapeWidth = width;
+ update();
}
diff --git a/src/tools/UBToolsManager.cpp b/src/tools/UBToolsManager.cpp
index 5fb516e8..e536bc2c 100644
--- a/src/tools/UBToolsManager.cpp
+++ b/src/tools/UBToolsManager.cpp
@@ -65,6 +65,17 @@ UBToolsManager::UBToolsManager(QObject *parent)
mToolsIcon.insert(magnifier.id,":/images/toolPalette/magnifierTool.png");
mDescriptors << magnifier;
+// --------------------------------------------------------------------------------
+// DO NOT ERASE THIS COMMENTED CODE! IT WILL BE UNCOMMENTED DURING THE NEXT DAYS!!!
+// --------------------------------------------------------------------------------
+ cache.id = "uniboardTool://uniboard.mnemis.com/cache";
+ cache.icon = QPixmap(":/images/toolPalette/cacheTool.png");
+ cache.label = tr("Cache");
+ cache.version = "1.0";
+ mToolsIcon.insert(cache.id, ":/images/toolPalette/cacheTool.png");
+ mDescriptors << cache;
+// --------------------------------------------------------------------------------
+
}
UBToolsManager::~UBToolsManager()
diff --git a/src/tools/UBToolsManager.h b/src/tools/UBToolsManager.h
index df87db8a..3ad3ccf1 100644
--- a/src/tools/UBToolsManager.h
+++ b/src/tools/UBToolsManager.h
@@ -79,6 +79,7 @@ class UBToolsManager : public QObject
UBToolDescriptor mask;
UBToolDescriptor triangle;
UBToolDescriptor magnifier;
+ UBToolDescriptor cache;
QString iconFromToolId(QString id) { return mToolsIcon.value(id);}