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. 4
      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. 323
      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. 1086
      src/board/UBBoardView.cpp
  77. 203
      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. 36
      src/core/UB.h
  83. 8
      src/core/UBApplication.cpp
  84. 2
      src/core/UBApplication.h
  85. 52
      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 it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License, the Free Software Foundation, version 3 of the License,
with a specific linking exception for the OpenSSL project's with a specific linking exception for the OpenSSL project's

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

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

@ -19,6 +19,15 @@
# functions # 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() initializeVariables()
{ {
MAKE_TAG=true MAKE_TAG=true
@ -120,6 +129,7 @@ buildWithStandardQt(){
#********************** #**********************
# script # script
#********************** #**********************
checkUser
initializeVariables initializeVariables
buildWithStandardQt buildWithStandardQt
@ -375,12 +385,13 @@ chmod 755 "$BASE_WORKING_DIR/DEBIAN/postint"
mkdir -p "install/linux" mkdir -p "install/linux"
DEBIAN_PACKAGE_NAME="Open-Sankore_${VERSION}_$ARCHITECTURE.deb" 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" dpkg -b "$BASE_WORKING_DIR" "install/linux/$DEBIAN_PACKAGE_NAME"
notifyProgress "Open-Sankore" "Package built"
#clean up mess #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 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" notifyProgress "Open-Sankore" "Build Diena zip file for distribution"
fi 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é. * 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é. * This file is part of Open-Sankoré.
* *
@ -100,7 +100,7 @@ private:
bool parseUBZPolygon(const QDomElement &element, QMultiMap<int, QDomElement> &dstSvgList); bool parseUBZPolygon(const QDomElement &element, QMultiMap<int, QDomElement> &dstSvgList);
bool parseUBZPolyline(const QDomElement &element, QMultiMap<int, QDomElement> &dstSvgList); bool parseUBZPolyline(const QDomElement &element, QMultiMap<int, QDomElement> &dstSvgList);
bool parseUBZLine(const QDomElement &element, QMultiMap<int, QDomElement> &dstSvgList); bool parseUBZLine(const QDomElement &element, QMultiMap<int, QDomElement> &dstSvgList);
void addSVGElementToResultModel(const QDomElement &element, QMultiMap<int, QDomElement> &dstList, int layer = DEFAULT_LAYER); void addSVGElementToResultModel(const QDomElement &element, QMultiMap<int, QDomElement> &dstList, int layer = DEFAULT_LAYER);
void addIWBElementToResultModel(const QDomElement &element); void addIWBElementToResultModel(const QDomElement &element);

@ -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é. * 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é. * 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é. * 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> <string>Check Update</string>
</property> </property>
</action> </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"> <action name="actionHideApplication">
<property name="icon"> <property name="icon">
<iconset resource="../sankore.qrc"> <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/toolbar/updates.png</file>
<file>images/paletteLibrary.png</file> <file>images/paletteLibrary.png</file>
<file>images/paletteNavigator.png</file> <file>images/paletteNavigator.png</file>
<file>images/toolbar/paraschool.png</file>
<file>images/toolbar/display.png</file> <file>images/toolbar/display.png</file>
<file>images/toolbar/hide.png</file> <file>images/toolbar/hide.png</file>
<file>images/toolbar/record.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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * This file is part of Open-Sankoré.
* *
@ -97,12 +97,12 @@ QMap<QString,IDataStorage*> UBSvgSubsetAdaptor::additionalElementToStore;
QString UBSvgSubsetAdaptor::toSvgTransform(const QMatrix& matrix) QString UBSvgSubsetAdaptor::toSvgTransform(const QMatrix& matrix)
{ {
return QString("matrix(%1, %2, %3, %4, %5, %6)") return QString("matrix(%1, %2, %3, %4, %5, %6)")
.arg(matrix.m11(), 0 , 'g') .arg(matrix.m11(), 0 , 'g')
.arg(matrix.m12(), 0 , 'g') .arg(matrix.m12(), 0 , 'g')
.arg(matrix.m21(), 0 , 'g') .arg(matrix.m21(), 0 , 'g')
.arg(matrix.m22(), 0 , 'g') .arg(matrix.m22(), 0 , 'g')
.arg(matrix.dx(), 0 , 'g') .arg(matrix.dx(), 0 , 'g')
.arg(matrix.dy(), 0 , 'g'); .arg(matrix.dy(), 0 , 'g');
} }
@ -117,12 +117,12 @@ QMatrix UBSvgSubsetAdaptor::fromSvgTransform(const QString& transform)
if (sl.size() >= 6) if (sl.size() >= 6)
{ {
matrix.setMatrix( matrix.setMatrix(
sl.at(0).toFloat(), sl.at(0).toFloat(),
sl.at(1).toFloat(), sl.at(1).toFloat(),
sl.at(2).toFloat(), sl.at(2).toFloat(),
sl.at(3).toFloat(), sl.at(3).toFloat(),
sl.at(4).toFloat(), sl.at(4).toFloat(),
sl.at(5).toFloat()); sl.at(5).toFloat());
} }
return matrix; return matrix;
@ -340,7 +340,7 @@ QString UBSvgSubsetAdaptor::readTeacherGuideNode(int sceneIndex)
mXmlReader.readNext(); mXmlReader.readNext();
if (mXmlReader.isStartElement()) if (mXmlReader.isStartElement())
{ {
if (mXmlReader.name() == "teacherBar" || mXmlReader.name() == "teacherGuide"){ if (mXmlReader.name() == "teacherBar" || mXmlReader.name() == "teacherGuide"){
result.clear(); result.clear();
result += "<teacherGuide version=\"" + mXmlReader.attributes().value("version").toString() + "\">"; result += "<teacherGuide version=\"" + mXmlReader.attributes().value("version").toString() + "\">";
result += "\n"; result += "\n";
@ -372,10 +372,10 @@ QString UBSvgSubsetAdaptor::readTeacherGuideNode(int sceneIndex)
UBSvgSubsetAdaptor::UBSvgSubsetReader::UBSvgSubsetReader(UBDocumentProxy* pProxy, const QByteArray& pXmlData) UBSvgSubsetAdaptor::UBSvgSubsetReader::UBSvgSubsetReader(UBDocumentProxy* pProxy, const QByteArray& pXmlData)
: mXmlReader(pXmlData) : mXmlReader(pXmlData)
, mProxy(pProxy) , mProxy(pProxy)
, mDocumentPath(pProxy->persistencePath()) , mDocumentPath(pProxy->persistencePath())
, mGroupHasInfo(false) , mGroupHasInfo(false)
{ {
// NOOP // NOOP
} }
@ -399,10 +399,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mXmlReader.readNext(); mXmlReader.readNext();
if (mXmlReader.isStartElement()) if (mXmlReader.isStartElement())
{ {
qreal zFromSvg = getZValueFromSvg();
QUuid uuidFromSvg = getUuidFromSvg();
if (mXmlReader.name() == "svg") if (mXmlReader.name() == "svg")
{ {
if (!mScene) if (!mScene)
@ -443,9 +439,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
QStringRef svgSceneUuid = mXmlReader.attributes().value(mNamespaceUri, "uuid"); QStringRef svgSceneUuid = mXmlReader.attributes().value(mNamespaceUri, "uuid");
if (!svgSceneUuid.isNull()) if (!svgSceneUuid.isNull())
{
mScene->setUuid(QUuid(svgSceneUuid.toString())); mScene->setUuid(QUuid(svgSceneUuid.toString()));
}
// introduced in UB 4.0 // introduced in UB 4.0
@ -475,9 +469,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
QStringRef pageDpi = mXmlReader.attributes().value("pageDpi"); QStringRef pageDpi = mXmlReader.attributes().value("pageDpi");
if (!pageDpi.isNull()) if (!pageDpi.isNull())
{
UBSettings::settings()->pageDpi->set(pageDpi.toString()); UBSettings::settings()->pageDpi->set(pageDpi.toString());
}
bool darkBackground = false; bool darkBackground = false;
bool crossedBackground = false; bool crossedBackground = false;
@ -560,9 +552,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
if (polygonItem) if (polygonItem)
{ {
polygonItem->setUuid(uuidFromSvg);
polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic)); polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic));
UBGraphicsStrokesGroup* group; UBGraphicsStrokesGroup* group;
@ -570,24 +559,26 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
group = new UBGraphicsStrokesGroup(); group = new UBGraphicsStrokesGroup();
mStrokesList.insert(parentId,group); mStrokesList.insert(parentId,group);
currentStroke = new UBGraphicsStroke(); currentStroke = new UBGraphicsStroke();
group->setTransform(polygonItem->transform());
UBGraphicsItem::assignZValue(group, polygonItem->zValue());
} }
else else
group = mStrokesList.value(parentId); group = mStrokesList.value(parentId);
polygonItem->setTransform(group->transform()); if(polygonItem->transform().isIdentity())
polygonItem->setTransform(group->transform());
group->addToGroup(polygonItem); group->addToGroup(polygonItem);
polygonItem->setStrokesGroup(group); polygonItem->setStrokesGroup(group);
polygonItem->setStroke(currentStroke); polygonItem->setStroke(currentStroke);
polygonItem->show(); polygonItem->show();
group->addToGroup(polygonItem); group->addToGroup(polygonItem);
} }
} }
else if (mXmlReader.name() == "polyline") else if (mXmlReader.name() == "polyline")
{ {
QList<UBGraphicsPolygonItem*> polygonItems QList<UBGraphicsPolygonItem*> polygonItems = polygonItemsFromPolylineSvg(mScene->isDarkBackground() ? Qt::white : Qt::black);
= polygonItemsFromPolylineSvg(mScene->isDarkBackground() ? Qt::white : Qt::black);
QString parentId = QUuid::createUuid().toString(); QString parentId = QUuid::createUuid().toString();
@ -600,11 +591,15 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
group = new UBGraphicsStrokesGroup(); group = new UBGraphicsStrokesGroup();
mStrokesList.insert(parentId,group); mStrokesList.insert(parentId,group);
currentStroke = new UBGraphicsStroke(); currentStroke = new UBGraphicsStroke();
group->setTransform(polygonItem->transform());
UBGraphicsItem::assignZValue(group, polygonItem->zValue());
} }
else else
group = mStrokesList.value(parentId); group = mStrokesList.value(parentId);
polygonItem->setTransform(group->transform()); if(polygonItem->transform().isIdentity())
polygonItem->setTransform(group->transform());
group->addToGroup(polygonItem); group->addToGroup(polygonItem);
polygonItem->setStrokesGroup(group); polygonItem->setStrokesGroup(group);
polygonItem->setStroke(currentStroke); polygonItem->setStroke(currentStroke);
@ -612,6 +607,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
polygonItem->show(); polygonItem->show();
group->addToGroup(polygonItem); group->addToGroup(polygonItem);
} }
} }
else if (mXmlReader.name() == "image") else if (mXmlReader.name() == "image")
{ {
@ -636,12 +632,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(pixmapItem); mScene->addItem(pixmapItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(pixmapItem, zFromSvg);
if (!uuidFromSvg.isNull())
pixmapItem->setUuid(uuidFromSvg);
if (isBackground) if (isBackground)
mScene->setAsBackgroundObject(pixmapItem); mScene->setAsBackgroundObject(pixmapItem);
@ -651,7 +641,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (href.contains("svg")) else if (href.contains("svg"))
{ {
UBGraphicsSvgItem* svgItem = svgItemFromSvg(); UBGraphicsSvgItem* svgItem = svgItemFromSvg();
if (svgItem) if (svgItem)
{ {
svgItem->setFlag(QGraphicsItem::ItemIsMovable, true); svgItem->setFlag(QGraphicsItem::ItemIsMovable, true);
@ -659,9 +648,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(svgItem); mScene->addItem(svgItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(svgItem, zFromSvg);
if (isBackground) if (isBackground)
mScene->setAsBackgroundObject(svgItem); mScene->setAsBackgroundObject(svgItem);
@ -677,7 +663,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (mXmlReader.name() == "audio") else if (mXmlReader.name() == "audio")
{ {
UBGraphicsMediaItem* audioItem = audioItemFromSvg(); UBGraphicsMediaItem* audioItem = audioItemFromSvg();
if (audioItem) if (audioItem)
{ {
audioItem->setFlag(QGraphicsItem::ItemIsMovable, true); audioItem->setFlag(QGraphicsItem::ItemIsMovable, true);
@ -685,12 +670,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(audioItem); mScene->addItem(audioItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(audioItem, zFromSvg);
if (!uuidFromSvg.isNull())
audioItem->setUuid(uuidFromSvg);
audioItem->show(); audioItem->show();
//force start to load the video and display the first frame //force start to load the video and display the first frame
@ -701,20 +680,14 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (mXmlReader.name() == "video") else if (mXmlReader.name() == "video")
{ {
UBGraphicsMediaItem* videoItem = videoItemFromSvg(); UBGraphicsMediaItem* videoItem = videoItemFromSvg();
if (videoItem) if (videoItem)
{ {
videoItem->setFlag(QGraphicsItem::ItemIsMovable, true); videoItem->setFlag(QGraphicsItem::ItemIsMovable, true);
videoItem->setFlag(QGraphicsItem::ItemIsSelectable, true); videoItem->setFlag(QGraphicsItem::ItemIsSelectable, true);
mScene->addItem(videoItem); mScene->addItem(videoItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(videoItem, zFromSvg);
if (!uuidFromSvg.isNull())
videoItem->setUuid(uuidFromSvg);
videoItem->show(); videoItem->show();
//force start to load the video and display the first frame //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 else if (mXmlReader.name() == "text")//This is for backward compatibility with proto text field prior to version 4.3
{ {
UBGraphicsTextItem* textItem = textItemFromSvg(); UBGraphicsTextItem* textItem = textItemFromSvg();
if (textItem) if (textItem)
{ {
textItem->setFlag(QGraphicsItem::ItemIsMovable, true); textItem->setFlag(QGraphicsItem::ItemIsMovable, true);
@ -733,85 +705,54 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(textItem); mScene->addItem(textItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(textItem, zFromSvg);
if (!uuidFromSvg.isNull())
textItem->setUuid(uuidFromSvg);
textItem->show(); textItem->show();
} }
} }
else if (mXmlReader.name() == "curtain") else if (mXmlReader.name() == "curtain")
{ {
UBGraphicsCurtainItem* mask = curtainItemFromSvg(); UBGraphicsCurtainItem* mask = curtainItemFromSvg();
if (mask) if (mask)
{ {
mScene->addItem(mask); mScene->addItem(mask);
mScene->registerTool(mask); mScene->registerTool(mask);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(mask, zFromSvg);
if (!uuidFromSvg.isNull())
mask->setUuid(uuidFromSvg);
} }
} }
else if (mXmlReader.name() == "ruler") else if (mXmlReader.name() == "ruler")
{ {
QString ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value").toString();
UBGraphicsRuler *ruler = rulerFromSvg(); UBGraphicsRuler *ruler = rulerFromSvg();
ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value").toString();
if (ruler) if (ruler)
{ {
mScene->addItem(ruler); mScene->addItem(ruler);
mScene->registerTool(ruler); mScene->registerTool(ruler);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(ruler, zFromSvg);
} }
} }
else if (mXmlReader.name() == "compass") else if (mXmlReader.name() == "compass")
{ {
UBGraphicsCompass *compass = compassFromSvg(); UBGraphicsCompass *compass = compassFromSvg();
if (compass) if (compass)
{ {
mScene->addItem(compass); mScene->addItem(compass);
mScene->registerTool(compass); mScene->registerTool(compass);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(compass, zFromSvg);
} }
} }
else if (mXmlReader.name() == "protractor") else if (mXmlReader.name() == "protractor")
{ {
UBGraphicsProtractor *protractor = protractorFromSvg(); UBGraphicsProtractor *protractor = protractorFromSvg();
if (protractor) if (protractor)
{ {
mScene->addItem(protractor); mScene->addItem(protractor);
mScene->registerTool(protractor); mScene->registerTool(protractor);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(protractor, zFromSvg);
} }
} }
else if (mXmlReader.name() == "triangle") else if (mXmlReader.name() == "triangle")
{ {
UBGraphicsTriangle *triangle = triangleFromSvg(); UBGraphicsTriangle *triangle = triangleFromSvg();
if (triangle) if (triangle)
{ {
mScene->addItem(triangle); mScene->addItem(triangle);
mScene->registerTool(triangle); mScene->registerTool(triangle);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(triangle, zFromSvg);
} }
} }
else if (mXmlReader.name() == "cache") else if (mXmlReader.name() == "cache")
@ -822,9 +763,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(cache); mScene->addItem(cache);
mScene->registerTool(cache); mScene->registerTool(cache);
UBApplication::boardController->notifyCache(true); UBApplication::boardController->notifyCache(true);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(cache, zFromSvg);
} }
} }
else if (mXmlReader.name() == "foreignObject") else if (mXmlReader.name() == "foreignObject")
@ -851,9 +789,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(pdfItem); mScene->addItem(pdfItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(pdfItem, zFromSvg);
if (isBackground) if (isBackground)
mScene->setAsBackgroundObject(pdfItem); mScene->setAsBackgroundObject(pdfItem);
@ -873,12 +808,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(appleWidgetItem); mScene->addItem(appleWidgetItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(appleWidgetItem, zFromSvg);
if (!uuidFromSvg.isNull())
appleWidgetItem->setUuid(uuidFromSvg);
appleWidgetItem->show(); appleWidgetItem->show();
currentWidget = appleWidgetItem; currentWidget = appleWidgetItem;
@ -887,7 +816,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (src.contains(".wgt")) else if (src.contains(".wgt"))
{ {
UBGraphicsW3CWidgetItem* w3cWidgetItem = graphicsW3CWidgetFromSvg(); UBGraphicsW3CWidgetItem* w3cWidgetItem = graphicsW3CWidgetFromSvg();
if (w3cWidgetItem) if (w3cWidgetItem)
{ {
w3cWidgetItem->setFlag(QGraphicsItem::ItemIsSelectable, true); w3cWidgetItem->setFlag(QGraphicsItem::ItemIsSelectable, true);
@ -896,12 +824,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(w3cWidgetItem); mScene->addItem(w3cWidgetItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(w3cWidgetItem, zFromSvg);
if (!uuidFromSvg.isNull())
w3cWidgetItem->setUuid(uuidFromSvg);
w3cWidgetItem->show(); w3cWidgetItem->show();
currentWidget = w3cWidgetItem; currentWidget = w3cWidgetItem;
@ -910,7 +832,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else if (type == "text") else if (type == "text")
{ {
UBGraphicsTextItem* textItem = textItemFromSvg(); UBGraphicsTextItem* textItem = textItemFromSvg();
UBGraphicsTextItemDelegate *textDelegate = 0; UBGraphicsTextItemDelegate *textDelegate = 0;
if (textItem) if (textItem)
@ -931,12 +852,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(textItem); mScene->addItem(textItem);
if (zFromSvg != UBZLayerController::errorNum())
UBGraphicsItem::assignZValue(textItem, zFromSvg);
if (!uuidFromSvg.isNull())
textItem->setUuid(uuidFromSvg);
textItem->show(); textItem->show();
} }
} }
@ -991,9 +906,8 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mScene->addItem(iterator.value()); mScene->addItem(iterator.value());
} }
if (mScene) { if (mScene)
mScene->setModified(false); mScene->setModified(false);
}
mScene->enableUndoRedoStack(); mScene->enableUndoRedoStack();
qDebug() << "loadScene() : created scene and read file"; qDebug() << "loadScene() : created scene and read file";
@ -1108,9 +1022,9 @@ void UBSvgSubsetAdaptor::persistScene(UBDocumentProxy* proxy, UBGraphicsScene* p
UBSvgSubsetAdaptor::UBSvgSubsetWriter::UBSvgSubsetWriter(UBDocumentProxy* proxy, UBGraphicsScene* pScene, const int pageIndex) UBSvgSubsetAdaptor::UBSvgSubsetWriter::UBSvgSubsetWriter(UBDocumentProxy* proxy, UBGraphicsScene* pScene, const int pageIndex)
: mScene(pScene) : mScene(pScene)
, mDocumentPath(proxy->persistencePath()) , mDocumentPath(proxy->persistencePath())
, mPageIndex(pageIndex) , mPageIndex(pageIndex)
{ {
// NOOP // NOOP
@ -1213,24 +1127,25 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
foreach(QGraphicsItem* item, strokesGroupItem->childItems()) { foreach(QGraphicsItem* item, strokesGroupItem->childItems()) {
UBGraphicsPolygonItem* poly = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item); UBGraphicsPolygonItem* poly = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item);
if (!poly) { if (!poly)
continue; continue;
} else if (!resultPoly) { if (!resultPoly) {
resultPoly = poly; resultPoly = poly;
continue; continue;
} }
QPolygonF newPolygon = poly->sceneTransform().map(poly->polygon());
QPainterPath strokePainterPath; QPolygonF unitedPolygon = resultPoly->polygon().united(poly->polygon());
strokePainterPath.addPolygon(resultPoly->sceneTransform().map(resultPoly->polygon())); resultPoly->setPolygon(unitedPolygon);
QPolygonF oldPolygons = strokePainterPath.simplified().toFillPolygon(resultPoly->sceneTransform().inverted());
newPolygon = oldPolygons.united(newPolygon);
resultPoly->setPolygon(newPolygon);
//
items.removeOne(poly); items.removeOne(poly);
} }
if (resultPoly) { 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); items.removeOne(resultPoly);
} }
} }
@ -1239,9 +1154,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*> (item); UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*> (item);
if (polygonItem && polygonItem->isVisible()) if (polygonItem && polygonItem->isVisible())
{ {
UBGraphicsStroke* currentStroke = polygonItem->stroke(); UBGraphicsStroke* currentStroke = polygonItem->stroke();
if (openStroke && (currentStroke != openStroke)) if (openStroke && (currentStroke != openStroke))
{ {
mXmlWriter.writeEndElement(); //g mXmlWriter.writeEndElement(); //g
@ -1514,15 +1427,14 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistGroupToDom(QGraphicsItem *gro
foreach (QGraphicsItem *item, groupItem->childItems()) { foreach (QGraphicsItem *item, groupItem->childItems()) {
QUuid tmpUuid = UBGraphicsScene::getPersonalUuid(item); QUuid tmpUuid = UBGraphicsScene::getPersonalUuid(item);
if (!tmpUuid.isNull()) { if (!tmpUuid.isNull()) {
if (item->type() == UBGraphicsGroupContainerItem::Type && item->childItems().count()) { if (item->type() == UBGraphicsGroupContainerItem::Type && item->childItems().count())
persistGroupToDom(item, curParent, groupDomDocument); persistGroupToDom(item, curParent, groupDomDocument);
} }
else { else {
QDomElement curSubElement = groupDomDocument->createElement(tElement); QDomElement curSubElement = groupDomDocument->createElement(tElement);
curSubElement.setAttribute(aId, tmpUuid); curSubElement.setAttribute(aId, tmpUuid);
curGroupElement.appendChild(curSubElement); curGroupElement.appendChild(curSubElement);
}
} }
} }
} }
@ -1694,26 +1606,15 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
{ {
UBGraphicsPolygonItem* polygonItem = new UBGraphicsPolygonItem(); UBGraphicsPolygonItem* polygonItem = new UBGraphicsPolygonItem();
graphicsItemFromSvg(polygonItem);
QStringRef svgPoints = mXmlReader.attributes().value("points"); QStringRef svgPoints = mXmlReader.attributes().value("points");
QPolygonF polygon; QPolygonF polygon;
if (!svgPoints.isNull()) if (!svgPoints.isNull())
{ {
// int lenght = strlen(svgPoints.toUtf8().constData()) + 1; QStringList ts = svgPoints.toString().split(QLatin1Char(' '), QString::SkipEmptyParts);
// 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);
foreach(const QString sPoint, ts) foreach(const QString sPoint, ts)
{ {
@ -1748,26 +1649,13 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
polygonItem->setPolygon(polygon); 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"); QStringRef svgFill = mXmlReader.attributes().value("fill");
QColor brushColor = pDefaultColor; QColor brushColor = pDefaultColor;
if (!svgFill.isNull()) if (!svgFill.isNull())
{
brushColor.setNamedColor(svgFill.toString()); brushColor.setNamedColor(svgFill.toString());
}
QStringRef svgFillOpacity = mXmlReader.attributes().value("fill-opacity"); QStringRef svgFillOpacity = mXmlReader.attributes().value("fill-opacity");
qreal opacity = 1.0; qreal opacity = 1.0;
@ -1779,17 +1667,6 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
polygonItem->setColor(brushColor); 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"); QStringRef ubFillOnDarkBackground = mXmlReader.attributes().value(mNamespaceUri, "fill-on-dark-background");
if (!ubFillOnDarkBackground.isNull()) if (!ubFillOnDarkBackground.isNull())
@ -1864,6 +1741,7 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromLin
} }
UBGraphicsPolygonItem* polygonItem = new UBGraphicsPolygonItem(line, lineWidth); UBGraphicsPolygonItem* polygonItem = new UBGraphicsPolygonItem(line, lineWidth);
graphicsItemFromSvg(polygonItem);
QStringRef svgStroke = mXmlReader.attributes().value("stroke"); QStringRef svgStroke = mXmlReader.attributes().value("stroke");
@ -1886,18 +1764,6 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromLin
polygonItem->setColor(brushColor); 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"); QStringRef ubFillOnDarkBackground = mXmlReader.attributes().value(mNamespaceUri, "fill-on-dark-background");
if (!ubFillOnDarkBackground.isNull()) if (!ubFillOnDarkBackground.isNull())
@ -2008,7 +1874,7 @@ QList<UBGraphicsPolygonItem*> UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItem
if (!svgPoints.isNull()) if (!svgPoints.isNull())
{ {
QStringList ts = svgPoints.toString().split(QLatin1Char(' '), QStringList ts = svgPoints.toString().split(QLatin1Char(' '),
QString::SkipEmptyParts); QString::SkipEmptyParts);
QList<QPointF> points; QList<QPointF> points;
@ -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 //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. //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"); int indexOfAudioDirectory = href.lastIndexOf("audios");
href = mDocumentPath + "/" + href.right(href.length() - indexOfAudioDirectory); href = mDocumentPath + "/" + href.right(href.length() - indexOfAudioDirectory);
} }
UBGraphicsMediaItem* audioItem = new UBGraphicsMediaItem(QUrl::fromLocalFile(href)); UBGraphicsMediaItem* audioItem = new UBGraphicsMediaItem(QUrl::fromLocalFile(href));
if(audioItem){ if(audioItem)
audioItem->connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), audioItem, SLOT(activeSceneChanged())); audioItem->connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), audioItem, SLOT(activeSceneChanged()));
}
graphicsItemFromSvg(audioItem); graphicsItemFromSvg(audioItem);
QStringRef ubPos = mXmlReader.attributes().value(mNamespaceUri, "position"); QStringRef ubPos = mXmlReader.attributes().value(mNamespaceUri, "position");
qint64 p = 0; qint64 p = 0;
if (!ubPos.isNull()) if (!ubPos.isNull())
{
p = ubPos.toString().toLongLong(); p = ubPos.toString().toLongLong();
}
audioItem->setInitialPos(p); audioItem->setInitialPos(p);
return audioItem; 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 //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. //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"); int indexOfAudioDirectory = href.lastIndexOf("videos");
href = mDocumentPath + "/" + href.right(href.length() - indexOfAudioDirectory); href = mDocumentPath + "/" + href.right(href.length() - indexOfAudioDirectory);
} }
@ -2380,9 +2243,9 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
{ {
if (!svgX.isNull() && !svgY.isNull()) if (!svgX.isNull() && !svgY.isNull())
{ {
#ifdef Q_WS_WIN #ifdef Q_WS_WIN
gItem->setPos(svgX.toString().toFloat(), svgY.toString().toFloat()); 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"); QStringRef ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value");
if (!ubZValue.isNull()) if (!ubZValue.isNull())
{
UBGraphicsItem::assignZValue(gItem, ubZValue.toString().toFloat()); UBGraphicsItem::assignZValue(gItem, ubZValue.toString().toFloat());
}
UBItem* ubItem = dynamic_cast<UBItem*>(gItem); UBItem* ubItem = dynamic_cast<UBItem*>(gItem);
@ -2413,16 +2274,14 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
QStringRef ubUuid = mXmlReader.attributes().value(mNamespaceUri, "uuid"); QStringRef ubUuid = mXmlReader.attributes().value(mNamespaceUri, "uuid");
if (!ubUuid.isNull()) if (!ubUuid.isNull())
{
ubItem->setUuid(QUuid(ubUuid.toString())); ubItem->setUuid(QUuid(ubUuid.toString()));
} else
ubItem->setUuid(QUuid::createUuid());
QStringRef ubSource = mXmlReader.attributes().value(mNamespaceUri, "source"); QStringRef ubSource = mXmlReader.attributes().value(mNamespaceUri, "source");
if (!ubSource.isNull()) if (!ubSource.isNull())
{
ubItem->setSourceUrl(QUrl(ubSource.toString())); ubItem->setSourceUrl(QUrl(ubSource.toString()));
}
} }
QStringRef ubLocked = mXmlReader.attributes().value(mNamespaceUri, "locked"); QStringRef ubLocked = mXmlReader.attributes().value(mNamespaceUri, "locked");
@ -2449,35 +2308,10 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
int layerAsInt = ubLayer.toString().toInt(&ok); int layerAsInt = ubLayer.toString().toInt(&ok);
if (ok) if (ok)
{
gItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(layerAsInt)); 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) void UBSvgSubsetAdaptor::UBSvgSubsetWriter::graphicsItemToSvg(QGraphicsItem* item)
{ {
mXmlWriter.writeAttribute("x", "0"); mXmlWriter.writeAttribute("x", "0");
@ -2759,7 +2593,7 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg()
color.setNamedColor(ubFillOnLightBackground.toString()); color.setNamedColor(ubFillOnLightBackground.toString());
if (!color.isValid()) if (!color.isValid())
color = Qt::black; color = Qt::black;
textItem->setColorOnLightBackground(color); textItem->setColorOnLightBackground(color);
} }
QString text; QString text;
@ -2769,6 +2603,7 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg()
if (mXmlReader.hasError()) if (mXmlReader.hasError())
{ {
delete textItem; delete textItem;
textItem = 0;
return 0; return 0;
} }
@ -2788,7 +2623,7 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg()
return textItem; return textItem;
} }
//tracking for backward capability with older versions //tracking for backward capability with older versions
} else if (mXmlReader.name() == "font") { } else if (mXmlReader.name() == "font") {
QFont font = textItem->font(); QFont font = textItem->font();
@ -2803,18 +2638,18 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg()
styleToken = styleToken.trimmed(); styleToken = styleToken.trimmed();
if (styleToken.startsWith(sFontSizePrefix) && styleToken.endsWith(sPixelUnit)) { if (styleToken.startsWith(sFontSizePrefix) && styleToken.endsWith(sPixelUnit)) {
int fontSize = styleToken.mid( int fontSize = styleToken.mid(
sFontSizePrefix.length(), sFontSizePrefix.length(),
styleToken.length() - sFontSizePrefix.length() - sPixelUnit.length()).toInt(); styleToken.length() - sFontSizePrefix.length() - sPixelUnit.length()).toInt();
font.setPixelSize(fontSize); font.setPixelSize(fontSize);
} else if (styleToken.startsWith(sFontWeightPrefix)) { } else if (styleToken.startsWith(sFontWeightPrefix)) {
QString fontWeight = styleToken.mid( QString fontWeight = styleToken.mid(
sFontWeightPrefix.length(), sFontWeightPrefix.length(),
styleToken.length() - sFontWeightPrefix.length()); styleToken.length() - sFontWeightPrefix.length());
font.setBold(fontWeight.contains("bold")); font.setBold(fontWeight.contains("bold"));
} else if (styleToken.startsWith(sFontStylePrefix)) { } else if (styleToken.startsWith(sFontStylePrefix)) {
QString fontStyle = styleToken.mid( QString fontStyle = styleToken.mid(
sFontStylePrefix.length(), sFontStylePrefix.length(),
styleToken.length() - sFontStylePrefix.length()); styleToken.length() - sFontStylePrefix.length());
font.setItalic(fontStyle.contains("italic")); font.setItalic(fontStyle.contains("italic"));
} }
} }
@ -3168,7 +3003,7 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg()
UBGraphicsTriangle::UBGraphicsTriangleOrientation orientation = UBGraphicsTriangle::orientationFromStr(orientationStringRef); UBGraphicsTriangle::UBGraphicsTriangleOrientation orientation = UBGraphicsTriangle::orientationFromStr(orientationStringRef);
triangle->setOrientation(orientation); triangle->setOrientation(orientation);
if (!svgX.isNull() && !svgY.isNull() && !svgWidth.isNull() && !svgHeight.isNull()) if (!svgX.isNull() && !svgY.isNull() && !svgWidth.isNull() && !svgHeight.isNull())
{ {
triangle->setRect(svgX.toString().toFloat(), svgY.toString().toFloat(), svgWidth.toString().toFloat(), svgHeight.toString().toFloat(), orientation); triangle->setRect(svgX.toString().toFloat(), svgY.toString().toFloat(), svgWidth.toString().toFloat(), svgHeight.toString().toFloat(), orientation);
} }
@ -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é. * This file is part of Open-Sankoré.
* *
@ -158,9 +158,6 @@ class UBSvgSubsetAdaptor
void graphicsItemFromSvg(QGraphicsItem* gItem); void graphicsItemFromSvg(QGraphicsItem* gItem);
qreal getZValueFromSvg();
QUuid getUuidFromSvg();
QXmlStreamReader mXmlReader; QXmlStreamReader mXmlReader;
int mFileVersion; int mFileVersion;
UBDocumentProxy *mProxy; 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * This file is part of Open-Sankoré.
* *
@ -358,9 +358,7 @@ void UBBoardController::setupToolbar()
void UBBoardController::setToolCursor(int tool) void UBBoardController::setToolCursor(int tool)
{ {
if (mActiveScene) if (mActiveScene)
{
mActiveScene->setToolCursor(tool); mActiveScene->setToolCursor(tool);
}
mControlView->setToolCursor(tool); mControlView->setToolCursor(tool);
} }
@ -1893,10 +1891,7 @@ void UBBoardController::updateSystemScaleFactor()
} }
if (mSystemScaleFactor != newScaleFactor) if (mSystemScaleFactor != newScaleFactor)
{
mSystemScaleFactor = newScaleFactor; mSystemScaleFactor = newScaleFactor;
emit systemScaleFactorChanged(newScaleFactor);
}
UBGraphicsScene::SceneViewState viewState = mActiveScene->viewState(); UBGraphicsScene::SceneViewState viewState = mActiveScene->viewState();
@ -1961,13 +1956,8 @@ void UBBoardController::setPageSize(QSize newSize)
void UBBoardController::notifyCache(bool visible) void UBBoardController::notifyCache(bool visible)
{ {
if(visible) if(visible)
{
emit cacheEnabled(); emit cacheEnabled();
}
else
{
emit cacheDisabled();
}
mCacheWidgetIsEnabled = visible; 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é. * This file is part of Open-Sankoré.
* *
@ -149,7 +149,7 @@ class UBBoardController : public UBDocumentContainer
void setBoxing(QRect displayRect); void setBoxing(QRect displayRect);
void setToolbarTexts(); void setToolbarTexts();
static QUrl expandWidgetToTempDir(const QByteArray& pZipedData, const QString& pExtension = QString("wgt")); static QUrl expandWidgetToTempDir(const QByteArray& pZipedData, const QString& pExtension = QString("wgt"));
// static QRect freeRectInGlobalPos() const {return ;}
void setPageSize(QSize newSize); void setPageSize(QSize newSize);
UBBoardPaletteManager *paletteManager() UBBoardPaletteManager *paletteManager()
{ {
@ -239,12 +239,10 @@ class UBBoardController : public UBDocumentContainer
void newPageAdded(); void newPageAdded();
void activeSceneChanged(); void activeSceneChanged();
void zoomChanged(qreal pZoomFactor); void zoomChanged(qreal pZoomFactor);
void systemScaleFactorChanged(qreal pSystemScaleFactor);
void penColorChanged(); void penColorChanged();
void controlViewportChanged(); void controlViewportChanged();
void backgroundChanged(); void backgroundChanged();
void cacheEnabled(); void cacheEnabled();
void cacheDisabled();
void documentReorganized(int index); void documentReorganized(int index);
void displayMetadata(QMap<QString, QString> metadata); void displayMetadata(QMap<QString, QString> metadata);
void pageSelectionChanged(int index); 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é. * This file is part of Open-Sankoré.
* *
@ -175,7 +175,7 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode) void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode)
{ {
// Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument // Board = 0, Internet, Document, Tutorial, WebDocument
switch( mainMode ) switch( mainMode )
{ {
@ -821,8 +821,6 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
if( !isInit ) if( !isInit )
UBApplication::boardController->notifyPageChanged(); UBApplication::boardController->notifyPageChanged();
emit signal_changeMode(newMode);
} }
void UBBoardPaletteManager::addItem(const QPixmap& pPixmap, const QPointF& pos, qreal scaleFactor, const QUrl& sourceUrl) 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() void UBBoardPaletteManager::refreshPalettes()
{ {
mRightPalette->update(); 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é. * This file is part of Open-Sankoré.
* *
@ -64,7 +64,6 @@ class UBBoardPaletteManager : public QObject
UBActionPalette *addItemPalette() {return mAddItemPalette;} UBActionPalette *addItemPalette() {return mAddItemPalette;}
void showVirtualKeyboard(bool show = true); void showVirtualKeyboard(bool show = true);
void initPalettesPosAtStartup(); void initPalettesPosAtStartup();
void connectToDocumentController();
void refreshPalettes(); void refreshPalettes();
UBKeyboardPalette *mKeyboardPalette; UBKeyboardPalette *mKeyboardPalette;
@ -79,10 +78,6 @@ class UBBoardPaletteManager : public QObject
void startDownloads(); void startDownloads();
void stopDownloads(); void stopDownloads();
signals:
void connectToDocController();
void signal_changeMode(eUBDockPaletteWidgetMode newMode);
public slots: public slots:
void activeSceneChanged(); void activeSceneChanged();

File diff suppressed because it is too large Load Diff

@ -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é. * This file is part of Open-Sankoré.
* *
@ -38,150 +38,145 @@ class UBBoardView : public QGraphicsView
{ {
Q_OBJECT Q_OBJECT
public: public:
UBBoardView(UBBoardController* pController, QWidget* pParent = 0, bool isControl = false, bool isDesktop = false); 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); UBBoardView(UBBoardController* pController, int pStartLayer, int pEndLayer, QWidget* pParent = 0, bool isControl = false, bool isDesktop = false);
virtual ~UBBoardView(); virtual ~UBBoardView();
UBGraphicsScene* scene(); UBGraphicsScene* scene();
void forcedTabletRelease(); void forcedTabletRelease();
void setToolCursor(int tool); void setToolCursor(int tool);
void rubberItems(); void rubberItems();
void moveRubberedItems(QPointF movingVector); void moveRubberedItems(QPointF movingVector);
void setMultiselection(bool enable); void setMultiselection(bool enable);
bool isMultipleSelectionEnabled() { return mMultipleSelectionIsEnabled; } 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) #if defined(Q_WS_MACX)
bool directTabletEvent(QEvent *event); bool directTabletEvent(QEvent *event);
QWidget *widgetForTabletEvent(QWidget *w, const QPoint &pos); QWidget *widgetForTabletEvent(QWidget *w, const QPoint &pos);
#endif #endif
signals: signals:
void resized(QResizeEvent* event);
void shown();
void clickOnBoard();
void mouseReleased();
void resized(QResizeEvent* event);
void hidden();
void shown();
void clickOnBoard();
void mouseReleased();
protected: protected:
bool itemIsLocked(QGraphicsItem *item); bool itemIsLocked(QGraphicsItem *item);
bool isUBItem(QGraphicsItem *item); // we should to determine items who is not UB and use general scene behavior for them. bool isUBItem(QGraphicsItem *item); // we should to determine items who is not UB and use general scene behavior for them.
bool isCppTool(QGraphicsItem *item); bool isCppTool(QGraphicsItem *item);
void handleItemsSelection(QGraphicsItem *item); void handleItemsSelection(QGraphicsItem *item);
bool itemShouldReceiveMousePressEvent(QGraphicsItem *item); bool itemShouldReceiveMousePressEvent(QGraphicsItem *item);
bool itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item); bool itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item);
bool itemHaveParentWithType(QGraphicsItem *item, int type); bool itemHaveParentWithType(QGraphicsItem *item, int type);
bool itemShouldBeMoved(QGraphicsItem *item); bool itemShouldBeMoved(QGraphicsItem *item);
QGraphicsItem* determineItemToPress(QGraphicsItem *item); QGraphicsItem* determineItemToPress(QGraphicsItem *item);
QGraphicsItem* determineItemToMove(QGraphicsItem *item); QGraphicsItem* determineItemToMove(QGraphicsItem *item);
void handleItemMousePress(QMouseEvent *event); void handleItemMousePress(QMouseEvent *event);
void handleItemMouseMove(QMouseEvent *event); void handleItemMouseMove(QMouseEvent *event);
virtual bool event (QEvent * e); virtual bool event (QEvent * e);
virtual void keyPressEvent(QKeyEvent *event); virtual void keyPressEvent(QKeyEvent *event);
virtual void keyReleaseEvent(QKeyEvent *event); virtual void keyReleaseEvent(QKeyEvent *event);
virtual void tabletEvent(QTabletEvent * event); virtual void tabletEvent(QTabletEvent * event);
virtual void mouseDoubleClickEvent(QMouseEvent *event); virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event); virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseMoveEvent(QMouseEvent *event); virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event); virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void wheelEvent(QWheelEvent *event); virtual void wheelEvent(QWheelEvent *event);
virtual void leaveEvent ( QEvent * event); virtual void leaveEvent ( QEvent * event);
virtual void focusOutEvent ( QFocusEvent * event ); virtual void focusOutEvent ( QFocusEvent * event );
virtual void drawItems(QPainter *painter, int numItems, virtual void drawItems(QPainter *painter, int numItems,
QGraphicsItem *items[], QGraphicsItem *items[],
const QStyleOptionGraphicsItem options[]); const QStyleOptionGraphicsItem options[]);
// virtual void dragEnterEvent(QDragEnterEvent * event); virtual void dropEvent(QDropEvent *event);
virtual void dropEvent(QDropEvent *event); virtual void dragMoveEvent(QDragMoveEvent *event);
virtual void dragMoveEvent(QDragMoveEvent *event);
virtual void resizeEvent(QResizeEvent * event); virtual void resizeEvent(QResizeEvent * event);
virtual void drawBackground(QPainter *painter, const QRectF &rect); virtual void drawBackground(QPainter *painter, const QRectF &rect);
virtual void showEvent(QShowEvent * event); private:
virtual void hideEvent(QHideEvent * event);
private: void init();
void init(); inline bool shouldDisplayItem(QGraphicsItem *item)
{
bool ok;
int itemLayerType = item->data(UBGraphicsItemData::ItemLayerType).toInt(&ok);
return (ok && (itemLayerType >= mStartLayer && itemLayerType <= mEndLayer));
}
inline bool shouldDisplayItem(QGraphicsItem *item) QList<QUrl> processMimeData(const QMimeData* pMimeData);
{
bool ok;
int itemLayerType = item->data(UBGraphicsItemData::ItemLayerType).toInt(&ok);
return (ok && (itemLayerType >= mStartLayer && itemLayerType <= mEndLayer));
}
QList<QUrl> processMimeData(const QMimeData* pMimeData); UBBoardController* mController;
UBBoardController* mController; int mStartLayer, mEndLayer;
bool mFilterZIndex;
int mStartLayer, mEndLayer; bool mTabletStylusIsPressed;
bool mFilterZIndex; bool mUsingTabletEraser;
bool mTabletStylusIsPressed; bool mPendingStylusReleaseEvent;
bool mUsingTabletEraser;
bool mPendingStylusReleaseEvent; bool mMouseButtonIsPressed;
QPointF mPreviousPoint;
QPoint mMouseDownPos;
bool mMouseButtonIsPressed; bool mPenPressureSensitive;
QPointF mPreviousPoint; bool mMarkerPressureSensitive;
QPoint mMouseDownPos; bool mUseHighResTabletEvent;
bool mPenPressureSensitive; QRubberBand *mRubberBand;
bool mMarkerPressureSensitive; bool mIsCreatingTextZone;
bool mUseHighResTabletEvent; bool mIsCreatingSceneGrabZone;
QRubberBand *mRubberBand; bool isAbsurdPoint(QPoint point);
bool mIsCreatingTextZone;
bool mIsCreatingSceneGrabZone;
bool isAbsurdPoint(QPoint point); bool mVirtualKeyboardActive;
bool mOkOnWidget;
bool mVirtualKeyboardActive; bool mWidgetMoved;
bool mOkOnWidget; QPointF mLastPressedMousePos;
QGraphicsItem *movingItem;
QMouseEvent *suspendedMousePressEvent;
bool mWidgetMoved; bool moveRubberBand;
QPointF mLastPressedMousePos; UBRubberBand *mUBRubberBand;
QGraphicsItem *movingItem;
QMouseEvent *suspendedMousePressEvent;
bool moveRubberBand; QList<QGraphicsItem *> mRubberedItems;
UBRubberBand *mUBRubberBand; QSet<QGraphicsItem*> mJustSelectedItems;
QList<QGraphicsItem *> mRubberedItems; int mLongPressInterval;
QSet<QGraphicsItem*> mJustSelectedItems; QTimer mLongPressTimer;
int mLongPressInterval; bool mIsDragInProgress;
QTimer mLongPressTimer; bool mMultipleSelectionIsEnabled;
bool bIsControl;
bool bIsDesktop;
bool mRubberBandInPlayMode;
bool mIsDragInProgress; static bool hasSelectedParents(QGraphicsItem * item);
bool mMultipleSelectionIsEnabled;
bool bIsControl;
bool bIsDesktop;
bool mRubberBandInPlayMode;
static bool hasSelectedParents(QGraphicsItem * item); private slots:
private slots: void settingChanged(QVariant newValue);
void settingChanged(QVariant newValue); public slots:
public slots: void virtualKeyboardActivated(bool b);
void longPressEvent();
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é. * This file is part of Open-Sankoré.
* *
@ -159,35 +159,23 @@ bool UBDrawingController::isDrawingTool()
int UBDrawingController::currentToolWidthIndex() int UBDrawingController::currentToolWidthIndex()
{ {
if (stylusTool() == UBStylusTool::Pen || stylusTool() == UBStylusTool::Line) if (stylusTool() == UBStylusTool::Pen || stylusTool() == UBStylusTool::Line)
{
return UBSettings::settings()->penWidthIndex(); return UBSettings::settings()->penWidthIndex();
}
else if (stylusTool() == UBStylusTool::Marker) else if (stylusTool() == UBStylusTool::Marker)
{
return UBSettings::settings()->markerWidthIndex(); return UBSettings::settings()->markerWidthIndex();
}
else else
{
return -1; return -1;
}
} }
qreal UBDrawingController::currentToolWidth() qreal UBDrawingController::currentToolWidth()
{ {
if (stylusTool() == UBStylusTool::Pen || stylusTool() == UBStylusTool::Line) if (stylusTool() == UBStylusTool::Pen || stylusTool() == UBStylusTool::Line)
{
return UBSettings::settings()->currentPenWidth(); return UBSettings::settings()->currentPenWidth();
}
else if (stylusTool() == UBStylusTool::Marker) else if (stylusTool() == UBStylusTool::Marker)
{
return UBSettings::settings()->currentMarkerWidth(); return UBSettings::settings()->currentMarkerWidth();
}
else else
{
//failsafe //failsafe
return UBSettings::settings()->currentPenWidth(); 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é. * 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é. * This file is part of Open-Sankoré.
* *
@ -37,7 +37,6 @@
#include "domain/UBGraphicsScene.h" #include "domain/UBGraphicsScene.h"
#include "domain/UBGraphicsSvgItem.h" #include "domain/UBGraphicsSvgItem.h"
#include "domain/UBGraphicsPixmapItem.h" #include "domain/UBGraphicsPixmapItem.h"
#include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsWidgetItem.h" #include "domain/UBGraphicsWidgetItem.h"
#include "gui/UBFeaturesWidget.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é. * 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é. * This file is part of Open-Sankoré.
* *
@ -50,17 +50,17 @@ struct UBStylusTool
{ {
enum Enum enum Enum
{ {
Pen = 0, Pen = 0,
Eraser, Eraser,
Marker, Marker,
Selector, Selector,
Play, Play,
Hand, Hand,
ZoomIn, ZoomIn,
ZoomOut, ZoomOut,
Pointer, Pointer,
Line, Line,
Text, Text,
Capture Capture
}; };
}; };
@ -138,17 +138,17 @@ struct UBGraphicsItemType
{ {
enum Enum enum Enum
{ {
PolygonItemType = QGraphicsItem::UserType + 1, PolygonItemType = QGraphicsItem::UserType + 1,
PixmapItemType, PixmapItemType,
SvgItemType, SvgItemType,
DelegateButtonType, DelegateButtonType,
MediaItemType, MediaItemType,
PDFItemType, PDFItemType,
TextItemType, TextItemType,
CurtainItemType, CurtainItemType,
RulerItemType, RulerItemType,
CompassItemType, CompassItemType,
ProtractorItemType, ProtractorItemType,
StrokeItemType, StrokeItemType,
TriangleItemType, TriangleItemType,
MagnifierItemType, MagnifierItemType,

@ -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é. * This file is part of Open-Sankoré.
* *
@ -317,8 +317,6 @@ int UBApplication::exec(const QString& pFileToImport)
webController = new UBWebController(mainWindow); webController = new UBWebController(mainWindow);
documentController = new UBDocumentController(mainWindow); documentController = new UBDocumentController(mainWindow);
boardController->paletteManager()->connectToDocumentController();
UBDrawingController::drawingController()->setStylusTool((int)UBStylusTool::Pen); UBDrawingController::drawingController()->setStylusTool((int)UBStylusTool::Pen);
applicationController = new UBApplicationController(boardController->controlView(), 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->actionPreferences, SIGNAL(triggered()), mPreferencesController, SLOT(show()));
connect(mainWindow->actionTutorial, SIGNAL(triggered()), applicationController, SLOT(showTutorial())); connect(mainWindow->actionTutorial, SIGNAL(triggered()), applicationController, SLOT(showTutorial()));
connect(mainWindow->actionTutorial, SIGNAL(triggered()), this, SLOT(stopScript())); connect(mainWindow->actionTutorial, SIGNAL(triggered()), this, SLOT(stopScript()));
connect(mainWindow->actionSankoreEditor, SIGNAL(triggered()), applicationController, SLOT(showSankoreEditor()));
connect(mainWindow->actionCheckUpdate, SIGNAL(triggered()), applicationController, SLOT(checkUpdateRequest())); connect(mainWindow->actionCheckUpdate, SIGNAL(triggered()), applicationController, SLOT(checkUpdateRequest()));
@ -543,7 +540,6 @@ void UBApplication::decorateActionMenu(QAction* action)
menu->addSeparator(); menu->addSeparator();
menu->addAction(mainWindow->actionTutorial); menu->addAction(mainWindow->actionTutorial);
menu->addAction(mainWindow->actionSankoreEditor);
#ifndef Q_WS_X11 // No Podcast on Linux yet #ifndef Q_WS_X11 // No Podcast on Linux yet
menu->addAction(mainWindow->actionPodcast); menu->addAction(mainWindow->actionPodcast);
@ -651,12 +647,10 @@ void UBApplication::cleanup()
if (webController) delete webController; if (webController) delete webController;
if (documentController) delete documentController; if (documentController) delete documentController;
applicationController = NULL; applicationController = NULL;
boardController = NULL; boardController = NULL;
webController = NULL; webController = NULL;
documentController = NULL; documentController = NULL;
} }
void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal, 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é. * 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é. * This file is part of Open-Sankoré.
* *
@ -68,9 +68,9 @@
#include "core/memcheck.h" #include "core/memcheck.h"
UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBApplicationController::UBApplicationController(UBBoardView *pControlView,
UBBoardView *pDisplayView, UBBoardView *pDisplayView,
UBMainWindow* pMainWindow, UBMainWindow* pMainWindow,
QObject* parent, QObject* parent,
UBRightPalette* rightPalette) UBRightPalette* rightPalette)
: QObject(parent) : QObject(parent)
@ -371,7 +371,7 @@ void UBApplicationController::showBoard()
UBPlatformUtils::setDesktopMode(false); UBPlatformUtils::setDesktopMode(false);
mUninoteController->hideWindow(); mUninoteController->hideWindow();
mMainWindow->show(); mMainWindow->show();
emit mainModeChanged(Board); emit mainModeChanged(Board);
@ -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() void UBApplicationController::checkUpdate()
{ {
if(mHttp) // if(mHttp)
delete mHttp; // delete mHttp;
QUrl url("http://ftp.open-sankore.org/update.json"); // QUrl url("http://ftp.open-sankore.org/update.json");
mHttp = new QHttp(url.host()); // mHttp = new QHttp(url.host());
connect(mHttp, SIGNAL(requestFinished(int,bool)), this, SLOT(updateRequestFinished(int,bool))); // connect(mHttp, SIGNAL(requestFinished(int,bool)), this, SLOT(updateRequestFinished(int,bool)));
mHttp->get(url.path()); // mHttp->get(url.path());
} }
void UBApplicationController::updateRequestFinished(int id, bool error) void UBApplicationController::updateRequestFinished(int id, bool error)
@ -622,10 +594,6 @@ void UBApplicationController::hideDesktop()
{ {
showTutorial(); showTutorial();
} }
else if (mMainMode == ParaschoolEditor)
{
showSankoreEditor();
}
mIsShowingDesktop = false; 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é. * This file is part of Open-Sankoré.
* *
@ -92,7 +92,7 @@ class UBApplicationController : public QObject
enum MainMode enum MainMode
{ {
Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument Board = 0, Internet, Document, Tutorial, WebDocument
}; };
MainMode displayMode() MainMode displayMode()
@ -137,7 +137,6 @@ class UBApplicationController : public QObject
void actionPaste(); void actionPaste();
void showTutorial(); void showTutorial();
void showSankoreEditor();
void checkUpdateRequest(); void checkUpdateRequest();
void checkUpdateAtLaunch(); 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é. * This file is part of Open-Sankoré.
* *
@ -19,6 +19,7 @@
* along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>. * along with Open-Sankoré. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "UBDisplayManager.h" #include "UBDisplayManager.h"
#include "frameworks/UBPlatformUtils.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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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é. * 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