UBBoardView conflicts merged

preferencesAboutTextFull
Ilia Ryabokon 12 years ago
commit 0594cfe09f
  1. 4
      LICENSE.txt
  2. 4
      Open-Sankore.packproj
  3. 4
      Sankore_3.1.pro
  4. 18
      buildDebianPackage.sh
  5. 2
      plugins/cffadaptor/src/UBCFFAdaptor.cpp
  6. 2
      plugins/cffadaptor/src/UBCFFAdaptor.h
  7. 2
      plugins/cffadaptor/src/UBCFFAdaptor_global.h
  8. 2
      plugins/cffadaptor/src/UBCFFConstants.h
  9. 2
      plugins/cffadaptor/src/UBGlobals.h
  10. BIN
      resources/etc/SankoreEditor/editor_en/files/calepin.png
  11. BIN
      resources/etc/SankoreEditor/editor_en/files/logo.png
  12. BIN
      resources/etc/SankoreEditor/editor_en/files/logoplanetesankore.png
  13. BIN
      resources/etc/SankoreEditor/editor_en/files/mappe.png
  14. BIN
      resources/etc/SankoreEditor/editor_en/files/outils.png
  15. 81
      resources/etc/SankoreEditor/editor_en/index.html
  16. BIN
      resources/etc/SankoreEditor/editor_fr/files/calepin.png
  17. BIN
      resources/etc/SankoreEditor/editor_fr/files/logo.png
  18. BIN
      resources/etc/SankoreEditor/editor_fr/files/logoplanetesankore.png
  19. BIN
      resources/etc/SankoreEditor/editor_fr/files/mappe.png
  20. BIN
      resources/etc/SankoreEditor/editor_fr/files/outils.png
  21. 80
      resources/etc/SankoreEditor/editor_fr/index.html
  22. 12
      resources/forms/mainWindow.ui
  23. BIN
      resources/images/toolbar/paraschool.png
  24. 1
      resources/sankore.qrc
  25. 2
      src/adaptors/UBCFFSubsetAdaptor.cpp
  26. 2
      src/adaptors/UBCFFSubsetAdaptor.h
  27. 2
      src/adaptors/UBExportAdaptor.cpp
  28. 2
      src/adaptors/UBExportAdaptor.h
  29. 2
      src/adaptors/UBExportCFF.cpp
  30. 2
      src/adaptors/UBExportCFF.h
  31. 2
      src/adaptors/UBExportDocument.cpp
  32. 2
      src/adaptors/UBExportDocument.h
  33. 2
      src/adaptors/UBExportFullPDF.cpp
  34. 2
      src/adaptors/UBExportFullPDF.h
  35. 2
      src/adaptors/UBExportPDF.cpp
  36. 2
      src/adaptors/UBExportPDF.h
  37. 2
      src/adaptors/UBExportWeb.cpp
  38. 2
      src/adaptors/UBExportWeb.h
  39. 2
      src/adaptors/UBImportAdaptor.cpp
  40. 2
      src/adaptors/UBImportAdaptor.h
  41. 2
      src/adaptors/UBImportCFF.cpp
  42. 2
      src/adaptors/UBImportCFF.h
  43. 2
      src/adaptors/UBImportDocument.cpp
  44. 2
      src/adaptors/UBImportDocument.h
  45. 2
      src/adaptors/UBImportImage.cpp
  46. 2
      src/adaptors/UBImportImage.h
  47. 2
      src/adaptors/UBImportPDF.cpp
  48. 2
      src/adaptors/UBImportPDF.h
  49. 2
      src/adaptors/UBImportVirtualPrinter.cpp
  50. 2
      src/adaptors/UBIniFileParser.cpp
  51. 2
      src/adaptors/UBIniFileParser.h
  52. 2
      src/adaptors/UBMetadataDcSubsetAdaptor.cpp
  53. 2
      src/adaptors/UBMetadataDcSubsetAdaptor.h
  54. 245
      src/adaptors/UBSvgSubsetAdaptor.cpp
  55. 5
      src/adaptors/UBSvgSubsetAdaptor.h
  56. 2
      src/adaptors/UBThumbnailAdaptor.cpp
  57. 2
      src/adaptors/UBThumbnailAdaptor.h
  58. 2
      src/adaptors/UBWebPublisher.cpp
  59. 2
      src/adaptors/UBWebPublisher.h
  60. 2
      src/adaptors/publishing/UBDocumentPublisher.cpp
  61. 2
      src/adaptors/publishing/UBDocumentPublisher.h
  62. 2
      src/adaptors/publishing/UBSvgSubsetRasterizer.cpp
  63. 2
      src/adaptors/publishing/UBSvgSubsetRasterizer.h
  64. 2
      src/api/UBLibraryAPI.cpp
  65. 2
      src/api/UBLibraryAPI.h
  66. 2
      src/api/UBW3CWidgetAPI.cpp
  67. 2
      src/api/UBW3CWidgetAPI.h
  68. 2
      src/api/UBWidgetMessageAPI.cpp
  69. 2
      src/api/UBWidgetMessageAPI.h
  70. 2
      src/api/UBWidgetUniboardAPI.cpp
  71. 2
      src/api/UBWidgetUniboardAPI.h
  72. 14
      src/board/UBBoardController.cpp
  73. 6
      src/board/UBBoardController.h
  74. 11
      src/board/UBBoardPaletteManager.cpp
  75. 7
      src/board/UBBoardPaletteManager.h
  76. 332
      src/board/UBBoardView.cpp
  77. 23
      src/board/UBBoardView.h
  78. 14
      src/board/UBDrawingController.cpp
  79. 2
      src/board/UBDrawingController.h
  80. 3
      src/board/UBFeaturesController.cpp
  81. 2
      src/board/UBFeaturesController.h
  82. 2
      src/core/UB.h
  83. 8
      src/core/UBApplication.cpp
  84. 2
      src/core/UBApplication.h
  85. 46
      src/core/UBApplicationController.cpp
  86. 5
      src/core/UBApplicationController.h
  87. 3
      src/core/UBDisplayManager.cpp
  88. 2
      src/core/UBDisplayManager.h
  89. 2
      src/core/UBDocumentManager.cpp
  90. 2
      src/core/UBDocumentManager.h
  91. 2
      src/core/UBDownloadManager.cpp
  92. 2
      src/core/UBDownloadManager.h
  93. 2
      src/core/UBDownloadThread.cpp
  94. 2
      src/core/UBDownloadThread.h
  95. 2
      src/core/UBIdleTimer.cpp
  96. 2
      src/core/UBIdleTimer.h
  97. 2
      src/core/UBMimeData.cpp
  98. 2
      src/core/UBMimeData.h
  99. 2
      src/core/UBPersistenceManager.cpp
  100. 2
      src/core/UBPersistenceManager.h
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,6 +1,6 @@
Copyright (C) 2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
Copyright (C) 2013 Groupement d'Inter<EFBFBD>t Public pour l'Education NumŽrique en Afrique (GIP ENA)
Open-Sankoré is free software: you can redistribute it and/or modify
Open-SankorŽ 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, version 3 of the License,
with a specific linking exception for the OpenSSL project's

@ -26,9 +26,9 @@
<key>International</key>
<dict>
<key>Mode</key>
<integer>0</integer>
<integer>1</integer>
<key>Path</key>
<string></string>
<string>LICENSE.txt</string>
<key>Path Type</key>
<integer>2</integer>
</dict>

@ -10,8 +10,8 @@ CONFIG += debug_and_release \
VERSION_MAJ = 2
VERSION_MIN = 00
VERSION_TYPE = r # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 05
VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 06
VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
VERSION = $$replace(VERSION, "\\.r", "")

@ -19,6 +19,15 @@
# functions
#**********************
checkUser()
{
if [ `id -u` -ne 0 ]; then
echo "Please run the script as root, may be using fakeroot command as follow"
echo "fakeroot ./buildDebianPackage.sh [options]"
exit 1
fi
}
initializeVariables()
{
MAKE_TAG=true
@ -120,6 +129,7 @@ buildWithStandardQt(){
#**********************
# script
#**********************
checkUser
initializeVariables
buildWithStandardQt
@ -375,12 +385,13 @@ chmod 755 "$BASE_WORKING_DIR/DEBIAN/postint"
mkdir -p "install/linux"
DEBIAN_PACKAGE_NAME="Open-Sankore_${VERSION}_$ARCHITECTURE.deb"
fakeroot chown -R root:root $BASE_WORKING_DIR
chown -R root:root $BASE_WORKING_DIR
dpkg -b "$BASE_WORKING_DIR" "install/linux/$DEBIAN_PACKAGE_NAME"
notifyProgress "Open-Sankore" "Package built"
#clean up mess
fakeroot rm -rf $BASE_WORKING_DIR
rm -rf $BASE_WORKING_DIR
notifyProgress "Open-Sankore" "Package built"
if [ $CREATE_DIENA_DISTRIBUTION_ZIP == true ]; then
@ -392,3 +403,4 @@ if [ $CREATE_DIENA_DISTRIBUTION_ZIP == true ]; then
notifyProgress "Open-Sankore" "Build Diena zip file for distribution"
fi
exit 0

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

@ -1,81 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Sankoré editor</title>
<style type="text/css">
<!--
.white { color: #FFF;
}
body {
background-color: #E5E3DB;
}
body,td,th {
font-family: Verdana, Geneva, sans-serif;
color: #666;
text-align: left;
}
.conteneur {
background-color: #5C5C5C;
text-align: center;
}
.c {
text-align: center;
}
.m {
font-size: medium;
}
a:link {
color: #666;
}
a:visited {
color: #666;
}
a:hover {
color: #000;
}
a:active {
color: #666;
}
-->
</style>
</head>
<body>
<table width="843" border="0" align="center">
<tr>
<td class="conteneur"><p><img src="files/logo.png" width="196" height="22" alt="editeur" /></p>
<p><span class="white">Instructions on how to use Sankoré editor </span></p>
<p><span class="white">THE CURRENT VERSION IS ONLY AVAILABLE IN FRENCH</span></p></td>
</tr>
<tr>
<td><div align="center"><img src="files/outils.png" width="128" height="128" alt="outils" /> <img src="files/mappe.png" width="128" height="128" alt="mappe" /> <img src="files/calepin.png" width="128" height="128" alt="calepin" /></div></td>
</tr>
<tr>
<td><p>Sankoré Editor allows you to create rich interactivity scenarios. Create interactive content easily with basic activities that can be used in various subjects (attach images, sounds, order of words, phrases, create categories ...). This content can then be added to the software Open-Sankore. </p></td>
</tr>
<tr>
<td><p>Requirement to work with the editor :</p>
<ul>
<li>a Web access</li>
<li>an account on Planète Sankoré</li>
</ul></td>
</tr>
<tr>
<td><div align="center">
<p>&nbsp;</p>
<p><a href="http://editeur.sankore.org" title="Editeur" target="_self" class="c">Click here to connect to the Sankoré Editor</a></p>
</div></td>
</tr>
<tr>
<td><p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></td>
</tr>
<tr>
<td>Sankoré editor is hosted on <a href="http://planete.sankore.org/" target="_self">planete.sankore.org</a></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

@ -1,80 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Editeur Sankoré</title>
<style type="text/css">
<!--
.white { color: #FFF;
}
body {
background-color: #E5E3DB;
}
body,td,th {
font-family: Verdana, Geneva, sans-serif;
color: #666;
text-align: left;
}
.conteneur {
background-color: #5C5C5C;
text-align: center;
}
.c {
text-align: center;
}
.m {
font-size: medium;
}
a:link {
color: #666;
}
a:visited {
color: #666;
}
a:hover {
color: #000;
}
a:active {
color: #666;
}
-->
</style>
</head>
<body>
<table width="843" border="0" align="center">
<tr>
<td class="conteneur"><p><img src="files/logo.png" width="196" height="22" alt="editeur" /></p>
<p><span class="white">Instructions pour l'utilisation de l'éditeur Sankoré</span></p></td>
</tr>
<tr>
<td><div align="center"><img src="files/outils.png" width="128" height="128" alt="outils" /> <img src="files/mappe.png" width="128" height="128" alt="mappe" /> <img src="files/calepin.png" width="128" height="128" alt="calepin" /></div></td>
</tr>
<tr>
<td>L'éditeur Sankoré vous permet de réaliser des scénarios d'interactivités riches. Il facilite la création de contenu interactif avec des activités de base qui peuvent être utilisées dans diverses disciplines (associer des images, des sons, ordonner des mots, des phrases, créer des catégories...). Ce contenu peut ensuite être ajouté à votre cours sur le logiciel Open-Sankoré. L'éditeur repose sur votre compte utilisateur Planète Sankoré.</td>
</tr>
<tr>
<td><p>Éléments requis pour travailler avec l'éditeur :</p>
<ul>
<li>un accès Web</li>
<li>un compte Planète Sankoré</li>
</ul></td>
</tr>
<tr>
<td><div align="center">
<p>&nbsp;</p>
<p><a href="http://editeur.sankore.org" title="Editeur" target="_self" class="c">Accès à l'éditeur Sankoré</a></p>
</div></td>
</tr>
<tr>
<td><p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p></td>
</tr>
<tr>
<td>L'éditeur Sankoré est hébergé sur <a href="http://planete.sankore.org/" target="_self">planete.sankore.org</a></td>
</tr>
</table>
<p>&nbsp;</p>
</body>
</html>

@ -1596,18 +1596,6 @@
<string>Check Update</string>
</property>
</action>
<action name="actionSankoreEditor">
<property name="icon">
<iconset resource="../sankore.qrc">
<normaloff>:/images/toolbar/paraschool.png</normaloff>:/images/toolbar/paraschool.png</iconset>
</property>
<property name="text">
<string>Open-Sankoré Editor</string>
</property>
<property name="toolTip">
<string>Show Open-Sankoré Widgets Editor</string>
</property>
</action>
<action name="actionHideApplication">
<property name="icon">
<iconset resource="../sankore.qrc">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

@ -295,7 +295,6 @@
<file>images/toolbar/updates.png</file>
<file>images/paletteLibrary.png</file>
<file>images/paletteNavigator.png</file>
<file>images/toolbar/paraschool.png</file>
<file>images/toolbar/display.png</file>
<file>images/toolbar/hide.png</file>
<file>images/toolbar/record.png</file>

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -399,10 +399,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mXmlReader.readNext();
if (mXmlReader.isStartElement())
{
qreal zFromSvg = getZValueFromSvg();
QUuid uuidFromSvg = getUuidFromSvg();
if (mXmlReader.name() == "svg")
{
if (!mScene)
@ -443,9 +439,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
QStringRef svgSceneUuid = mXmlReader.attributes().value(mNamespaceUri, "uuid");
if (!svgSceneUuid.isNull())
{
mScene->setUuid(QUuid(svgSceneUuid.toString()));
}
// introduced in UB 4.0
@ -475,9 +469,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
QStringRef pageDpi = mXmlReader.attributes().value("pageDpi");
if (!pageDpi.isNull())
{
UBSettings::settings()->pageDpi->set(pageDpi.toString());
}
bool darkBackground = false;
bool crossedBackground = false;
@ -560,9 +552,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
if (polygonItem)
{
polygonItem->setUuid(uuidFromSvg);
polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic));
UBGraphicsStrokesGroup* group;
@ -570,24 +559,26 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
group = new UBGraphicsStrokesGroup();
mStrokesList.insert(parentId,group);
currentStroke = new UBGraphicsStroke();
group->setTransform(polygonItem->transform());
UBGraphicsItem::assignZValue(group, polygonItem->zValue());
}
else
group = mStrokesList.value(parentId);
if(polygonItem->transform().isIdentity())
polygonItem->setTransform(group->transform());
group->addToGroup(polygonItem);
polygonItem->setStrokesGroup(group);
polygonItem->setStroke(currentStroke);
polygonItem->show();
group->addToGroup(polygonItem);
}
}
else if (mXmlReader.name() == "polyline")
{
QList<UBGraphicsPolygonItem*> polygonItems
= polygonItemsFromPolylineSvg(mScene->isDarkBackground() ? Qt::white : Qt::black);
QList<UBGraphicsPolygonItem*> polygonItems = polygonItemsFromPolylineSvg(mScene->isDarkBackground() ? Qt::white : Qt::black);
QString parentId = QUuid::createUuid().toString();
@ -600,11 +591,15 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
group = new UBGraphicsStrokesGroup();
mStrokesList.insert(parentId,group);
currentStroke = new UBGraphicsStroke();
group->setTransform(polygonItem->transform());
UBGraphicsItem::assignZValue(group, polygonItem->zValue());
}
else
group = mStrokesList.value(parentId);
if(polygonItem->transform().isIdentity())
polygonItem->setTransform(group->transform());
group->addToGroup(polygonItem);
polygonItem->setStrokesGroup(group);
polygonItem->setStroke(currentStroke);
@ -612,6 +607,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
polygonItem->show();
group->addToGroup(polygonItem);
}
}
else if (mXmlReader.name() == "image")
{
@ -636,12 +632,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(pixmapItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(pixmapItem, zFromSvg);
if (!uuidFromSvg.isNull())
pixmapItem->setUuid(uuidFromSvg);
if (isBackground)
mScene->setAsBackgroundObject(pixmapItem);
@ -651,7 +641,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (href.contains("svg"))
{
UBGraphicsSvgItem* svgItem = svgItemFromSvg();
if (svgItem)
{
svgItem->setFlag(QGraphicsItem::ItemIsMovable, true);
@ -659,9 +648,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(svgItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(svgItem, zFromSvg);
if (isBackground)
mScene->setAsBackgroundObject(svgItem);
@ -677,7 +663,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (mXmlReader.name() == "audio")
{
UBGraphicsMediaItem* audioItem = audioItemFromSvg();
if (audioItem)
{
audioItem->setFlag(QGraphicsItem::ItemIsMovable, true);
@ -685,12 +670,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(audioItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(audioItem, zFromSvg);
if (!uuidFromSvg.isNull())
audioItem->setUuid(uuidFromSvg);
audioItem->show();
//force start to load the video and display the first frame
@ -701,20 +680,14 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (mXmlReader.name() == "video")
{
UBGraphicsMediaItem* videoItem = videoItemFromSvg();
if (videoItem)
{
videoItem->setFlag(QGraphicsItem::ItemIsMovable, true);
videoItem->setFlag(QGraphicsItem::ItemIsSelectable, true);
mScene->addItem(videoItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(videoItem, zFromSvg);
if (!uuidFromSvg.isNull())
videoItem->setUuid(uuidFromSvg);
videoItem->show();
//force start to load the video and display the first frame
@ -725,7 +698,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (mXmlReader.name() == "text")//This is for backward compatibility with proto text field prior to version 4.3
{
UBGraphicsTextItem* textItem = textItemFromSvg();
if (textItem)
{
textItem->setFlag(QGraphicsItem::ItemIsMovable, true);
@ -733,85 +705,54 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(textItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(textItem, zFromSvg);
if (!uuidFromSvg.isNull())
textItem->setUuid(uuidFromSvg);
textItem->show();
}
}
else if (mXmlReader.name() == "curtain")
{
UBGraphicsCurtainItem* mask = curtainItemFromSvg();
if (mask)
{
mScene->addItem(mask);
mScene->registerTool(mask);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(mask, zFromSvg);
if (!uuidFromSvg.isNull())
mask->setUuid(uuidFromSvg);
}
}
else if (mXmlReader.name() == "ruler")
{
QString ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value").toString();
UBGraphicsRuler *ruler = rulerFromSvg();
ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value").toString();
if (ruler)
{
mScene->addItem(ruler);
mScene->registerTool(ruler);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(ruler, zFromSvg);
}
}
else if (mXmlReader.name() == "compass")
{
UBGraphicsCompass *compass = compassFromSvg();
if (compass)
{
mScene->addItem(compass);
mScene->registerTool(compass);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(compass, zFromSvg);
}
}
else if (mXmlReader.name() == "protractor")
{
UBGraphicsProtractor *protractor = protractorFromSvg();
if (protractor)
{
mScene->addItem(protractor);
mScene->registerTool(protractor);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(protractor, zFromSvg);
}
}
else if (mXmlReader.name() == "triangle")
{
UBGraphicsTriangle *triangle = triangleFromSvg();
if (triangle)
{
mScene->addItem(triangle);
mScene->registerTool(triangle);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(triangle, zFromSvg);
}
}
else if (mXmlReader.name() == "cache")
@ -822,9 +763,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(cache);
mScene->registerTool(cache);
UBApplication::boardController->notifyCache(true);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(cache, zFromSvg);
}
}
else if (mXmlReader.name() == "foreignObject")
@ -851,9 +789,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(pdfItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(pdfItem, zFromSvg);
if (isBackground)
mScene->setAsBackgroundObject(pdfItem);
@ -873,12 +808,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(appleWidgetItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(appleWidgetItem, zFromSvg);
if (!uuidFromSvg.isNull())
appleWidgetItem->setUuid(uuidFromSvg);
appleWidgetItem->show();
currentWidget = appleWidgetItem;
@ -887,7 +816,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (src.contains(".wgt"))
{
UBGraphicsW3CWidgetItem* w3cWidgetItem = graphicsW3CWidgetFromSvg();
if (w3cWidgetItem)
{
w3cWidgetItem->setFlag(QGraphicsItem::ItemIsSelectable, true);
@ -896,12 +824,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(w3cWidgetItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(w3cWidgetItem, zFromSvg);
if (!uuidFromSvg.isNull())
w3cWidgetItem->setUuid(uuidFromSvg);
w3cWidgetItem->show();
currentWidget = w3cWidgetItem;
@ -910,7 +832,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (type == "text")
{
UBGraphicsTextItem* textItem = textItemFromSvg();
UBGraphicsTextItemDelegate *textDelegate = 0;
if (textItem)
@ -931,12 +852,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(textItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(textItem, zFromSvg);
if (!uuidFromSvg.isNull())
textItem->setUuid(uuidFromSvg);
textItem->show();
}
}
@ -991,9 +906,8 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(iterator.value());
}
if (mScene) {
if (mScene)
mScene->setModified(false);
}
mScene->enableUndoRedoStack();
qDebug() << "loadScene() : created scene and read file";
@ -1213,24 +1127,25 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
foreach(QGraphicsItem* item, strokesGroupItem->childItems()) {
UBGraphicsPolygonItem* poly = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item);
if (!poly) {
if (!poly)
continue;
} else if (!resultPoly) {
if (!resultPoly) {
resultPoly = poly;
continue;
}
QPolygonF newPolygon = poly->sceneTransform().map(poly->polygon());
QPainterPath strokePainterPath;
strokePainterPath.addPolygon(resultPoly->sceneTransform().map(resultPoly->polygon()));
QPolygonF oldPolygons = strokePainterPath.simplified().toFillPolygon(resultPoly->sceneTransform().inverted());
newPolygon = oldPolygons.united(newPolygon);
resultPoly->setPolygon(newPolygon);
//
QPolygonF unitedPolygon = resultPoly->polygon().united(poly->polygon());
resultPoly->setPolygon(unitedPolygon);
items.removeOne(poly);
}
if (resultPoly) {
polygonItemToSvgPolygon(resultPoly, true);
resultPoly->setZValue(strokesGroupItem->zValue());
//Claudio: the painter path simplification remove all the polygons overlap
QPainterPath painterPath;
painterPath.addPolygon(resultPoly->polygon());
painterPath = painterPath.simplified();
resultPoly->setPolygon(painterPath.toFillPolygon());
polygonItemToSvgPolygon(resultPoly, false);
items.removeOne(resultPoly);
}
}
@ -1239,9 +1154,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*> (item);
if (polygonItem && polygonItem->isVisible())
{
UBGraphicsStroke* currentStroke = polygonItem->stroke();
if (openStroke && (currentStroke != openStroke))
{
mXmlWriter.writeEndElement(); //g
@ -1514,7 +1427,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro
foreach (QGraphicsItem *item, groupItem->childItems()) {
QUuid tmpUuid = UBGraphicsScene::getPersonalUuid(item);
if (!tmpUuid.isNull()) {
if (item->type() == UBGraphicsGroupContainerItem::Type && item->childItems().count()) {
if (item->type() == UBGraphicsGroupContainerItem::Type && item->childItems().count())
persistGroupToDom(item, curParent, groupDomDocument);
}
else {
@ -1525,7 +1438,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro
}
}
}
}
}
void UBSvgSubsetAdaptor::UBSvgSubsetWriter::polygonItemToSvgLine(UBGraphicsPolygonItem* polygonItem, bool groupHoldsInfo)
@ -1694,26 +1606,15 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
{
UBGraphicsPolygonItem* polygonItem = new UBGraphicsPolygonItem();
graphicsItemFromSvg(polygonItem);
QStringRef svgPoints = mXmlReader.attributes().value("points");
QPolygonF polygon;
if (!svgPoints.isNull())
{
// int lenght = strlen(svgPoints.toUtf8().constData()) + 1;
// char pippo[lenght];
// memcpy(pippo,svgPoints.toUtf8().constData(),lenght);
// char* localPosition = (char*) &pippo[0];
// do{
// float x = atof(localPosition);
// localPosition = strchr(localPosition,',') + 1;
// float y = atof(localPosition);
// localPosition = strchrnul(localPosition,' ');
// polygon << QPointF(x,y);
// }while(localPosition - pippo > lenght - 5);
QStringList ts = svgPoints.toString().split(QLatin1Char(' '),
QString::SkipEmptyParts);
QStringList ts = svgPoints.toString().split(QLatin1Char(' '), QString::SkipEmptyParts);
foreach(const QString sPoint, ts)
{
@ -1748,26 +1649,13 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
polygonItem->setPolygon(polygon);
QStringRef svgTransform = mXmlReader.attributes().value("transform");
QMatrix itemMatrix;
if (!svgTransform.isNull())
{
itemMatrix = fromSvgTransform(svgTransform.toString());
polygonItem->setMatrix(itemMatrix);
}
QStringRef svgFill = mXmlReader.attributes().value("fill");
QColor brushColor = pDefaultColor;
if (!svgFill.isNull())
{
brushColor.setNamedColor(svgFill.toString());
}
QStringRef svgFillOpacity = mXmlReader.attributes().value("fill-opacity");
qreal opacity = 1.0;
@ -1779,17 +1667,6 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
polygonItem->setColor(brushColor);
QStringRef ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value");
if (!ubZValue.isNull())
{
UBGraphicsItem::assignZValue(polygonItem, ubZValue.toString().toFloat());
}
else
{
UBGraphicsItem::assignZValue(polygonItem, mGroupZIndex);
}
QStringRef ubFillOnDarkBackground = mXmlReader.attributes().value(mNamespaceUri, "fill-on-dark-background");
if (!ubFillOnDarkBackground.isNull())
@ -1864,6 +1741,7 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromLin
}
UBGraphicsPolygonItem* polygonItem = new UBGraphicsPolygonItem(line, lineWidth);
graphicsItemFromSvg(polygonItem);
QStringRef svgStroke = mXmlReader.attributes().value("stroke");
@ -1886,18 +1764,6 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromLin
polygonItem->setColor(brushColor);
QStringRef ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value");
if (!ubZValue.isNull())
{
UBGraphicsItem::assignZValue(polygonItem, ubZValue.toString().toFloat());
}
else
{
UBGraphicsItem::assignZValue(polygonItem, mGroupZIndex);
}
QStringRef ubFillOnDarkBackground = mXmlReader.attributes().value(mNamespaceUri, "fill-on-dark-background");
if (!ubFillOnDarkBackground.isNull())
@ -2288,24 +2154,21 @@ UBGraphicsMediaItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::audioItemFromSvg()
//Claudio this is necessary to fix the absolute path added on Sankore 3.1 1.00.00
//The absoult path doesn't work when you want to share Sankore documents.
if(!href.startsWith("audios/")){
if(!audioHref.startsWith("audios/")){
int indexOfAudioDirectory = href.lastIndexOf("audios");
href = mDocumentPath + "/" + href.right(href.length() - indexOfAudioDirectory);
}
UBGraphicsMediaItem* audioItem = new UBGraphicsMediaItem(QUrl::fromLocalFile(href));
if(audioItem){
if(audioItem)
audioItem->connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), audioItem, SLOT(activeSceneChanged()));
}
graphicsItemFromSvg(audioItem);
QStringRef ubPos = mXmlReader.attributes().value(mNamespaceUri, "position");
qint64 p = 0;
if (!ubPos.isNull())
{
p = ubPos.toString().toLongLong();
}
audioItem->setInitialPos(p);
return audioItem;
@ -2326,7 +2189,7 @@ UBGraphicsMediaItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::videoItemFromSvg()
//Claudio this is necessary to fix the absolute path added on Sankore 3.1 1.00.00
//The absoult path doesn't work when you want to share Sankore documents.
if(!href.startsWith("videos/")){
if(!videoHref.startsWith("videos/")){
int indexOfAudioDirectory = href.lastIndexOf("videos");
href = mDocumentPath + "/" + href.right(href.length() - indexOfAudioDirectory);
}
@ -2380,9 +2243,9 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
{
if (!svgX.isNull() && !svgY.isNull())
{
#ifdef Q_WS_WIN
#ifdef Q_WS_WIN
gItem->setPos(svgX.toString().toFloat(), svgY.toString().toFloat());
#endif
#endif
}
}
@ -2402,9 +2265,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
QStringRef ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value");
if (!ubZValue.isNull())
{
UBGraphicsItem::assignZValue(gItem, ubZValue.toString().toFloat());
}
UBItem* ubItem = dynamic_cast<UBItem*>(gItem);
@ -2413,17 +2274,15 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
QStringRef ubUuid = mXmlReader.attributes().value(mNamespaceUri, "uuid");
if (!ubUuid.isNull())
{
ubItem->setUuid(QUuid(ubUuid.toString()));
}
else
ubItem->setUuid(QUuid::createUuid());
QStringRef ubSource = mXmlReader.attributes().value(mNamespaceUri, "source");
if (!ubSource.isNull())
{
ubItem->setSourceUrl(QUrl(ubSource.toString()));
}
}
QStringRef ubLocked = mXmlReader.attributes().value(mNamespaceUri, "locked");
@ -2449,35 +2308,10 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
int layerAsInt = ubLayer.toString().toInt(&ok);
if (ok)
{
gItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(layerAsInt));
}
}
}
qreal UBSvgSubsetAdaptor::UBSvgSubsetReader::getZValueFromSvg()
{
qreal result = UBZLayerController::errorNum();
QStringRef ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value");
if (!ubZValue.isNull()) {
result = ubZValue.toString().toFloat();
}
return result;
}
QUuid UBSvgSubsetAdaptor::UBSvgSubsetReader::getUuidFromSvg()
{
QString strUuid = mXmlReader.attributes().value(mNamespaceUri, "uuid").toString();
QUuid uuid = QUuid(strUuid);
if (!uuid.isNull())
return uuid;
return QUuid::createUuid();
}
void UBSvgSubsetAdaptor::UBSvgSubsetWriter::graphicsItemToSvg(QGraphicsItem* item)
{
mXmlWriter.writeAttribute("x", "0");
@ -2769,6 +2603,7 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg()
if (mXmlReader.hasError())
{
delete textItem;
textItem = 0;
return 0;
}
@ -3299,9 +3134,3 @@ void UBSvgSubsetAdaptor::convertSvgImagesToImages(UBDocumentProxy* proxy)
}
}
}

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -158,9 +158,6 @@ class UBSvgSubsetAdaptor
void graphicsItemFromSvg(QGraphicsItem* gItem);
qreal getZValueFromSvg();
QUuid getUuidFromSvg();
QXmlStreamReader mXmlReader;
int mFileVersion;
UBDocumentProxy *mProxy;

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -358,9 +358,7 @@ void UBBoardController::setupToolbar()
void UBBoardController::setToolCursor(int tool)
{
if (mActiveScene)
{
mActiveScene->setToolCursor(tool);
}
mControlView->setToolCursor(tool);
}
@ -1893,10 +1891,7 @@ void UBBoardController::updateSystemScaleFactor()
}
if (mSystemScaleFactor != newScaleFactor)
{
mSystemScaleFactor = newScaleFactor;
emit systemScaleFactorChanged(newScaleFactor);
}
UBGraphicsScene::SceneViewState viewState = mActiveScene->viewState();
@ -1961,13 +1956,8 @@ void UBBoardController::setPageSize(QSize newSize)
void UBBoardController::notifyCache(bool visible)
{
if(visible)
{
emit cacheEnabled();
}
else
{
emit cacheDisabled();
}
mCacheWidgetIsEnabled = visible;
}

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -149,7 +149,7 @@ class UBBoardController : public UBDocumentContainer
void setBoxing(QRect displayRect);
void setToolbarTexts();
static QUrl expandWidgetToTempDir(const QByteArray& pZipedData, const QString& pExtension = QString("wgt"));
// static QRect freeRectInGlobalPos() const {return ;}
void setPageSize(QSize newSize);
UBBoardPaletteManager *paletteManager()
{
@ -239,12 +239,10 @@ class UBBoardController : public UBDocumentContainer
void newPageAdded();
void activeSceneChanged();
void zoomChanged(qreal pZoomFactor);
void systemScaleFactorChanged(qreal pSystemScaleFactor);
void penColorChanged();
void controlViewportChanged();
void backgroundChanged();
void cacheEnabled();
void cacheDisabled();
void documentReorganized(int index);
void displayMetadata(QMap<QString, QString> metadata);
void pageSelectionChanged(int index);

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -175,7 +175,7 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode)
{
// Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument
// Board = 0, Internet, Document, Tutorial, WebDocument
switch( mainMode )
{
@ -821,8 +821,6 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
if( !isInit )
UBApplication::boardController->notifyPageChanged();
emit signal_changeMode(newMode);
}
void UBBoardPaletteManager::addItem(const QPixmap& pPixmap, const QPointF& pos, qreal scaleFactor, const QUrl& sourceUrl)
@ -970,11 +968,6 @@ void UBBoardPaletteManager::changeStylusPaletteOrientation(QVariant var)
}
void UBBoardPaletteManager::connectToDocumentController()
{
emit connectToDocController();
}
void UBBoardPaletteManager::refreshPalettes()
{
mRightPalette->update();

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -64,7 +64,6 @@ class UBBoardPaletteManager : public QObject
UBActionPalette *addItemPalette() {return mAddItemPalette;}
void showVirtualKeyboard(bool show = true);
void initPalettesPosAtStartup();
void connectToDocumentController();
void refreshPalettes();
UBKeyboardPalette *mKeyboardPalette;
@ -79,10 +78,6 @@ class UBBoardPaletteManager : public QObject
void startDownloads();
void stopDownloads();
signals:
void connectToDocController();
void signal_changeMode(eUBDockPaletteWidgetMode newMode);
public slots:
void activeSceneChanged();

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -80,18 +80,18 @@
#include "core/memcheck.h"
UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool isControl, bool isDesktop)
: QGraphicsView (pParent)
, mController (pController)
, mIsCreatingTextZone (false)
, mIsCreatingSceneGrabZone (false)
, mOkOnWidget(false)
, suspendedMousePressEvent(NULL)
, mLongPressInterval(1000)
, mIsDragInProgress(false)
, mMultipleSelectionIsEnabled(false)
, bIsControl(isControl)
, bIsDesktop(isDesktop)
, mRubberBandInPlayMode(false) //enables rubberband with play tool
: QGraphicsView (pParent)
, mController (pController)
, mIsCreatingTextZone (false)
, mIsCreatingSceneGrabZone (false)
, mOkOnWidget(false)
, suspendedMousePressEvent(NULL)
, mLongPressInterval(1000)
, mIsDragInProgress(false)
, mMultipleSelectionIsEnabled(false)
, bIsControl(isControl)
, bIsDesktop(isDesktop)
, mRubberBandInPlayMode(false) //enables rubberband with play tool
{
init ();
@ -102,14 +102,14 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool
}
UBBoardView::UBBoardView (UBBoardController* pController, int pStartLayer, int pEndLayer, QWidget* pParent, bool isControl, bool isDesktop)
: QGraphicsView (pParent)
, mController (pController)
, suspendedMousePressEvent(NULL)
, mLongPressInterval(1000)
, mIsDragInProgress(false)
, mMultipleSelectionIsEnabled(false)
, bIsControl(isControl)
, bIsDesktop(isDesktop)
: QGraphicsView (pParent)
, mController (pController)
, suspendedMousePressEvent(NULL)
, mLongPressInterval(1000)
, mIsDragInProgress(false)
, mMultipleSelectionIsEnabled(false)
, bIsControl(isControl)
, bIsDesktop(isDesktop)
{
init ();
@ -122,10 +122,12 @@ UBBoardView::UBBoardView (UBBoardController* pController, int pStartLayer, int p
mLongPressTimer.setSingleShot(true);
}
UBBoardView::~UBBoardView () {
//NOOP
if (suspendedMousePressEvent)
UBBoardView::~UBBoardView ()
{
if (suspendedMousePressEvent){
delete suspendedMousePressEvent;
suspendedMousePressEvent = NULL;
}
}
void UBBoardView::init ()
@ -139,6 +141,8 @@ void UBBoardView::init ()
connect (UBSettings::settings ()->boardUseHighResTabletEvent, SIGNAL (changed (QVariant)),
this, SLOT (settingChanged (QVariant)));
setOptimizationFlags (QGraphicsView::IndirectPainting | QGraphicsView::DontSavePainterState); // enable UBBoardView::drawItems filter
setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
setWindowFlags (Qt::FramelessWindowHint);
setFrameStyle (QFrame::NoFrame);
setRenderHints (QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing);
@ -146,9 +150,6 @@ void UBBoardView::init ()
setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
setAcceptDrops (true);
setOptimizationFlags (QGraphicsView::IndirectPainting | QGraphicsView::DontSavePainterState); // enable UBBoardView::drawItems filter
setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
mTabletStylusIsPressed = false;
mMouseButtonIsPressed = false;
mPendingStylusReleaseEvent = false;
@ -170,28 +171,13 @@ void UBBoardView::init ()
mWidgetMoved = false;
}
UBGraphicsScene*
UBBoardView::scene ()
UBGraphicsScene* UBBoardView::scene ()
{
return qobject_cast<UBGraphicsScene*> (QGraphicsView::scene ());
}
void
UBBoardView::hideEvent (QHideEvent * event)
{
Q_UNUSED (event);
emit hidden ();
}
void
UBBoardView::showEvent (QShowEvent * event)
{
Q_UNUSED (event);
emit shown ();
}
void
UBBoardView::keyPressEvent (QKeyEvent *event)
void UBBoardView::keyPressEvent (QKeyEvent *event)
{
// send to the scene anyway
QApplication::sendEvent (scene (), event);
@ -304,20 +290,14 @@ UBBoardView::keyPressEvent (QKeyEvent *event)
void UBBoardView::keyReleaseEvent(QKeyEvent *event)
{
// if (!event->isAccepted ())
{
if (Qt::Key_Shift == event->key()
||Qt::Key_Control == event->key())
{
if (Qt::Key_Shift == event->key() ||Qt::Key_Control == event->key())
setMultiselection(false);
}
}
QGraphicsView::keyReleaseEvent(event);
}
bool
UBBoardView::event (QEvent * e)
bool UBBoardView::event (QEvent * e)
{
if (e->type () == QEvent::Gesture)
{
@ -462,14 +442,13 @@ bool UBBoardView::itemHaveParentWithType(QGraphicsItem *item, int type)
return itemHaveParentWithType(item->parentItem(), type);
}
bool UBBoardView::isUBItem(QGraphicsItem *item)
{
if ((UBGraphicsItemType::UserTypesCount > item->type()) && (item->type() > QGraphicsItem::UserType))
return true;
else
{
return false;
}
}
bool UBBoardView::isCppTool(QGraphicsItem *item)
@ -483,12 +462,12 @@ bool UBBoardView::isCppTool(QGraphicsItem *item)
void UBBoardView::handleItemsSelection(QGraphicsItem *item)
{
// we need to select new pressed itemOnBoard and deselect all other items.
// the trouble is in:
// some items can has parents (groupped items or strokes, or strokes in groups).
// some items is already selected and we don't need to reselect them
//
// item selection managed by QGraphicsView::mousePressEvent(). It should be called later.
// we need to select new pressed itemOnBoard and deselect all other items.
// the trouble is in:
// some items can has parents (groupped items or strokes, or strokes in groups).
// some items is already selected and we don't need to reselect them
//
// item selection managed by QGraphicsView::mousePressEvent(). It should be called later.
if (item)
{
@ -531,7 +510,7 @@ void UBBoardView::handleItemsSelection(QGraphicsItem *item)
bool UBBoardView::itemShouldReceiveMousePressEvent(QGraphicsItem *item)
{
/*
/*
Some items should receive mouse press events averytime,
some items should receive that events when they are selected,
some items shouldn't receive mouse press events at mouse press, but should receive them at mouse release (suspended mouse press event)
@ -571,6 +550,8 @@ Here we determines cases when items should to get mouse press event at pressing
case UBGraphicsSvgItem::Type:
case UBGraphicsPixmapItem::Type:
case UBGraphicsTextItem::Type:
if (currentTool == UBStylusTool::Play)
return true;
if ((currentTool == UBStylusTool::Selector) && item->isSelected())
return true;
if ((currentTool == UBStylusTool::Selector) && item->parentItem() && item->parentItem()->isSelected())
@ -578,19 +559,19 @@ Here we determines cases when items should to get mouse press event at pressing
if (currentTool != UBStylusTool::Selector)
return false;
break;
// Groups shouldn't reacts on any presses and moves for Play tool.
case UBGraphicsItemType::StrokeItemType:
if (currentTool == UBStylusTool::Play)
return true;
break;
case UBGraphicsGroupContainerItem::Type:
// Groups shouldn't reacts on any presses and moves for Play tool.
if(currentTool == UBStylusTool::Play)
{
movingItem = NULL;
return true;
}
return false;
break;
//case UBToolWidget::Type:
// return true;
case QGraphicsWebView::Type:
return true;
@ -761,11 +742,8 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
return;
if (itemShouldReceiveMousePressEvent(movingItem))
{
QGraphicsView::mousePressEvent (event);
}
else
{
else {
if (movingItem)
{
UBGraphicsItem *graphicsItem = dynamic_cast<UBGraphicsItem*>(movingItem);
@ -933,6 +911,7 @@ QWidget *UBBoardView::widgetForTabletEvent(QWidget *w, const QPoint &pos)
return childAtPos;
}
#endif
void UBBoardView::longPressEvent()
{
UBDrawingController *drawingController = UBDrawingController::drawingController();
@ -966,8 +945,7 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
mIsDragInProgress = false;
if (isAbsurdPoint (event->pos ()))
{
if (isAbsurdPoint (event->pos ())) {
event->accept ();
return;
}
@ -1016,13 +994,13 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
mLongPressTimer.start();
if (!movingItem) {
// Rubberband selection implementation
// if (!mUBRubberBand) {
// mUBRubberBand = new UBRubberBand(QRubberBand::Rectangle, this);
// }
// mUBRubberBand->setGeometry (QRect (mMouseDownPos, QSize ()));
// mUBRubberBand->show();
// scene()->updateMultipleSelectionFrame();
// Rubberband selection implementation
// if (!mUBRubberBand) {
// mUBRubberBand = new UBRubberBand(QRubberBand::Rectangle, this);
// }
// mUBRubberBand->setGeometry (QRect (mMouseDownPos, QSize ()));
// mUBRubberBand->show();
// scene()->updateMultipleSelectionFrame();
}
if(mUBRubberBand) {
@ -1081,7 +1059,6 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
default:
if(UBDrawingController::drawingController()->mActiveRuler==NULL) {
viewport()->setCursor (QCursor (Qt::BlankCursor));
}
if (scene () && !mTabletStylusIsPressed) {
if (currentTool == UBStylusTool::Eraser) {
@ -1093,17 +1070,17 @@ void UBBoardView::mousePressEvent (QMouseEvent *event)
event->accept ();
}
}
}
}
void
UBBoardView::mouseMoveEvent (QMouseEvent *event)
void UBBoardView::mouseMoveEvent (QMouseEvent *event)
{
// static QTime lastCallTime;
// if (!lastCallTime.isNull()) {
// qDebug() << "time interval is " << lastCallTime.msecsTo(QTime::currentTime());
// }
// static QTime lastCallTime;
// if (!lastCallTime.isNull()) {
// qDebug() << "time interval is " << lastCallTime.msecsTo(QTime::currentTime());
// }
// QTime mouseMoveTime = QTime::currentTime();
// QTime mouseMoveTime = QTime::currentTime();
if(!mIsDragInProgress
&& ((mapToScene(event->pos()) - mLastPressedMousePos).manhattanLength() < QApplication::startDragDistance())) {
qDebug() << "mouse move event canceled";
@ -1158,24 +1135,24 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
if (!mUBRubberBand) {
mUBRubberBand = new UBRubberBand(QRubberBand::Rectangle, this);
}
// mUBRubberBand->setGeometry (QRect (mMouseDownPos, QSize ()));
// mUBRubberBand->setGeometry (QRect (mMouseDownPos, QSize ()));
mUBRubberBand->setGeometry(bandRect);
mUBRubberBand->show();
// QTime startTime = QTime::currentTime();
// QTime testTime = QTime::currentTime();
// QTime startTime = QTime::currentTime();
// QTime testTime = QTime::currentTime();
QList<QGraphicsItem *> rubberItems = items(bandRect);
// qDebug() << "==================";
// qDebug() << "| ====rubber items" << testTime.msecsTo(QTime::currentTime());
// testTime = QTime::currentTime();
// qDebug() << "==================";
// qDebug() << "| ====rubber items" << testTime.msecsTo(QTime::currentTime());
// testTime = QTime::currentTime();
foreach (QGraphicsItem *item, mJustSelectedItems) {
if (!rubberItems.contains(item)) {
item->setSelected(false);
mJustSelectedItems.remove(item);
}
}
// qDebug() << "| ===foreach length" << testTime.msecsTo(QTime::currentTime());
// testTime = QTime::currentTime();
// qDebug() << "| ===foreach length" << testTime.msecsTo(QTime::currentTime());
// testTime = QTime::currentTime();
int counter = 0;
if (currentTool == UBStylusTool::Selector) {
@ -1199,11 +1176,11 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
}
}
// qDebug() << "| ==selected items count" << counter << endl
// << "| ==selection time" << testTime.msecsTo(QTime::currentTime()) << endl
// << "| =elapsed time " << startTime.msecsTo(QTime::currentTime()) << endl
// << "==================";
// QCoreApplication::removePostedEvents(scene(), 0);
// qDebug() << "| ==selected items count" << counter << endl
// << "| ==selection time" << testTime.msecsTo(QTime::currentTime()) << endl
// << "| =elapsed time " << startTime.msecsTo(QTime::currentTime()) << endl
// << "==================";
// QCoreApplication::removePostedEvents(scene(), 0);
}
handleItemMouseMove(event);
} break;
@ -1227,12 +1204,12 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
event->accept ();
}
// qDebug() << "mouse move time" << mouseMoveTime.msecsTo(QTime::currentTime());
// lastCallTime = QTime::currentTime();
// qDebug() << "mouse move time" << mouseMoveTime.msecsTo(QTime::currentTime());
// lastCallTime = QTime::currentTime();
}
void
UBBoardView::mouseReleaseEvent (QMouseEvent *event)
void UBBoardView::mouseReleaseEvent (QMouseEvent *event)
{
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool ();
@ -1342,10 +1319,96 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
if (mRubberBand) {
mRubberBand->hide ();
}
UBGraphicsItem *graphicsItem = dynamic_cast<UBGraphicsItem*>(movingItem);
if (graphicsItem)
graphicsItem->Delegate()->commitUndoStep();
bool bReleaseIsNeed = true;
if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->posF().toPoint()))))
{
movingItem = NULL;
bReleaseIsNeed = false;
}
if (mWidgetMoved)
{
mWidgetMoved = false;
movingItem = NULL;
}
else
if (movingItem && (!isCppTool(movingItem) || UBGraphicsCurtainItem::Type == movingItem->type()))
{
if (suspendedMousePressEvent)
{
QGraphicsView::mousePressEvent(suspendedMousePressEvent); // suspendedMousePressEvent is deleted by old Qt event loop
movingItem = NULL;
delete suspendedMousePressEvent;
suspendedMousePressEvent = NULL;
bReleaseIsNeed = true;
}
else
{
if (isUBItem(movingItem) &&
DelegateButton::Type != movingItem->type() &&
QGraphicsSvgItem::Type != movingItem->type() &&
UBGraphicsDelegateFrame::Type != movingItem->type() &&
UBGraphicsCache::Type != movingItem->type() &&
QGraphicsWebView::Type != movingItem->type() && // for W3C widgets as Tools.
!(!isMultipleSelectionEnabled() && movingItem->parentItem() && UBGraphicsWidgetItem::Type == movingItem->type() && UBGraphicsGroupContainerItem::Type == movingItem->parentItem()->type()))
{
bReleaseIsNeed = false;
if (movingItem->isSelected() && isMultipleSelectionEnabled())
movingItem->setSelected(false);
else
if (movingItem->parentItem() && movingItem->parentItem()->isSelected() && isMultipleSelectionEnabled())
movingItem->parentItem()->setSelected(false);
else
{
if (movingItem->isSelected())
bReleaseIsNeed = true;
movingItem->setSelected(true);
}
}
}
}
else
bReleaseIsNeed = true;
if (scene () && mRubberBand && mIsCreatingTextZone)
if (mUBRubberBand && mUBRubberBand->isVisible()) {
mUBRubberBand->hide();
}
if (bReleaseIsNeed)
{
QGraphicsView::mouseReleaseEvent (event);
}
}
else if (currentTool == UBStylusTool::Play) {
if (bIsDesktop) {
event->ignore();
return;
}
if (mWidgetMoved) {
movingItem = NULL;
mWidgetMoved = false;
}
else {
if (suspendedMousePressEvent) {
QGraphicsView::mousePressEvent(suspendedMousePressEvent); // suspendedMousePressEvent is deleted by old Qt event loop
movingItem = NULL;
delete suspendedMousePressEvent;
suspendedMousePressEvent = NULL;
}
}
QGraphicsView::mouseReleaseEvent (event);
}
else if (currentTool == UBStylusTool::Text) {
if (mRubberBand)
mRubberBand->hide ();
if (scene () && mRubberBand && mIsCreatingTextZone) {
QRect rubberRect = mRubberBand->geometry ();
UBGraphicsTextItem* textItem = scene()->addTextHtml ("", mapToScene (rubberRect.topLeft ()));
@ -1357,9 +1420,7 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
textItem->setFocus();
}
else
{
QGraphicsView::mouseReleaseEvent (event);
}
mIsCreatingTextZone = false;
}
@ -1368,7 +1429,6 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
if (mRubberBand) {
mRubberBand->hide ();
}
if (scene () && mRubberBand && mIsCreatingSceneGrabZone && mRubberBand->geometry ().width () > 16)
{
QRect rect = mRubberBand->geometry ();
@ -1401,14 +1461,11 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event)
movingItem = NULL;
mLongPressTimer.stop();
emit mouseReleased();
}
void
UBBoardView::forcedTabletRelease ()
void UBBoardView::forcedTabletRelease ()
{
if (mMouseButtonIsPressed || mTabletStylusIsPressed || mPendingStylusReleaseEvent)
{
qWarning () << "dirty mouse/tablet state:";
@ -1425,26 +1482,14 @@ UBBoardView::forcedTabletRelease ()
}
}
void
UBBoardView::mouseDoubleClickEvent (QMouseEvent *event)
void UBBoardView::mouseDoubleClickEvent (QMouseEvent *event)
{
// We don't want a double click, we want two clicks
mousePressEvent (event);
}
void
UBBoardView::wheelEvent (QWheelEvent *wheelEvent)
void UBBoardView::wheelEvent (QWheelEvent *wheelEvent)
{
if (isInteractive () && wheelEvent->orientation () == Qt::Vertical)
{
// Too many wheelEvent are sent, how should we handle them to "smoothly" zoom ?
// something like zoom( pow(zoomFactor, event->delta() / 120) )
// use DateTime man, store last event time, and if if less than 300ms than this is one big scroll
// and move scroll with one const speed.
// so, you no will related with scroll event count
}
QList<QGraphicsItem *> selItemsList = scene()->selectedItems();
// if NO have selected items, than no need process mouse wheel. just exist
if( selItemsList.count() > 0 )
@ -1456,8 +1501,8 @@ UBBoardView::wheelEvent (QWheelEvent *wheelEvent)
QPointF scenePos = mapToScene(wheelEvent->pos());
QList<QGraphicsItem *> itemsList = scene()->items(scenePos);
QBool isSlectedAndMouseHower = itemsList.contains(selItem);
if(isSlectedAndMouseHower)
QBool isSelectedAndMouseHower = itemsList.contains(selItem);
if(isSelectedAndMouseHower)
{
QGraphicsView::wheelEvent(wheelEvent);
wheelEvent->accept();
@ -1467,8 +1512,7 @@ UBBoardView::wheelEvent (QWheelEvent *wheelEvent)
}
void
UBBoardView::leaveEvent (QEvent * event)
void UBBoardView::leaveEvent (QEvent * event)
{
if (scene ())
scene ()->leaveEvent (event);
@ -1476,15 +1520,10 @@ UBBoardView::leaveEvent (QEvent * event)
QGraphicsView::leaveEvent (event);
}
void
UBBoardView::drawItems (QPainter *painter, int numItems,
QGraphicsItem* items[],
const QStyleOptionGraphicsItem options[])
void UBBoardView::drawItems (QPainter *painter, int numItems, QGraphicsItem* items[], const QStyleOptionGraphicsItem options[])
{
if (!mFilterZIndex)
{
QGraphicsView::drawItems (painter, numItems, items, options);
}
else
{
int count = 0;
@ -1539,8 +1578,7 @@ void UBBoardView::dropEvent (QDropEvent *event)
}
}
void
UBBoardView::resizeEvent (QResizeEvent * event)
void UBBoardView::resizeEvent (QResizeEvent * event)
{
const qreal maxWidth = width () * 10;
const qreal maxHeight = height () * 10;
@ -1551,8 +1589,7 @@ UBBoardView::resizeEvent (QResizeEvent * event)
emit resized (event);
}
void
UBBoardView::drawBackground (QPainter *painter, const QRectF &rect)
void UBBoardView::drawBackground (QPainter *painter, const QRectF &rect)
{
if (testAttribute (Qt::WA_TranslucentBackground))
{
@ -1634,8 +1671,7 @@ UBBoardView::drawBackground (QPainter *painter, const QRectF &rect)
}
}
void
UBBoardView::settingChanged (QVariant newValue)
void UBBoardView::settingChanged (QVariant newValue)
{
Q_UNUSED (newValue);
@ -1668,14 +1704,12 @@ bool UBBoardView::isAbsurdPoint(QPoint point)
return !isValidPoint;
}
void
UBBoardView::focusOutEvent (QFocusEvent * event)
void UBBoardView::focusOutEvent (QFocusEvent * event)
{
Q_UNUSED (event);
}
void
UBBoardView::setToolCursor (int tool)
void UBBoardView::setToolCursor (int tool)
{
QWidget *controlViewport = viewport ();
switch (tool)

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -38,7 +38,7 @@ class UBBoardView : public QGraphicsView
{
Q_OBJECT
public:
public:
UBBoardView(UBBoardController* pController, QWidget* pParent = 0, bool isControl = false, bool isDesktop = false);
UBBoardView(UBBoardController* pController, int pStartLayer, int pEndLayer, QWidget* pParent = 0, bool isControl = false, bool isDesktop = false);
@ -55,20 +55,19 @@ class UBBoardView : public QGraphicsView
void setMultiselection(bool enable);
bool isMultipleSelectionEnabled() { return mMultipleSelectionIsEnabled; }
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
// work around for handling tablet events on MAC OS with Qt 4.8.0 and above
#if defined(Q_WS_MACX)
bool directTabletEvent(QEvent *event);
QWidget *widgetForTabletEvent(QWidget *w, const QPoint &pos);
#endif
signals:
signals:
void resized(QResizeEvent* event);
void hidden();
void shown();
void clickOnBoard();
void mouseReleased();
protected:
protected:
bool itemIsLocked(QGraphicsItem *item);
bool isUBItem(QGraphicsItem *item); // we should to determine items who is not UB and use general scene behavior for them.
@ -101,7 +100,6 @@ class UBBoardView : public QGraphicsView
QGraphicsItem *items[],
const QStyleOptionGraphicsItem options[]);
// virtual void dragEnterEvent(QDragEnterEvent * event);
virtual void dropEvent(QDropEvent *event);
virtual void dragMoveEvent(QDragMoveEvent *event);
@ -109,10 +107,7 @@ class UBBoardView : public QGraphicsView
virtual void drawBackground(QPainter *painter, const QRectF &rect);
virtual void showEvent(QShowEvent * event);
virtual void hideEvent(QHideEvent * event);
private:
private:
void init();
@ -174,11 +169,11 @@ class UBBoardView : public QGraphicsView
static bool hasSelectedParents(QGraphicsItem * item);
private slots:
private slots:
void settingChanged(QVariant newValue);
public slots:
public slots:
void virtualKeyboardActivated(bool b);
void longPressEvent();

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -159,35 +159,23 @@ bool UBDrawingController::isDrawingTool()
int UBDrawingController::currentToolWidthIndex()
{
if (stylusTool() == UBStylusTool::Pen || stylusTool() == UBStylusTool::Line)
{
return UBSettings::settings()->penWidthIndex();
}
else if (stylusTool() == UBStylusTool::Marker)
{
return UBSettings::settings()->markerWidthIndex();
}
else
{
return -1;
}
}
qreal UBDrawingController::currentToolWidth()
{
if (stylusTool() == UBStylusTool::Pen || stylusTool() == UBStylusTool::Line)
{
return UBSettings::settings()->currentPenWidth();
}
else if (stylusTool() == UBStylusTool::Marker)
{
return UBSettings::settings()->currentMarkerWidth();
}
else
{
//failsafe
return UBSettings::settings()->currentPenWidth();
}
}

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -37,7 +37,6 @@
#include "domain/UBGraphicsScene.h"
#include "domain/UBGraphicsSvgItem.h"
#include "domain/UBGraphicsPixmapItem.h"
#include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsWidgetItem.h"
#include "gui/UBFeaturesWidget.h"

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -317,8 +317,6 @@ int UBApplication::exec(const QString& pFileToImport)
webController = new UBWebController(mainWindow);
documentController = new UBDocumentController(mainWindow);
boardController->paletteManager()->connectToDocumentController();
UBDrawingController::drawingController()->setStylusTool((int)UBStylusTool::Pen);
applicationController = new UBApplicationController(boardController->controlView(),
@ -349,7 +347,6 @@ int UBApplication::exec(const QString& pFileToImport)
connect(mainWindow->actionPreferences, SIGNAL(triggered()), mPreferencesController, SLOT(show()));
connect(mainWindow->actionTutorial, SIGNAL(triggered()), applicationController, SLOT(showTutorial()));
connect(mainWindow->actionTutorial, SIGNAL(triggered()), this, SLOT(stopScript()));
connect(mainWindow->actionSankoreEditor, SIGNAL(triggered()), applicationController, SLOT(showSankoreEditor()));
connect(mainWindow->actionCheckUpdate, SIGNAL(triggered()), applicationController, SLOT(checkUpdateRequest()));
@ -543,7 +540,6 @@ void UBApplication::decorateActionMenu(QAction* action)
menu->addSeparator();
menu->addAction(mainWindow->actionTutorial);
menu->addAction(mainWindow->actionSankoreEditor);
#ifndef Q_WS_X11 // No Podcast on Linux yet
menu->addAction(mainWindow->actionPodcast);
@ -651,12 +647,10 @@ void UBApplication::cleanup()
if (webController) delete webController;
if (documentController) delete documentController;
applicationController = NULL;
boardController = NULL;
webController = NULL;
documentController = NULL;
}
void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -513,42 +513,14 @@ void UBApplicationController::showTutorial()
}
void UBApplicationController::showSankoreEditor()
{
if (UBApplication::boardController)
{
UBApplication::boardController->persistCurrentScene();
UBApplication::boardController->hide();
}
// it's needed not to duplicate webbrowser search in web mode. If I've breaked smbd's code let Ivan know
UBApplication::webController->show(UBWebController::Paraschool);
mMainWindow->webToolBar->hide();
mMainWindow->boardToolBar->hide();
mMainWindow->documentToolBar->hide();
mMainWindow->tutorialToolBar->show();
mMainMode = ParaschoolEditor;
adaptToolBar();
mUninoteController->hideWindow();
mirroringEnabled(false);
emit mainModeChanged(mMainMode);
}
void UBApplicationController::checkUpdate()
{
if(mHttp)
delete mHttp;
QUrl url("http://ftp.open-sankore.org/update.json");
mHttp = new QHttp(url.host());
connect(mHttp, SIGNAL(requestFinished(int,bool)), this, SLOT(updateRequestFinished(int,bool)));
mHttp->get(url.path());
// if(mHttp)
// delete mHttp;
// QUrl url("http://ftp.open-sankore.org/update.json");
// mHttp = new QHttp(url.host());
// connect(mHttp, SIGNAL(requestFinished(int,bool)), this, SLOT(updateRequestFinished(int,bool)));
// mHttp->get(url.path());
}
void UBApplicationController::updateRequestFinished(int id, bool error)
@ -622,10 +594,6 @@ void UBApplicationController::hideDesktop()
{
showTutorial();
}
else if (mMainMode == ParaschoolEditor)
{
showSankoreEditor();
}
mIsShowingDesktop = false;

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -92,7 +92,7 @@ class UBApplicationController : public QObject
enum MainMode
{
Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument
Board = 0, Internet, Document, Tutorial, WebDocument
};
MainMode displayMode()
@ -137,7 +137,6 @@ class UBApplicationController : public QObject
void actionPaste();
void showTutorial();
void showSankoreEditor();
void checkUpdateRequest();
void checkUpdateAtLaunch();

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*
@ -19,6 +19,7 @@
* along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
*/
#include "UBDisplayManager.h"
#include "frameworks/UBPlatformUtils.h"

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Webdoc SA
* Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA)
*
* This file is part of Open-Sankoré.
*

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save