diff --git a/LICENSE.txt b/LICENSE.txt index 6560f040..c60ab7c9 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -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'Intert Public pour l'Education Numrique 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 diff --git a/Open-Sankore.packproj b/Open-Sankore.packproj index 45ec0cb4..f443040f 100644 --- a/Open-Sankore.packproj +++ b/Open-Sankore.packproj @@ -26,9 +26,9 @@ International Mode - 0 + 1 Path - + LICENSE.txt Path Type 2 diff --git a/Sankore_3.1.pro b/Sankore_3.1.pro index b3116be0..7e046954 100644 --- a/Sankore_3.1.pro +++ b/Sankore_3.1.pro @@ -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", "") diff --git a/buildDebianPackage.sh b/buildDebianPackage.sh index e2be330f..877f4f8c 100755 --- a/buildDebianPackage.sh +++ b/buildDebianPackage.sh @@ -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 diff --git a/plugins/cffadaptor/src/UBCFFAdaptor.cpp b/plugins/cffadaptor/src/UBCFFAdaptor.cpp index 431c46e8..b9a135a4 100644 --- a/plugins/cffadaptor/src/UBCFFAdaptor.cpp +++ b/plugins/cffadaptor/src/UBCFFAdaptor.cpp @@ -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é. * diff --git a/plugins/cffadaptor/src/UBCFFAdaptor.h b/plugins/cffadaptor/src/UBCFFAdaptor.h index 93eb6166..10ac6366 100644 --- a/plugins/cffadaptor/src/UBCFFAdaptor.h +++ b/plugins/cffadaptor/src/UBCFFAdaptor.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é. * @@ -100,7 +100,7 @@ private: bool parseUBZPolygon(const QDomElement &element, QMultiMap &dstSvgList); bool parseUBZPolyline(const QDomElement &element, QMultiMap &dstSvgList); - bool parseUBZLine(const QDomElement &element, QMultiMap &dstSvgList); + bool parseUBZLine(const QDomElement &element, QMultiMap &dstSvgList); void addSVGElementToResultModel(const QDomElement &element, QMultiMap &dstList, int layer = DEFAULT_LAYER); void addIWBElementToResultModel(const QDomElement &element); diff --git a/plugins/cffadaptor/src/UBCFFAdaptor_global.h b/plugins/cffadaptor/src/UBCFFAdaptor_global.h index 182a649a..3f060b96 100644 --- a/plugins/cffadaptor/src/UBCFFAdaptor_global.h +++ b/plugins/cffadaptor/src/UBCFFAdaptor_global.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é. * diff --git a/plugins/cffadaptor/src/UBCFFConstants.h b/plugins/cffadaptor/src/UBCFFConstants.h index 7d03d55f..588ea699 100644 --- a/plugins/cffadaptor/src/UBCFFConstants.h +++ b/plugins/cffadaptor/src/UBCFFConstants.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é. * diff --git a/plugins/cffadaptor/src/UBGlobals.h b/plugins/cffadaptor/src/UBGlobals.h index 309004c2..1c2864d3 100644 --- a/plugins/cffadaptor/src/UBGlobals.h +++ b/plugins/cffadaptor/src/UBGlobals.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é. * diff --git a/resources/etc/SankoreEditor/editor_en/files/calepin.png b/resources/etc/SankoreEditor/editor_en/files/calepin.png deleted file mode 100644 index e710d8c0..00000000 Binary files a/resources/etc/SankoreEditor/editor_en/files/calepin.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_en/files/logo.png b/resources/etc/SankoreEditor/editor_en/files/logo.png deleted file mode 100644 index e1a85e35..00000000 Binary files a/resources/etc/SankoreEditor/editor_en/files/logo.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_en/files/logoplanetesankore.png b/resources/etc/SankoreEditor/editor_en/files/logoplanetesankore.png deleted file mode 100644 index c6f4ac3a..00000000 Binary files a/resources/etc/SankoreEditor/editor_en/files/logoplanetesankore.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_en/files/mappe.png b/resources/etc/SankoreEditor/editor_en/files/mappe.png deleted file mode 100644 index f9548bee..00000000 Binary files a/resources/etc/SankoreEditor/editor_en/files/mappe.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_en/files/outils.png b/resources/etc/SankoreEditor/editor_en/files/outils.png deleted file mode 100644 index 0ef1c5bb..00000000 Binary files a/resources/etc/SankoreEditor/editor_en/files/outils.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_en/index.html b/resources/etc/SankoreEditor/editor_en/index.html deleted file mode 100644 index e9aaa661..00000000 --- a/resources/etc/SankoreEditor/editor_en/index.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - -Sankoré editor - - - - - - - - - - - - - - - - - - - - - - - - - - -

editeur

-

Instructions on how to use Sankoré editor

-

THE CURRENT VERSION IS ONLY AVAILABLE IN FRENCH

outils mappe calepin

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.

Requirement to work with the editor :

-
    -
  • a Web access
  • -
  • an account on Planète Sankoré
  • -

 

-

 

-

 

Sankoré editor is hosted on planete.sankore.org
-

 

- - diff --git a/resources/etc/SankoreEditor/editor_fr/files/calepin.png b/resources/etc/SankoreEditor/editor_fr/files/calepin.png deleted file mode 100644 index e710d8c0..00000000 Binary files a/resources/etc/SankoreEditor/editor_fr/files/calepin.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_fr/files/logo.png b/resources/etc/SankoreEditor/editor_fr/files/logo.png deleted file mode 100644 index e1a85e35..00000000 Binary files a/resources/etc/SankoreEditor/editor_fr/files/logo.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_fr/files/logoplanetesankore.png b/resources/etc/SankoreEditor/editor_fr/files/logoplanetesankore.png deleted file mode 100644 index c6f4ac3a..00000000 Binary files a/resources/etc/SankoreEditor/editor_fr/files/logoplanetesankore.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_fr/files/mappe.png b/resources/etc/SankoreEditor/editor_fr/files/mappe.png deleted file mode 100644 index f9548bee..00000000 Binary files a/resources/etc/SankoreEditor/editor_fr/files/mappe.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_fr/files/outils.png b/resources/etc/SankoreEditor/editor_fr/files/outils.png deleted file mode 100644 index 0ef1c5bb..00000000 Binary files a/resources/etc/SankoreEditor/editor_fr/files/outils.png and /dev/null differ diff --git a/resources/etc/SankoreEditor/editor_fr/index.html b/resources/etc/SankoreEditor/editor_fr/index.html deleted file mode 100644 index c3288659..00000000 --- a/resources/etc/SankoreEditor/editor_fr/index.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - -Editeur Sankoré - - - - - - - - - - - - - - - - - - - - - - - - - - -

editeur

-

Instructions pour l'utilisation de l'éditeur Sankoré

outils mappe calepin
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é.

Éléments requis pour travailler avec l'éditeur :

-
    -
  • un accès Web
  • -
  • un compte Planète Sankoré
  • -

 

-

 

-

 

L'éditeur Sankoré est hébergé sur planete.sankore.org
-

 

- - diff --git a/resources/forms/mainWindow.ui b/resources/forms/mainWindow.ui index 67222ab7..575d475d 100644 --- a/resources/forms/mainWindow.ui +++ b/resources/forms/mainWindow.ui @@ -1596,18 +1596,6 @@ Check Update - - - - :/images/toolbar/paraschool.png:/images/toolbar/paraschool.png - - - Open-Sankoré Editor - - - Show Open-Sankoré Widgets Editor - - diff --git a/resources/images/toolbar/paraschool.png b/resources/images/toolbar/paraschool.png deleted file mode 100644 index bdb6da43..00000000 Binary files a/resources/images/toolbar/paraschool.png and /dev/null differ diff --git a/resources/sankore.qrc b/resources/sankore.qrc index fcefa2e8..b98a501b 100644 --- a/resources/sankore.qrc +++ b/resources/sankore.qrc @@ -295,7 +295,6 @@ images/toolbar/updates.png images/paletteLibrary.png images/paletteNavigator.png - images/toolbar/paraschool.png images/toolbar/display.png images/toolbar/hide.png images/toolbar/record.png diff --git a/src/adaptors/UBCFFSubsetAdaptor.cpp b/src/adaptors/UBCFFSubsetAdaptor.cpp index 6f26472d..73a81c5b 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.cpp +++ b/src/adaptors/UBCFFSubsetAdaptor.cpp @@ -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é. * diff --git a/src/adaptors/UBCFFSubsetAdaptor.h b/src/adaptors/UBCFFSubsetAdaptor.h index 5e6e7df3..68f741e9 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.h +++ b/src/adaptors/UBCFFSubsetAdaptor.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é. * diff --git a/src/adaptors/UBExportAdaptor.cpp b/src/adaptors/UBExportAdaptor.cpp index 787d95da..d36de637 100644 --- a/src/adaptors/UBExportAdaptor.cpp +++ b/src/adaptors/UBExportAdaptor.cpp @@ -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é. * diff --git a/src/adaptors/UBExportAdaptor.h b/src/adaptors/UBExportAdaptor.h index 38c896fd..a4986137 100644 --- a/src/adaptors/UBExportAdaptor.h +++ b/src/adaptors/UBExportAdaptor.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é. * diff --git a/src/adaptors/UBExportCFF.cpp b/src/adaptors/UBExportCFF.cpp index aebd5341..3d3b94c9 100644 --- a/src/adaptors/UBExportCFF.cpp +++ b/src/adaptors/UBExportCFF.cpp @@ -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é. * diff --git a/src/adaptors/UBExportCFF.h b/src/adaptors/UBExportCFF.h index 82c08e31..62743aa3 100644 --- a/src/adaptors/UBExportCFF.h +++ b/src/adaptors/UBExportCFF.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é. * diff --git a/src/adaptors/UBExportDocument.cpp b/src/adaptors/UBExportDocument.cpp index a69b8cf7..745cf998 100644 --- a/src/adaptors/UBExportDocument.cpp +++ b/src/adaptors/UBExportDocument.cpp @@ -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é. * diff --git a/src/adaptors/UBExportDocument.h b/src/adaptors/UBExportDocument.h index 43a62cec..9fbb5b69 100644 --- a/src/adaptors/UBExportDocument.h +++ b/src/adaptors/UBExportDocument.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é. * diff --git a/src/adaptors/UBExportFullPDF.cpp b/src/adaptors/UBExportFullPDF.cpp index ce416bce..b68b92da 100644 --- a/src/adaptors/UBExportFullPDF.cpp +++ b/src/adaptors/UBExportFullPDF.cpp @@ -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é. * diff --git a/src/adaptors/UBExportFullPDF.h b/src/adaptors/UBExportFullPDF.h index a1fc9111..a3110c14 100644 --- a/src/adaptors/UBExportFullPDF.h +++ b/src/adaptors/UBExportFullPDF.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é. * diff --git a/src/adaptors/UBExportPDF.cpp b/src/adaptors/UBExportPDF.cpp index 6b4aa685..b62d35c7 100644 --- a/src/adaptors/UBExportPDF.cpp +++ b/src/adaptors/UBExportPDF.cpp @@ -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é. * diff --git a/src/adaptors/UBExportPDF.h b/src/adaptors/UBExportPDF.h index a598c10f..537c8d81 100644 --- a/src/adaptors/UBExportPDF.h +++ b/src/adaptors/UBExportPDF.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é. * diff --git a/src/adaptors/UBExportWeb.cpp b/src/adaptors/UBExportWeb.cpp index b026da75..ad9e0c89 100644 --- a/src/adaptors/UBExportWeb.cpp +++ b/src/adaptors/UBExportWeb.cpp @@ -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é. * diff --git a/src/adaptors/UBExportWeb.h b/src/adaptors/UBExportWeb.h index 74bf309e..bf52cc1c 100644 --- a/src/adaptors/UBExportWeb.h +++ b/src/adaptors/UBExportWeb.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é. * diff --git a/src/adaptors/UBImportAdaptor.cpp b/src/adaptors/UBImportAdaptor.cpp index 22716f70..0a842f3e 100644 --- a/src/adaptors/UBImportAdaptor.cpp +++ b/src/adaptors/UBImportAdaptor.cpp @@ -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é. * diff --git a/src/adaptors/UBImportAdaptor.h b/src/adaptors/UBImportAdaptor.h index c5854f23..a99a991c 100644 --- a/src/adaptors/UBImportAdaptor.h +++ b/src/adaptors/UBImportAdaptor.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é. * diff --git a/src/adaptors/UBImportCFF.cpp b/src/adaptors/UBImportCFF.cpp index f8b2cca6..4845e653 100644 --- a/src/adaptors/UBImportCFF.cpp +++ b/src/adaptors/UBImportCFF.cpp @@ -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é. * diff --git a/src/adaptors/UBImportCFF.h b/src/adaptors/UBImportCFF.h index 7748f5f3..d06b9d18 100644 --- a/src/adaptors/UBImportCFF.h +++ b/src/adaptors/UBImportCFF.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é. * diff --git a/src/adaptors/UBImportDocument.cpp b/src/adaptors/UBImportDocument.cpp index 14b33ccf..f155385d 100644 --- a/src/adaptors/UBImportDocument.cpp +++ b/src/adaptors/UBImportDocument.cpp @@ -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é. * diff --git a/src/adaptors/UBImportDocument.h b/src/adaptors/UBImportDocument.h index d2b7ed6b..8ac246fd 100644 --- a/src/adaptors/UBImportDocument.h +++ b/src/adaptors/UBImportDocument.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é. * diff --git a/src/adaptors/UBImportImage.cpp b/src/adaptors/UBImportImage.cpp index 1ddfbd01..ce0648e3 100644 --- a/src/adaptors/UBImportImage.cpp +++ b/src/adaptors/UBImportImage.cpp @@ -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é. * diff --git a/src/adaptors/UBImportImage.h b/src/adaptors/UBImportImage.h index 24acd3bc..c7273086 100644 --- a/src/adaptors/UBImportImage.h +++ b/src/adaptors/UBImportImage.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é. * diff --git a/src/adaptors/UBImportPDF.cpp b/src/adaptors/UBImportPDF.cpp index 1114fa7e..4f76c50e 100644 --- a/src/adaptors/UBImportPDF.cpp +++ b/src/adaptors/UBImportPDF.cpp @@ -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é. * diff --git a/src/adaptors/UBImportPDF.h b/src/adaptors/UBImportPDF.h index 6eb777c8..bed1ada9 100644 --- a/src/adaptors/UBImportPDF.h +++ b/src/adaptors/UBImportPDF.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é. * diff --git a/src/adaptors/UBImportVirtualPrinter.cpp b/src/adaptors/UBImportVirtualPrinter.cpp index 54344060..68fd5376 100644 --- a/src/adaptors/UBImportVirtualPrinter.cpp +++ b/src/adaptors/UBImportVirtualPrinter.cpp @@ -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é. * diff --git a/src/adaptors/UBIniFileParser.cpp b/src/adaptors/UBIniFileParser.cpp index 62672d76..67e2bf38 100644 --- a/src/adaptors/UBIniFileParser.cpp +++ b/src/adaptors/UBIniFileParser.cpp @@ -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é. * diff --git a/src/adaptors/UBIniFileParser.h b/src/adaptors/UBIniFileParser.h index 6bd5fd05..b60178ab 100644 --- a/src/adaptors/UBIniFileParser.h +++ b/src/adaptors/UBIniFileParser.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é. * diff --git a/src/adaptors/UBMetadataDcSubsetAdaptor.cpp b/src/adaptors/UBMetadataDcSubsetAdaptor.cpp index 217c93a2..676bbca8 100644 --- a/src/adaptors/UBMetadataDcSubsetAdaptor.cpp +++ b/src/adaptors/UBMetadataDcSubsetAdaptor.cpp @@ -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é. * diff --git a/src/adaptors/UBMetadataDcSubsetAdaptor.h b/src/adaptors/UBMetadataDcSubsetAdaptor.h index 10c34175..303c8f3e 100644 --- a/src/adaptors/UBMetadataDcSubsetAdaptor.h +++ b/src/adaptors/UBMetadataDcSubsetAdaptor.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é. * diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index 2b65af19..546c6ed0 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -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é. * @@ -97,12 +97,12 @@ QMap UBSvgSubsetAdaptor::additionalElementToStore; QString UBSvgSubsetAdaptor::toSvgTransform(const QMatrix& matrix) { return QString("matrix(%1, %2, %3, %4, %5, %6)") - .arg(matrix.m11(), 0 , 'g') - .arg(matrix.m12(), 0 , 'g') - .arg(matrix.m21(), 0 , 'g') - .arg(matrix.m22(), 0 , 'g') - .arg(matrix.dx(), 0 , 'g') - .arg(matrix.dy(), 0 , 'g'); + .arg(matrix.m11(), 0 , 'g') + .arg(matrix.m12(), 0 , 'g') + .arg(matrix.m21(), 0 , 'g') + .arg(matrix.m22(), 0 , 'g') + .arg(matrix.dx(), 0 , 'g') + .arg(matrix.dy(), 0 , 'g'); } @@ -117,12 +117,12 @@ QMatrix UBSvgSubsetAdaptor::fromSvgTransform(const QString& transform) if (sl.size() >= 6) { matrix.setMatrix( - sl.at(0).toFloat(), - sl.at(1).toFloat(), - sl.at(2).toFloat(), - sl.at(3).toFloat(), - sl.at(4).toFloat(), - sl.at(5).toFloat()); + sl.at(0).toFloat(), + sl.at(1).toFloat(), + sl.at(2).toFloat(), + sl.at(3).toFloat(), + sl.at(4).toFloat(), + sl.at(5).toFloat()); } return matrix; @@ -340,7 +340,7 @@ QString UBSvgSubsetAdaptor::readTeacherGuideNode(int sceneIndex) mXmlReader.readNext(); if (mXmlReader.isStartElement()) { - if (mXmlReader.name() == "teacherBar" || mXmlReader.name() == "teacherGuide"){ + if (mXmlReader.name() == "teacherBar" || mXmlReader.name() == "teacherGuide"){ result.clear(); result += ""; result += "\n"; @@ -372,10 +372,10 @@ QString UBSvgSubsetAdaptor::readTeacherGuideNode(int sceneIndex) UBSvgSubsetAdaptor::UBSvgSubsetReader::UBSvgSubsetReader(UBDocumentProxy* pProxy, const QByteArray& pXmlData) - : mXmlReader(pXmlData) - , mProxy(pProxy) - , mDocumentPath(pProxy->persistencePath()) - , mGroupHasInfo(false) + : mXmlReader(pXmlData) + , mProxy(pProxy) + , mDocumentPath(pProxy->persistencePath()) + , mGroupHasInfo(false) { // NOOP } @@ -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); - polygonItem->setTransform(group->transform()); + 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 polygonItems - = polygonItemsFromPolylineSvg(mScene->isDarkBackground() ? Qt::white : Qt::black); + QList 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); - polygonItem->setTransform(group->transform()); + 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"; @@ -1108,9 +1022,9 @@ void UBSvgSubsetAdaptor::persistScene(UBDocumentProxy* proxy, UBGraphicsScene* p UBSvgSubsetAdaptor::UBSvgSubsetWriter::UBSvgSubsetWriter(UBDocumentProxy* proxy, UBGraphicsScene* pScene, const int pageIndex) - : mScene(pScene) - , mDocumentPath(proxy->persistencePath()) - , mPageIndex(pageIndex) + : mScene(pScene) + , mDocumentPath(proxy->persistencePath()) + , mPageIndex(pageIndex) { // NOOP @@ -1213,24 +1127,25 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex) foreach(QGraphicsItem* item, strokesGroupItem->childItems()) { UBGraphicsPolygonItem* poly = qgraphicsitem_cast(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 (item); if (polygonItem && polygonItem->isVisible()) { - UBGraphicsStroke* currentStroke = polygonItem->stroke(); - if (openStroke && (currentStroke != openStroke)) { mXmlWriter.writeEndElement(); //g @@ -1514,15 +1427,14 @@ 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 { - QDomElement curSubElement = groupDomDocument->createElement(tElement); + } + else { + QDomElement curSubElement = groupDomDocument->createElement(tElement); - curSubElement.setAttribute(aId, tmpUuid); - curGroupElement.appendChild(curSubElement); - } + curSubElement.setAttribute(aId, tmpUuid); + curGroupElement.appendChild(curSubElement); } } } @@ -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()) @@ -2008,7 +1874,7 @@ QList UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItem if (!svgPoints.isNull()) { QStringList ts = svgPoints.toString().split(QLatin1Char(' '), - QString::SkipEmptyParts); + QString::SkipEmptyParts); QList 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 //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 - gItem->setPos(svgX.toString().toFloat(), svgY.toString().toFloat()); - #endif +#ifdef Q_WS_WIN + gItem->setPos(svgX.toString().toFloat(), svgY.toString().toFloat()); +#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(gItem); @@ -2413,16 +2274,14 @@ 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"); @@ -2759,7 +2593,7 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg() color.setNamedColor(ubFillOnLightBackground.toString()); if (!color.isValid()) color = Qt::black; - textItem->setColorOnLightBackground(color); + textItem->setColorOnLightBackground(color); } QString text; @@ -2769,6 +2603,7 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg() if (mXmlReader.hasError()) { delete textItem; + textItem = 0; return 0; } @@ -2788,7 +2623,7 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg() return textItem; } - //tracking for backward capability with older versions + //tracking for backward capability with older versions } else if (mXmlReader.name() == "font") { QFont font = textItem->font(); @@ -2803,18 +2638,18 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg() styleToken = styleToken.trimmed(); if (styleToken.startsWith(sFontSizePrefix) && styleToken.endsWith(sPixelUnit)) { int fontSize = styleToken.mid( - sFontSizePrefix.length(), - styleToken.length() - sFontSizePrefix.length() - sPixelUnit.length()).toInt(); + sFontSizePrefix.length(), + styleToken.length() - sFontSizePrefix.length() - sPixelUnit.length()).toInt(); font.setPixelSize(fontSize); } else if (styleToken.startsWith(sFontWeightPrefix)) { QString fontWeight = styleToken.mid( - sFontWeightPrefix.length(), - styleToken.length() - sFontWeightPrefix.length()); + sFontWeightPrefix.length(), + styleToken.length() - sFontWeightPrefix.length()); font.setBold(fontWeight.contains("bold")); } else if (styleToken.startsWith(sFontStylePrefix)) { QString fontStyle = styleToken.mid( - sFontStylePrefix.length(), - styleToken.length() - sFontStylePrefix.length()); + sFontStylePrefix.length(), + styleToken.length() - sFontStylePrefix.length()); font.setItalic(fontStyle.contains("italic")); } } @@ -3168,7 +3003,7 @@ UBGraphicsTriangle* UBSvgSubsetAdaptor::UBSvgSubsetReader::triangleFromSvg() UBGraphicsTriangle::UBGraphicsTriangleOrientation orientation = UBGraphicsTriangle::orientationFromStr(orientationStringRef); 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); } @@ -3299,9 +3134,3 @@ void UBSvgSubsetAdaptor::convertSvgImagesToImages(UBDocumentProxy* proxy) } } } - - - - - - diff --git a/src/adaptors/UBSvgSubsetAdaptor.h b/src/adaptors/UBSvgSubsetAdaptor.h index 24f54444..cd241d7e 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.h +++ b/src/adaptors/UBSvgSubsetAdaptor.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é. * @@ -158,9 +158,6 @@ class UBSvgSubsetAdaptor void graphicsItemFromSvg(QGraphicsItem* gItem); - qreal getZValueFromSvg(); - QUuid getUuidFromSvg(); - QXmlStreamReader mXmlReader; int mFileVersion; UBDocumentProxy *mProxy; diff --git a/src/adaptors/UBThumbnailAdaptor.cpp b/src/adaptors/UBThumbnailAdaptor.cpp index 858e3247..97c53852 100644 --- a/src/adaptors/UBThumbnailAdaptor.cpp +++ b/src/adaptors/UBThumbnailAdaptor.cpp @@ -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é. * diff --git a/src/adaptors/UBThumbnailAdaptor.h b/src/adaptors/UBThumbnailAdaptor.h index 52305dc1..88c39bf7 100644 --- a/src/adaptors/UBThumbnailAdaptor.h +++ b/src/adaptors/UBThumbnailAdaptor.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é. * diff --git a/src/adaptors/UBWebPublisher.cpp b/src/adaptors/UBWebPublisher.cpp index 47ec6cc3..a979515a 100644 --- a/src/adaptors/UBWebPublisher.cpp +++ b/src/adaptors/UBWebPublisher.cpp @@ -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é. * diff --git a/src/adaptors/UBWebPublisher.h b/src/adaptors/UBWebPublisher.h index f47516d8..99409373 100644 --- a/src/adaptors/UBWebPublisher.h +++ b/src/adaptors/UBWebPublisher.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é. * diff --git a/src/adaptors/publishing/UBDocumentPublisher.cpp b/src/adaptors/publishing/UBDocumentPublisher.cpp index 33e9b58e..4edeffdf 100644 --- a/src/adaptors/publishing/UBDocumentPublisher.cpp +++ b/src/adaptors/publishing/UBDocumentPublisher.cpp @@ -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é. * diff --git a/src/adaptors/publishing/UBDocumentPublisher.h b/src/adaptors/publishing/UBDocumentPublisher.h index 6b4b5f27..5e8768bf 100644 --- a/src/adaptors/publishing/UBDocumentPublisher.h +++ b/src/adaptors/publishing/UBDocumentPublisher.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é. * diff --git a/src/adaptors/publishing/UBSvgSubsetRasterizer.cpp b/src/adaptors/publishing/UBSvgSubsetRasterizer.cpp index 98eb2cfc..458eb1c9 100644 --- a/src/adaptors/publishing/UBSvgSubsetRasterizer.cpp +++ b/src/adaptors/publishing/UBSvgSubsetRasterizer.cpp @@ -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é. * diff --git a/src/adaptors/publishing/UBSvgSubsetRasterizer.h b/src/adaptors/publishing/UBSvgSubsetRasterizer.h index a208c121..fcc40cff 100644 --- a/src/adaptors/publishing/UBSvgSubsetRasterizer.h +++ b/src/adaptors/publishing/UBSvgSubsetRasterizer.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é. * diff --git a/src/api/UBLibraryAPI.cpp b/src/api/UBLibraryAPI.cpp index bd69bb4b..94f4908d 100644 --- a/src/api/UBLibraryAPI.cpp +++ b/src/api/UBLibraryAPI.cpp @@ -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é. * diff --git a/src/api/UBLibraryAPI.h b/src/api/UBLibraryAPI.h index 9fbdce19..0a55c943 100644 --- a/src/api/UBLibraryAPI.h +++ b/src/api/UBLibraryAPI.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é. * diff --git a/src/api/UBW3CWidgetAPI.cpp b/src/api/UBW3CWidgetAPI.cpp index a1a4b7e3..3295ba03 100644 --- a/src/api/UBW3CWidgetAPI.cpp +++ b/src/api/UBW3CWidgetAPI.cpp @@ -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é. * diff --git a/src/api/UBW3CWidgetAPI.h b/src/api/UBW3CWidgetAPI.h index 3778c647..cd41cbdb 100644 --- a/src/api/UBW3CWidgetAPI.h +++ b/src/api/UBW3CWidgetAPI.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é. * diff --git a/src/api/UBWidgetMessageAPI.cpp b/src/api/UBWidgetMessageAPI.cpp index 94ae18c9..674aec7c 100644 --- a/src/api/UBWidgetMessageAPI.cpp +++ b/src/api/UBWidgetMessageAPI.cpp @@ -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é. * diff --git a/src/api/UBWidgetMessageAPI.h b/src/api/UBWidgetMessageAPI.h index 5e0d3747..366dbe96 100644 --- a/src/api/UBWidgetMessageAPI.h +++ b/src/api/UBWidgetMessageAPI.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é. * diff --git a/src/api/UBWidgetUniboardAPI.cpp b/src/api/UBWidgetUniboardAPI.cpp index e9ff6996..69eb953c 100644 --- a/src/api/UBWidgetUniboardAPI.cpp +++ b/src/api/UBWidgetUniboardAPI.cpp @@ -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é. * diff --git a/src/api/UBWidgetUniboardAPI.h b/src/api/UBWidgetUniboardAPI.h index e022af4e..76758fa9 100644 --- a/src/api/UBWidgetUniboardAPI.h +++ b/src/api/UBWidgetUniboardAPI.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é. * diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 96f8c3b1..d9f2bcc8 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -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; } diff --git a/src/board/UBBoardController.h b/src/board/UBBoardController.h index c0549707..52270050 100644 --- a/src/board/UBBoardController.h +++ b/src/board/UBBoardController.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é. * @@ -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 metadata); void pageSelectionChanged(int index); diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 086da59b..cac33bde 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -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(); diff --git a/src/board/UBBoardPaletteManager.h b/src/board/UBBoardPaletteManager.h index 7526e081..5f05af11 100644 --- a/src/board/UBBoardPaletteManager.h +++ b/src/board/UBBoardPaletteManager.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é. * @@ -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(); diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index bbfa9fec..903f4e54 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -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,218 +80,204 @@ #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 (); + init (); - mFilterZIndex = false; + mFilterZIndex = false; - mLongPressTimer.setInterval(mLongPressInterval); - mLongPressTimer.setSingleShot(true); + mLongPressTimer.setInterval(mLongPressInterval); + mLongPressTimer.setSingleShot(true); } 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 (); + init (); - mStartLayer = pStartLayer; - mEndLayer = pEndLayer; + mStartLayer = pStartLayer; + mEndLayer = pEndLayer; - mFilterZIndex = true; + mFilterZIndex = true; - mLongPressTimer.setInterval(mLongPressInterval); - mLongPressTimer.setSingleShot(true); + mLongPressTimer.setInterval(mLongPressInterval); + mLongPressTimer.setSingleShot(true); } -UBBoardView::~UBBoardView () { - //NOOP - if (suspendedMousePressEvent) +UBBoardView::~UBBoardView () +{ + if (suspendedMousePressEvent){ delete suspendedMousePressEvent; + suspendedMousePressEvent = NULL; + } } void UBBoardView::init () { - connect (UBSettings::settings ()->boardPenPressureSensitive, SIGNAL (changed (QVariant)), - this, SLOT (settingChanged (QVariant))); + connect (UBSettings::settings ()->boardPenPressureSensitive, SIGNAL (changed (QVariant)), + this, SLOT (settingChanged (QVariant))); - connect (UBSettings::settings ()->boardMarkerPressureSensitive, SIGNAL (changed (QVariant)), - this, SLOT (settingChanged (QVariant))); + connect (UBSettings::settings ()->boardMarkerPressureSensitive, SIGNAL (changed (QVariant)), + this, SLOT (settingChanged (QVariant))); - connect (UBSettings::settings ()->boardUseHighResTabletEvent, SIGNAL (changed (QVariant)), - this, SLOT (settingChanged (QVariant))); + connect (UBSettings::settings ()->boardUseHighResTabletEvent, SIGNAL (changed (QVariant)), + this, SLOT (settingChanged (QVariant))); - setWindowFlags (Qt::FramelessWindowHint); - setFrameStyle (QFrame::NoFrame); - setRenderHints (QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing); - setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff); - setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff); - setAcceptDrops (true); + 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); + setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff); + setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff); + setAcceptDrops (true); - setOptimizationFlags (QGraphicsView::IndirectPainting | QGraphicsView::DontSavePainterState); // enable UBBoardView::drawItems filter - setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); + mTabletStylusIsPressed = false; + mMouseButtonIsPressed = false; + mPendingStylusReleaseEvent = false; - mTabletStylusIsPressed = false; - mMouseButtonIsPressed = false; - mPendingStylusReleaseEvent = false; + setCacheMode (QGraphicsView::CacheBackground); - setCacheMode (QGraphicsView::CacheBackground); + mUsingTabletEraser = false; + mIsCreatingTextZone = false; + mRubberBand = 0; + mUBRubberBand = 0; - mUsingTabletEraser = false; - mIsCreatingTextZone = false; - mRubberBand = 0; - mUBRubberBand = 0; + mVirtualKeyboardActive = false; - mVirtualKeyboardActive = false; + settingChanged (QVariant ()); - settingChanged (QVariant ()); + unsetCursor(); - unsetCursor(); - - movingItem = NULL; - mWidgetMoved = false; + movingItem = NULL; + mWidgetMoved = false; } -UBGraphicsScene* -UBBoardView::scene () +UBGraphicsScene* UBBoardView::scene () { - return qobject_cast (QGraphicsView::scene ()); + return qobject_cast (QGraphicsView::scene ()); } -void -UBBoardView::hideEvent (QHideEvent * event) -{ - Q_UNUSED (event); - emit hidden (); -} -void -UBBoardView::showEvent (QShowEvent * event) +void UBBoardView::keyPressEvent (QKeyEvent *event) { - Q_UNUSED (event); - emit shown (); -} + // send to the scene anyway + QApplication::sendEvent (scene (), event); -void -UBBoardView::keyPressEvent (QKeyEvent *event) -{ - // send to the scene anyway - QApplication::sendEvent (scene (), event); - - if (!event->isAccepted ()) + if (!event->isAccepted ()) { - switch (event->key ()) + switch (event->key ()) { case Qt::Key_Up: case Qt::Key_PageUp: case Qt::Key_Left: - { + { mController->previousScene (); break; - } + } case Qt::Key_Down: case Qt::Key_PageDown: case Qt::Key_Right: case Qt::Key_Space: - { + { mController->nextScene (); break; - } + } case Qt::Key_Home: - { + { mController->firstScene (); break; - } + } case Qt::Key_End: - { + { mController->lastScene (); break; - } + } case Qt::Key_Insert: - { + { mController->addScene (); break; - } + } case Qt::Key_Control: case Qt::Key_Shift: - { + { setMultiselection(true); - }break; + }break; } - if (event->modifiers () & Qt::ControlModifier) // keep only ctrl/cmd keys + if (event->modifiers () & Qt::ControlModifier) // keep only ctrl/cmd keys { - switch (event->key ()) + switch (event->key ()) { case Qt::Key_Plus: case Qt::Key_I: - { + { mController->zoomIn (); event->accept (); break; - } + } case Qt::Key_Minus: case Qt::Key_O: - { + { mController->zoomOut (); event->accept (); break; - } + } case Qt::Key_0: - { + { mController->zoomRestore (); event->accept (); break; - } + } case Qt::Key_Left: - { + { mController->handScroll (-100, 0); event->accept (); break; - } + } case Qt::Key_Right: - { + { mController->handScroll (100, 0); event->accept (); break; - } + } case Qt::Key_Up: - { + { mController->handScroll (0, -100); event->accept (); break; - } + } case Qt::Key_Down: - { + { mController->handScroll (0, 100); event->accept (); break; - } + } default: - { + { // NOOP - } + } } } } @@ -304,45 +290,39 @@ UBBoardView::keyPressEvent (QKeyEvent *event) void UBBoardView::keyReleaseEvent(QKeyEvent *event) { - // if (!event->isAccepted ()) - { - if (Qt::Key_Shift == event->key() - ||Qt::Key_Control == event->key()) - { - setMultiselection(false); - } - } + + 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) + if (e->type () == QEvent::Gesture) { - QGestureEvent *gestureEvent = dynamic_cast (e); - if (gestureEvent) + QGestureEvent *gestureEvent = dynamic_cast (e); + if (gestureEvent) { - QSwipeGesture* swipe = dynamic_cast (gestureEvent->gesture (Qt::SwipeGesture)); - if (swipe) + QSwipeGesture* swipe = dynamic_cast (gestureEvent->gesture (Qt::SwipeGesture)); + if (swipe) { - if (swipe->horizontalDirection () == QSwipeGesture::Left) + if (swipe->horizontalDirection () == QSwipeGesture::Left) { - mController->previousScene (); - gestureEvent->setAccepted (swipe, true); + mController->previousScene (); + gestureEvent->setAccepted (swipe, true); } - if (swipe->horizontalDirection () == QSwipeGesture::Right) + if (swipe->horizontalDirection () == QSwipeGesture::Right) { - mController->nextScene (); - gestureEvent->setAccepted (swipe, true); + mController->nextScene (); + gestureEvent->setAccepted (swipe, true); } } } } - return QGraphicsView::event (e); + return QGraphicsView::event (e); } void UBBoardView::tabletEvent (QTabletEvent * event) @@ -462,33 +442,32 @@ 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; - } + + return false; } bool UBBoardView::isCppTool(QGraphicsItem *item) { return (item->type() == UBGraphicsItemType::CompassItemType - || item->type() == UBGraphicsItemType::RulerItemType - || item->type() == UBGraphicsItemType::ProtractorItemType - || item->type() == UBGraphicsItemType::TriangleItemType - || item->type() == UBGraphicsItemType::CurtainItemType); + || item->type() == UBGraphicsItemType::RulerItemType + || item->type() == UBGraphicsItemType::ProtractorItemType + || item->type() == UBGraphicsItemType::TriangleItemType + || item->type() == UBGraphicsItemType::CurtainItemType); } 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; @@ -694,9 +675,9 @@ QGraphicsItem* UBBoardView::determineItemToPress(QGraphicsItem *item) // if item is on group and group is not selected - group should take press. if (UBStylusTool::Selector == currentTool - && item->parentItem() - && UBGraphicsGroupContainerItem::Type == item->parentItem()->type() - && !item->parentItem()->isSelected()) + && item->parentItem() + && UBGraphicsGroupContainerItem::Type == item->parentItem()->type() + && !item->parentItem()->isSelected()) return item->parentItem(); // items like polygons placed in two groups nested, so we need to recursive call. @@ -716,7 +697,7 @@ QGraphicsItem* UBBoardView::determineItemToMove(QGraphicsItem *item) //W3C widgets should take mouse move events from play tool. if ((UBStylusTool::Play == currentTool) && (UBGraphicsWidgetItem::Type == item->type())) - return item; + return item; // if item is in group if(item->parentItem() && UBGraphicsGroupContainerItem::Type == item->parentItem()->type()) @@ -761,11 +742,8 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event) return; if (itemShouldReceiveMousePressEvent(movingItem)) - { QGraphicsView::mousePressEvent (event); - } - else - { + else { if (movingItem) { UBGraphicsItem *graphicsItem = dynamic_cast(movingItem); @@ -814,7 +792,7 @@ void UBBoardView::handleItemMouseMove(QMouseEvent *event) QGraphicsView::mouseMoveEvent (event); if (movingItem) - posAfterMove = movingItem->pos(); + posAfterMove = movingItem->pos(); mWidgetMoved = ((posAfterMove-posBeforeMove).manhattanLength() != 0); @@ -846,14 +824,14 @@ void UBBoardView::moveRubberedItems(QPointF movingVector) { if (item->type() == UBGraphicsW3CWidgetItem::Type - || item->type() == UBGraphicsPixmapItem::Type - || item->type() == UBGraphicsMediaItem::Type - || item->type() == UBGraphicsSvgItem::Type - || item->type() == UBGraphicsTextItem::Type - || item->type() == UBGraphicsStrokesGroup::Type - || item->type() == UBGraphicsGroupContainerItem::Type) + || item->type() == UBGraphicsPixmapItem::Type + || item->type() == UBGraphicsMediaItem::Type + || item->type() == UBGraphicsSvgItem::Type + || item->type() == UBGraphicsTextItem::Type + || item->type() == UBGraphicsStrokesGroup::Type + || item->type() == UBGraphicsGroupContainerItem::Type) { - item->setPos(item->pos()+movingVector); + item->setPos(item->pos()+movingVector); } } @@ -871,19 +849,19 @@ bool UBBoardView::directTabletEvent(QEvent *event) { QTabletEvent *tEvent = static_cast(event); tEvent = new QTabletEvent(tEvent->type() - , mapFromGlobal(tEvent->pos()) - , tEvent->globalPos() - , tEvent->hiResGlobalPos() - , tEvent->device() - , tEvent->pointerType() - , tEvent->pressure() - , tEvent->xTilt() - , tEvent->yTilt() - , tEvent->tangentialPressure() - , tEvent->rotation() - , tEvent->z() - , tEvent->modifiers() - , tEvent->uniqueId()); + , mapFromGlobal(tEvent->pos()) + , tEvent->globalPos() + , tEvent->hiResGlobalPos() + , tEvent->device() + , tEvent->pointerType() + , tEvent->pressure() + , tEvent->xTilt() + , tEvent->yTilt() + , tEvent->tangentialPressure() + , tEvent->rotation() + , tEvent->z() + , tEvent->modifiers() + , tEvent->uniqueId()); if (geometry().contains(tEvent->pos())) { @@ -933,27 +911,28 @@ QWidget *UBBoardView::widgetForTabletEvent(QWidget *w, const QPoint &pos) return childAtPos; } #endif + void UBBoardView::longPressEvent() { - UBDrawingController *drawingController = UBDrawingController::drawingController(); - UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool (); + UBDrawingController *drawingController = UBDrawingController::drawingController(); + UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool (); - disconnect(&mLongPressTimer, SIGNAL(timeout()), this, SLOT(longPressEvent())); + disconnect(&mLongPressTimer, SIGNAL(timeout()), this, SLOT(longPressEvent())); - if (UBStylusTool::Selector == currentTool) - { + if (UBStylusTool::Selector == currentTool) + { drawingController->setStylusTool(UBStylusTool::Play); - } - else - if (currentTool == UBStylusTool::Play) - { - drawingController->setStylusTool(UBStylusTool::Selector); - } - else - if (UBStylusTool::Eraser == currentTool) - { - UBApplication::boardController->paletteManager()->toggleErasePalette(true); - } + } + else + if (currentTool == UBStylusTool::Play) + { + drawingController->setStylusTool(UBStylusTool::Selector); + } + else + if (UBStylusTool::Eraser == currentTool) + { + UBApplication::boardController->paletteManager()->toggleErasePalette(true); + } } @@ -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,158 +1059,157 @@ void UBBoardView::mousePressEvent (QMouseEvent *event) default: if(UBDrawingController::drawingController()->mActiveRuler==NULL) { viewport()->setCursor (QCursor (Qt::BlankCursor)); - } - if (scene () && !mTabletStylusIsPressed) { - if (currentTool == UBStylusTool::Eraser) { - connect(&mLongPressTimer, SIGNAL(timeout()), this, SLOT(longPressEvent())); - mLongPressTimer.start(); + if (scene () && !mTabletStylusIsPressed) { + if (currentTool == UBStylusTool::Eraser) { + connect(&mLongPressTimer, SIGNAL(timeout()), this, SLOT(longPressEvent())); + mLongPressTimer.start(); + } + scene()->inputDevicePress(mapToScene(UBGeometryUtils::pointConstrainedInRect(event->pos(), rect()))); } - scene()->inputDevicePress(mapToScene(UBGeometryUtils::pointConstrainedInRect(event->pos(), rect()))); + event->accept (); } - 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()); -// } - -// QTime mouseMoveTime = QTime::currentTime(); - if(!mIsDragInProgress - && ((mapToScene(event->pos()) - mLastPressedMousePos).manhattanLength() < QApplication::startDragDistance())) { - qDebug() << "mouse move event canceled"; - return; - } + // static QTime lastCallTime; + // if (!lastCallTime.isNull()) { + // qDebug() << "time interval is " << lastCallTime.msecsTo(QTime::currentTime()); + // } + + // QTime mouseMoveTime = QTime::currentTime(); + if(!mIsDragInProgress + && ((mapToScene(event->pos()) - mLastPressedMousePos).manhattanLength() < QApplication::startDragDistance())) { + qDebug() << "mouse move event canceled"; + return; + } - mIsDragInProgress = true; - mWidgetMoved = true; - mLongPressTimer.stop(); + mIsDragInProgress = true; + mWidgetMoved = true; + mLongPressTimer.stop(); - if (isAbsurdPoint (event->pos ())) { - event->accept (); - return; - } + if (isAbsurdPoint (event->pos ())) { + event->accept (); + return; + } - if ((UBDrawingController::drawingController()->isDrawingTool()) - && !mMouseButtonIsPressed) { - QGraphicsView::mouseMoveEvent(event); - } + if ((UBDrawingController::drawingController()->isDrawingTool()) + && !mMouseButtonIsPressed) { + QGraphicsView::mouseMoveEvent(event); + } - int currentTool = static_cast(UBDrawingController::drawingController()->stylusTool()); - switch (currentTool) { + int currentTool = static_cast(UBDrawingController::drawingController()->stylusTool()); + switch (currentTool) { - case UBStylusTool::Hand : { - if (!mMouseButtonIsPressed && mTabletStylusIsPressed) { - break; - } - QPointF eventPosition = event->posF (); - qreal dx = eventPosition.x () - mPreviousPoint.x (); - qreal dy = eventPosition.y () - mPreviousPoint.y (); - mController->handScroll (dx, dy); - mPreviousPoint = eventPosition; - event->accept (); - } break; - - case UBStylusTool::Selector : - case UBStylusTool::Play : { - if (bIsDesktop) { - event->ignore(); - return; - } + case UBStylusTool::Hand : { + if (!mMouseButtonIsPressed && mTabletStylusIsPressed) { + break; + } + QPointF eventPosition = event->posF (); + qreal dx = eventPosition.x () - mPreviousPoint.x (); + qreal dy = eventPosition.y () - mPreviousPoint.y (); + mController->handScroll (dx, dy); + mPreviousPoint = eventPosition; + event->accept (); + } break; - bool rubberMove = currentTool != (UBStylusTool::Play || mRubberBandInPlayMode) - && (mMouseButtonIsPressed || mTabletStylusIsPressed) - && !movingItem; + case UBStylusTool::Selector : + case UBStylusTool::Play : { + if (bIsDesktop) { + event->ignore(); + return; + } - if (rubberMove) { - QRect bandRect(mMouseDownPos, event->pos()); + bool rubberMove = currentTool != (UBStylusTool::Play || mRubberBandInPlayMode) + && (mMouseButtonIsPressed || mTabletStylusIsPressed) + && !movingItem; - bandRect = bandRect.normalized(); + if (rubberMove) { + QRect bandRect(mMouseDownPos, event->pos()); - if (!mUBRubberBand) { - mUBRubberBand = new UBRubberBand(QRubberBand::Rectangle, this); - } -// mUBRubberBand->setGeometry (QRect (mMouseDownPos, QSize ())); - mUBRubberBand->setGeometry(bandRect); - mUBRubberBand->show(); - -// QTime startTime = QTime::currentTime(); -// QTime testTime = QTime::currentTime(); - QList rubberItems = items(bandRect); -// 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(); - - int counter = 0; - if (currentTool == UBStylusTool::Selector) { - foreach (QGraphicsItem *item, items(bandRect)) { - - if (item->type() == UBGraphicsW3CWidgetItem::Type - || item->type() == UBGraphicsPixmapItem::Type - || item->type() == UBGraphicsMediaItem::Type - || item->type() == UBGraphicsSvgItem::Type - || item->type() == UBGraphicsTextItem::Type - || item->type() == UBGraphicsStrokesGroup::Type - || item->type() == UBGraphicsGroupContainerItem::Type) { - - - if (!mJustSelectedItems.contains(item)) { - counter++; - item->setSelected(true); - mJustSelectedItems.insert(item); - } - } - } - } + bandRect = bandRect.normalized(); -// 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; - - case UBStylusTool::Text : - case UBStylusTool::Capture : { - if (mRubberBand - && (mIsCreatingTextZone || mIsCreatingSceneGrabZone)) { - mRubberBand->setGeometry(QRect(mMouseDownPos, event->pos()).normalized()); - event->accept(); - } else { - QGraphicsView::mouseMoveEvent (event); - } - } break; + if (!mUBRubberBand) { + mUBRubberBand = new UBRubberBand(QRubberBand::Rectangle, this); + } + // mUBRubberBand->setGeometry (QRect (mMouseDownPos, QSize ())); + mUBRubberBand->setGeometry(bandRect); + mUBRubberBand->show(); + + // QTime startTime = QTime::currentTime(); + // QTime testTime = QTime::currentTime(); + QList rubberItems = items(bandRect); + // 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(); + + int counter = 0; + if (currentTool == UBStylusTool::Selector) { + foreach (QGraphicsItem *item, items(bandRect)) { + + if (item->type() == UBGraphicsW3CWidgetItem::Type + || item->type() == UBGraphicsPixmapItem::Type + || item->type() == UBGraphicsMediaItem::Type + || item->type() == UBGraphicsSvgItem::Type + || item->type() == UBGraphicsTextItem::Type + || item->type() == UBGraphicsStrokesGroup::Type + || item->type() == UBGraphicsGroupContainerItem::Type) { + + + if (!mJustSelectedItems.contains(item)) { + counter++; + item->setSelected(true); + mJustSelectedItems.insert(item); + } + } + } + } - default: - if (!mTabletStylusIsPressed && scene()) { - scene()->inputDeviceMove(mapToScene(UBGeometryUtils::pointConstrainedInRect(event->pos(), rect())) - , mMouseButtonIsPressed); - } - event->accept (); - } + // 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; + + case UBStylusTool::Text : + case UBStylusTool::Capture : { + if (mRubberBand + && (mIsCreatingTextZone || mIsCreatingSceneGrabZone)) { + mRubberBand->setGeometry(QRect(mMouseDownPos, event->pos()).normalized()); + event->accept(); + } else { + QGraphicsView::mouseMoveEvent (event); + } + } break; + + default: + if (!mTabletStylusIsPressed && scene()) { + scene()->inputDeviceMove(mapToScene(UBGeometryUtils::pointConstrainedInRect(event->pos(), rect())) + , mMouseButtonIsPressed); + } + 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,109 +1319,177 @@ UBBoardView::mouseReleaseEvent (QMouseEvent *event) if (mRubberBand) { mRubberBand->hide (); } + UBGraphicsItem *graphicsItem = dynamic_cast(movingItem); + if (graphicsItem) + graphicsItem->Delegate()->commitUndoStep(); - - if (scene () && mRubberBand && mIsCreatingTextZone) + bool bReleaseIsNeed = true; + if (movingItem != determineItemToPress(scene()->itemAt(this->mapToScene(event->posF().toPoint())))) { - QRect rubberRect = mRubberBand->geometry (); - - UBGraphicsTextItem* textItem = scene()->addTextHtml ("", mapToScene (rubberRect.topLeft ())); - event->accept (); + 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); + } - UBDrawingController::drawingController ()->setStylusTool (UBStylusTool::Selector); + } + } + } + else + bReleaseIsNeed = true; - textItem->setSelected (true); - textItem->setFocus(); + if (mUBRubberBand && mUBRubberBand->isVisible()) { + mUBRubberBand->hide(); } - else + + if (bReleaseIsNeed) { - QGraphicsView::mouseReleaseEvent (event); + QGraphicsView::mouseReleaseEvent (event); + } + } + else if (currentTool == UBStylusTool::Play) { + if (bIsDesktop) { + event->ignore(); + return; } - mIsCreatingTextZone = false; + 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::Capture) + else if (currentTool == UBStylusTool::Text) { + if (mRubberBand) + mRubberBand->hide (); + + if (scene () && mRubberBand && mIsCreatingTextZone) { + QRect rubberRect = mRubberBand->geometry (); + + UBGraphicsTextItem* textItem = scene()->addTextHtml ("", mapToScene (rubberRect.topLeft ())); + event->accept (); + + UBDrawingController::drawingController ()->setStylusTool (UBStylusTool::Selector); + + textItem->setSelected (true); + textItem->setFocus(); + } + else + QGraphicsView::mouseReleaseEvent (event); + + mIsCreatingTextZone = false; + } + else if (currentTool == UBStylusTool::Capture) { if (mRubberBand) { mRubberBand->hide (); } - - if (scene () && mRubberBand && mIsCreatingSceneGrabZone && mRubberBand->geometry ().width () > 16) + if (scene () && mRubberBand && mIsCreatingSceneGrabZone && mRubberBand->geometry ().width () > 16) { - QRect rect = mRubberBand->geometry (); - QPointF sceneTopLeft = mapToScene (rect.topLeft ()); - QPointF sceneBottomRight = mapToScene (rect.bottomRight ()); - QRectF sceneRect (sceneTopLeft, sceneBottomRight); + QRect rect = mRubberBand->geometry (); + QPointF sceneTopLeft = mapToScene (rect.topLeft ()); + QPointF sceneBottomRight = mapToScene (rect.bottomRight ()); + QRectF sceneRect (sceneTopLeft, sceneBottomRight); - mController->grabScene (sceneRect); + mController->grabScene (sceneRect); - event->accept (); + event->accept (); } - else + else { - QGraphicsView::mouseReleaseEvent (event); + QGraphicsView::mouseReleaseEvent (event); } - mIsCreatingSceneGrabZone = false; + mIsCreatingSceneGrabZone = false; } - else + else { - if (mPendingStylusReleaseEvent || mMouseButtonIsPressed) + if (mPendingStylusReleaseEvent || mMouseButtonIsPressed) { - event->accept (); + event->accept (); } } - mMouseButtonIsPressed = false; - mPendingStylusReleaseEvent = false; - mTabletStylusIsPressed = false; - movingItem = NULL; - - mLongPressTimer.stop(); + mMouseButtonIsPressed = false; + mPendingStylusReleaseEvent = false; + mTabletStylusIsPressed = false; + movingItem = NULL; - emit mouseReleased(); + mLongPressTimer.stop(); + emit mouseReleased(); } -void -UBBoardView::forcedTabletRelease () +void UBBoardView::forcedTabletRelease () { - - if (mMouseButtonIsPressed || mTabletStylusIsPressed || mPendingStylusReleaseEvent) + if (mMouseButtonIsPressed || mTabletStylusIsPressed || mPendingStylusReleaseEvent) { - qWarning () << "dirty mouse/tablet state:"; - qWarning () << "mMouseButtonIsPressed =" << mMouseButtonIsPressed; - qWarning () << "mTabletStylusIsPressed = " << mTabletStylusIsPressed; - qWarning () << "mPendingStylusReleaseEvent" << mPendingStylusReleaseEvent; - qWarning () << "forcing device release"; + qWarning () << "dirty mouse/tablet state:"; + qWarning () << "mMouseButtonIsPressed =" << mMouseButtonIsPressed; + qWarning () << "mTabletStylusIsPressed = " << mTabletStylusIsPressed; + qWarning () << "mPendingStylusReleaseEvent" << mPendingStylusReleaseEvent; + qWarning () << "forcing device release"; - scene ()->inputDeviceRelease (); + scene ()->inputDeviceRelease (); - mMouseButtonIsPressed = false; - mTabletStylusIsPressed = false; - mPendingStylusReleaseEvent = false; + mMouseButtonIsPressed = false; + mTabletStylusIsPressed = false; + mPendingStylusReleaseEvent = false; } } -void -UBBoardView::mouseDoubleClickEvent (QMouseEvent *event) +void UBBoardView::mouseDoubleClickEvent (QMouseEvent *event) { - // We don't want a double click, we want two clicks - mousePressEvent (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 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 itemsList = scene()->items(scenePos); - QBool isSlectedAndMouseHower = itemsList.contains(selItem); - if(isSlectedAndMouseHower) + QBool isSelectedAndMouseHower = itemsList.contains(selItem); + if(isSelectedAndMouseHower) { QGraphicsView::wheelEvent(wheelEvent); wheelEvent->accept(); @@ -1467,53 +1512,47 @@ UBBoardView::wheelEvent (QWheelEvent *wheelEvent) } -void -UBBoardView::leaveEvent (QEvent * event) +void UBBoardView::leaveEvent (QEvent * event) { - if (scene ()) - scene ()->leaveEvent (event); + if (scene ()) + scene ()->leaveEvent (event); - QGraphicsView::leaveEvent (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 + if (!mFilterZIndex) + QGraphicsView::drawItems (painter, numItems, items, options); + else { - int count = 0; + int count = 0; - QGraphicsItem** itemsFiltered = new QGraphicsItem*[numItems]; - QStyleOptionGraphicsItem *optionsFiltered = new QStyleOptionGraphicsItem[numItems]; + QGraphicsItem** itemsFiltered = new QGraphicsItem*[numItems]; + QStyleOptionGraphicsItem *optionsFiltered = new QStyleOptionGraphicsItem[numItems]; - for (int i = 0; i < numItems; i++) + for (int i = 0; i < numItems; i++) { - if (shouldDisplayItem (items[i])) + if (shouldDisplayItem (items[i])) { - itemsFiltered[count] = items[i]; - optionsFiltered[count] = options[i]; - count++; + itemsFiltered[count] = items[i]; + optionsFiltered[count] = options[i]; + count++; } } - QGraphicsView::drawItems (painter, count, itemsFiltered, optionsFiltered); + QGraphicsView::drawItems (painter, count, itemsFiltered, optionsFiltered); - delete[] optionsFiltered; - delete[] itemsFiltered; + delete[] optionsFiltered; + delete[] itemsFiltered; } } void UBBoardView::dragMoveEvent(QDragMoveEvent *event) { - QGraphicsView::dragMoveEvent(event); - event->acceptProposedAction(); + QGraphicsView::dragMoveEvent(event); + event->acceptProposedAction(); } void UBBoardView::dropEvent (QDropEvent *event) @@ -1539,109 +1578,106 @@ 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; + const qreal maxWidth = width () * 10; + const qreal maxHeight = height () * 10; - setSceneRect (-(maxWidth / 2), -(maxHeight / 2), maxWidth, maxHeight); - centerOn (0, 0); + setSceneRect (-(maxWidth / 2), -(maxHeight / 2), maxWidth, maxHeight); + centerOn (0, 0); - emit resized (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)) + if (testAttribute (Qt::WA_TranslucentBackground)) { - QGraphicsView::drawBackground (painter, rect); - return; + QGraphicsView::drawBackground (painter, rect); + return; } - bool darkBackground = scene () && scene ()->isDarkBackground (); + bool darkBackground = scene () && scene ()->isDarkBackground (); - if (darkBackground) + if (darkBackground) { - painter->fillRect (rect, QBrush (QColor (Qt::black))); + painter->fillRect (rect, QBrush (QColor (Qt::black))); } - else + else { - painter->fillRect (rect, QBrush (QColor (Qt::white))); + painter->fillRect (rect, QBrush (QColor (Qt::white))); } - if (transform ().m11 () > 0.5) + if (transform ().m11 () > 0.5) { - QColor bgCrossColor; + QColor bgCrossColor; - if (darkBackground) - bgCrossColor = UBSettings::crossDarkBackground; - else - bgCrossColor = UBSettings::crossLightBackground; + if (darkBackground) + bgCrossColor = UBSettings::crossDarkBackground; + else + bgCrossColor = UBSettings::crossLightBackground; - if (transform ().m11 () < 1.0) + if (transform ().m11 () < 1.0) { - int alpha = 255 * transform ().m11 () / 2; - bgCrossColor.setAlpha (alpha); // fade the crossing on small zooms + int alpha = 255 * transform ().m11 () / 2; + bgCrossColor.setAlpha (alpha); // fade the crossing on small zooms } - painter->setPen (bgCrossColor); + painter->setPen (bgCrossColor); - if (scene () && scene ()->isCrossedBackground ()) + if (scene () && scene ()->isCrossedBackground ()) { - qreal firstY = ((int) (rect.y () / UBSettings::crossSize)) * UBSettings::crossSize; + qreal firstY = ((int) (rect.y () / UBSettings::crossSize)) * UBSettings::crossSize; - for (qreal yPos = firstY; yPos < rect.y () + rect.height (); yPos += UBSettings::crossSize) + for (qreal yPos = firstY; yPos < rect.y () + rect.height (); yPos += UBSettings::crossSize) { - painter->drawLine (rect.x (), yPos, rect.x () + rect.width (), yPos); + painter->drawLine (rect.x (), yPos, rect.x () + rect.width (), yPos); } - qreal firstX = ((int) (rect.x () / UBSettings::crossSize)) * UBSettings::crossSize; + qreal firstX = ((int) (rect.x () / UBSettings::crossSize)) * UBSettings::crossSize; - for (qreal xPos = firstX; xPos < rect.x () + rect.width (); xPos += UBSettings::crossSize) + for (qreal xPos = firstX; xPos < rect.x () + rect.width (); xPos += UBSettings::crossSize) { - painter->drawLine (xPos, rect.y (), xPos, rect.y () + rect.height ()); + painter->drawLine (xPos, rect.y (), xPos, rect.y () + rect.height ()); } } } - if (!mFilterZIndex && scene ()) + if (!mFilterZIndex && scene ()) { - QSize pageNominalSize = scene ()->nominalSize (); + QSize pageNominalSize = scene ()->nominalSize (); - if (pageNominalSize.isValid ()) + if (pageNominalSize.isValid ()) { - qreal penWidth = 8.0 / transform ().m11 (); + qreal penWidth = 8.0 / transform ().m11 (); - QRectF pageRect (pageNominalSize.width () / -2, pageNominalSize.height () / -2 - , pageNominalSize.width (), pageNominalSize.height ()); + QRectF pageRect (pageNominalSize.width () / -2, pageNominalSize.height () / -2 + , pageNominalSize.width (), pageNominalSize.height ()); - pageRect.adjust (-penWidth / 2, -penWidth / 2, penWidth / 2, penWidth / 2); + pageRect.adjust (-penWidth / 2, -penWidth / 2, penWidth / 2, penWidth / 2); - QColor docSizeColor; + QColor docSizeColor; - if (darkBackground) - docSizeColor = UBSettings::documentSizeMarkColorDarkBackground; - else - docSizeColor = UBSettings::documentSizeMarkColorLightBackground; + if (darkBackground) + docSizeColor = UBSettings::documentSizeMarkColorDarkBackground; + else + docSizeColor = UBSettings::documentSizeMarkColorLightBackground; - QPen pen (docSizeColor); - pen.setWidth (penWidth); - painter->setPen (pen); - painter->drawRect (pageRect); + QPen pen (docSizeColor); + pen.setWidth (penWidth); + painter->setPen (pen); + painter->drawRect (pageRect); } } } -void -UBBoardView::settingChanged (QVariant newValue) +void UBBoardView::settingChanged (QVariant newValue) { - Q_UNUSED (newValue); + Q_UNUSED (newValue); - mPenPressureSensitive = UBSettings::settings ()->boardPenPressureSensitive->get ().toBool (); - mMarkerPressureSensitive = UBSettings::settings ()->boardMarkerPressureSensitive->get ().toBool (); - mUseHighResTabletEvent = UBSettings::settings ()->boardUseHighResTabletEvent->get ().toBool (); + mPenPressureSensitive = UBSettings::settings ()->boardPenPressureSensitive->get ().toBool (); + mMarkerPressureSensitive = UBSettings::settings ()->boardMarkerPressureSensitive->get ().toBool (); + mUseHighResTabletEvent = UBSettings::settings ()->boardUseHighResTabletEvent->get ().toBool (); } void UBBoardView::virtualKeyboardActivated(bool b) @@ -1661,66 +1697,64 @@ bool UBBoardView::isAbsurdPoint(QPoint point) for (int i = 0; i < desktop->numScreens (); i++) { - QRect screenRect = desktop->screenGeometry (i); - isValidPoint = isValidPoint || screenRect.contains (mapToGlobal(point)); + QRect screenRect = desktop->screenGeometry (i); + isValidPoint = isValidPoint || screenRect.contains (mapToGlobal(point)); } return !isValidPoint; } -void -UBBoardView::focusOutEvent (QFocusEvent * event) +void UBBoardView::focusOutEvent (QFocusEvent * event) { - Q_UNUSED (event); + Q_UNUSED (event); } -void -UBBoardView::setToolCursor (int tool) +void UBBoardView::setToolCursor (int tool) { - QWidget *controlViewport = viewport (); - switch (tool) + QWidget *controlViewport = viewport (); + switch (tool) { case UBStylusTool::Pen: - controlViewport->setCursor (UBResources::resources ()->penCursor); - break; + controlViewport->setCursor (UBResources::resources ()->penCursor); + break; case UBStylusTool::Eraser: - controlViewport->setCursor (UBResources::resources ()->eraserCursor); - scene()->hideEraser(); - break; + controlViewport->setCursor (UBResources::resources ()->eraserCursor); + scene()->hideEraser(); + break; case UBStylusTool::Marker: - controlViewport->setCursor (UBResources::resources ()->markerCursor); - break; + controlViewport->setCursor (UBResources::resources ()->markerCursor); + break; case UBStylusTool::Pointer: - controlViewport->setCursor (UBResources::resources ()->pointerCursor); - break; + controlViewport->setCursor (UBResources::resources ()->pointerCursor); + break; case UBStylusTool::Hand: - controlViewport->setCursor (UBResources::resources ()->handCursor); - break; + controlViewport->setCursor (UBResources::resources ()->handCursor); + break; case UBStylusTool::ZoomIn: - controlViewport->setCursor (UBResources::resources ()->zoomInCursor); - break; + controlViewport->setCursor (UBResources::resources ()->zoomInCursor); + break; case UBStylusTool::ZoomOut: - controlViewport->setCursor (UBResources::resources ()->zoomOutCursor); - break; + controlViewport->setCursor (UBResources::resources ()->zoomOutCursor); + break; case UBStylusTool::Selector: - controlViewport->setCursor (UBResources::resources ()->arrowCursor); - break; + controlViewport->setCursor (UBResources::resources ()->arrowCursor); + break; case UBStylusTool::Play: - controlViewport->setCursor (UBResources::resources ()->playCursor); - break; + controlViewport->setCursor (UBResources::resources ()->playCursor); + break; case UBStylusTool::Line: - controlViewport->setCursor (UBResources::resources ()->penCursor); - break; + controlViewport->setCursor (UBResources::resources ()->penCursor); + break; case UBStylusTool::Text: - controlViewport->setCursor (UBResources::resources ()->textCursor); - break; + controlViewport->setCursor (UBResources::resources ()->textCursor); + break; case UBStylusTool::Capture: - controlViewport->setCursor (UBResources::resources ()->penCursor); - break; + controlViewport->setCursor (UBResources::resources ()->penCursor); + break; default: - Q_ASSERT (false); - //failsafe - controlViewport->setCursor (UBResources::resources ()->penCursor); + Q_ASSERT (false); + //failsafe + controlViewport->setCursor (UBResources::resources ()->penCursor); } } diff --git a/src/board/UBBoardView.h b/src/board/UBBoardView.h index 6a800e36..ab020b6f 100644 --- a/src/board/UBBoardView.h +++ b/src/board/UBBoardView.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é. * @@ -38,150 +38,145 @@ 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); - virtual ~UBBoardView(); + 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); + virtual ~UBBoardView(); - UBGraphicsScene* scene(); + UBGraphicsScene* scene(); - void forcedTabletRelease(); + void forcedTabletRelease(); - void setToolCursor(int tool); + void setToolCursor(int tool); - void rubberItems(); - void moveRubberedItems(QPointF movingVector); + void rubberItems(); + void moveRubberedItems(QPointF movingVector); - void setMultiselection(bool enable); - bool isMultipleSelectionEnabled() { return mMultipleSelectionIsEnabled; } -// work around for handling tablet events on MAC OS with Qt 4.8.0 and above + void setMultiselection(bool enable); + bool isMultipleSelectionEnabled() { return mMultipleSelectionIsEnabled; } + // 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); + bool directTabletEvent(QEvent *event); + QWidget *widgetForTabletEvent(QWidget *w, const QPoint &pos); #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 isUBItem(QGraphicsItem *item); // we should to determine items who is not UB and use general scene behavior for them. - bool isCppTool(QGraphicsItem *item); - void handleItemsSelection(QGraphicsItem *item); - bool itemShouldReceiveMousePressEvent(QGraphicsItem *item); - bool itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item); - bool itemHaveParentWithType(QGraphicsItem *item, int type); - bool itemShouldBeMoved(QGraphicsItem *item); - QGraphicsItem* determineItemToPress(QGraphicsItem *item); - QGraphicsItem* determineItemToMove(QGraphicsItem *item); - void handleItemMousePress(QMouseEvent *event); - void handleItemMouseMove(QMouseEvent *event); + 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 isCppTool(QGraphicsItem *item); + void handleItemsSelection(QGraphicsItem *item); + bool itemShouldReceiveMousePressEvent(QGraphicsItem *item); + bool itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item); + bool itemHaveParentWithType(QGraphicsItem *item, int type); + bool itemShouldBeMoved(QGraphicsItem *item); + QGraphicsItem* determineItemToPress(QGraphicsItem *item); + QGraphicsItem* determineItemToMove(QGraphicsItem *item); + void handleItemMousePress(QMouseEvent *event); + void handleItemMouseMove(QMouseEvent *event); - virtual bool event (QEvent * e); + virtual bool event (QEvent * e); - virtual void keyPressEvent(QKeyEvent *event); - virtual void keyReleaseEvent(QKeyEvent *event); - virtual void tabletEvent(QTabletEvent * event); - virtual void mouseDoubleClickEvent(QMouseEvent *event); - virtual void mousePressEvent(QMouseEvent *event); - virtual void mouseMoveEvent(QMouseEvent *event); - virtual void mouseReleaseEvent(QMouseEvent *event); - virtual void wheelEvent(QWheelEvent *event); - virtual void leaveEvent ( QEvent * event); + virtual void keyPressEvent(QKeyEvent *event); + virtual void keyReleaseEvent(QKeyEvent *event); + virtual void tabletEvent(QTabletEvent * event); + virtual void mouseDoubleClickEvent(QMouseEvent *event); + virtual void mousePressEvent(QMouseEvent *event); + virtual void mouseMoveEvent(QMouseEvent *event); + virtual void mouseReleaseEvent(QMouseEvent *event); + virtual void wheelEvent(QWheelEvent *event); + virtual void leaveEvent ( QEvent * event); - virtual void focusOutEvent ( QFocusEvent * event ); + virtual void focusOutEvent ( QFocusEvent * event ); - virtual void drawItems(QPainter *painter, int numItems, - QGraphicsItem *items[], - const QStyleOptionGraphicsItem options[]); + virtual void drawItems(QPainter *painter, int numItems, + QGraphicsItem *items[], + const QStyleOptionGraphicsItem options[]); -// virtual void dragEnterEvent(QDragEnterEvent * event); - virtual void dropEvent(QDropEvent *event); - virtual void dragMoveEvent(QDragMoveEvent *event); + virtual void dropEvent(QDropEvent *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); - virtual void hideEvent(QHideEvent * event); +private: - 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) - { - bool ok; - int itemLayerType = item->data(UBGraphicsItemData::ItemLayerType).toInt(&ok); - return (ok && (itemLayerType >= mStartLayer && itemLayerType <= mEndLayer)); - } + QList processMimeData(const QMimeData* pMimeData); - QList processMimeData(const QMimeData* pMimeData); + UBBoardController* mController; - UBBoardController* mController; + int mStartLayer, mEndLayer; + bool mFilterZIndex; - int mStartLayer, mEndLayer; - bool mFilterZIndex; + bool mTabletStylusIsPressed; + bool mUsingTabletEraser; - bool mTabletStylusIsPressed; - bool mUsingTabletEraser; + bool mPendingStylusReleaseEvent; - bool mPendingStylusReleaseEvent; + bool mMouseButtonIsPressed; + QPointF mPreviousPoint; + QPoint mMouseDownPos; - bool mMouseButtonIsPressed; - QPointF mPreviousPoint; - QPoint mMouseDownPos; + bool mPenPressureSensitive; + bool mMarkerPressureSensitive; + bool mUseHighResTabletEvent; - bool mPenPressureSensitive; - bool mMarkerPressureSensitive; - bool mUseHighResTabletEvent; + QRubberBand *mRubberBand; + bool mIsCreatingTextZone; + bool mIsCreatingSceneGrabZone; - QRubberBand *mRubberBand; - bool mIsCreatingTextZone; - bool mIsCreatingSceneGrabZone; + bool isAbsurdPoint(QPoint point); - bool isAbsurdPoint(QPoint point); + bool mVirtualKeyboardActive; + bool mOkOnWidget; - bool mVirtualKeyboardActive; - bool mOkOnWidget; + bool mWidgetMoved; + QPointF mLastPressedMousePos; + QGraphicsItem *movingItem; + QMouseEvent *suspendedMousePressEvent; - bool mWidgetMoved; - QPointF mLastPressedMousePos; - QGraphicsItem *movingItem; - QMouseEvent *suspendedMousePressEvent; + bool moveRubberBand; + UBRubberBand *mUBRubberBand; - bool moveRubberBand; - UBRubberBand *mUBRubberBand; + QList mRubberedItems; + QSet mJustSelectedItems; - QList mRubberedItems; - QSet mJustSelectedItems; + int mLongPressInterval; + QTimer mLongPressTimer; - int mLongPressInterval; - QTimer mLongPressTimer; + bool mIsDragInProgress; + bool mMultipleSelectionIsEnabled; + bool bIsControl; + bool bIsDesktop; + bool mRubberBandInPlayMode; - bool mIsDragInProgress; - bool mMultipleSelectionIsEnabled; - bool bIsControl; - bool bIsDesktop; - bool mRubberBandInPlayMode; + static bool hasSelectedParents(QGraphicsItem * item); - 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(); }; diff --git a/src/board/UBDrawingController.cpp b/src/board/UBDrawingController.cpp index ec8af0d9..667d044f 100644 --- a/src/board/UBDrawingController.cpp +++ b/src/board/UBDrawingController.cpp @@ -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(); - } } diff --git a/src/board/UBDrawingController.h b/src/board/UBDrawingController.h index 1e6a8af3..d3f5586f 100644 --- a/src/board/UBDrawingController.h +++ b/src/board/UBDrawingController.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é. * diff --git a/src/board/UBFeaturesController.cpp b/src/board/UBFeaturesController.cpp index d34228e6..edb0bd60 100644 --- a/src/board/UBFeaturesController.cpp +++ b/src/board/UBFeaturesController.cpp @@ -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" diff --git a/src/board/UBFeaturesController.h b/src/board/UBFeaturesController.h index 667fd83f..f2b0f774 100644 --- a/src/board/UBFeaturesController.h +++ b/src/board/UBFeaturesController.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é. * diff --git a/src/core/UB.h b/src/core/UB.h index ec6bb00a..5661abc1 100644 --- a/src/core/UB.h +++ b/src/core/UB.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é. * @@ -50,17 +50,17 @@ struct UBStylusTool { enum Enum { - Pen = 0, - Eraser, - Marker, - Selector, + Pen = 0, + Eraser, + Marker, + Selector, Play, - Hand, - ZoomIn, - ZoomOut, - Pointer, - Line, - Text, + Hand, + ZoomIn, + ZoomOut, + Pointer, + Line, + Text, Capture }; }; @@ -138,17 +138,17 @@ struct UBGraphicsItemType { enum Enum { - PolygonItemType = QGraphicsItem::UserType + 1, + PolygonItemType = QGraphicsItem::UserType + 1, PixmapItemType, - SvgItemType, + SvgItemType, DelegateButtonType, - MediaItemType, - PDFItemType, + MediaItemType, + PDFItemType, TextItemType, CurtainItemType, - RulerItemType, - CompassItemType, - ProtractorItemType, + RulerItemType, + CompassItemType, + ProtractorItemType, StrokeItemType, TriangleItemType, MagnifierItemType, diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index 7936148a..95abad24 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -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, diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h index 618538b0..6f76c1db 100644 --- a/src/core/UBApplication.h +++ b/src/core/UBApplication.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é. * diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index 3922a385..49b2f698 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -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é. * @@ -68,9 +68,9 @@ #include "core/memcheck.h" -UBApplicationController::UBApplicationController(UBBoardView *pControlView, +UBApplicationController::UBApplicationController(UBBoardView *pControlView, UBBoardView *pDisplayView, - UBMainWindow* pMainWindow, + UBMainWindow* pMainWindow, QObject* parent, UBRightPalette* rightPalette) : QObject(parent) @@ -371,7 +371,7 @@ void UBApplicationController::showBoard() UBPlatformUtils::setDesktopMode(false); mUninoteController->hideWindow(); - + mMainWindow->show(); 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() { - 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; diff --git a/src/core/UBApplicationController.h b/src/core/UBApplicationController.h index 77f6433f..b94655d6 100644 --- a/src/core/UBApplicationController.h +++ b/src/core/UBApplicationController.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é. * @@ -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(); diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index 51577ae3..f1d3a865 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -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 . */ + #include "UBDisplayManager.h" #include "frameworks/UBPlatformUtils.h" diff --git a/src/core/UBDisplayManager.h b/src/core/UBDisplayManager.h index 2ce27459..9f5283a9 100644 --- a/src/core/UBDisplayManager.h +++ b/src/core/UBDisplayManager.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é. * diff --git a/src/core/UBDocumentManager.cpp b/src/core/UBDocumentManager.cpp index b7566eed..bfaa2368 100644 --- a/src/core/UBDocumentManager.cpp +++ b/src/core/UBDocumentManager.cpp @@ -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é. * diff --git a/src/core/UBDocumentManager.h b/src/core/UBDocumentManager.h index 99e1fb23..d20baae0 100644 --- a/src/core/UBDocumentManager.h +++ b/src/core/UBDocumentManager.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é. * diff --git a/src/core/UBDownloadManager.cpp b/src/core/UBDownloadManager.cpp index cb3f8735..d631917e 100644 --- a/src/core/UBDownloadManager.cpp +++ b/src/core/UBDownloadManager.cpp @@ -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é. * diff --git a/src/core/UBDownloadManager.h b/src/core/UBDownloadManager.h index f4992ce7..77afad84 100644 --- a/src/core/UBDownloadManager.h +++ b/src/core/UBDownloadManager.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é. * diff --git a/src/core/UBDownloadThread.cpp b/src/core/UBDownloadThread.cpp index 0dabd5dd..48e158bf 100644 --- a/src/core/UBDownloadThread.cpp +++ b/src/core/UBDownloadThread.cpp @@ -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é. * diff --git a/src/core/UBDownloadThread.h b/src/core/UBDownloadThread.h index 301ace12..a9b38630 100644 --- a/src/core/UBDownloadThread.h +++ b/src/core/UBDownloadThread.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é. * diff --git a/src/core/UBIdleTimer.cpp b/src/core/UBIdleTimer.cpp index 223db330..cc214d4c 100644 --- a/src/core/UBIdleTimer.cpp +++ b/src/core/UBIdleTimer.cpp @@ -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é. * diff --git a/src/core/UBIdleTimer.h b/src/core/UBIdleTimer.h index 7916cf96..e0963f68 100644 --- a/src/core/UBIdleTimer.h +++ b/src/core/UBIdleTimer.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é. * diff --git a/src/core/UBMimeData.cpp b/src/core/UBMimeData.cpp index 3d0da1e7..42a835fc 100644 --- a/src/core/UBMimeData.cpp +++ b/src/core/UBMimeData.cpp @@ -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é. * diff --git a/src/core/UBMimeData.h b/src/core/UBMimeData.h index efb2b4f6..2e01d32f 100644 --- a/src/core/UBMimeData.h +++ b/src/core/UBMimeData.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é. * diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 156709b9..9001d17d 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -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é. * diff --git a/src/core/UBPersistenceManager.h b/src/core/UBPersistenceManager.h index 3d840ff1..a8e17bff 100644 --- a/src/core/UBPersistenceManager.h +++ b/src/core/UBPersistenceManager.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é. * diff --git a/src/core/UBPreferencesController.cpp b/src/core/UBPreferencesController.cpp index 84b4b369..b10e85cc 100644 --- a/src/core/UBPreferencesController.cpp +++ b/src/core/UBPreferencesController.cpp @@ -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é. * diff --git a/src/core/UBPreferencesController.h b/src/core/UBPreferencesController.h index 23656086..3ba0ae96 100644 --- a/src/core/UBPreferencesController.h +++ b/src/core/UBPreferencesController.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é. * diff --git a/src/core/UBSceneCache.cpp b/src/core/UBSceneCache.cpp index 67593360..bb2f2189 100644 --- a/src/core/UBSceneCache.cpp +++ b/src/core/UBSceneCache.cpp @@ -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é. * diff --git a/src/core/UBSceneCache.h b/src/core/UBSceneCache.h index 561982b7..116a0bfd 100644 --- a/src/core/UBSceneCache.h +++ b/src/core/UBSceneCache.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é. * diff --git a/src/core/UBSetting.cpp b/src/core/UBSetting.cpp index 08242dc8..23f12fee 100644 --- a/src/core/UBSetting.cpp +++ b/src/core/UBSetting.cpp @@ -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é. * diff --git a/src/core/UBSetting.h b/src/core/UBSetting.h index c8cc4054..0c545157 100644 --- a/src/core/UBSetting.h +++ b/src/core/UBSetting.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é. * diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index f563dc13..73ba20a5 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -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é. * diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 745d2970..74e89691 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.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é. * diff --git a/src/core/main.cpp b/src/core/main.cpp index 20e3402d..af7c60e1 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -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é. * diff --git a/src/core/memcheck.h b/src/core/memcheck.h index 5a4ac095..2c90405e 100644 --- a/src/core/memcheck.h +++ b/src/core/memcheck.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é. * diff --git a/src/customWidgets/UBActionableWidget.cpp b/src/customWidgets/UBActionableWidget.cpp index 8ec8043b..ba334aca 100644 --- a/src/customWidgets/UBActionableWidget.cpp +++ b/src/customWidgets/UBActionableWidget.cpp @@ -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é. * diff --git a/src/customWidgets/UBActionableWidget.h b/src/customWidgets/UBActionableWidget.h index 44f16561..cdc8e767 100644 --- a/src/customWidgets/UBActionableWidget.h +++ b/src/customWidgets/UBActionableWidget.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é. * diff --git a/src/customWidgets/UBMediaWidget.cpp b/src/customWidgets/UBMediaWidget.cpp index 221ce6a8..fc57d6ed 100644 --- a/src/customWidgets/UBMediaWidget.cpp +++ b/src/customWidgets/UBMediaWidget.cpp @@ -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é. * diff --git a/src/customWidgets/UBMediaWidget.h b/src/customWidgets/UBMediaWidget.h index ea524c67..973b9226 100644 --- a/src/customWidgets/UBMediaWidget.h +++ b/src/customWidgets/UBMediaWidget.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é. * diff --git a/src/desktop/UBCustomCaptureWindow.cpp b/src/desktop/UBCustomCaptureWindow.cpp index bb0606a5..7c5cbd2f 100644 --- a/src/desktop/UBCustomCaptureWindow.cpp +++ b/src/desktop/UBCustomCaptureWindow.cpp @@ -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é. * diff --git a/src/desktop/UBCustomCaptureWindow.h b/src/desktop/UBCustomCaptureWindow.h index a53d14d3..65703593 100644 --- a/src/desktop/UBCustomCaptureWindow.h +++ b/src/desktop/UBCustomCaptureWindow.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é. * diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 82ff1440..64e49223 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -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é. * diff --git a/src/desktop/UBDesktopAnnotationController.h b/src/desktop/UBDesktopAnnotationController.h index 02f345de..bb2c8b1d 100644 --- a/src/desktop/UBDesktopAnnotationController.h +++ b/src/desktop/UBDesktopAnnotationController.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é. * diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp index e1e68fd8..4a531322 100644 --- a/src/desktop/UBDesktopPalette.cpp +++ b/src/desktop/UBDesktopPalette.cpp @@ -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é. * diff --git a/src/desktop/UBDesktopPalette.h b/src/desktop/UBDesktopPalette.h index 321bbfc7..0d9bb593 100644 --- a/src/desktop/UBDesktopPalette.h +++ b/src/desktop/UBDesktopPalette.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é. * diff --git a/src/desktop/UBDesktopPropertyPalette.cpp b/src/desktop/UBDesktopPropertyPalette.cpp index 436f6ab9..f5d88bc8 100644 --- a/src/desktop/UBDesktopPropertyPalette.cpp +++ b/src/desktop/UBDesktopPropertyPalette.cpp @@ -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é. * diff --git a/src/desktop/UBDesktopPropertyPalette.h b/src/desktop/UBDesktopPropertyPalette.h index 9acd05f7..dc3c7963 100644 --- a/src/desktop/UBDesktopPropertyPalette.h +++ b/src/desktop/UBDesktopPropertyPalette.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é. * diff --git a/src/desktop/UBWindowCapture.h b/src/desktop/UBWindowCapture.h index 9adc3735..77375042 100644 --- a/src/desktop/UBWindowCapture.h +++ b/src/desktop/UBWindowCapture.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é. * diff --git a/src/desktop/UBWindowCaptureDelegate_win.cpp b/src/desktop/UBWindowCaptureDelegate_win.cpp index b93c193a..1b63803a 100644 --- a/src/desktop/UBWindowCaptureDelegate_win.cpp +++ b/src/desktop/UBWindowCaptureDelegate_win.cpp @@ -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é. * diff --git a/src/desktop/UBWindowCaptureDelegate_win.h b/src/desktop/UBWindowCaptureDelegate_win.h index f6b104bd..081e1e68 100644 --- a/src/desktop/UBWindowCaptureDelegate_win.h +++ b/src/desktop/UBWindowCaptureDelegate_win.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é. * diff --git a/src/desktop/UBWindowCapture_linux.cpp b/src/desktop/UBWindowCapture_linux.cpp index 3e099850..e7c22c63 100644 --- a/src/desktop/UBWindowCapture_linux.cpp +++ b/src/desktop/UBWindowCapture_linux.cpp @@ -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é. * diff --git a/src/desktop/UBWindowCapture_mac.mm b/src/desktop/UBWindowCapture_mac.mm index 62a60b40..4d0b802a 100644 --- a/src/desktop/UBWindowCapture_mac.mm +++ b/src/desktop/UBWindowCapture_mac.mm @@ -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é. * diff --git a/src/desktop/UBWindowCapture_win.cpp b/src/desktop/UBWindowCapture_win.cpp index 526b3d96..4394698a 100644 --- a/src/desktop/UBWindowCapture_win.cpp +++ b/src/desktop/UBWindowCapture_win.cpp @@ -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é. * diff --git a/src/document/UBDocumentContainer.cpp b/src/document/UBDocumentContainer.cpp index cb92fb67..b2ba4664 100644 --- a/src/document/UBDocumentContainer.cpp +++ b/src/document/UBDocumentContainer.cpp @@ -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é. * diff --git a/src/document/UBDocumentContainer.h b/src/document/UBDocumentContainer.h index d2b7b045..681fdae3 100644 --- a/src/document/UBDocumentContainer.h +++ b/src/document/UBDocumentContainer.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é. * diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index d06c11cc..d24282a4 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -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é. * @@ -1412,7 +1412,7 @@ bool UBDocumentController::isOKToOpenDocument(UBDocumentProxy* proxy) if (docVersion.isEmpty() || docVersion.startsWith("4.1") || docVersion.startsWith("4.2") || docVersion.startsWith("4.3") || docVersion.startsWith("4.4") || docVersion.startsWith("4.5") - || docVersion.startsWith("4.6")) // TODO UB 4.7 update if necessary + || docVersion.startsWith("4.6") || docVersion.startsWith("4.8")) // TODO UB 4.7 update if necessary { return true; } diff --git a/src/document/UBDocumentController.h b/src/document/UBDocumentController.h index a77c05e6..75608f41 100644 --- a/src/document/UBDocumentController.h +++ b/src/document/UBDocumentController.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é. * diff --git a/src/document/UBDocumentProxy.cpp b/src/document/UBDocumentProxy.cpp index 707cc1e5..82145959 100644 --- a/src/document/UBDocumentProxy.cpp +++ b/src/document/UBDocumentProxy.cpp @@ -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é. * @@ -188,8 +188,6 @@ void UBDocumentProxy::setDefaultDocumentSize(QSize pSize) if (defaultDocumentSize() != pSize) { setMetaData(UBSettings::documentSize, QVariant(pSize)); - emit defaultDocumentSizeChanged(); - mIsModified = true; } } diff --git a/src/document/UBDocumentProxy.h b/src/document/UBDocumentProxy.h index dd55fdb4..e575375a 100644 --- a/src/document/UBDocumentProxy.h +++ b/src/document/UBDocumentProxy.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é. * @@ -76,9 +76,6 @@ class UBDocumentProxy : public QObject int incPageCount(); int decPageCount(); - signals: - void defaultDocumentSizeChanged(); - private: void init(); diff --git a/src/domain/UBAbstractUndoCommand.cpp b/src/domain/UBAbstractUndoCommand.cpp index f1ecd8aa..54083211 100644 --- a/src/domain/UBAbstractUndoCommand.cpp +++ b/src/domain/UBAbstractUndoCommand.cpp @@ -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é. * diff --git a/src/domain/UBAbstractUndoCommand.h b/src/domain/UBAbstractUndoCommand.h index 95133cf4..15c25ae3 100644 --- a/src/domain/UBAbstractUndoCommand.h +++ b/src/domain/UBAbstractUndoCommand.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é. * diff --git a/src/domain/UBDocumentUndoCommand.cpp b/src/domain/UBDocumentUndoCommand.cpp index 75376836..880afcd6 100644 --- a/src/domain/UBDocumentUndoCommand.cpp +++ b/src/domain/UBDocumentUndoCommand.cpp @@ -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é. * diff --git a/src/domain/UBDocumentUndoCommand.h b/src/domain/UBDocumentUndoCommand.h index a393d015..a839b153 100644 --- a/src/domain/UBDocumentUndoCommand.h +++ b/src/domain/UBDocumentUndoCommand.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é. * diff --git a/src/domain/UBGraphicsAudioItem.h b/src/domain/UBGraphicsAudioItem.h deleted file mode 100644 index fc7ee6ba..00000000 --- a/src/domain/UBGraphicsAudioItem.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - diff --git a/src/domain/UBGraphicsDelegateFrame.cpp b/src/domain/UBGraphicsDelegateFrame.cpp index 8cb4b7bd..410d7c3b 100644 --- a/src/domain/UBGraphicsDelegateFrame.cpp +++ b/src/domain/UBGraphicsDelegateFrame.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsDelegateFrame.h b/src/domain/UBGraphicsDelegateFrame.h index 27b17ace..296846aa 100644 --- a/src/domain/UBGraphicsDelegateFrame.h +++ b/src/domain/UBGraphicsDelegateFrame.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é. * diff --git a/src/domain/UBGraphicsGroupContainerItem.cpp b/src/domain/UBGraphicsGroupContainerItem.cpp index 9d72432a..8d55177c 100644 --- a/src/domain/UBGraphicsGroupContainerItem.cpp +++ b/src/domain/UBGraphicsGroupContainerItem.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsGroupContainerItem.h b/src/domain/UBGraphicsGroupContainerItem.h index ef92b253..0912b85d 100644 --- a/src/domain/UBGraphicsGroupContainerItem.h +++ b/src/domain/UBGraphicsGroupContainerItem.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é. * diff --git a/src/domain/UBGraphicsGroupContainerItemDelegate.cpp b/src/domain/UBGraphicsGroupContainerItemDelegate.cpp index 4f533b9b..b0922814 100644 --- a/src/domain/UBGraphicsGroupContainerItemDelegate.cpp +++ b/src/domain/UBGraphicsGroupContainerItemDelegate.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsGroupContainerItemDelegate.h b/src/domain/UBGraphicsGroupContainerItemDelegate.h index 00523236..2494ee8d 100644 --- a/src/domain/UBGraphicsGroupContainerItemDelegate.h +++ b/src/domain/UBGraphicsGroupContainerItemDelegate.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é. * diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 9d4c22ca..7a5e5c59 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -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é. * @@ -768,7 +768,7 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated) mDelegated->scene()->addItem(mDeleteButton); } - if (showUpdated /*&& mFrame->isResizing()*/) + if (showUpdated) mDeleteButton->show(); int i = 1, j = 0, k = 0; @@ -860,25 +860,29 @@ MediaTimer::MediaTimer(QGraphicsItem * parent): QGraphicsRectItem(parent) { val = 0; smallPoint = false; - setNumDigits(4); + setNumDigits(6); } MediaTimer::~MediaTimer() {} +void MediaTimer::positionHandles() +{ + digitSpace = smallPoint ? 2 : 1; + ySegLen = rect().height()*5/12; + xSegLen = ySegLen*2/3; + segLen = xSegLen; + xAdvance = segLen*(5 + digitSpace)/5; + xOffset = (rect().width() - ndigits*xAdvance + segLen/5)/2; + yOffset = rect().height() - ySegLen*2; + + setRect(rect().x(), rect().y(), xOffset + xAdvance*ndigits, rect().height()); +} void MediaTimer::drawString(const QString &s, QPainter &p, QBitArray *newPoints, bool newString) { QPoint pos; - int digitSpace = smallPoint ? 2 : 1; - int xSegLen = (rect().width()/1)*5/(ndigits*(5 + digitSpace) + digitSpace); - int ySegLen = rect().height()*5/12; - int segLen = ySegLen > xSegLen ? xSegLen : ySegLen; - int xAdvance = segLen*(5 + digitSpace)/5; - int xOffset = rect().x() + (rect().width()/1 - ndigits*xAdvance + segLen/5)/2; - int yOffset = (rect().height() - segLen*2)/2; - for (int i=0; ifont(); - f.setPointSizeF(f.pointSizeF()); - p->setFont(f); - if (smallPoint) drawString(digitStr, *p, &points, false); else @@ -1212,7 +1212,7 @@ void MediaTimer::setNumDigits(int numDigits) numDigits = 0; } if (digitStr.isNull()) { // from constructor - ndigits = numDigits; + ndigits = numDigits + numDigits/2 - 1; digitStr.fill(QLatin1Char(' '), ndigits); points.fill(0, ndigits); digitStr[ndigits - 1] = QLatin1Char('0'); // "0" is the default number @@ -1242,6 +1242,7 @@ void MediaTimer::setNumDigits(int numDigits) ndigits = numDigits; update(); } + positionHandles(); } DelegateMediaControl::DelegateMediaControl(UBGraphicsMediaItem* pDelegated, QGraphicsItem * parent) @@ -1272,13 +1273,6 @@ void DelegateMediaControl::paint(QPainter *painter, QPainterPath path; - mLCDTimerArea.setHeight(rect().height()); - mLCDTimerArea.setWidth(rect().height()); - - mSeecArea.setWidth(rect().width()-mLCDTimerArea.width()-2); - mSeecArea.setHeight(rect().height()-2*mSeecAreaBorderHeight); - mSeecArea.setY(mSeecAreaBorderHeight); - path.addRoundedRect(mSeecArea, mSeecArea.height()/2, mSeecArea.height()/2); painter->fillPath(path, brush()); @@ -1308,28 +1302,55 @@ QPainterPath DelegateMediaControl::shape() const void DelegateMediaControl::positionHandles() { - mLCDTimerArea.setWidth(parentItem()->boundingRect().height()); + QRectF selfRect = rect(); + selfRect.setHeight(parentItem()->boundingRect().height()); + setRect(selfRect); + + QTime tTotal; + tTotal = tTotal.addMSecs(mTotalTimeInMs); mLCDTimerArea.setHeight(parentItem()->boundingRect().height()); + int digitsCount = 2; + int timerWidth = mLCDTimerArea.height(); + + mDisplayFormat = "ss"; + + if (tTotal.minute() > 0) + { + mDisplayFormat = "mm:" + mDisplayFormat; + digitsCount += 3; + timerWidth += mLCDTimerArea.height()*0.5; + } + + if (tTotal.hour() > 0) + { + mDisplayFormat = "hh:" + mDisplayFormat; + digitsCount += 3; + timerWidth += mLCDTimerArea.height(); + } + + lcdTimer->setNumDigits(digitsCount); + + mLCDTimerArea.setWidth(timerWidth); lcdTimer->setRect(mLCDTimerArea); - lcdTimer->setPos(mSeecArea.width()-mLCDTimerArea.width(),0); + // not the best solution, but it works. + lcdTimer->positionHandles(); + mLCDTimerArea = lcdTimer->rect(); + // ------------------------------------- + + lcdTimer->setPos(rect().width() - mLCDTimerArea.width(), 0); mSeecAreaBorderHeight = rect().height()/20; mSeecArea.setWidth(rect().width()-mLCDTimerArea.width()-2); mSeecArea.setHeight(rect().height()-2*mSeecAreaBorderHeight); mSeecArea.setY(mSeecAreaBorderHeight); - - QRectF selfRect = rect(); - selfRect.setHeight(parentItem()->boundingRect().height()); - setRect(selfRect); - - lcdTimer->setPos(rect().width() - mLCDTimerArea.width(), 0); } void DelegateMediaControl::update() { - QTime t; - t = t.addMSecs(mCurrentTimeInMs < 0 ? 0 : mCurrentTimeInMs); - lcdTimer->display(t.toString("m:ss")); + QTime tCurrent; + tCurrent = tCurrent.addMSecs(mCurrentTimeInMs < 0 ? 0 : mCurrentTimeInMs); + + lcdTimer->display(tCurrent.toString(mDisplayFormat)); QGraphicsRectItem::update(); } @@ -1343,8 +1364,12 @@ void DelegateMediaControl::updateTicker(qint64 time ) void DelegateMediaControl::totalTimeChanged(qint64 newTotalTime) { - mTotalTimeInMs = newTotalTime; - update(); + if (mTotalTimeInMs != newTotalTime) + { + mTotalTimeInMs = newTotalTime; + positionHandles(); + update(); + } } @@ -1381,7 +1406,7 @@ void DelegateMediaControl::seekToMousePos(QPointF mousePos) qreal frameWidth = rect().height() / 2; minX = frameWidth; - length = mSeecArea.width() - lcdTimer->rect().width(); + length = mSeecArea.width() - mSeecArea.height(); qreal mouseX = mousePos.x(); if (mouseX >= (mSeecArea.width() - mSeecArea.height()/2)) diff --git a/src/domain/UBGraphicsItemDelegate.h b/src/domain/UBGraphicsItemDelegate.h index 87e73948..0b74a4c0 100644 --- a/src/domain/UBGraphicsItemDelegate.h +++ b/src/domain/UBGraphicsItemDelegate.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é. * @@ -113,10 +113,12 @@ public: MediaTimer(QGraphicsItem * parent = 0); ~MediaTimer(); + void positionHandles(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); void display(const QString &str); + void setNumDigits(int nDigits); private: @@ -126,7 +128,6 @@ private: void drawSegment(const QPoint &, char, QPainter &, int, bool = false); void addPoint(QPolygon&, const QPoint&); void internalSetString(const QString& s); - void setNumDigits(int nDigits); static char segments [][8]; @@ -137,6 +138,14 @@ private: uint shadow : 1; uint smallPoint : 1; + + int digitSpace; + int xSegLen; + int ySegLen; + int segLen; + int xAdvance; + int xOffset; + int yOffset; }; class DelegateMediaControl: public QObject, public QGraphicsRectItem @@ -187,6 +196,8 @@ class DelegateMediaControl: public QObject, public QGraphicsRectItem QRectF mLCDTimerArea; MediaTimer *lcdTimer; + + QString mDisplayFormat; }; class UBGraphicsToolBarItem : public QGraphicsRectItem, public QObject @@ -354,6 +365,8 @@ private: bool mToolBarUsed; bool mShowGoContentButton; + + bool mMoved; }; diff --git a/src/domain/UBGraphicsItemGroupUndoCommand.cpp b/src/domain/UBGraphicsItemGroupUndoCommand.cpp index d640359b..25a3ebed 100644 --- a/src/domain/UBGraphicsItemGroupUndoCommand.cpp +++ b/src/domain/UBGraphicsItemGroupUndoCommand.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsItemGroupUndoCommand.h b/src/domain/UBGraphicsItemGroupUndoCommand.h index 0f7ff1e5..981ebb33 100644 --- a/src/domain/UBGraphicsItemGroupUndoCommand.h +++ b/src/domain/UBGraphicsItemGroupUndoCommand.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é. * diff --git a/src/domain/UBGraphicsItemTransformUndoCommand.cpp b/src/domain/UBGraphicsItemTransformUndoCommand.cpp index dd6a5fed..316eb703 100644 --- a/src/domain/UBGraphicsItemTransformUndoCommand.cpp +++ b/src/domain/UBGraphicsItemTransformUndoCommand.cpp @@ -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é. * @@ -58,7 +58,6 @@ void UBGraphicsItemTransformUndoCommand::undo() mItem->setPos(mPreviousPosition); mItem->setTransform(mPreviousTransform); mItem->setZValue(mPreviousZValue); -// UBGraphicsItem::assignZValue(mItem, mPreviousZValue); UBResizableGraphicsItem* resizableItem = dynamic_cast(mItem); @@ -72,8 +71,6 @@ void UBGraphicsItemTransformUndoCommand::redo() mItem->setTransform(mCurrentTransform); mItem->setZValue(mCurrentZValue); -// UBGraphicsItem::assignZValue(mItem, /*mCurrentZValue*/mItem->data(UBGraphicsItemData::ItemOwnZValue).toReal()); - UBResizableGraphicsItem* resizableItem = dynamic_cast(mItem); if (resizableItem) diff --git a/src/domain/UBGraphicsItemTransformUndoCommand.h b/src/domain/UBGraphicsItemTransformUndoCommand.h index ab68c90e..aa586ec2 100644 --- a/src/domain/UBGraphicsItemTransformUndoCommand.h +++ b/src/domain/UBGraphicsItemTransformUndoCommand.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é. * diff --git a/src/domain/UBGraphicsItemUndoCommand.cpp b/src/domain/UBGraphicsItemUndoCommand.cpp index 1b70b76c..1fb1bd3d 100644 --- a/src/domain/UBGraphicsItemUndoCommand.cpp +++ b/src/domain/UBGraphicsItemUndoCommand.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsItemUndoCommand.h b/src/domain/UBGraphicsItemUndoCommand.h index 72404a68..f349938f 100644 --- a/src/domain/UBGraphicsItemUndoCommand.h +++ b/src/domain/UBGraphicsItemUndoCommand.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é. * diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index 5c71fdc2..be0c7112 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -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é. * @@ -35,7 +35,6 @@ UBAudioPresentationWidget::UBAudioPresentationWidget(QWidget *parent) : QWidget(parent) , mBorderSize(10) - , mTitleSize(10) { } @@ -44,7 +43,7 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event) { QPainter painter(this); painter.fillRect(rect(), QBrush(Qt::white)); - + QPen borderPen; borderPen.setWidth(2); borderPen.setColor(QColor(Qt::black)); @@ -52,16 +51,6 @@ void UBAudioPresentationWidget::paintEvent(QPaintEvent *event) painter.setPen(borderPen); painter.drawRect(0,0, width(), height()); - if (QString() != mTitle) - { - painter.setPen(QPen(Qt::black)); - QRect titleRect = rect(); - titleRect.setX(mBorderSize); - titleRect.setY(2); - titleRect.setHeight(15); - painter.drawText(titleRect, mTitle); - } - QWidget::paintEvent(event); } @@ -85,7 +74,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte if ("" == mediaPath) mediaPath = pMediaFileUrl.toLocalFile(); - if (mediaPath.toLower().contains("videos")) + if (mediaPath.toLower().contains("videos")) { mMediaType = mediaType_Video; @@ -102,8 +91,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte haveLinkedImage = true; } - else - if (mediaPath.toLower().contains("audios")) + else if (mediaPath.toLower().contains("audios")) { mMediaType = mediaType_Audio; mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this); @@ -113,24 +101,22 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte int borderSize = 0; UBAudioPresentationWidget* pAudioWidget = dynamic_cast(mAudioWidget); if (pAudioWidget) - { borderSize = pAudioWidget->borderSize(); - } - mAudioWidget->resize(320,26+3*borderSize); + mAudioWidget->resize(320,26+2*borderSize); //3*border size with enabled title mAudioWidget->setMinimumSize(150,26+borderSize); haveLinkedImage = false; } Phonon::createPath(mMediaObject, mAudioOutput); - + mSource = Phonon::MediaSource(pMediaFileUrl); mMediaObject->setCurrentSource(mSource); // we should create delegate after media objects because delegate uses his properties at creation. setDelegate(new UBGraphicsMediaItemDelegate(this, mMediaObject)); - + // delegate should be created earler because we setWidget calls resize event for graphics proxy widgt. // resize uses delegate. if (mediaType_Video == mMediaType) @@ -167,26 +153,19 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria || (change == QGraphicsItem::ItemVisibleChange)) { if (mMediaObject && (!isEnabled() || !isVisible() || !scene())) - { mMediaObject->pause(); - } } else if (change == QGraphicsItem::ItemSceneHasChanged) { if (!scene()) - { mMediaObject->stop(); - } - else - { + else { QString absoluteMediaFilename; - if(mMediaFileUrl.toLocalFile().startsWith("audios/") || mMediaFileUrl.toLocalFile().startsWith("videos/")){ + if(mMediaFileUrl.toLocalFile().startsWith("audios/") || mMediaFileUrl.toLocalFile().startsWith("videos/")) absoluteMediaFilename = scene()->document()->persistencePath() + "/" + mMediaFileUrl.toLocalFile(); - } - else{ + else absoluteMediaFilename = mMediaFileUrl.toLocalFile(); - } if (absoluteMediaFilename.length() > 0) mMediaObject->setCurrentSource(Phonon::MediaSource(absoluteMediaFilename)); @@ -200,12 +179,6 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria void UBGraphicsMediaItem::setSourceUrl(const QUrl &pSourceUrl) { - UBAudioPresentationWidget* pAudioWidget = dynamic_cast(mAudioWidget); - if (pAudioWidget) - { - pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toString())); - } - UBItem::setSourceUrl(pSourceUrl); } @@ -320,13 +293,13 @@ void UBGraphicsMediaItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { QGraphicsItem *curItem = group->getCurrentItem(); if (curItem && this != curItem) - { - group->deselectCurrentItem(); - } + { + group->deselectCurrentItem(); + } group->setCurrentItem(this); this->setSelected(true); Delegate()->positionHandles(); - } + } } } @@ -339,7 +312,7 @@ void UBGraphicsMediaItem::mousePressEvent(QGraphicsSceneMouseEvent *event) event->accept(); } } - else + else { mShouldMove = (event->buttons() & Qt::LeftButton); mMousePressPos = event->scenePos(); diff --git a/src/domain/UBGraphicsMediaItem.h b/src/domain/UBGraphicsMediaItem.h index 63a63a7b..b512beb2 100644 --- a/src/domain/UBGraphicsMediaItem.h +++ b/src/domain/UBGraphicsMediaItem.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é. * @@ -45,7 +45,6 @@ private: virtual void paintEvent(QPaintEvent *event); int mBorderSize; - int mTitleSize; QString mTitle; }; diff --git a/src/domain/UBGraphicsMediaItemDelegate.cpp b/src/domain/UBGraphicsMediaItemDelegate.cpp index c22a3e21..4d36e134 100644 --- a/src/domain/UBGraphicsMediaItemDelegate.cpp +++ b/src/domain/UBGraphicsMediaItemDelegate.cpp @@ -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é. * @@ -60,10 +60,9 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD connect(mToolBarShowTimer, SIGNAL(timeout()), this, SLOT(hideToolBar())); mToolBarShowTimer->setInterval(m_iToolBarShowingInterval); } + if (delegated()->isMuted()) - { delegated()->setMute(true); - } //Wrapper function. Use it to set correct data() to QGraphicsItem as well setFlippable(false); @@ -97,13 +96,13 @@ void UBGraphicsMediaItemDelegate::buildButtons() mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem); mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true); UBGraphicsItem::assignZValue(mMediaControl, delegated()->zValue()); - + if (delegated()->isMuted()) mMuteButton = new DelegateButton(":/images/soundOff.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); else mMuteButton = new DelegateButton(":/images/soundOn.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); - connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute())); + connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute())); connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton; @@ -145,7 +144,7 @@ void UBGraphicsMediaItemDelegate::positionHandles() { QRectF toolBarRect = mToolBarItem->rect(); if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Video) - { + { mToolBarItem->setPos(0, delegated()->boundingRect().height()-mToolBarItem->rect().height()); toolBarRect.setWidth(delegated()->boundingRect().width()); @@ -186,15 +185,10 @@ void UBGraphicsMediaItemDelegate::positionHandles() mMediaControl->setRect(mediaItemRect); mToolBarItem->positionHandles(); - mMediaControl->positionHandles(); + mMediaControl->positionHandles(); - if (mediaItem) - { - if (mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio) - { - mToolBarItem->show(); - } - } + if (mediaItem && mediaItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio) + mToolBarItem->show(); } void UBGraphicsMediaItemDelegate::remove(bool canUndo) @@ -255,6 +249,11 @@ void UBGraphicsMediaItemDelegate::mediaStateChanged ( Phonon::State newstate, Ph { Q_UNUSED(newstate); Q_UNUSED(oldstate); + + if (oldstate == Phonon::LoadingState) + { + mMediaControl->totalTimeChanged(delegated()->mediaObject()->totalTime()); + } updatePlayPauseState(); } diff --git a/src/domain/UBGraphicsMediaItemDelegate.h b/src/domain/UBGraphicsMediaItemDelegate.h index ad04e168..9ac65c93 100644 --- a/src/domain/UBGraphicsMediaItemDelegate.h +++ b/src/domain/UBGraphicsMediaItemDelegate.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é. * diff --git a/src/domain/UBGraphicsPDFItem.cpp b/src/domain/UBGraphicsPDFItem.cpp index 09379e98..0acc8abe 100644 --- a/src/domain/UBGraphicsPDFItem.cpp +++ b/src/domain/UBGraphicsPDFItem.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsPDFItem.h b/src/domain/UBGraphicsPDFItem.h index 0a49bf29..9a1a42da 100644 --- a/src/domain/UBGraphicsPDFItem.h +++ b/src/domain/UBGraphicsPDFItem.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é. * diff --git a/src/domain/UBGraphicsPixmapItem.cpp b/src/domain/UBGraphicsPixmapItem.cpp index e46149a5..69e28e7e 100644 --- a/src/domain/UBGraphicsPixmapItem.cpp +++ b/src/domain/UBGraphicsPixmapItem.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsPixmapItem.h b/src/domain/UBGraphicsPixmapItem.h index 1c66bebb..3ef6b846 100644 --- a/src/domain/UBGraphicsPixmapItem.h +++ b/src/domain/UBGraphicsPixmapItem.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é. * diff --git a/src/domain/UBGraphicsPolygonItem.cpp b/src/domain/UBGraphicsPolygonItem.cpp index b210786f..52b09954 100644 --- a/src/domain/UBGraphicsPolygonItem.cpp +++ b/src/domain/UBGraphicsPolygonItem.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsPolygonItem.h b/src/domain/UBGraphicsPolygonItem.h index 4134088c..b752bff0 100644 --- a/src/domain/UBGraphicsPolygonItem.h +++ b/src/domain/UBGraphicsPolygonItem.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é. * diff --git a/src/domain/UBGraphicsProxyWidget.cpp b/src/domain/UBGraphicsProxyWidget.cpp index 4bc4e331..250304ea 100644 --- a/src/domain/UBGraphicsProxyWidget.cpp +++ b/src/domain/UBGraphicsProxyWidget.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsProxyWidget.h b/src/domain/UBGraphicsProxyWidget.h index af43ac7b..37c13d94 100644 --- a/src/domain/UBGraphicsProxyWidget.h +++ b/src/domain/UBGraphicsProxyWidget.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é. * diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 6690e23b..82009210 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -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é. * @@ -74,6 +74,9 @@ #include "core/memcheck.h" + +#define DEFAULT_Z_VALUE 0.0 + qreal UBZLayerController::errorNumber = -20000001.0; UBZLayerController::UBZLayerController(QGraphicsScene *scene) : @@ -81,17 +84,18 @@ UBZLayerController::UBZLayerController(QGraphicsScene *scene) : { scopeMap.insert(itemLayerType::NoLayer, ItemLayerTypeData( errorNumber, errorNumber)); - scopeMap.insert(itemLayerType::BackgroundItem, ItemLayerTypeData(-10000000.0, -10000000.0 )); - scopeMap.insert(itemLayerType::ObjectItem, ItemLayerTypeData(-10000000.0, 0.0 )); - scopeMap.insert(itemLayerType::DrawingItem, ItemLayerTypeData( 0.0, 10000000.0 )); - scopeMap.insert(itemLayerType::ToolItem, ItemLayerTypeData( 10000000.0, 10000100.0 )); - scopeMap.insert(itemLayerType::CppTool, ItemLayerTypeData( 10000100.0, 10000200.0 )); - scopeMap.insert(itemLayerType::Curtain, ItemLayerTypeData( 10000200.0, 10001000.0 )); - scopeMap.insert(itemLayerType::Eraiser, ItemLayerTypeData( 10001000.0, 10001100.0 )); - scopeMap.insert(itemLayerType::Pointer, ItemLayerTypeData( 10001100.0, 10001200.0 )); - scopeMap.insert(itemLayerType::Cache, ItemLayerTypeData( 10001300.0, 10001400.0 )); + scopeMap.insert(itemLayerType::BackgroundItem, ItemLayerTypeData(-1000000.0, -1000000.0 )); + // DEFAULT_Z_VALUE isn't used because it allows to easily identify new objects + scopeMap.insert(itemLayerType::ObjectItem, ItemLayerTypeData(-1000000.0, DEFAULT_Z_VALUE - 1.0)); + scopeMap.insert(itemLayerType::DrawingItem, ItemLayerTypeData( DEFAULT_Z_VALUE + 1.0, 1000000.0 )); + scopeMap.insert(itemLayerType::ToolItem, ItemLayerTypeData( 1000000.0, 1000100.0 )); + scopeMap.insert(itemLayerType::CppTool, ItemLayerTypeData( 1000100.0, 1000200.0 )); + scopeMap.insert(itemLayerType::Curtain, ItemLayerTypeData( 1000200.0, 1001000.0 )); + scopeMap.insert(itemLayerType::Eraiser, ItemLayerTypeData( 1001000.0, 1001100.0 )); + scopeMap.insert(itemLayerType::Pointer, ItemLayerTypeData( 1001100.0, 1001200.0 )); + scopeMap.insert(itemLayerType::Cache, ItemLayerTypeData( 1001300.0, 1001400.0 )); - scopeMap.insert(itemLayerType::SelectedItem, ItemLayerTypeData( 10001000.0, 10001000.0 )); + scopeMap.insert(itemLayerType::SelectedItem, ItemLayerTypeData( 1001000.0, 1001000.0 )); } qreal UBZLayerController::generateZLevel(itemLayerType::Enum key) @@ -340,8 +344,8 @@ void UBGraphicsScene::updateGroupButtonState() { UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool(); - if (UBStylusTool::Selector != currentTool) - UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); + if (UBStylusTool::Selector != currentTool && UBStylusTool::Play != currentTool) + return; QAction *groupAction = UBApplication::mainWindow->actionGroupItems; QList selItems = selectedItems(); @@ -369,19 +373,16 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre { bool accepted = false; - if (mInputDeviceIsPressed) - { + if (mInputDeviceIsPressed) { qWarning() << "scene received input device pressed, without input device release, muting event as input device move"; accepted = inputDeviceMove(scenePos, pressure); } - else - { + else { mInputDeviceIsPressed = true; UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool(); - if (UBDrawingController::drawingController()->isDrawingTool()) - { + if (UBDrawingController::drawingController()->isDrawingTool()) { // ----------------------------------------------------------------- // We fall here if we are using the Pen, the Marker or the Line tool // ----------------------------------------------------------------- @@ -401,7 +402,8 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre if (currentTool != UBStylusTool::Line){ // Handle the pressure width = UBDrawingController::drawingController()->currentToolWidth() * pressure; - }else{ + } + else{ // Ignore pressure for the line tool width = UBDrawingController::drawingController()->currentToolWidth(); } @@ -413,18 +415,14 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre mRemovedItems.clear(); if (UBDrawingController::drawingController()->mActiveRuler) - { UBDrawingController::drawingController()->mActiveRuler->StartLine(scenePos, width); - } - else - { + else { moveTo(scenePos); drawLineTo(scenePos, width, UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Line); } accepted = true; } - else if (currentTool == UBStylusTool::Eraser) - { + else if (currentTool == UBStylusTool::Eraser) { mAddedItems.clear(); mRemovedItems.clear(); moveTo(scenePos); @@ -438,8 +436,7 @@ bool UBGraphicsScene::inputDevicePress(const QPointF& scenePos, const qreal& pre accepted = true; } - else if (currentTool == UBStylusTool::Pointer) - { + else if (currentTool == UBStylusTool::Pointer) { drawPointer(scenePos, true); accepted = true; } @@ -512,13 +509,14 @@ bool UBGraphicsScene::inputDeviceMove(const QPointF& scenePos, const qreal& pres mPreviousPoint.x() + radiusLength * cos((angle * PI) / 180), mPreviousPoint.y() - radiusLength * sin((angle * PI) / 180)); QLineF chord(position, newPosition); - if (chord.length() < qMin((int)16, (int)(radiusLength / 20))) + if (chord.length() < qMin((int)16, (int)(radiusLength / 20))) position = newPosition; } if(dc->mActiveRuler){ dc->mActiveRuler->DrawLine(position, width); - }else{ + } + else{ drawLineTo(position, width, UBDrawingController::drawingController()->stylusTool() == UBStylusTool::Line); } } @@ -557,46 +555,47 @@ bool UBGraphicsScene::inputDeviceRelease() { if(mArcPolygonItem){ - UBGraphicsStrokesGroup* pStrokes = new UBGraphicsStrokesGroup(); + UBGraphicsStrokesGroup* pStrokes = new UBGraphicsStrokesGroup(); - // Add the arc - mAddedItems.remove(mArcPolygonItem); - removeItem(mArcPolygonItem); - UBCoreGraphicsScene::removeItemFromDeletion(mArcPolygonItem); + // Add the arc + mAddedItems.remove(mArcPolygonItem); + removeItem(mArcPolygonItem); + UBCoreGraphicsScene::removeItemFromDeletion(mArcPolygonItem); + mArcPolygonItem->setStrokesGroup(pStrokes); + pStrokes->addToGroup(mArcPolygonItem); + + // Add the center cross + foreach(QGraphicsItem* item, mAddedItems){ + mAddedItems.remove(item); + removeItem(item); + UBCoreGraphicsScene::removeItemFromDeletion(item); mArcPolygonItem->setStrokesGroup(pStrokes); - pStrokes->addToGroup(mArcPolygonItem); - - // Add the center cross - foreach(QGraphicsItem* item, mAddedItems){ - removeItem(item); - UBCoreGraphicsScene::removeItemFromDeletion(item); - mArcPolygonItem->setStrokesGroup(pStrokes); - pStrokes->addToGroup(item); - } + pStrokes->addToGroup(item); + } - mAddedItems.clear(); - mAddedItems << pStrokes; - addItem(pStrokes); - mDrawWithCompass = false; + mAddedItems.clear(); + mAddedItems << pStrokes; + addItem(pStrokes); + mDrawWithCompass = false; } else if (mCurrentStroke){ - UBGraphicsStrokesGroup* pStrokes = new UBGraphicsStrokesGroup(); - - // Remove the strokes that were just drawn here and replace them by a stroke item - foreach(UBGraphicsPolygonItem* poly, mCurrentStroke->polygons()){ - mPreviousPolygonItems.removeAll(poly); - removeItem(poly); - UBCoreGraphicsScene::removeItemFromDeletion(poly); - poly->setStrokesGroup(pStrokes); - pStrokes->addToGroup(poly); - } + UBGraphicsStrokesGroup* pStrokes = new UBGraphicsStrokesGroup(); + + // Remove the strokes that were just drawn here and replace them by a stroke item + foreach(UBGraphicsPolygonItem* poly, mCurrentStroke->polygons()){ + mPreviousPolygonItems.removeAll(poly); + removeItem(poly); + UBCoreGraphicsScene::removeItemFromDeletion(poly); + poly->setStrokesGroup(pStrokes); + pStrokes->addToGroup(poly); + } - // TODO LATER : Generate well pressure-interpolated polygons and create the line group with them + // TODO LATER : Generate well pressure-interpolated polygons and create the line group with them - mAddedItems.clear(); - mAddedItems << pStrokes; - addItem(pStrokes); + mAddedItems.clear(); + mAddedItems << pStrokes; + addItem(pStrokes); if (mCurrentStroke->polygons().empty()){ delete mCurrentStroke; @@ -742,44 +741,17 @@ void UBGraphicsScene::drawLineTo(const QPointF &pEndPoint, const qreal &pWidth, mAddedItems.clear(); } + mpLastPolygon = polygonItem; + mAddedItems.insert(polygonItem); + + // Here we add the item to the scene + addItem(polygonItem); if (!mCurrentStroke) mCurrentStroke = new UBGraphicsStroke(); + polygonItem->setStroke(mCurrentStroke); - QPolygonF newPolygon = UBGeometryUtils::lineToPolygon(QLineF(mPreviousPoint, pEndPoint), pWidth); - - if (!mCurrentPolygon) - { - mCurrentPolygon = new UBGraphicsPolygonItem(); - mCurrentPolygon->setPolygon(newPolygon); - initPolygonItem(mCurrentPolygon); - addItem(mCurrentPolygon); - mAddedItems.insert(mCurrentPolygon); - mCurrentPolygon->setStroke(mCurrentStroke); - mpLastPolygon = mCurrentPolygon; - } - - - //newPolygon = newPolygon.united(mCurrentPolygon->polygon()); - - QPainterPath strokePainterPath; - - - strokePainterPath.addPolygon(mCurrentPolygon->sceneTransform().map(mCurrentPolygon->polygon())); - - //QList - QPolygonF oldPolygons = strokePainterPath.simplified().toFillPolygon(mCurrentPolygon->sceneTransform().inverted()); - newPolygon = oldPolygons.united(newPolygon); - - /* foreach(QPolygonF polygon, oldPolygons) - { - newPolygon = polygon.united(newPolygon); - } - */ - - mpLastPolygon = mCurrentPolygon; - - mCurrentPolygon->setPolygon(newPolygon); + mPreviousPolygonItems.append(polygonItem); if (!bLineStyle) @@ -861,10 +833,29 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth) } } - //remove full polygon item for replace it by couple of polygons who creates the same stroke without a part which intersects with eraser - mRemovedItems << intersectedPolygonItem; - intersectedPolygonItem->strokesGroup()->removeFromGroup(intersectedPolygonItem); + //remove full polygon item for replace it by couple of polygons which creates the same stroke without a part intersects with eraser + mRemovedItems << intersectedPolygonItem; + + QTransform t; + bool bApplyTransform = false; + if (intersectedPolygonItem->strokesGroup()) + { + if (intersectedPolygonItem->strokesGroup()->parentItem()) + { + bApplyTransform = true; + t = intersectedPolygonItem->sceneTransform(); + } + intersectedPolygonItem->strokesGroup()->removeFromGroup(intersectedPolygonItem); + } + removeItem(intersectedPolygonItem); + if (bApplyTransform) + intersectedPolygonItem->setTransform(t); + + removeItem(intersectedPolygonItem); + + if (bApplyTransform) + intersectedPolygonItem->setTransform(t); } if (!intersectedItems.empty()) @@ -1572,15 +1563,34 @@ UBGraphicsTextItem* UBGraphicsScene::textForObjectName(const QString& pString, c if(!textItem){ textItem = addTextWithFont(pString,QPointF(0,0) ,72,UBSettings::settings()->fontFamily(),true,false); textItem->setObjectName(objectName); - QSizeF size = textItem->size(); - textItem->setPos(QPointF(-size.width()/2.0,-size.height()/2.0)); textItem->setData(UBGraphicsItemData::ItemEditable,QVariant(false)); + textItem->adjustSize(); + textItem->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); + textItem->setPlainText(pString); + } + else{ + textItem->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); + if (pString == textItem->toPlainText()) + return textItem; + + QTextCursor curCursor = textItem->textCursor(); + QFont font = textItem->font(); + QColor color = curCursor.charFormat().foreground().color(); + + textItem->setPlainText(pString); + textItem->clearFocus(); + textItem->setFont(font); + + + QTextCharFormat format; + format.setForeground(QBrush(color)); + curCursor.mergeCharFormat(format); + textItem->setTextCursor(curCursor); + textItem->contentsChanged(); + } - textItem->setPlainText(pString); - textItem->adjustSize(); textItem->clearFocus(); - textItem->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); return textItem; } @@ -1670,7 +1680,11 @@ void UBGraphicsScene::addItem(QGraphicsItem* item) { UBCoreGraphicsScene::addItem(item); - UBGraphicsItem::assignZValue(item, mZLayerController->generateZLevel(item)); + // the default z value is already set. This is the case when a svg file is read + if(item->zValue() == DEFAULT_Z_VALUE || item->zValue() == UBZLayerController::errorNum()){ + qreal zvalue = mZLayerController->generateZLevel(item); + UBGraphicsItem::assignZValue(item, zvalue); + } if (!mTools.contains(item)) ++mItemCount; @@ -2119,11 +2133,9 @@ void UBGraphicsScene::setNominalSize(const QSize& pSize) if (nominalSize() != pSize) { mNominalSize = pSize; - emit pageSizeChanged(); if(mDocument) mDocument->setDefaultDocumentSize(pSize); - } } @@ -2371,9 +2383,8 @@ void UBGraphicsScene::createPointer() void UBGraphicsScene::setToolCursor(int tool) { if (tool == (int)UBStylusTool::Selector || - tool == (int)UBStylusTool::Text || - tool == (int)UBStylusTool::Play) - { + tool == (int)UBStylusTool::Text || + tool == (int)UBStylusTool::Play) { deselectAllItems(); } diff --git a/src/domain/UBGraphicsScene.h b/src/domain/UBGraphicsScene.h index ee002320..ef0db5a2 100644 --- a/src/domain/UBGraphicsScene.h +++ b/src/domain/UBGraphicsScene.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é. * @@ -343,10 +343,6 @@ public slots: void zoomOutMagnifier(); void resizedMagnifier(qreal newPercent); - signals: - - void pageSizeChanged(); - protected: UBGraphicsPolygonItem* lineToPolygonItem(const QLineF& pLine, const qreal& pWidth); diff --git a/src/domain/UBGraphicsStroke.cpp b/src/domain/UBGraphicsStroke.cpp index 130243f5..8cf92cbe 100644 --- a/src/domain/UBGraphicsStroke.cpp +++ b/src/domain/UBGraphicsStroke.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsStroke.h b/src/domain/UBGraphicsStroke.h index ed9c3168..6d246d76 100644 --- a/src/domain/UBGraphicsStroke.h +++ b/src/domain/UBGraphicsStroke.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é. * diff --git a/src/domain/UBGraphicsStrokesGroup.cpp b/src/domain/UBGraphicsStrokesGroup.cpp index cac67693..9919e70b 100644 --- a/src/domain/UBGraphicsStrokesGroup.cpp +++ b/src/domain/UBGraphicsStrokesGroup.cpp @@ -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é. * @@ -43,6 +43,7 @@ UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent) setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); setFlag(QGraphicsItem::ItemIsSelectable, true); setFlag(QGraphicsItem::ItemIsMovable, true); + } UBGraphicsStrokesGroup::~UBGraphicsStrokesGroup() diff --git a/src/domain/UBGraphicsStrokesGroup.h b/src/domain/UBGraphicsStrokesGroup.h index 0009da13..846051df 100644 --- a/src/domain/UBGraphicsStrokesGroup.h +++ b/src/domain/UBGraphicsStrokesGroup.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é. * diff --git a/src/domain/UBGraphicsSvgItem.cpp b/src/domain/UBGraphicsSvgItem.cpp index 5b45b460..37f123e5 100644 --- a/src/domain/UBGraphicsSvgItem.cpp +++ b/src/domain/UBGraphicsSvgItem.cpp @@ -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é. * @@ -98,14 +98,17 @@ QVariant UBGraphicsSvgItem::itemChange(GraphicsItemChange change, const QVariant void UBGraphicsSvgItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if (Delegate()->mousePressEvent(event)) - { - //NOOP - } - else - { + QMimeData* pMime = new QMimeData(); + QPixmap pixmap = toPixmapItem()->pixmap(); + pMime->setImageData(pixmap.toImage()); + Delegate()->setMimeData(pMime); + qreal k = (qreal)pixmap.width() / 100.0; + + QSize newSize((int)(pixmap.width() / k), (int)(pixmap.height() / k)); + + Delegate()->setDragPixmap(pixmap.scaled(newSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + if (!Delegate()->mousePressEvent(event)) QGraphicsSvgItem::mousePressEvent(event); - } } diff --git a/src/domain/UBGraphicsSvgItem.h b/src/domain/UBGraphicsSvgItem.h index d4e319cc..ef805bd6 100644 --- a/src/domain/UBGraphicsSvgItem.h +++ b/src/domain/UBGraphicsSvgItem.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é. * diff --git a/src/domain/UBGraphicsTextItem.cpp b/src/domain/UBGraphicsTextItem.cpp index 2e724cbe..c4d401b4 100644 --- a/src/domain/UBGraphicsTextItem.cpp +++ b/src/domain/UBGraphicsTextItem.cpp @@ -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é. * @@ -93,6 +93,7 @@ void UBGraphicsTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event) // It is a cludge... if (UBStylusTool::Play == UBDrawingController::drawingController()->stylusTool()) { + QGraphicsTextItem::mousePressEvent(event); event->accept(); clearFocus(); return; diff --git a/src/domain/UBGraphicsTextItem.h b/src/domain/UBGraphicsTextItem.h index 0eeaadb1..06d4133b 100644 --- a/src/domain/UBGraphicsTextItem.h +++ b/src/domain/UBGraphicsTextItem.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é. * diff --git a/src/domain/UBGraphicsTextItemDelegate.cpp b/src/domain/UBGraphicsTextItemDelegate.cpp index 92dbc62d..17b4dd28 100644 --- a/src/domain/UBGraphicsTextItemDelegate.cpp +++ b/src/domain/UBGraphicsTextItemDelegate.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsTextItemDelegate.h b/src/domain/UBGraphicsTextItemDelegate.h index 44b718b3..8d62c278 100644 --- a/src/domain/UBGraphicsTextItemDelegate.h +++ b/src/domain/UBGraphicsTextItemDelegate.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é. * diff --git a/src/domain/UBGraphicsTextItemUndoCommand.cpp b/src/domain/UBGraphicsTextItemUndoCommand.cpp index ef937def..879626b4 100644 --- a/src/domain/UBGraphicsTextItemUndoCommand.cpp +++ b/src/domain/UBGraphicsTextItemUndoCommand.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsTextItemUndoCommand.h b/src/domain/UBGraphicsTextItemUndoCommand.h index 5d736d1f..5b1d8c53 100644 --- a/src/domain/UBGraphicsTextItemUndoCommand.h +++ b/src/domain/UBGraphicsTextItemUndoCommand.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é. * diff --git a/src/domain/UBGraphicsVideoItem.cpp b/src/domain/UBGraphicsVideoItem.cpp deleted file mode 100644 index fc7ee6ba..00000000 --- a/src/domain/UBGraphicsVideoItem.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - diff --git a/src/domain/UBGraphicsVideoItem.h b/src/domain/UBGraphicsVideoItem.h deleted file mode 100644 index fc7ee6ba..00000000 --- a/src/domain/UBGraphicsVideoItem.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - diff --git a/src/domain/UBGraphicsVideoItemDelegate.cpp b/src/domain/UBGraphicsVideoItemDelegate.cpp deleted file mode 100644 index fc7ee6ba..00000000 --- a/src/domain/UBGraphicsVideoItemDelegate.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - diff --git a/src/domain/UBGraphicsVideoItemDelegate.h b/src/domain/UBGraphicsVideoItemDelegate.h deleted file mode 100644 index 29ffd4f5..00000000 --- a/src/domain/UBGraphicsVideoItemDelegate.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - - -#ifndef UBGRAPHICSVIDEOITEMDELEGATE_H_ -#define UBGRAPHICSVIDEOITEMDELEGATE_H_ - -#include -#include - -#include "core/UB.h" -#include "UBGraphicsItemDelegate.h" - -class QGraphicsSceneMouseEvent; -class QGraphicsItem; -class UBGraphicsVideoItem; - -class DelegateVideoControl: public QGraphicsRectItem -{ - public: - - DelegateVideoControl(UBGraphicsVideoItem* pDelegated, QGraphicsItem * parent = 0); - - virtual ~DelegateVideoControl() - { - // NOOP - } - - void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget); - - QPainterPath shape() const; - - void setAntiScale(qreal antiScale){ mAntiScale = antiScale; } - - virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); - virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - - void updateTicker(qint64 time); - void totalTimeChanged( qint64 newTotalTime); - - protected: - - - void seekToMousePos(QPointF mousePos); - - UBGraphicsVideoItem* mDelegate; - bool mDisplayCurrentTime; - - qreal mAntiScale; - qint64 mCurrentTimeInMs; - qint64 mTotalTimeInMs; - - private: - int mStartWidth; - QRectF mBalloon; -}; - - -class UBGraphicsVideoItemDelegate : public UBGraphicsItemDelegate -{ - Q_OBJECT - - public: - UBGraphicsVideoItemDelegate(UBGraphicsVideoItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent = 0); - virtual ~UBGraphicsVideoItemDelegate(); - - virtual void positionHandles(); - - public slots: - - void toggleMute(); - void updateTicker(qint64 time); - - protected slots: - - virtual void remove(bool canUndo = true); - - void togglePlayPause(); - - void mediaStateChanged ( Phonon::State newstate, Phonon::State oldstate ); - - void updatePlayPauseState(); - - void totalTimeChanged( qint64 newTotalTime); - - protected: - - virtual void buildButtons(); - - private: - - UBGraphicsVideoItem* delegated(); - - DelegateButton* mPlayPauseButton; - DelegateButton* mStopButton; - DelegateButton* mMuteButton; - DelegateVideoControl *mVideoControl; - - Phonon::MediaObject* mMedia; -}; - - -#endif /* UBGRAPHICSVIDEOITEMDELEGATE_H_ */ diff --git a/src/domain/UBGraphicsWidgetItem.cpp b/src/domain/UBGraphicsWidgetItem.cpp index 32c10fe3..2f30d47b 100644 --- a/src/domain/UBGraphicsWidgetItem.cpp +++ b/src/domain/UBGraphicsWidgetItem.cpp @@ -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é. * @@ -609,7 +609,9 @@ void UBGraphicsWidgetItem::mainFrameLoadFinished (bool ok) { mLoadIsErronous = !ok; update(boundingRect()); - takeSnapshot(); + + if (mInitialLoadDone && scene() && scene()->renderingContext() == UBGraphicsScene::Screen) + takeSnapshot(); } void UBGraphicsWidgetItem::wheelEvent(QGraphicsSceneWheelEvent *event) diff --git a/src/domain/UBGraphicsWidgetItem.h b/src/domain/UBGraphicsWidgetItem.h index eaf28f76..65da2bd7 100644 --- a/src/domain/UBGraphicsWidgetItem.h +++ b/src/domain/UBGraphicsWidgetItem.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é. * diff --git a/src/domain/UBGraphicsWidgetItemDelegate.cpp b/src/domain/UBGraphicsWidgetItemDelegate.cpp index 2964fff7..840da663 100644 --- a/src/domain/UBGraphicsWidgetItemDelegate.cpp +++ b/src/domain/UBGraphicsWidgetItemDelegate.cpp @@ -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é. * diff --git a/src/domain/UBGraphicsWidgetItemDelegate.h b/src/domain/UBGraphicsWidgetItemDelegate.h index ac4e1f87..642dbfea 100644 --- a/src/domain/UBGraphicsWidgetItemDelegate.h +++ b/src/domain/UBGraphicsWidgetItemDelegate.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é. * diff --git a/src/domain/UBItem.cpp b/src/domain/UBItem.cpp index 712a7cbe..ffa3962a 100644 --- a/src/domain/UBItem.cpp +++ b/src/domain/UBItem.cpp @@ -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é. * diff --git a/src/domain/UBItem.h b/src/domain/UBItem.h index 31834df3..0aea3a23 100644 --- a/src/domain/UBItem.h +++ b/src/domain/UBItem.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é. * diff --git a/src/domain/UBPageSizeUndoCommand.cpp b/src/domain/UBPageSizeUndoCommand.cpp index 47ab6693..adde99e1 100644 --- a/src/domain/UBPageSizeUndoCommand.cpp +++ b/src/domain/UBPageSizeUndoCommand.cpp @@ -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é. * diff --git a/src/domain/UBPageSizeUndoCommand.h b/src/domain/UBPageSizeUndoCommand.h index d18b3b65..35e46bda 100644 --- a/src/domain/UBPageSizeUndoCommand.h +++ b/src/domain/UBPageSizeUndoCommand.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é. * diff --git a/src/domain/UBResizableGraphicsItem.cpp b/src/domain/UBResizableGraphicsItem.cpp index 944ab4f7..a16884c1 100644 --- a/src/domain/UBResizableGraphicsItem.cpp +++ b/src/domain/UBResizableGraphicsItem.cpp @@ -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é. * diff --git a/src/domain/UBResizableGraphicsItem.h b/src/domain/UBResizableGraphicsItem.h index 0002d8e4..74f4ed87 100644 --- a/src/domain/UBResizableGraphicsItem.h +++ b/src/domain/UBResizableGraphicsItem.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é. * diff --git a/src/domain/domain.pri b/src/domain/domain.pri index f2d149c6..601e1f7d 100644 --- a/src/domain/domain.pri +++ b/src/domain/domain.pri @@ -38,7 +38,6 @@ SOURCES += src/domain/UBGraphicsScene.cpp \ src/domain/UBGraphicsSvgItem.cpp \ src/domain/UBGraphicsPolygonItem.cpp \ src/domain/UBItem.cpp \ - src/domain/UBGraphicsVideoItem.cpp \ src/domain/UBGraphicsWidgetItem.cpp \ src/domain/UBGraphicsPDFItem.cpp \ src/domain/UBGraphicsTextItem.cpp \ diff --git a/src/frameworks/MacUtils.h b/src/frameworks/MacUtils.h index b43f7150..b8d4cedd 100644 --- a/src/frameworks/MacUtils.h +++ b/src/frameworks/MacUtils.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é. * diff --git a/src/frameworks/UBBase32.cpp b/src/frameworks/UBBase32.cpp index 12dae141..0dc02f42 100644 --- a/src/frameworks/UBBase32.cpp +++ b/src/frameworks/UBBase32.cpp @@ -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é. * diff --git a/src/frameworks/UBBase32.h b/src/frameworks/UBBase32.h index 591f2707..dbbc64f8 100644 --- a/src/frameworks/UBBase32.h +++ b/src/frameworks/UBBase32.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é. * diff --git a/src/frameworks/UBCoreGraphicsScene.cpp b/src/frameworks/UBCoreGraphicsScene.cpp index 44dc13f0..3f590f0c 100644 --- a/src/frameworks/UBCoreGraphicsScene.cpp +++ b/src/frameworks/UBCoreGraphicsScene.cpp @@ -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é. * diff --git a/src/frameworks/UBCoreGraphicsScene.h b/src/frameworks/UBCoreGraphicsScene.h index 5e99f60b..5e4f8104 100644 --- a/src/frameworks/UBCoreGraphicsScene.h +++ b/src/frameworks/UBCoreGraphicsScene.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é. * diff --git a/src/frameworks/UBCryptoUtils.cpp b/src/frameworks/UBCryptoUtils.cpp index c62cdff6..b5df8ccd 100644 --- a/src/frameworks/UBCryptoUtils.cpp +++ b/src/frameworks/UBCryptoUtils.cpp @@ -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é. * diff --git a/src/frameworks/UBCryptoUtils.h b/src/frameworks/UBCryptoUtils.h index f514ab91..c286f70b 100644 --- a/src/frameworks/UBCryptoUtils.h +++ b/src/frameworks/UBCryptoUtils.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é. * diff --git a/src/frameworks/UBFileSystemUtils.cpp b/src/frameworks/UBFileSystemUtils.cpp index 17268d63..49f37cbd 100644 --- a/src/frameworks/UBFileSystemUtils.cpp +++ b/src/frameworks/UBFileSystemUtils.cpp @@ -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é. * diff --git a/src/frameworks/UBFileSystemUtils.h b/src/frameworks/UBFileSystemUtils.h index 610018be..70f543f0 100644 --- a/src/frameworks/UBFileSystemUtils.h +++ b/src/frameworks/UBFileSystemUtils.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é. * diff --git a/src/frameworks/UBGeometryUtils.cpp b/src/frameworks/UBGeometryUtils.cpp index a006b191..d35ba652 100644 --- a/src/frameworks/UBGeometryUtils.cpp +++ b/src/frameworks/UBGeometryUtils.cpp @@ -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é. * diff --git a/src/frameworks/UBGeometryUtils.h b/src/frameworks/UBGeometryUtils.h index 49ca8843..6cf68d31 100644 --- a/src/frameworks/UBGeometryUtils.h +++ b/src/frameworks/UBGeometryUtils.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é. * diff --git a/src/frameworks/UBPlatformUtils.cpp b/src/frameworks/UBPlatformUtils.cpp index 40e9a1e1..dbfc9d2f 100644 --- a/src/frameworks/UBPlatformUtils.cpp +++ b/src/frameworks/UBPlatformUtils.cpp @@ -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é. * diff --git a/src/frameworks/UBPlatformUtils.h b/src/frameworks/UBPlatformUtils.h index e9c681cb..27b3ed34 100644 --- a/src/frameworks/UBPlatformUtils.h +++ b/src/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é. * diff --git a/src/frameworks/UBPlatformUtils_linux.cpp b/src/frameworks/UBPlatformUtils_linux.cpp index 45cc853b..e9fd62e3 100644 --- a/src/frameworks/UBPlatformUtils_linux.cpp +++ b/src/frameworks/UBPlatformUtils_linux.cpp @@ -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é. * diff --git a/src/frameworks/UBPlatformUtils_mac.mm b/src/frameworks/UBPlatformUtils_mac.mm index 02782e5f..517e38d2 100644 --- a/src/frameworks/UBPlatformUtils_mac.mm +++ b/src/frameworks/UBPlatformUtils_mac.mm @@ -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é. * diff --git a/src/frameworks/UBPlatformUtils_win.cpp b/src/frameworks/UBPlatformUtils_win.cpp index 2436edf7..e56974f4 100644 --- a/src/frameworks/UBPlatformUtils_win.cpp +++ b/src/frameworks/UBPlatformUtils_win.cpp @@ -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é. * diff --git a/src/frameworks/UBStringUtils.cpp b/src/frameworks/UBStringUtils.cpp index 849d01e5..1e17b01e 100644 --- a/src/frameworks/UBStringUtils.cpp +++ b/src/frameworks/UBStringUtils.cpp @@ -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é. * diff --git a/src/frameworks/UBStringUtils.h b/src/frameworks/UBStringUtils.h index 070fdbbb..587a628a 100644 --- a/src/frameworks/UBStringUtils.h +++ b/src/frameworks/UBStringUtils.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é. * diff --git a/src/frameworks/UBVersion.cpp b/src/frameworks/UBVersion.cpp index 332600a4..854101dd 100644 --- a/src/frameworks/UBVersion.cpp +++ b/src/frameworks/UBVersion.cpp @@ -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é. * diff --git a/src/frameworks/UBVersion.h b/src/frameworks/UBVersion.h index ed132384..b2aed9bc 100644 --- a/src/frameworks/UBVersion.h +++ b/src/frameworks/UBVersion.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é. * diff --git a/src/globals/UBGlobals.h b/src/globals/UBGlobals.h index 643ca5bc..6072d27c 100644 --- a/src/globals/UBGlobals.h +++ b/src/globals/UBGlobals.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é. * diff --git a/src/gui/UBActionPalette.cpp b/src/gui/UBActionPalette.cpp index 53fd25e1..a6c061fe 100644 --- a/src/gui/UBActionPalette.cpp +++ b/src/gui/UBActionPalette.cpp @@ -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é. * diff --git a/src/gui/UBActionPalette.h b/src/gui/UBActionPalette.h index 8307fc97..ab53b573 100644 --- a/src/gui/UBActionPalette.h +++ b/src/gui/UBActionPalette.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é. * diff --git a/src/gui/UBBlackoutWidget.cpp b/src/gui/UBBlackoutWidget.cpp index 476e9639..da2aef3b 100644 --- a/src/gui/UBBlackoutWidget.cpp +++ b/src/gui/UBBlackoutWidget.cpp @@ -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é. * diff --git a/src/gui/UBBlackoutWidget.h b/src/gui/UBBlackoutWidget.h index 551d05e6..bb606fdb 100644 --- a/src/gui/UBBlackoutWidget.h +++ b/src/gui/UBBlackoutWidget.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é. * diff --git a/src/gui/UBCachePropertiesWidget.cpp b/src/gui/UBCachePropertiesWidget.cpp index 5c75db1e..5bdcdc3f 100644 --- a/src/gui/UBCachePropertiesWidget.cpp +++ b/src/gui/UBCachePropertiesWidget.cpp @@ -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é. * @@ -241,11 +241,6 @@ void UBCachePropertiesWidget::onCloseClicked() UBApplication::boardController->activeScene()->removeItem(mpCurrentCache); mpCurrentCache = NULL; - if(mCaches.empty()) - { - emit cacheListEmpty(); - } - emit hideTab(this); } } diff --git a/src/gui/UBCachePropertiesWidget.h b/src/gui/UBCachePropertiesWidget.h index 3cb6d101..7a6abac4 100644 --- a/src/gui/UBCachePropertiesWidget.h +++ b/src/gui/UBCachePropertiesWidget.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é. * @@ -52,9 +52,6 @@ public: public slots: void updateCurrentCache(); -signals: - void cacheListEmpty(); - private slots: void onCloseClicked(); void updateCacheColor(QColor color); diff --git a/src/gui/UBCircleFrame.cpp b/src/gui/UBCircleFrame.cpp index fc77105d..e4cfe83c 100644 --- a/src/gui/UBCircleFrame.cpp +++ b/src/gui/UBCircleFrame.cpp @@ -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é. * diff --git a/src/gui/UBCircleFrame.h b/src/gui/UBCircleFrame.h index cfc7cfa8..d7ee9b22 100644 --- a/src/gui/UBCircleFrame.h +++ b/src/gui/UBCircleFrame.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é. * diff --git a/src/gui/UBClockPalette.h b/src/gui/UBClockPalette.h index c35aceca..efb517ff 100644 --- a/src/gui/UBClockPalette.h +++ b/src/gui/UBClockPalette.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é. * diff --git a/src/gui/UBColorPicker.cpp b/src/gui/UBColorPicker.cpp index 99e6dccc..38f9fa90 100644 --- a/src/gui/UBColorPicker.cpp +++ b/src/gui/UBColorPicker.cpp @@ -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é. * diff --git a/src/gui/UBColorPicker.h b/src/gui/UBColorPicker.h index 02ceb488..008a0d0b 100644 --- a/src/gui/UBColorPicker.h +++ b/src/gui/UBColorPicker.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é. * diff --git a/src/gui/UBDockDownloadWidget.cpp b/src/gui/UBDockDownloadWidget.cpp index 08f0765d..191c8a39 100644 --- a/src/gui/UBDockDownloadWidget.cpp +++ b/src/gui/UBDockDownloadWidget.cpp @@ -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é. * diff --git a/src/gui/UBDockDownloadWidget.h b/src/gui/UBDockDownloadWidget.h index 6f64a28b..5aac7f7e 100644 --- a/src/gui/UBDockDownloadWidget.h +++ b/src/gui/UBDockDownloadWidget.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é. * diff --git a/src/gui/UBDockPalette.cpp b/src/gui/UBDockPalette.cpp index 4b857220..f9c218e6 100644 --- a/src/gui/UBDockPalette.cpp +++ b/src/gui/UBDockPalette.cpp @@ -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é. * diff --git a/src/gui/UBDockPalette.h b/src/gui/UBDockPalette.h index 5b1f48ac..297b3ebc 100644 --- a/src/gui/UBDockPalette.h +++ b/src/gui/UBDockPalette.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é. * diff --git a/src/gui/UBDockPaletteWidget.cpp b/src/gui/UBDockPaletteWidget.cpp index 25a5e73a..4ffbbcf8 100644 --- a/src/gui/UBDockPaletteWidget.cpp +++ b/src/gui/UBDockPaletteWidget.cpp @@ -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é. * diff --git a/src/gui/UBDockPaletteWidget.h b/src/gui/UBDockPaletteWidget.h index 5d2b3015..64e86ecf 100644 --- a/src/gui/UBDockPaletteWidget.h +++ b/src/gui/UBDockPaletteWidget.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é. * diff --git a/src/gui/UBDockTeacherGuideWidget.cpp b/src/gui/UBDockTeacherGuideWidget.cpp index db28bc92..7a1401a9 100644 --- a/src/gui/UBDockTeacherGuideWidget.cpp +++ b/src/gui/UBDockTeacherGuideWidget.cpp @@ -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é. * diff --git a/src/gui/UBDockTeacherGuideWidget.h b/src/gui/UBDockTeacherGuideWidget.h index 5c223c60..fe33410c 100644 --- a/src/gui/UBDockTeacherGuideWidget.h +++ b/src/gui/UBDockTeacherGuideWidget.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é. * diff --git a/src/gui/UBDocumentNavigator.cpp b/src/gui/UBDocumentNavigator.cpp index 1a7e6289..ccf5d518 100644 --- a/src/gui/UBDocumentNavigator.cpp +++ b/src/gui/UBDocumentNavigator.cpp @@ -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é. * diff --git a/src/gui/UBDocumentNavigator.h b/src/gui/UBDocumentNavigator.h index c7696595..ad5fcf31 100644 --- a/src/gui/UBDocumentNavigator.h +++ b/src/gui/UBDocumentNavigator.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é. * diff --git a/src/gui/UBDocumentThumbnailWidget.cpp b/src/gui/UBDocumentThumbnailWidget.cpp index f21df274..667e91f3 100644 --- a/src/gui/UBDocumentThumbnailWidget.cpp +++ b/src/gui/UBDocumentThumbnailWidget.cpp @@ -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é. * diff --git a/src/gui/UBDocumentThumbnailWidget.h b/src/gui/UBDocumentThumbnailWidget.h index 364e1ba4..2a7e1e8a 100644 --- a/src/gui/UBDocumentThumbnailWidget.h +++ b/src/gui/UBDocumentThumbnailWidget.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é. * diff --git a/src/gui/UBDocumentToolsPalette.cpp b/src/gui/UBDocumentToolsPalette.cpp index 9ba2941b..18f2738d 100644 --- a/src/gui/UBDocumentToolsPalette.cpp +++ b/src/gui/UBDocumentToolsPalette.cpp @@ -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é. * diff --git a/src/gui/UBDocumentToolsPalette.h b/src/gui/UBDocumentToolsPalette.h index 4032dee7..8796f106 100644 --- a/src/gui/UBDocumentToolsPalette.h +++ b/src/gui/UBDocumentToolsPalette.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é. * diff --git a/src/gui/UBDocumentTreeWidget.cpp b/src/gui/UBDocumentTreeWidget.cpp index 3688618c..6c1409f6 100644 --- a/src/gui/UBDocumentTreeWidget.cpp +++ b/src/gui/UBDocumentTreeWidget.cpp @@ -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é. * diff --git a/src/gui/UBDocumentTreeWidget.h b/src/gui/UBDocumentTreeWidget.h index a0577539..e0ffd216 100644 --- a/src/gui/UBDocumentTreeWidget.h +++ b/src/gui/UBDocumentTreeWidget.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é. * diff --git a/src/gui/UBDownloadWidget.cpp b/src/gui/UBDownloadWidget.cpp index b83aac8b..d097c481 100644 --- a/src/gui/UBDownloadWidget.cpp +++ b/src/gui/UBDownloadWidget.cpp @@ -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é. * diff --git a/src/gui/UBDownloadWidget.h b/src/gui/UBDownloadWidget.h index eb457c06..6f9a53f1 100644 --- a/src/gui/UBDownloadWidget.h +++ b/src/gui/UBDownloadWidget.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é. * diff --git a/src/gui/UBFavoriteToolPalette.cpp b/src/gui/UBFavoriteToolPalette.cpp index ce4ca385..114fba33 100644 --- a/src/gui/UBFavoriteToolPalette.cpp +++ b/src/gui/UBFavoriteToolPalette.cpp @@ -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é. * diff --git a/src/gui/UBFavoriteToolPalette.h b/src/gui/UBFavoriteToolPalette.h index 0c52860a..8c6341a7 100644 --- a/src/gui/UBFavoriteToolPalette.h +++ b/src/gui/UBFavoriteToolPalette.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é. * diff --git a/src/gui/UBFeaturesActionBar.cpp b/src/gui/UBFeaturesActionBar.cpp index 3c31d21f..19627e28 100644 --- a/src/gui/UBFeaturesActionBar.cpp +++ b/src/gui/UBFeaturesActionBar.cpp @@ -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é. * diff --git a/src/gui/UBFeaturesActionBar.h b/src/gui/UBFeaturesActionBar.h index 812d359a..cddb9c84 100644 --- a/src/gui/UBFeaturesActionBar.h +++ b/src/gui/UBFeaturesActionBar.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é. * diff --git a/src/gui/UBFeaturesWidget.cpp b/src/gui/UBFeaturesWidget.cpp index 831a4a94..812405e5 100644 --- a/src/gui/UBFeaturesWidget.cpp +++ b/src/gui/UBFeaturesWidget.cpp @@ -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é. * diff --git a/src/gui/UBFeaturesWidget.h b/src/gui/UBFeaturesWidget.h index eef4321d..1320ee5c 100644 --- a/src/gui/UBFeaturesWidget.h +++ b/src/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é. * diff --git a/src/gui/UBFloatingPalette.cpp b/src/gui/UBFloatingPalette.cpp index 7b566283..fe380c6c 100644 --- a/src/gui/UBFloatingPalette.cpp +++ b/src/gui/UBFloatingPalette.cpp @@ -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é. * diff --git a/src/gui/UBFloatingPalette.h b/src/gui/UBFloatingPalette.h index 2586dedd..7f21b9aa 100644 --- a/src/gui/UBFloatingPalette.h +++ b/src/gui/UBFloatingPalette.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é. * diff --git a/src/gui/UBIconButton.cpp b/src/gui/UBIconButton.cpp index 08c54140..335db35a 100644 --- a/src/gui/UBIconButton.cpp +++ b/src/gui/UBIconButton.cpp @@ -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é. * diff --git a/src/gui/UBIconButton.h b/src/gui/UBIconButton.h index 32a86791..710e637d 100644 --- a/src/gui/UBIconButton.h +++ b/src/gui/UBIconButton.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é. * diff --git a/src/gui/UBKeyboardPalette.cpp b/src/gui/UBKeyboardPalette.cpp index fe8301bc..d287bc0d 100644 --- a/src/gui/UBKeyboardPalette.cpp +++ b/src/gui/UBKeyboardPalette.cpp @@ -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é. * diff --git a/src/gui/UBKeyboardPalette.h b/src/gui/UBKeyboardPalette.h index 1b5d59b9..5267f7cb 100644 --- a/src/gui/UBKeyboardPalette.h +++ b/src/gui/UBKeyboardPalette.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é. * diff --git a/src/gui/UBKeyboardPalette_linux.cpp b/src/gui/UBKeyboardPalette_linux.cpp index 7e4e9f8a..13c95a25 100644 --- a/src/gui/UBKeyboardPalette_linux.cpp +++ b/src/gui/UBKeyboardPalette_linux.cpp @@ -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é. * diff --git a/src/gui/UBKeyboardPalette_mac.cpp b/src/gui/UBKeyboardPalette_mac.cpp index 119a31b7..06c43528 100644 --- a/src/gui/UBKeyboardPalette_mac.cpp +++ b/src/gui/UBKeyboardPalette_mac.cpp @@ -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é. * diff --git a/src/gui/UBKeyboardPalette_win.cpp b/src/gui/UBKeyboardPalette_win.cpp index d30236c2..fb9a65de 100644 --- a/src/gui/UBKeyboardPalette_win.cpp +++ b/src/gui/UBKeyboardPalette_win.cpp @@ -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é. * diff --git a/src/gui/UBLeftPalette.cpp b/src/gui/UBLeftPalette.cpp index 6f63e176..c2f6ea15 100644 --- a/src/gui/UBLeftPalette.cpp +++ b/src/gui/UBLeftPalette.cpp @@ -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é. * diff --git a/src/gui/UBLeftPalette.h b/src/gui/UBLeftPalette.h index 5925cfbc..6ba12c91 100644 --- a/src/gui/UBLeftPalette.h +++ b/src/gui/UBLeftPalette.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é. * diff --git a/src/gui/UBMagnifer.cpp b/src/gui/UBMagnifer.cpp index 76796b77..e40752e3 100644 --- a/src/gui/UBMagnifer.cpp +++ b/src/gui/UBMagnifer.cpp @@ -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é. * diff --git a/src/gui/UBMagnifer.h b/src/gui/UBMagnifer.h index f69a4610..3f2b8fd9 100644 --- a/src/gui/UBMagnifer.h +++ b/src/gui/UBMagnifer.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é. * diff --git a/src/gui/UBMainWindow.cpp b/src/gui/UBMainWindow.cpp index dc0497bf..61f77f9d 100644 --- a/src/gui/UBMainWindow.cpp +++ b/src/gui/UBMainWindow.cpp @@ -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é. * diff --git a/src/gui/UBMainWindow.h b/src/gui/UBMainWindow.h index f4d11ba3..c5cbc9b6 100644 --- a/src/gui/UBMainWindow.h +++ b/src/gui/UBMainWindow.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é. * diff --git a/src/gui/UBMessageWindow.cpp b/src/gui/UBMessageWindow.cpp index 73a1a60c..16b467f3 100644 --- a/src/gui/UBMessageWindow.cpp +++ b/src/gui/UBMessageWindow.cpp @@ -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é. * diff --git a/src/gui/UBMessageWindow.h b/src/gui/UBMessageWindow.h index 0522b815..33e7d4d0 100644 --- a/src/gui/UBMessageWindow.h +++ b/src/gui/UBMessageWindow.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é. * diff --git a/src/gui/UBMessagesDialog.cpp b/src/gui/UBMessagesDialog.cpp index fad98a3b..09fd9045 100644 --- a/src/gui/UBMessagesDialog.cpp +++ b/src/gui/UBMessagesDialog.cpp @@ -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é. * diff --git a/src/gui/UBMessagesDialog.h b/src/gui/UBMessagesDialog.h index 79b361bf..cefce272 100644 --- a/src/gui/UBMessagesDialog.h +++ b/src/gui/UBMessagesDialog.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é. * diff --git a/src/gui/UBMousePressFilter.cpp b/src/gui/UBMousePressFilter.cpp index 6da92f13..a1a74e9c 100644 --- a/src/gui/UBMousePressFilter.cpp +++ b/src/gui/UBMousePressFilter.cpp @@ -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é. * diff --git a/src/gui/UBMousePressFilter.h b/src/gui/UBMousePressFilter.h index d9220d25..4dc6f90c 100644 --- a/src/gui/UBMousePressFilter.h +++ b/src/gui/UBMousePressFilter.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é. * diff --git a/src/gui/UBNavigatorPalette.cpp b/src/gui/UBNavigatorPalette.cpp index f29f69e6..6ad9505d 100644 --- a/src/gui/UBNavigatorPalette.cpp +++ b/src/gui/UBNavigatorPalette.cpp @@ -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é. * @@ -98,13 +98,13 @@ UBNavigatorPalette::~UBNavigatorPalette() } if(NULL != mLayout) { - delete mLayout; - mLayout = NULL; + delete mLayout; + mLayout = NULL; } if(NULL != mNavigator) { - delete mNavigator; - mNavigator = NULL; + delete mNavigator; + mNavigator = NULL; } } diff --git a/src/gui/UBNavigatorPalette.h b/src/gui/UBNavigatorPalette.h index 060252e3..b09cd08a 100644 --- a/src/gui/UBNavigatorPalette.h +++ b/src/gui/UBNavigatorPalette.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é. * diff --git a/src/gui/UBPageNavigationWidget.cpp b/src/gui/UBPageNavigationWidget.cpp index 7366709e..9d1646ee 100644 --- a/src/gui/UBPageNavigationWidget.cpp +++ b/src/gui/UBPageNavigationWidget.cpp @@ -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é. * diff --git a/src/gui/UBPageNavigationWidget.h b/src/gui/UBPageNavigationWidget.h index 1ff4aab0..1299a9f4 100644 --- a/src/gui/UBPageNavigationWidget.h +++ b/src/gui/UBPageNavigationWidget.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é. * diff --git a/src/gui/UBPropertyPalette.cpp b/src/gui/UBPropertyPalette.cpp index 15871037..b085b355 100644 --- a/src/gui/UBPropertyPalette.cpp +++ b/src/gui/UBPropertyPalette.cpp @@ -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é. * diff --git a/src/gui/UBPropertyPalette.h b/src/gui/UBPropertyPalette.h index 69798c2d..1388bad2 100644 --- a/src/gui/UBPropertyPalette.h +++ b/src/gui/UBPropertyPalette.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é. * diff --git a/src/gui/UBResources.cpp b/src/gui/UBResources.cpp index 08869868..02e23bfe 100644 --- a/src/gui/UBResources.cpp +++ b/src/gui/UBResources.cpp @@ -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é. * diff --git a/src/gui/UBResources.h b/src/gui/UBResources.h index 180f6304..5d5455c5 100644 --- a/src/gui/UBResources.h +++ b/src/gui/UBResources.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é. * diff --git a/src/gui/UBRightPalette.cpp b/src/gui/UBRightPalette.cpp index 0724b87e..4363d5f5 100644 --- a/src/gui/UBRightPalette.cpp +++ b/src/gui/UBRightPalette.cpp @@ -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é. * diff --git a/src/gui/UBRightPalette.h b/src/gui/UBRightPalette.h index f1ae40f8..fea60ec9 100644 --- a/src/gui/UBRightPalette.h +++ b/src/gui/UBRightPalette.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é. * diff --git a/src/gui/UBRubberBand.cpp b/src/gui/UBRubberBand.cpp index a889f8af..ee9d430c 100644 --- a/src/gui/UBRubberBand.cpp +++ b/src/gui/UBRubberBand.cpp @@ -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é. * diff --git a/src/gui/UBRubberBand.h b/src/gui/UBRubberBand.h index 968b0d28..931639e9 100644 --- a/src/gui/UBRubberBand.h +++ b/src/gui/UBRubberBand.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é. * diff --git a/src/gui/UBScreenMirror.cpp b/src/gui/UBScreenMirror.cpp index 12d090bd..285c5ec8 100644 --- a/src/gui/UBScreenMirror.cpp +++ b/src/gui/UBScreenMirror.cpp @@ -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é. * diff --git a/src/gui/UBScreenMirror.h b/src/gui/UBScreenMirror.h index 15db32fc..1ab9fbae 100644 --- a/src/gui/UBScreenMirror.h +++ b/src/gui/UBScreenMirror.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é. * diff --git a/src/gui/UBSpinningWheel.cpp b/src/gui/UBSpinningWheel.cpp index 46cbe9fa..828293fc 100644 --- a/src/gui/UBSpinningWheel.cpp +++ b/src/gui/UBSpinningWheel.cpp @@ -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é. * diff --git a/src/gui/UBSpinningWheel.h b/src/gui/UBSpinningWheel.h index 310bc0d2..5dfec9cd 100644 --- a/src/gui/UBSpinningWheel.h +++ b/src/gui/UBSpinningWheel.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é. * diff --git a/src/gui/UBStylusPalette.cpp b/src/gui/UBStylusPalette.cpp index a6fe1f7f..1cf47b63 100644 --- a/src/gui/UBStylusPalette.cpp +++ b/src/gui/UBStylusPalette.cpp @@ -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é. * diff --git a/src/gui/UBStylusPalette.h b/src/gui/UBStylusPalette.h index 4af6ee56..b3542667 100644 --- a/src/gui/UBStylusPalette.h +++ b/src/gui/UBStylusPalette.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é. * diff --git a/src/gui/UBTeacherGuideWidget.cpp b/src/gui/UBTeacherGuideWidget.cpp index 443ec9d2..09520118 100644 --- a/src/gui/UBTeacherGuideWidget.cpp +++ b/src/gui/UBTeacherGuideWidget.cpp @@ -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é. * @@ -273,8 +273,8 @@ void UBTeacherGuideEditionWidget::onActiveSceneChanged() void UBTeacherGuideEditionWidget::cleanData() { - mpPageTitle->setText(""); - mpComment->setText(""); + mpPageTitle->resetText(); + mpComment->resetText(); QList children = mpAddAnActionItem->takeChildren(); children << mpAddAMediaItem->takeChildren(); children << mpAddALinkItem->takeChildren(); diff --git a/src/gui/UBTeacherGuideWidget.h b/src/gui/UBTeacherGuideWidget.h index b25e4a74..5c445cec 100644 --- a/src/gui/UBTeacherGuideWidget.h +++ b/src/gui/UBTeacherGuideWidget.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é. * diff --git a/src/gui/UBTeacherGuideWidgetsTools.cpp b/src/gui/UBTeacherGuideWidgetsTools.cpp index 77ef3add..87c0c722 100644 --- a/src/gui/UBTeacherGuideWidgetsTools.cpp +++ b/src/gui/UBTeacherGuideWidgetsTools.cpp @@ -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é. * @@ -224,6 +224,19 @@ void UBTGAdaptableText::setInitialText(const QString& text) onTextChanged(); } +void UBTGAdaptableText::resetText() +{ + if(mHasPlaceHolder && !mPlaceHolderText.isEmpty()){ + setTextColor(QColor(Qt::lightGray)); + setText(mPlaceHolderText); + } + else{ + setText(""); + setTextColor(QColor(Qt::black)); + } + onTextChanged(); +} + void UBTGAdaptableText::showText(const QString & text) { setText(text); @@ -252,14 +265,40 @@ void UBTGAdaptableText::focusOutEvent(QFocusEvent* e) QTextEdit::focusOutEvent(e); } +void UBTGAdaptableText::insertFromMimeData(const QMimeData *source) +{ + QMimeData editedMimeData; + QTextDocument textDoc; + QString plainText; + + if (source->hasHtml()) + { + textDoc.setHtml(source->html()); + plainText += textDoc.toPlainText(); + } + if (source->hasText()) + if (textDoc.toPlainText() != source->text()) + plainText += source->text(); + if (source->hasUrls()) + { + foreach(QUrl url, source->urls()) + { + plainText += url.toString(); + } + } + + editedMimeData.setText(plainText); + QTextEdit::insertFromMimeData(&editedMimeData); +} + void UBTGAdaptableText::managePlaceholder(bool focus) { if(focus){ if(toPlainText() == mPlaceHolderText){ setTextColor(QColor(Qt::black)); setPlainText(""); + setCursorToTheEnd(); } - setCursorToTheEnd(); } else{ if(toPlainText().isEmpty()){ @@ -537,9 +576,9 @@ void UBTGMediaWidget::createWorkWidget(bool forceFlashMediaType) mpMediaLayout = new QHBoxLayout(mpWorkWidget); mpWorkWidget->setLayout(mpMediaLayout); } - + mpMediaLayout->addStretch(1); - + if(mpMediaLabelWidget){ mpMediaLabelWidget->setFixedHeight(mMediaWidgetHeight); mpMediaLabelWidget->setParent(mpWorkWidget); diff --git a/src/gui/UBTeacherGuideWidgetsTools.h b/src/gui/UBTeacherGuideWidgetsTools.h index 50e671dc..ba944ddd 100644 --- a/src/gui/UBTeacherGuideWidgetsTools.h +++ b/src/gui/UBTeacherGuideWidgetsTools.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é. * @@ -103,6 +103,7 @@ class UBTGAdaptableText : public QTextEdit public: explicit UBTGAdaptableText(QTreeWidgetItem* widget = 0, QWidget *parent = 0, const char* name = "UBTGAdaptableText"); void showText(const QString & text); + void resetText(); void bottomMargin(int newValue); void setPlaceHolderText(QString text); QString text(); @@ -118,6 +119,7 @@ protected: void showEvent(QShowEvent* e); void focusInEvent(QFocusEvent* e); void focusOutEvent(QFocusEvent* e); + virtual void insertFromMimeData(const QMimeData *source); private: void setCursorToTheEnd(); diff --git a/src/gui/UBThumbnailView.cpp b/src/gui/UBThumbnailView.cpp index 6ad45336..e77c940e 100644 --- a/src/gui/UBThumbnailView.cpp +++ b/src/gui/UBThumbnailView.cpp @@ -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é. * diff --git a/src/gui/UBThumbnailView.h b/src/gui/UBThumbnailView.h index 68673c42..1e585480 100644 --- a/src/gui/UBThumbnailView.h +++ b/src/gui/UBThumbnailView.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é. * diff --git a/src/gui/UBThumbnailWidget.cpp b/src/gui/UBThumbnailWidget.cpp index c67f14f8..905fa15e 100644 --- a/src/gui/UBThumbnailWidget.cpp +++ b/src/gui/UBThumbnailWidget.cpp @@ -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é. * @@ -87,6 +87,7 @@ void UBThumbnailWidget::setGraphicsItems(const QList& pGraphicsI , const QStringList pLabels , const QString& pMimeType) { + Q_ASSERT(pItemsPaths.count() == pLabels.count()); mGraphicItems = pGraphicsItems; mItemsPaths = pItemsPaths; mMimeType = pMimeType; @@ -224,13 +225,6 @@ void UBThumbnailWidget::mousePressEvent(QMouseEvent *event) event->ignore(); return; } - //if(sceneItem){ - // int pageIndex = UBDocumentContainer::pageFromSceneIndex(sceneItem->sceneIndex()); - // if(pageIndex == 0){ - // event->ignore(); - // return; - // } - //} mMousePressScenePos = mapToScene(mMousePressPos); QGraphicsItem* underlyingItem = itemAt(mMousePressPos); diff --git a/src/gui/UBThumbnailWidget.h b/src/gui/UBThumbnailWidget.h index bf235c61..76a8a24e 100644 --- a/src/gui/UBThumbnailWidget.h +++ b/src/gui/UBThumbnailWidget.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é. * @@ -97,7 +97,7 @@ class UBThumbnailWidget : public QGraphicsView QList mItemsPaths; QStringList mLabels; bool bSelectionInProgress; - bool bCanDrag; + bool bCanDrag; private: void selectAll(); @@ -161,7 +161,6 @@ class UBThumbnail { item->scene()->addItem(mSelectionItem); mSelectionItem->setZValue(item->zValue() - 1); -// UBGraphicsItem::assignZValue(mSelectionItem, item->zValue() - 1); mAddedToScene = true; } diff --git a/src/gui/UBToolWidget.cpp b/src/gui/UBToolWidget.cpp index ae80bb78..4f9667e6 100644 --- a/src/gui/UBToolWidget.cpp +++ b/src/gui/UBToolWidget.cpp @@ -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é. * diff --git a/src/gui/UBToolWidget.h b/src/gui/UBToolWidget.h index b12a22c3..699fc47c 100644 --- a/src/gui/UBToolWidget.h +++ b/src/gui/UBToolWidget.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é. * diff --git a/src/gui/UBToolbarButtonGroup.cpp b/src/gui/UBToolbarButtonGroup.cpp index e2696d59..4a4a17f5 100644 --- a/src/gui/UBToolbarButtonGroup.cpp +++ b/src/gui/UBToolbarButtonGroup.cpp @@ -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é. * diff --git a/src/gui/UBToolbarButtonGroup.h b/src/gui/UBToolbarButtonGroup.h index 1826df3b..74398e1d 100644 --- a/src/gui/UBToolbarButtonGroup.h +++ b/src/gui/UBToolbarButtonGroup.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é. * diff --git a/src/gui/UBUpdateDlg.cpp b/src/gui/UBUpdateDlg.cpp index f17ca9a5..76af8c25 100644 --- a/src/gui/UBUpdateDlg.cpp +++ b/src/gui/UBUpdateDlg.cpp @@ -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é. * diff --git a/src/gui/UBUpdateDlg.h b/src/gui/UBUpdateDlg.h index 7b0b1e1f..fdf509d6 100644 --- a/src/gui/UBUpdateDlg.h +++ b/src/gui/UBUpdateDlg.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é. * diff --git a/src/gui/UBVideoPlayer.cpp b/src/gui/UBVideoPlayer.cpp index e78a1248..e1831895 100644 --- a/src/gui/UBVideoPlayer.cpp +++ b/src/gui/UBVideoPlayer.cpp @@ -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é. * diff --git a/src/gui/UBVideoPlayer.h b/src/gui/UBVideoPlayer.h index d0d567b2..27c5f575 100644 --- a/src/gui/UBVideoPlayer.h +++ b/src/gui/UBVideoPlayer.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é. * diff --git a/src/gui/UBWebToolsPalette.cpp b/src/gui/UBWebToolsPalette.cpp index d7a7a3ae..797c4501 100644 --- a/src/gui/UBWebToolsPalette.cpp +++ b/src/gui/UBWebToolsPalette.cpp @@ -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é. * diff --git a/src/gui/UBWebToolsPalette.h b/src/gui/UBWebToolsPalette.h index f1cde31d..974d2f6e 100644 --- a/src/gui/UBWebToolsPalette.h +++ b/src/gui/UBWebToolsPalette.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é. * diff --git a/src/gui/UBWidgetMirror.cpp b/src/gui/UBWidgetMirror.cpp index 7bcc4301..4d833d3e 100644 --- a/src/gui/UBWidgetMirror.cpp +++ b/src/gui/UBWidgetMirror.cpp @@ -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é. * diff --git a/src/gui/UBWidgetMirror.h b/src/gui/UBWidgetMirror.h index e172c28b..dee30378 100644 --- a/src/gui/UBWidgetMirror.h +++ b/src/gui/UBWidgetMirror.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é. * diff --git a/src/gui/UBZoomPalette.cpp b/src/gui/UBZoomPalette.cpp index f5e4b1c6..c3bce63a 100644 --- a/src/gui/UBZoomPalette.cpp +++ b/src/gui/UBZoomPalette.cpp @@ -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é. * diff --git a/src/gui/UBZoomPalette.h b/src/gui/UBZoomPalette.h index 20bb50fb..f8c3fc92 100644 --- a/src/gui/UBZoomPalette.h +++ b/src/gui/UBZoomPalette.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é. * diff --git a/src/interfaces/IDataStorage.h b/src/interfaces/IDataStorage.h index d3ce687a..35921dbc 100644 --- a/src/interfaces/IDataStorage.h +++ b/src/interfaces/IDataStorage.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é. * diff --git a/src/network/UBAutoSaver.cpp b/src/network/UBAutoSaver.cpp index e81a7c35..b2760e1c 100644 --- a/src/network/UBAutoSaver.cpp +++ b/src/network/UBAutoSaver.cpp @@ -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é. * diff --git a/src/network/UBAutoSaver.h b/src/network/UBAutoSaver.h index 15904fa1..d886f1fa 100644 --- a/src/network/UBAutoSaver.h +++ b/src/network/UBAutoSaver.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é. * diff --git a/src/network/UBCookieJar.cpp b/src/network/UBCookieJar.cpp index 01559402..4ec2d58e 100644 --- a/src/network/UBCookieJar.cpp +++ b/src/network/UBCookieJar.cpp @@ -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é. * diff --git a/src/network/UBCookieJar.h b/src/network/UBCookieJar.h index 8ed99139..0a4cea14 100644 --- a/src/network/UBCookieJar.h +++ b/src/network/UBCookieJar.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é. * diff --git a/src/network/UBHttpFileDownloader.cpp b/src/network/UBHttpFileDownloader.cpp index 8948ccef..35ea75e4 100644 --- a/src/network/UBHttpFileDownloader.cpp +++ b/src/network/UBHttpFileDownloader.cpp @@ -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é. * diff --git a/src/network/UBHttpFileDownloader.h b/src/network/UBHttpFileDownloader.h index 91fd7009..5bc4c3dd 100644 --- a/src/network/UBHttpFileDownloader.h +++ b/src/network/UBHttpFileDownloader.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é. * diff --git a/src/network/UBHttpGet.cpp b/src/network/UBHttpGet.cpp index 0fcb5a2f..30c09419 100644 --- a/src/network/UBHttpGet.cpp +++ b/src/network/UBHttpGet.cpp @@ -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é. * diff --git a/src/network/UBHttpGet.h b/src/network/UBHttpGet.h index 5a00b67d..08a0abd2 100644 --- a/src/network/UBHttpGet.h +++ b/src/network/UBHttpGet.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é. * diff --git a/src/network/UBNetworkAccessManager.cpp b/src/network/UBNetworkAccessManager.cpp index 3c6b9073..71f8d0c9 100644 --- a/src/network/UBNetworkAccessManager.cpp +++ b/src/network/UBNetworkAccessManager.cpp @@ -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é. * diff --git a/src/network/UBNetworkAccessManager.h b/src/network/UBNetworkAccessManager.h index 6b6e32e2..cc4e578c 100644 --- a/src/network/UBNetworkAccessManager.h +++ b/src/network/UBNetworkAccessManager.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é. * diff --git a/src/network/UBServerXMLHttpRequest.cpp b/src/network/UBServerXMLHttpRequest.cpp index a5088e38..b3ae2b9f 100644 --- a/src/network/UBServerXMLHttpRequest.cpp +++ b/src/network/UBServerXMLHttpRequest.cpp @@ -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é. * diff --git a/src/network/UBServerXMLHttpRequest.h b/src/network/UBServerXMLHttpRequest.h index 1e34b32e..6905bcf7 100644 --- a/src/network/UBServerXMLHttpRequest.h +++ b/src/network/UBServerXMLHttpRequest.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é. * diff --git a/src/pdf-merger/ASCII85Decode.cpp b/src/pdf-merger/ASCII85Decode.cpp index 634ecb0e..fd26a4c4 100644 --- a/src/pdf-merger/ASCII85Decode.cpp +++ b/src/pdf-merger/ASCII85Decode.cpp @@ -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é. * diff --git a/src/pdf-merger/ASCII85Decode.h b/src/pdf-merger/ASCII85Decode.h index b605e2a0..85c1ecd5 100644 --- a/src/pdf-merger/ASCII85Decode.h +++ b/src/pdf-merger/ASCII85Decode.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é. * diff --git a/src/pdf-merger/ASCIIHexDecode.cpp b/src/pdf-merger/ASCIIHexDecode.cpp index 84b127d5..c2c6bbae 100644 --- a/src/pdf-merger/ASCIIHexDecode.cpp +++ b/src/pdf-merger/ASCIIHexDecode.cpp @@ -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é. * diff --git a/src/pdf-merger/ASCIIHexDecode.h b/src/pdf-merger/ASCIIHexDecode.h index 60ca682e..ef0a89d2 100644 --- a/src/pdf-merger/ASCIIHexDecode.h +++ b/src/pdf-merger/ASCIIHexDecode.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é. * diff --git a/src/pdf-merger/AbstractBoxElementHandler.h b/src/pdf-merger/AbstractBoxElementHandler.h index 9e315088..9e662623 100644 --- a/src/pdf-merger/AbstractBoxElementHandler.h +++ b/src/pdf-merger/AbstractBoxElementHandler.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é. * diff --git a/src/pdf-merger/AnnotsHandler.cpp b/src/pdf-merger/AnnotsHandler.cpp index 83aa94e2..34794b5c 100644 --- a/src/pdf-merger/AnnotsHandler.cpp +++ b/src/pdf-merger/AnnotsHandler.cpp @@ -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é. * diff --git a/src/pdf-merger/AnnotsHandler.h b/src/pdf-merger/AnnotsHandler.h index 93c5a4fa..8f7270f9 100644 --- a/src/pdf-merger/AnnotsHandler.h +++ b/src/pdf-merger/AnnotsHandler.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é. * diff --git a/src/pdf-merger/CCITTFaxDecode.cpp b/src/pdf-merger/CCITTFaxDecode.cpp index 7793af87..7da883c4 100644 --- a/src/pdf-merger/CCITTFaxDecode.cpp +++ b/src/pdf-merger/CCITTFaxDecode.cpp @@ -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é. * diff --git a/src/pdf-merger/CCITTFaxDecode.h b/src/pdf-merger/CCITTFaxDecode.h index 24a5c5a0..a69b2a0b 100644 --- a/src/pdf-merger/CCITTFaxDecode.h +++ b/src/pdf-merger/CCITTFaxDecode.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é. * diff --git a/src/pdf-merger/Config.h b/src/pdf-merger/Config.h index a443a915..dac1d4cf 100644 --- a/src/pdf-merger/Config.h +++ b/src/pdf-merger/Config.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é. * diff --git a/src/pdf-merger/ContentHandler.cpp b/src/pdf-merger/ContentHandler.cpp index de376906..973cda88 100644 --- a/src/pdf-merger/ContentHandler.cpp +++ b/src/pdf-merger/ContentHandler.cpp @@ -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é. * diff --git a/src/pdf-merger/ContentHandler.h b/src/pdf-merger/ContentHandler.h index 2cec0640..b8e4a022 100644 --- a/src/pdf-merger/ContentHandler.h +++ b/src/pdf-merger/ContentHandler.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é. * diff --git a/src/pdf-merger/CropBoxElementHandler.h b/src/pdf-merger/CropBoxElementHandler.h index bd053b3e..4b9881c4 100644 --- a/src/pdf-merger/CropBoxElementHandler.h +++ b/src/pdf-merger/CropBoxElementHandler.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é. * diff --git a/src/pdf-merger/DCTDecode.cpp b/src/pdf-merger/DCTDecode.cpp index 5dbd64b1..029dc62b 100644 --- a/src/pdf-merger/DCTDecode.cpp +++ b/src/pdf-merger/DCTDecode.cpp @@ -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é. * diff --git a/src/pdf-merger/DCTDecode.h b/src/pdf-merger/DCTDecode.h index 47d4636b..06ff0f6e 100644 --- a/src/pdf-merger/DCTDecode.h +++ b/src/pdf-merger/DCTDecode.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é. * diff --git a/src/pdf-merger/Decoder.h b/src/pdf-merger/Decoder.h index bd1afaaf..2988b2b0 100644 --- a/src/pdf-merger/Decoder.h +++ b/src/pdf-merger/Decoder.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é. * diff --git a/src/pdf-merger/Document.cpp b/src/pdf-merger/Document.cpp index 372e3ba4..175436a3 100644 --- a/src/pdf-merger/Document.cpp +++ b/src/pdf-merger/Document.cpp @@ -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é. * diff --git a/src/pdf-merger/Document.h b/src/pdf-merger/Document.h index ed8a0924..227bfc27 100644 --- a/src/pdf-merger/Document.h +++ b/src/pdf-merger/Document.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é. * diff --git a/src/pdf-merger/Exception.h b/src/pdf-merger/Exception.h index 415018c6..c83c6e8b 100644 --- a/src/pdf-merger/Exception.h +++ b/src/pdf-merger/Exception.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é. * diff --git a/src/pdf-merger/FileIsAbsentException.h b/src/pdf-merger/FileIsAbsentException.h index 36b2198a..b6649714 100644 --- a/src/pdf-merger/FileIsAbsentException.h +++ b/src/pdf-merger/FileIsAbsentException.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é. * diff --git a/src/pdf-merger/Filter.cpp b/src/pdf-merger/Filter.cpp index 3e1b9e57..3800bf04 100644 --- a/src/pdf-merger/Filter.cpp +++ b/src/pdf-merger/Filter.cpp @@ -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é. * diff --git a/src/pdf-merger/Filter.h b/src/pdf-merger/Filter.h index 85932e98..0a1f2029 100644 --- a/src/pdf-merger/Filter.h +++ b/src/pdf-merger/Filter.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é. * diff --git a/src/pdf-merger/FilterPredictor.cpp b/src/pdf-merger/FilterPredictor.cpp index 0b595821..a31d0231 100644 --- a/src/pdf-merger/FilterPredictor.cpp +++ b/src/pdf-merger/FilterPredictor.cpp @@ -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é. * diff --git a/src/pdf-merger/FilterPredictor.h b/src/pdf-merger/FilterPredictor.h index d826e9b7..28afbd6d 100644 --- a/src/pdf-merger/FilterPredictor.h +++ b/src/pdf-merger/FilterPredictor.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é. * diff --git a/src/pdf-merger/FlateDecode.cpp b/src/pdf-merger/FlateDecode.cpp index 49f6229e..a2215c48 100644 --- a/src/pdf-merger/FlateDecode.cpp +++ b/src/pdf-merger/FlateDecode.cpp @@ -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é. * diff --git a/src/pdf-merger/FlateDecode.h b/src/pdf-merger/FlateDecode.h index a9a4dd70..8ec75e91 100644 --- a/src/pdf-merger/FlateDecode.h +++ b/src/pdf-merger/FlateDecode.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é. * diff --git a/src/pdf-merger/JBIG2Decode.cpp b/src/pdf-merger/JBIG2Decode.cpp index b4826754..92f1c7d9 100644 --- a/src/pdf-merger/JBIG2Decode.cpp +++ b/src/pdf-merger/JBIG2Decode.cpp @@ -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é. * diff --git a/src/pdf-merger/JBIG2Decode.h b/src/pdf-merger/JBIG2Decode.h index e31ed2b1..4d9b72fc 100644 --- a/src/pdf-merger/JBIG2Decode.h +++ b/src/pdf-merger/JBIG2Decode.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é. * diff --git a/src/pdf-merger/LZWDecode.cpp b/src/pdf-merger/LZWDecode.cpp index 5ef46779..ad1b486f 100644 --- a/src/pdf-merger/LZWDecode.cpp +++ b/src/pdf-merger/LZWDecode.cpp @@ -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é. * diff --git a/src/pdf-merger/LZWDecode.h b/src/pdf-merger/LZWDecode.h index c7ce79ea..748e65dc 100644 --- a/src/pdf-merger/LZWDecode.h +++ b/src/pdf-merger/LZWDecode.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é. * diff --git a/src/pdf-merger/MediaBoxElementHandler.h b/src/pdf-merger/MediaBoxElementHandler.h index e5479624..b1d390c0 100644 --- a/src/pdf-merger/MediaBoxElementHandler.h +++ b/src/pdf-merger/MediaBoxElementHandler.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é. * diff --git a/src/pdf-merger/MergePageDescription.h b/src/pdf-merger/MergePageDescription.h index 6ad7af77..f9fee166 100644 --- a/src/pdf-merger/MergePageDescription.h +++ b/src/pdf-merger/MergePageDescription.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é. * diff --git a/src/pdf-merger/Merger.cpp b/src/pdf-merger/Merger.cpp index ab607b5a..8ba52d33 100644 --- a/src/pdf-merger/Merger.cpp +++ b/src/pdf-merger/Merger.cpp @@ -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é. * diff --git a/src/pdf-merger/Merger.h b/src/pdf-merger/Merger.h index 5b004d01..34172baf 100644 --- a/src/pdf-merger/Merger.h +++ b/src/pdf-merger/Merger.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é. * diff --git a/src/pdf-merger/Object.cpp b/src/pdf-merger/Object.cpp index 00f88647..93439cd4 100644 --- a/src/pdf-merger/Object.cpp +++ b/src/pdf-merger/Object.cpp @@ -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é. * diff --git a/src/pdf-merger/Object.h b/src/pdf-merger/Object.h index e1bdad6a..ff742c40 100644 --- a/src/pdf-merger/Object.h +++ b/src/pdf-merger/Object.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é. * diff --git a/src/pdf-merger/OverlayDocumentParser.cpp b/src/pdf-merger/OverlayDocumentParser.cpp index e237a252..956cec82 100644 --- a/src/pdf-merger/OverlayDocumentParser.cpp +++ b/src/pdf-merger/OverlayDocumentParser.cpp @@ -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é. * diff --git a/src/pdf-merger/OverlayDocumentParser.h b/src/pdf-merger/OverlayDocumentParser.h index 7829a0d6..14775a90 100644 --- a/src/pdf-merger/OverlayDocumentParser.h +++ b/src/pdf-merger/OverlayDocumentParser.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é. * diff --git a/src/pdf-merger/Page.cpp b/src/pdf-merger/Page.cpp index e92a7e66..7dfbfd81 100644 --- a/src/pdf-merger/Page.cpp +++ b/src/pdf-merger/Page.cpp @@ -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é. * diff --git a/src/pdf-merger/Page.h b/src/pdf-merger/Page.h index 4b67cfdb..fba3dfea 100644 --- a/src/pdf-merger/Page.h +++ b/src/pdf-merger/Page.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é. * diff --git a/src/pdf-merger/PageElementHandler.cpp b/src/pdf-merger/PageElementHandler.cpp index 4b6bff77..f45544f7 100644 --- a/src/pdf-merger/PageElementHandler.cpp +++ b/src/pdf-merger/PageElementHandler.cpp @@ -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é. * diff --git a/src/pdf-merger/PageElementHandler.h b/src/pdf-merger/PageElementHandler.h index b12060a6..e927d3cf 100644 --- a/src/pdf-merger/PageElementHandler.h +++ b/src/pdf-merger/PageElementHandler.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é. * diff --git a/src/pdf-merger/PageParser.h b/src/pdf-merger/PageParser.h index b8f9c7a7..f723cb29 100644 --- a/src/pdf-merger/PageParser.h +++ b/src/pdf-merger/PageParser.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é. * diff --git a/src/pdf-merger/Parser.cpp b/src/pdf-merger/Parser.cpp index 426efb22..78f9fe92 100644 --- a/src/pdf-merger/Parser.cpp +++ b/src/pdf-merger/Parser.cpp @@ -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é. * diff --git a/src/pdf-merger/Parser.h b/src/pdf-merger/Parser.h index 92673277..89917146 100644 --- a/src/pdf-merger/Parser.h +++ b/src/pdf-merger/Parser.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é. * diff --git a/src/pdf-merger/Rectangle.cpp b/src/pdf-merger/Rectangle.cpp index 674fb8d7..722a45d8 100644 --- a/src/pdf-merger/Rectangle.cpp +++ b/src/pdf-merger/Rectangle.cpp @@ -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é. * diff --git a/src/pdf-merger/Rectangle.h b/src/pdf-merger/Rectangle.h index 0d3fad63..db14d5b0 100644 --- a/src/pdf-merger/Rectangle.h +++ b/src/pdf-merger/Rectangle.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é. * diff --git a/src/pdf-merger/RemoveHimSelfHandler.h b/src/pdf-merger/RemoveHimSelfHandler.h index 69a436b2..64e41ada 100644 --- a/src/pdf-merger/RemoveHimSelfHandler.h +++ b/src/pdf-merger/RemoveHimSelfHandler.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é. * diff --git a/src/pdf-merger/RemoveHimselfHandler.cpp b/src/pdf-merger/RemoveHimselfHandler.cpp index 0bc91cab..2abc473b 100644 --- a/src/pdf-merger/RemoveHimselfHandler.cpp +++ b/src/pdf-merger/RemoveHimselfHandler.cpp @@ -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é. * diff --git a/src/pdf-merger/RotationHandler.h b/src/pdf-merger/RotationHandler.h index 10dcbd34..bbba9b6d 100644 --- a/src/pdf-merger/RotationHandler.h +++ b/src/pdf-merger/RotationHandler.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é. * diff --git a/src/pdf-merger/RunLengthDecode.cpp b/src/pdf-merger/RunLengthDecode.cpp index 223b8735..48da4cda 100644 --- a/src/pdf-merger/RunLengthDecode.cpp +++ b/src/pdf-merger/RunLengthDecode.cpp @@ -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é. * diff --git a/src/pdf-merger/RunLengthDecode.h b/src/pdf-merger/RunLengthDecode.h index 6bc76b1b..b29b01e0 100644 --- a/src/pdf-merger/RunLengthDecode.h +++ b/src/pdf-merger/RunLengthDecode.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é. * diff --git a/src/pdf-merger/Transformation.h b/src/pdf-merger/Transformation.h index 67f2e4a7..9be96d2f 100644 --- a/src/pdf-merger/Transformation.h +++ b/src/pdf-merger/Transformation.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é. * diff --git a/src/pdf-merger/TypeElementHandler.h b/src/pdf-merger/TypeElementHandler.h index f9ed9843..7c01456b 100644 --- a/src/pdf-merger/TypeElementHandler.h +++ b/src/pdf-merger/TypeElementHandler.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é. * diff --git a/src/pdf-merger/Utils.cpp b/src/pdf-merger/Utils.cpp index 926e90f8..305c8e07 100644 --- a/src/pdf-merger/Utils.cpp +++ b/src/pdf-merger/Utils.cpp @@ -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é. * diff --git a/src/pdf-merger/Utils.h b/src/pdf-merger/Utils.h index af5f54b5..2857df8e 100644 --- a/src/pdf-merger/Utils.h +++ b/src/pdf-merger/Utils.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é. * diff --git a/src/pdf/GraphicsPDFItem.cpp b/src/pdf/GraphicsPDFItem.cpp index 2bbbc232..b4c71edc 100644 --- a/src/pdf/GraphicsPDFItem.cpp +++ b/src/pdf/GraphicsPDFItem.cpp @@ -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é. * diff --git a/src/pdf/GraphicsPDFItem.h b/src/pdf/GraphicsPDFItem.h index 5045e487..3c4b6f38 100644 --- a/src/pdf/GraphicsPDFItem.h +++ b/src/pdf/GraphicsPDFItem.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é. * diff --git a/src/pdf/PDFRenderer.cpp b/src/pdf/PDFRenderer.cpp index d2def0ed..16b8821f 100644 --- a/src/pdf/PDFRenderer.cpp +++ b/src/pdf/PDFRenderer.cpp @@ -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é. * diff --git a/src/pdf/PDFRenderer.h b/src/pdf/PDFRenderer.h index feb12a80..0daa0e03 100644 --- a/src/pdf/PDFRenderer.h +++ b/src/pdf/PDFRenderer.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é. * diff --git a/src/pdf/UBWebPluginPDFWidget.cpp b/src/pdf/UBWebPluginPDFWidget.cpp index 1867cde4..0419713b 100644 --- a/src/pdf/UBWebPluginPDFWidget.cpp +++ b/src/pdf/UBWebPluginPDFWidget.cpp @@ -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é. * diff --git a/src/pdf/UBWebPluginPDFWidget.h b/src/pdf/UBWebPluginPDFWidget.h index d409dfed..681f2237 100644 --- a/src/pdf/UBWebPluginPDFWidget.h +++ b/src/pdf/UBWebPluginPDFWidget.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é. * diff --git a/src/pdf/XPDFRenderer.cpp b/src/pdf/XPDFRenderer.cpp index 6bb666f6..d50e559e 100644 --- a/src/pdf/XPDFRenderer.cpp +++ b/src/pdf/XPDFRenderer.cpp @@ -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é. * diff --git a/src/pdf/XPDFRenderer.h b/src/pdf/XPDFRenderer.h index 4254773f..ab9f3de2 100644 --- a/src/pdf/XPDFRenderer.h +++ b/src/pdf/XPDFRenderer.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é. * diff --git a/src/podcast/UBAbstractVideoEncoder.cpp b/src/podcast/UBAbstractVideoEncoder.cpp index 1475e5b1..d038fd11 100644 --- a/src/podcast/UBAbstractVideoEncoder.cpp +++ b/src/podcast/UBAbstractVideoEncoder.cpp @@ -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é. * diff --git a/src/podcast/UBAbstractVideoEncoder.h b/src/podcast/UBAbstractVideoEncoder.h index 312856e9..cd7bb9d3 100644 --- a/src/podcast/UBAbstractVideoEncoder.h +++ b/src/podcast/UBAbstractVideoEncoder.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é. * diff --git a/src/podcast/UBPodcastController.cpp b/src/podcast/UBPodcastController.cpp index 90b00dcb..01fd9246 100644 --- a/src/podcast/UBPodcastController.cpp +++ b/src/podcast/UBPodcastController.cpp @@ -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é. * diff --git a/src/podcast/UBPodcastController.h b/src/podcast/UBPodcastController.h index 5b02c7f8..14ae312e 100644 --- a/src/podcast/UBPodcastController.h +++ b/src/podcast/UBPodcastController.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é. * diff --git a/src/podcast/UBPodcastRecordingPalette.cpp b/src/podcast/UBPodcastRecordingPalette.cpp index 220f3529..bbea18c1 100644 --- a/src/podcast/UBPodcastRecordingPalette.cpp +++ b/src/podcast/UBPodcastRecordingPalette.cpp @@ -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é. * diff --git a/src/podcast/UBPodcastRecordingPalette.h b/src/podcast/UBPodcastRecordingPalette.h index 44eb9944..aece20c6 100644 --- a/src/podcast/UBPodcastRecordingPalette.h +++ b/src/podcast/UBPodcastRecordingPalette.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é. * diff --git a/src/podcast/intranet/UBIntranetPodcastPublisher.cpp b/src/podcast/intranet/UBIntranetPodcastPublisher.cpp index 7e914441..512d087d 100644 --- a/src/podcast/intranet/UBIntranetPodcastPublisher.cpp +++ b/src/podcast/intranet/UBIntranetPodcastPublisher.cpp @@ -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é. * diff --git a/src/podcast/intranet/UBIntranetPodcastPublisher.h b/src/podcast/intranet/UBIntranetPodcastPublisher.h index 26652e38..5a764aa7 100644 --- a/src/podcast/intranet/UBIntranetPodcastPublisher.h +++ b/src/podcast/intranet/UBIntranetPodcastPublisher.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é. * diff --git a/src/podcast/quicktime/UBAudioQueueRecorder.cpp b/src/podcast/quicktime/UBAudioQueueRecorder.cpp index 1f5c11f5..46d7d9b9 100644 --- a/src/podcast/quicktime/UBAudioQueueRecorder.cpp +++ b/src/podcast/quicktime/UBAudioQueueRecorder.cpp @@ -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é. * diff --git a/src/podcast/quicktime/UBAudioQueueRecorder.h b/src/podcast/quicktime/UBAudioQueueRecorder.h index c5744abb..31e7aa80 100644 --- a/src/podcast/quicktime/UBAudioQueueRecorder.h +++ b/src/podcast/quicktime/UBAudioQueueRecorder.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é. * diff --git a/src/podcast/quicktime/UBQuickTimeFile.cpp b/src/podcast/quicktime/UBQuickTimeFile.cpp index b47198f8..8b6451de 100644 --- a/src/podcast/quicktime/UBQuickTimeFile.cpp +++ b/src/podcast/quicktime/UBQuickTimeFile.cpp @@ -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é. * diff --git a/src/podcast/quicktime/UBQuickTimeFile.h b/src/podcast/quicktime/UBQuickTimeFile.h index be5ef9ed..996e25a9 100644 --- a/src/podcast/quicktime/UBQuickTimeFile.h +++ b/src/podcast/quicktime/UBQuickTimeFile.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é. * diff --git a/src/podcast/quicktime/UBQuickTimeVideoEncoder.cpp b/src/podcast/quicktime/UBQuickTimeVideoEncoder.cpp index 03f9a192..a43849fb 100644 --- a/src/podcast/quicktime/UBQuickTimeVideoEncoder.cpp +++ b/src/podcast/quicktime/UBQuickTimeVideoEncoder.cpp @@ -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é. * diff --git a/src/podcast/quicktime/UBQuickTimeVideoEncoder.h b/src/podcast/quicktime/UBQuickTimeVideoEncoder.h index 6127d2db..67262d62 100644 --- a/src/podcast/quicktime/UBQuickTimeVideoEncoder.h +++ b/src/podcast/quicktime/UBQuickTimeVideoEncoder.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é. * diff --git a/src/podcast/windowsmedia/UBWaveRecorder.cpp b/src/podcast/windowsmedia/UBWaveRecorder.cpp index 527426cd..c347093e 100644 --- a/src/podcast/windowsmedia/UBWaveRecorder.cpp +++ b/src/podcast/windowsmedia/UBWaveRecorder.cpp @@ -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é. * diff --git a/src/podcast/windowsmedia/UBWaveRecorder.h b/src/podcast/windowsmedia/UBWaveRecorder.h index a7cce208..d136c579 100644 --- a/src/podcast/windowsmedia/UBWaveRecorder.h +++ b/src/podcast/windowsmedia/UBWaveRecorder.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é. * diff --git a/src/podcast/windowsmedia/UBWindowsMediaFile.cpp b/src/podcast/windowsmedia/UBWindowsMediaFile.cpp index 7011e21f..3b8f6b98 100644 --- a/src/podcast/windowsmedia/UBWindowsMediaFile.cpp +++ b/src/podcast/windowsmedia/UBWindowsMediaFile.cpp @@ -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é. * diff --git a/src/podcast/windowsmedia/UBWindowsMediaFile.h b/src/podcast/windowsmedia/UBWindowsMediaFile.h index 97278ce7..2bcb20ad 100644 --- a/src/podcast/windowsmedia/UBWindowsMediaFile.h +++ b/src/podcast/windowsmedia/UBWindowsMediaFile.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é. * diff --git a/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp b/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp index f814485b..659f1cf2 100644 --- a/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp +++ b/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.cpp @@ -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é. * diff --git a/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.h b/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.h index f5f55fba..adb24a23 100644 --- a/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.h +++ b/src/podcast/windowsmedia/UBWindowsMediaVideoEncoder.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é. * diff --git a/src/podcast/youtube/UBYouTubePublisher.cpp b/src/podcast/youtube/UBYouTubePublisher.cpp index 10342d2f..e6d22126 100644 --- a/src/podcast/youtube/UBYouTubePublisher.cpp +++ b/src/podcast/youtube/UBYouTubePublisher.cpp @@ -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é. * diff --git a/src/podcast/youtube/UBYouTubePublisher.h b/src/podcast/youtube/UBYouTubePublisher.h index 7381649a..9b0a52d0 100644 --- a/src/podcast/youtube/UBYouTubePublisher.h +++ b/src/podcast/youtube/UBYouTubePublisher.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é. * diff --git a/src/tools/UBAbstractDrawRuler.cpp b/src/tools/UBAbstractDrawRuler.cpp index dab62567..b5aad3bd 100644 --- a/src/tools/UBAbstractDrawRuler.cpp +++ b/src/tools/UBAbstractDrawRuler.cpp @@ -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é. * diff --git a/src/tools/UBAbstractDrawRuler.h b/src/tools/UBAbstractDrawRuler.h index 7015f708..f8955381 100644 --- a/src/tools/UBAbstractDrawRuler.h +++ b/src/tools/UBAbstractDrawRuler.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é. * @@ -44,9 +44,6 @@ public: virtual void DrawLine(const QPointF& position, qreal width); virtual void EndLine(); - signals: - void hidden(); - protected: void paint(); diff --git a/src/tools/UBGraphicsCache.cpp b/src/tools/UBGraphicsCache.cpp index 537e17e7..bd923d78 100644 --- a/src/tools/UBGraphicsCache.cpp +++ b/src/tools/UBGraphicsCache.cpp @@ -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é. * diff --git a/src/tools/UBGraphicsCache.h b/src/tools/UBGraphicsCache.h index 89510b66..2aa87bbd 100644 --- a/src/tools/UBGraphicsCache.h +++ b/src/tools/UBGraphicsCache.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é. * diff --git a/src/tools/UBGraphicsCompass.cpp b/src/tools/UBGraphicsCompass.cpp index d9b7a47d..6d321986 100644 --- a/src/tools/UBGraphicsCompass.cpp +++ b/src/tools/UBGraphicsCompass.cpp @@ -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é. * @@ -222,7 +222,7 @@ void UBGraphicsCompass::mousePressEvent(QGraphicsSceneMouseEvent *event) } QGraphicsRectItem::mousePressEvent(event); } - else + else closing = true; mResizeSvgItem->setVisible(mShowButtons && mResizing); @@ -299,8 +299,6 @@ void UBGraphicsCompass::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) else if (closeButtonRect().contains(event->pos())) { hide(); - - emit hidden(); event->accept(); } else diff --git a/src/tools/UBGraphicsCompass.h b/src/tools/UBGraphicsCompass.h index 2af6c2e7..96263ffe 100644 --- a/src/tools/UBGraphicsCompass.h +++ b/src/tools/UBGraphicsCompass.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é. * @@ -51,10 +51,6 @@ class UBGraphicsCompass: public QObject, public QGraphicsRectItem, public UBItem virtual void copyItemParameters(UBItem *copy) const; - signals: - - void hidden(); - protected: virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *styleOption, QWidget *widget); virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); diff --git a/src/tools/UBGraphicsCurtainItem.cpp b/src/tools/UBGraphicsCurtainItem.cpp index 116205f3..30f92eee 100644 --- a/src/tools/UBGraphicsCurtainItem.cpp +++ b/src/tools/UBGraphicsCurtainItem.cpp @@ -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é. * diff --git a/src/tools/UBGraphicsCurtainItem.h b/src/tools/UBGraphicsCurtainItem.h index 2dbd4d62..1d0ce652 100644 --- a/src/tools/UBGraphicsCurtainItem.h +++ b/src/tools/UBGraphicsCurtainItem.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é. * diff --git a/src/tools/UBGraphicsCurtainItemDelegate.cpp b/src/tools/UBGraphicsCurtainItemDelegate.cpp index 06f24a27..0a3da8d9 100644 --- a/src/tools/UBGraphicsCurtainItemDelegate.cpp +++ b/src/tools/UBGraphicsCurtainItemDelegate.cpp @@ -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é. * diff --git a/src/tools/UBGraphicsCurtainItemDelegate.h b/src/tools/UBGraphicsCurtainItemDelegate.h index 40bf047d..36040ba9 100644 --- a/src/tools/UBGraphicsCurtainItemDelegate.h +++ b/src/tools/UBGraphicsCurtainItemDelegate.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é. * diff --git a/src/tools/UBGraphicsProtractor.cpp b/src/tools/UBGraphicsProtractor.cpp index 26f01f39..e7cd626d 100644 --- a/src/tools/UBGraphicsProtractor.cpp +++ b/src/tools/UBGraphicsProtractor.cpp @@ -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é. * @@ -240,7 +240,6 @@ void UBGraphicsProtractor::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) case Close : hide(); - emit hidden(); break; case MoveMarker : diff --git a/src/tools/UBGraphicsProtractor.h b/src/tools/UBGraphicsProtractor.h index d47e5bae..1fd8929c 100644 --- a/src/tools/UBGraphicsProtractor.h +++ b/src/tools/UBGraphicsProtractor.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é. * diff --git a/src/tools/UBGraphicsRuler.cpp b/src/tools/UBGraphicsRuler.cpp index 801f829a..1ecaaf2a 100644 --- a/src/tools/UBGraphicsRuler.cpp +++ b/src/tools/UBGraphicsRuler.cpp @@ -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é. * @@ -371,7 +371,6 @@ void UBGraphicsRuler::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) else if (closeButtonRect().contains(event->pos())) { hide(); - emit hidden(); event->accept(); } else diff --git a/src/tools/UBGraphicsRuler.h b/src/tools/UBGraphicsRuler.h index 9a4f3066..8201045d 100644 --- a/src/tools/UBGraphicsRuler.h +++ b/src/tools/UBGraphicsRuler.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é. * diff --git a/src/tools/UBGraphicsTriangle.cpp b/src/tools/UBGraphicsTriangle.cpp index 262c657a..ee53dcc9 100644 --- a/src/tools/UBGraphicsTriangle.cpp +++ b/src/tools/UBGraphicsTriangle.cpp @@ -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é. * @@ -33,7 +33,7 @@ #include "core/memcheck.h" const QRect UBGraphicsTriangle::sDefaultRect = QRect(0, 0, 800, 400); -const UBGraphicsTriangle::UBGraphicsTriangleOrientation UBGraphicsTriangle::sDefaultOrientation = +const UBGraphicsTriangle::UBGraphicsTriangleOrientation UBGraphicsTriangle::sDefaultOrientation = UBGraphicsTriangle::BottomLeft; UBGraphicsTriangle::UBGraphicsTriangle() @@ -114,7 +114,7 @@ void UBGraphicsTriangle::copyItemParameters(UBItem *copy) const { UBGraphicsTriangle* cp = dynamic_cast(copy); if (cp) - { + { cp->setPos(this->pos()); cp->setPolygon(this->polygon()); cp->setTransform(this->transform()); @@ -332,7 +332,7 @@ void UBGraphicsTriangle::paintGraduations(QPainter *painter) if (lineY <= rotationCenter().y() - ky * graduationHeight) break; } - + painter->drawLine(QLine(graduationX, rotationCenter().y(), graduationX, rotationCenter().y() - ky * graduationHeight)); if (0 == millimeters % UBGeometryUtils::millimetersPerCentimeter) { @@ -371,7 +371,7 @@ void UBGraphicsTriangle::paintGraduations(QPainter *painter) if (bText) painter->drawText( - QRectF(graduationX - textWidth / 2, + QRectF(graduationX - textWidth / 2, textY, textWidth, textHeight), Qt::AlignVCenter, text); @@ -418,23 +418,23 @@ QRectF UBGraphicsTriangle::closeButtonRect() const switch(mOrientation) { case BottomLeft: - return QRectF(B2.x() - mCloseSvgItem->boundingRect().width() - 5, - B2.y() - mCloseSvgItem->boundingRect().height() - 5, + return QRectF(B2.x() - mCloseSvgItem->boundingRect().width() - 5, + B2.y() - mCloseSvgItem->boundingRect().height() - 5, mCloseSvgItem->boundingRect().width(), mCloseSvgItem->boundingRect().height()); case TopLeft: - return QRectF(B2.x() - mCloseSvgItem->boundingRect().width() - 5, - B2.y() + 5, + return QRectF(B2.x() - mCloseSvgItem->boundingRect().width() - 5, + B2.y() + 5, mCloseSvgItem->boundingRect().width(), mCloseSvgItem->boundingRect().height()); case TopRight: - return QRectF(B2.x() + 5, - B2.y() + 5, + return QRectF(B2.x() + 5, + B2.y() + 5, mCloseSvgItem->boundingRect().width(), mCloseSvgItem->boundingRect().height()); case BottomRight: - return QRectF(B2.x() + 5, - B2.y() - mCloseSvgItem->boundingRect().height() - 5, + return QRectF(B2.x() + 5, + B2.y() - mCloseSvgItem->boundingRect().height() - 5, mCloseSvgItem->boundingRect().width(), mCloseSvgItem->boundingRect().height()); } @@ -466,7 +466,7 @@ QPolygonF UBGraphicsTriangle::resize1Polygon() const QPointF P1(C1.x() + x1 * sArrowLength, C1.y()); QPointF P2(C1.x() + x1 * sArrowLength * rect().width()/C, C1.y() + y1 * sArrowLength * rect().height() / C); QPolygonF p; - p << C1 << P1 << P2; + p << C1 << P1 << P2; return p; } @@ -493,10 +493,10 @@ QPolygonF UBGraphicsTriangle::resize2Polygon() const break; } QPointF P1(A1.x(), A1.y() + y1 * sArrowLength); - QPointF P2(A1.x() + x1 * sArrowLength * rect().width()/C, + QPointF P2(A1.x() + x1 * sArrowLength * rect().width()/C, A1.y() + y1 * sArrowLength * rect().height() / C); QPolygonF p; - p << A1 << P1 << P2; + p << A1 << P1 << P2; return p; } @@ -506,23 +506,23 @@ QRectF UBGraphicsTriangle::hFlipRect() const switch(mOrientation) { case BottomLeft: - return QRectF(B2.x() - mHFlipSvgItem->boundingRect().width() - 5, - B2.y() - mHFlipSvgItem->boundingRect().height() - 5 - dy, + return QRectF(B2.x() - mHFlipSvgItem->boundingRect().width() - 5, + B2.y() - mHFlipSvgItem->boundingRect().height() - 5 - dy, mHFlipSvgItem->boundingRect().width(), mHFlipSvgItem->boundingRect().height()); case TopLeft: - return QRectF(B2.x() - mHFlipSvgItem->boundingRect().width() - 5, - B2.y() + 5 + dy, + return QRectF(B2.x() - mHFlipSvgItem->boundingRect().width() - 5, + B2.y() + 5 + dy, mHFlipSvgItem->boundingRect().width(), mHFlipSvgItem->boundingRect().height()); case TopRight: - return QRectF(B2.x() + 5, - B2.y() + 5 + dy, + return QRectF(B2.x() + 5, + B2.y() + 5 + dy, mHFlipSvgItem->boundingRect().width(), mHFlipSvgItem->boundingRect().height()); case BottomRight: - return QRectF(B2.x() + 5, - B2.y() - mHFlipSvgItem->boundingRect().height() - 5 - dy, + return QRectF(B2.x() + 5, + B2.y() - mHFlipSvgItem->boundingRect().height() - 5 - dy, mHFlipSvgItem->boundingRect().width(), mHFlipSvgItem->boundingRect().height()); } @@ -535,23 +535,23 @@ QRectF UBGraphicsTriangle::vFlipRect() const switch(mOrientation) { case BottomLeft: - return QRectF(B2.x() - mVFlipSvgItem->boundingRect().width() - 5, - B2.y() - mVFlipSvgItem->boundingRect().height() - 5 - dy, + return QRectF(B2.x() - mVFlipSvgItem->boundingRect().width() - 5, + B2.y() - mVFlipSvgItem->boundingRect().height() - 5 - dy, mVFlipSvgItem->boundingRect().width(), mVFlipSvgItem->boundingRect().height()); case TopLeft: - return QRectF(B2.x() - mVFlipSvgItem->boundingRect().width() - 5, - B2.y() + 5 + dy, + return QRectF(B2.x() - mVFlipSvgItem->boundingRect().width() - 5, + B2.y() + 5 + dy, mVFlipSvgItem->boundingRect().width(), mVFlipSvgItem->boundingRect().height()); case TopRight: - return QRectF(B2.x() + 5, - B2.y() + 5 + dy, + return QRectF(B2.x() + 5, + B2.y() + 5 + dy, mVFlipSvgItem->boundingRect().width(), mVFlipSvgItem->boundingRect().height()); case BottomRight: - return QRectF(B2.x() + 5, - B2.y() - mVFlipSvgItem->boundingRect().height() - 5 - dy, + return QRectF(B2.x() + 5, + B2.y() - mVFlipSvgItem->boundingRect().height() - 5 - dy, mVFlipSvgItem->boundingRect().width(), mVFlipSvgItem->boundingRect().height()); } @@ -605,13 +605,13 @@ void UBGraphicsTriangle::mousePressEvent(QGraphicsSceneMouseEvent *event) mResizing1 = true; event->accept(); } - else + else if (resize2Polygon().containsPoint(event->pos().toPoint(), Qt::OddEvenFill)) { mResizing2 = true; event->accept(); } - else + else if(rotateRect().contains(event->pos())) { mRotating = true; @@ -631,7 +631,7 @@ void UBGraphicsTriangle::mousePressEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsTriangle::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { - + if (!mResizing1 && !mResizing2 && !mRotating) { QGraphicsItem::mouseMoveEvent(event); @@ -716,7 +716,6 @@ void UBGraphicsTriangle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) else if (closeButtonRect().contains(event->pos())) { hide(); - emit hidden(); event->accept(); } else if (hFlipRect().contains(event->pos())) diff --git a/src/tools/UBGraphicsTriangle.h b/src/tools/UBGraphicsTriangle.h index 7fd83c55..e8a2fdb0 100644 --- a/src/tools/UBGraphicsTriangle.h +++ b/src/tools/UBGraphicsTriangle.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é. * diff --git a/src/tools/UBToolsManager.cpp b/src/tools/UBToolsManager.cpp index 64125be0..f6c4cb17 100644 --- a/src/tools/UBToolsManager.cpp +++ b/src/tools/UBToolsManager.cpp @@ -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é. * diff --git a/src/tools/UBToolsManager.h b/src/tools/UBToolsManager.h index 0da57e90..a7aa539e 100644 --- a/src/tools/UBToolsManager.h +++ b/src/tools/UBToolsManager.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é. * diff --git a/src/web/UBOEmbedParser.cpp b/src/web/UBOEmbedParser.cpp index 8c60e167..8f8b5a63 100644 --- a/src/web/UBOEmbedParser.cpp +++ b/src/web/UBOEmbedParser.cpp @@ -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é. * diff --git a/src/web/UBOEmbedParser.h b/src/web/UBOEmbedParser.h index 98107f2a..2be41508 100644 --- a/src/web/UBOEmbedParser.h +++ b/src/web/UBOEmbedParser.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é. * diff --git a/src/web/UBTrapFlashController.cpp b/src/web/UBTrapFlashController.cpp index 6fb6f7d0..1487f91c 100644 --- a/src/web/UBTrapFlashController.cpp +++ b/src/web/UBTrapFlashController.cpp @@ -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é. * diff --git a/src/web/UBTrapFlashController.h b/src/web/UBTrapFlashController.h index 4491e164..7fa4d060 100644 --- a/src/web/UBTrapFlashController.h +++ b/src/web/UBTrapFlashController.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é. * diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index 87837e34..7eaacecf 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -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é. * @@ -75,7 +75,6 @@ UBWebController::UBWebController(UBMainWindow* mainWindow) mStackedWidget = new QStackedWidget(); mStackedWidget->addWidget(new QWidget(mStackedWidget)); mStackedWidget->addWidget(new QWidget(mStackedWidget)); - mStackedWidget->addWidget(new QWidget(mStackedWidget)); mMainWindow->addWebWidget(mStackedWidget); @@ -246,62 +245,6 @@ void UBWebController::tutorialWebInstance() } -void UBWebController::paraschoolWebInstance() -{ - QLocale locale = QLocale(); - QString language = "_" + locale.name().left(2); - QString editorPath = "/etc/SankoreEditor/editor" + language + "/index.html"; - QString editorHtmlIndexFile; -#if defined(Q_WS_MAC) - editorHtmlIndexFile = QApplication::applicationDirPath() + "/../Resources" + editorPath; -#elif defined(Q_WS_WIN) - editorHtmlIndexFile = QApplication::applicationDirPath() + editorPath; -#else - editorHtmlIndexFile = QApplication::applicationDirPath() + editorPath; -#endif - - QUrl currentUrl = QUrl::fromLocalFile(editorHtmlIndexFile); - - if (UBSettings::settings()->webUseExternalBrowser->get().toBool()){ - QDesktopServices::openUrl(currentUrl); - } - - else { - mCurrentWebBrowser = &mWebBrowserList[Paraschool]; - mToolsCurrentPalette = &mToolsPaletteList[Paraschool]; - mToolsPalettePositionned = &mToolsPalettePositionnedList[Paraschool]; - if (!(*mCurrentWebBrowser)){ - (*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow, true); - connect((*mCurrentWebBrowser), SIGNAL(activeViewChange(QWidget*)), this, SLOT(setSourceWidget(QWidget*))); - - mStackedWidget->setCurrentIndex(Paraschool); - if (mStackedWidget->currentWidget()) { - mStackedWidget->removeWidget(mStackedWidget->currentWidget()); - } - mStackedWidget->insertWidget(Paraschool, (*mCurrentWebBrowser)); - - adaptToolBar(); - - mTrapFlashController = new UBTrapFlashController((*mCurrentWebBrowser)); - - connect((*mCurrentWebBrowser), SIGNAL(activeViewPageChanged()), this, SLOT(activePageChanged())); - (*mCurrentWebBrowser)->loadUrl(currentUrl); - (*mCurrentWebBrowser)->tabWidget()->tabBar()->hide(); - (*mCurrentWebBrowser)->tabWidget()->lineEdits()->hide(); - - } - - mStackedWidget->setCurrentIndex(Paraschool); - UBApplication::applicationController->setMirrorSourceWidget((*mCurrentWebBrowser)->paintWidget()); - mMainWindow->switchToWebWidget(); - screenLayoutChanged(); - - bool mirroring = UBSettings::settings()->webShowPageImmediatelyOnMirroredScreen->get().toBool(); - UBApplication::mainWindow->actionWebShowHideOnDisplay->setChecked(mirroring); - } -} - - void UBWebController::show(WebInstance type) { switch(type) @@ -312,9 +255,6 @@ void UBWebController::show(WebInstance type) case Tutorial: tutorialWebInstance(); break; - case Paraschool: - paraschoolWebInstance(); - break; default: qCritical() << __FILE__ << " non supported web instance type " << QString::number(type) ; break; diff --git a/src/web/UBWebController.h b/src/web/UBWebController.h index 3f239402..6bba430a 100644 --- a/src/web/UBWebController.h +++ b/src/web/UBWebController.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é. * @@ -60,7 +60,7 @@ class UBWebController : public QObject enum WebInstance { - WebBrowser = 0, Tutorial, Paraschool, TotalNumberOfWebInstances + WebBrowser = 0, Tutorial, TotalNumberOfWebInstances }; void show(WebInstance type = UBWebController::WebBrowser); @@ -108,7 +108,6 @@ class UBWebController : public QObject void initialiazemOEmbedProviders(); void tutorialWebInstance(); void webBrowserInstance(); - void paraschoolWebInstance(); void lookForEmbedContent(QString* pHtml, QString tag, QString attribute, QList* pList); void checkForOEmbed(QString* pHtml); @@ -123,8 +122,6 @@ class UBWebController : public QObject UBTrapFlashController* mTrapFlashController; UBWebToolsPalette** mToolsCurrentPalette; UBWebToolsPalette* mToolsPaletteList[TotalNumberOfWebInstances]; -// UBKeyboardPalette** mKeyboardCurrentPalette; -// UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances]; bool mToolsPalettePositionned; bool mToolsPalettePositionnedList[TotalNumberOfWebInstances]; @@ -144,7 +141,6 @@ class UBWebController : public QObject void toggleWebTrap(bool checked); void onOEmbedParsed(QVector contents); -// void showKeyboard(bool checked); signals: /** diff --git a/src/web/UBWebKitUtils.cpp b/src/web/UBWebKitUtils.cpp index 514f4a6d..fad27116 100644 --- a/src/web/UBWebKitUtils.cpp +++ b/src/web/UBWebKitUtils.cpp @@ -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é. * diff --git a/src/web/UBWebKitUtils.h b/src/web/UBWebKitUtils.h index fbda8b73..c00fcf22 100644 --- a/src/web/UBWebKitUtils.h +++ b/src/web/UBWebKitUtils.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é. * diff --git a/src/web/UBWebPage.cpp b/src/web/UBWebPage.cpp index d48666ae..6597317b 100644 --- a/src/web/UBWebPage.cpp +++ b/src/web/UBWebPage.cpp @@ -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é. * diff --git a/src/web/UBWebPage.h b/src/web/UBWebPage.h index d8340dbd..e470039e 100644 --- a/src/web/UBWebPage.h +++ b/src/web/UBWebPage.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é. * diff --git a/src/web/UBWebPluginWidget.cpp b/src/web/UBWebPluginWidget.cpp index a8d120ee..7128b460 100644 --- a/src/web/UBWebPluginWidget.cpp +++ b/src/web/UBWebPluginWidget.cpp @@ -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é. * diff --git a/src/web/UBWebPluginWidget.h b/src/web/UBWebPluginWidget.h index 0a752a2b..333783ba 100644 --- a/src/web/UBWebPluginWidget.h +++ b/src/web/UBWebPluginWidget.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é. * diff --git a/src/web/browser/WBBrowserWindow.cpp b/src/web/browser/WBBrowserWindow.cpp index 2649da32..74286edc 100644 --- a/src/web/browser/WBBrowserWindow.cpp +++ b/src/web/browser/WBBrowserWindow.cpp @@ -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é. * diff --git a/src/web/browser/WBBrowserWindow.h b/src/web/browser/WBBrowserWindow.h index e4885148..a26530a8 100644 --- a/src/web/browser/WBBrowserWindow.h +++ b/src/web/browser/WBBrowserWindow.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é. * diff --git a/src/web/browser/WBChaseWidget.cpp b/src/web/browser/WBChaseWidget.cpp index 582d0ac3..7d7c841c 100644 --- a/src/web/browser/WBChaseWidget.cpp +++ b/src/web/browser/WBChaseWidget.cpp @@ -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é. * diff --git a/src/web/browser/WBChaseWidget.h b/src/web/browser/WBChaseWidget.h index 0577c449..7252fe8f 100644 --- a/src/web/browser/WBChaseWidget.h +++ b/src/web/browser/WBChaseWidget.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é. * diff --git a/src/web/browser/WBDownloadManager.cpp b/src/web/browser/WBDownloadManager.cpp index cfad8b50..6692cc48 100644 --- a/src/web/browser/WBDownloadManager.cpp +++ b/src/web/browser/WBDownloadManager.cpp @@ -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é. * diff --git a/src/web/browser/WBDownloadManager.h b/src/web/browser/WBDownloadManager.h index d1af7a36..16fdb961 100644 --- a/src/web/browser/WBDownloadManager.h +++ b/src/web/browser/WBDownloadManager.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é. * diff --git a/src/web/browser/WBEditTableView.cpp b/src/web/browser/WBEditTableView.cpp index f7357f16..88bede00 100644 --- a/src/web/browser/WBEditTableView.cpp +++ b/src/web/browser/WBEditTableView.cpp @@ -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é. * diff --git a/src/web/browser/WBEditTableView.h b/src/web/browser/WBEditTableView.h index 7b0ff700..691d44cf 100644 --- a/src/web/browser/WBEditTableView.h +++ b/src/web/browser/WBEditTableView.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é. * diff --git a/src/web/browser/WBHistory.cpp b/src/web/browser/WBHistory.cpp index 2d46dce0..7cd455f5 100644 --- a/src/web/browser/WBHistory.cpp +++ b/src/web/browser/WBHistory.cpp @@ -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é. * diff --git a/src/web/browser/WBHistory.h b/src/web/browser/WBHistory.h index 9510da9d..e8a6afd6 100644 --- a/src/web/browser/WBHistory.h +++ b/src/web/browser/WBHistory.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é. * diff --git a/src/web/browser/WBModelMenu.cpp b/src/web/browser/WBModelMenu.cpp index 66da00d6..4561baa5 100644 --- a/src/web/browser/WBModelMenu.cpp +++ b/src/web/browser/WBModelMenu.cpp @@ -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é. * diff --git a/src/web/browser/WBModelMenu.h b/src/web/browser/WBModelMenu.h index 50c794a4..71a58bf2 100644 --- a/src/web/browser/WBModelMenu.h +++ b/src/web/browser/WBModelMenu.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é. * diff --git a/src/web/browser/WBSearchLineEdit.cpp b/src/web/browser/WBSearchLineEdit.cpp index 8562fb71..a74d12d1 100644 --- a/src/web/browser/WBSearchLineEdit.cpp +++ b/src/web/browser/WBSearchLineEdit.cpp @@ -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é. * diff --git a/src/web/browser/WBSearchLineEdit.h b/src/web/browser/WBSearchLineEdit.h index 2b1d2d7f..af160508 100644 --- a/src/web/browser/WBSearchLineEdit.h +++ b/src/web/browser/WBSearchLineEdit.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é. * diff --git a/src/web/browser/WBSqueezeLabel.cpp b/src/web/browser/WBSqueezeLabel.cpp index fa8041d1..e1de11d1 100644 --- a/src/web/browser/WBSqueezeLabel.cpp +++ b/src/web/browser/WBSqueezeLabel.cpp @@ -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é. * diff --git a/src/web/browser/WBSqueezeLabel.h b/src/web/browser/WBSqueezeLabel.h index 96105ead..f1ac5305 100644 --- a/src/web/browser/WBSqueezeLabel.h +++ b/src/web/browser/WBSqueezeLabel.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é. * diff --git a/src/web/browser/WBTabWidget.cpp b/src/web/browser/WBTabWidget.cpp index d4e85e6a..141e73c1 100644 --- a/src/web/browser/WBTabWidget.cpp +++ b/src/web/browser/WBTabWidget.cpp @@ -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é. * diff --git a/src/web/browser/WBTabWidget.h b/src/web/browser/WBTabWidget.h index 15292389..bb416cbf 100644 --- a/src/web/browser/WBTabWidget.h +++ b/src/web/browser/WBTabWidget.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é. * diff --git a/src/web/browser/WBToolBarSearch.cpp b/src/web/browser/WBToolBarSearch.cpp index f78ebe81..d21f98cc 100644 --- a/src/web/browser/WBToolBarSearch.cpp +++ b/src/web/browser/WBToolBarSearch.cpp @@ -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é. * diff --git a/src/web/browser/WBToolBarSearch.h b/src/web/browser/WBToolBarSearch.h index ac465334..e639118b 100644 --- a/src/web/browser/WBToolBarSearch.h +++ b/src/web/browser/WBToolBarSearch.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é. * diff --git a/src/web/browser/WBUrlLineEdit.cpp b/src/web/browser/WBUrlLineEdit.cpp index 0649f806..50df2226 100644 --- a/src/web/browser/WBUrlLineEdit.cpp +++ b/src/web/browser/WBUrlLineEdit.cpp @@ -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é. * diff --git a/src/web/browser/WBUrlLineEdit.h b/src/web/browser/WBUrlLineEdit.h index dcd5490a..a98dfa9b 100644 --- a/src/web/browser/WBUrlLineEdit.h +++ b/src/web/browser/WBUrlLineEdit.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é. * diff --git a/src/web/browser/WBWebTrapWebView.cpp b/src/web/browser/WBWebTrapWebView.cpp index 30373cf9..3b06ce89 100644 --- a/src/web/browser/WBWebTrapWebView.cpp +++ b/src/web/browser/WBWebTrapWebView.cpp @@ -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é. * diff --git a/src/web/browser/WBWebTrapWebView.h b/src/web/browser/WBWebTrapWebView.h index b838f9b5..0167be14 100644 --- a/src/web/browser/WBWebTrapWebView.h +++ b/src/web/browser/WBWebTrapWebView.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é. * diff --git a/src/web/browser/WBWebView.cpp b/src/web/browser/WBWebView.cpp index ec5d1b7a..e943e5ff 100644 --- a/src/web/browser/WBWebView.cpp +++ b/src/web/browser/WBWebView.cpp @@ -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é. * diff --git a/src/web/browser/WBWebView.h b/src/web/browser/WBWebView.h index d9119e84..413506f0 100644 --- a/src/web/browser/WBWebView.h +++ b/src/web/browser/WBWebView.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é. * diff --git a/tools/CrashReportViewer/Bug.icns b/tools/CrashReportViewer/Bug.icns deleted file mode 100644 index 07c91b54..00000000 Binary files a/tools/CrashReportViewer/Bug.icns and /dev/null differ diff --git a/tools/CrashReportViewer/CrashReportViewer.pro b/tools/CrashReportViewer/CrashReportViewer.pro deleted file mode 100644 index 5a08f6e8..00000000 --- a/tools/CrashReportViewer/CrashReportViewer.pro +++ /dev/null @@ -1,28 +0,0 @@ -TEMPLATE = app -VERSION = 1.0 -TARGET = "Crash Report Viewer" - -DESTDIR = "build/macx" -OBJECTS_DIR = "build/macx/objects" -MOC_DIR = "build/macx/moc" -RCC_DIR = "build/macx/rcc" -UI_DIR = "build/macx/ui" - -INCLUDEPATH += ../../thirdparty/google-breakpad/r318/include/google_breakpad -LIBS += "-L../../thirdparty/google-breakpad/r318/lib/macx" "-lbreakpad" - -SOURCES = main.cpp \ - CrashWindow.cpp \ - CrashReporterSymbolSupplier.cpp - -HEADERS += CrashWindow.h \ - CrashReporterSymbolSupplier.h - -FORMS += CrashReportViewer.ui - -QMAKE_INFO_PLIST = Info.plist - -ICON.files = "Bug.icns" -ICON.path = "Contents/Resources" - -QMAKE_BUNDLE_DATA = "ICON" diff --git a/tools/CrashReportViewer/CrashReportViewer.ui b/tools/CrashReportViewer/CrashReportViewer.ui deleted file mode 100644 index dd8e9f1a..00000000 --- a/tools/CrashReportViewer/CrashReportViewer.ui +++ /dev/null @@ -1,106 +0,0 @@ - - - UniboardCrashreporter - - - - 0 - 0 - 874 - 515 - - - - Uniboard Crash Reporter - - - - - - - - - - - - Dump File Path - - - - - - - UB Sym File Path - - - - - - - - - - - - - - - - - - - - - - - - - - - ... - - - - - - - ... - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - View report - - - - - - - - - - - - - diff --git a/tools/CrashReportViewer/CrashReporterSymbolSupplier.cpp b/tools/CrashReportViewer/CrashReporterSymbolSupplier.cpp deleted file mode 100644 index 4b126d98..00000000 --- a/tools/CrashReportViewer/CrashReporterSymbolSupplier.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - -#include -#include -#include - -#include "CrashReporterSymbolSupplier.h" -#include "google_breakpad/processor/basic_source_line_resolver.h" -#include "google_breakpad/processor/minidump.h" -#include "google_breakpad/processor/system_info.h" -#include "processor/pathname_stripper.h" - - - -CrashReporterSymbolSupplier::CrashReporterSymbolSupplier(QString pUniboardSymFiles) { - mUniboardSymFile.setFileName(pUniboardSymFiles); -} -// Returns the path to the symbol file for the given module. -google_breakpad::SymbolSupplier::SymbolResult CrashReporterSymbolSupplier::GetSymbolFile(const google_breakpad::CodeModule *module, - const google_breakpad::SystemInfo *system_info, - string *symbol_file) -{ - QString moduleName = QString::fromStdString(module->code_file()); - if (moduleName.contains("Uniboard")) - { - *symbol_file = mUniboardSymFile.fileName().toStdString(); - return FOUND; - } - return NOT_FOUND; -} - -// Returns the path to the symbol file for the given module. -google_breakpad::SymbolSupplier::SymbolResult CrashReporterSymbolSupplier::GetSymbolFile(const google_breakpad::CodeModule *module, - const google_breakpad::SystemInfo *system_info, - string *symbol_file, - string *symbol_data) -{ - SymbolSupplier::SymbolResult s = GetSymbolFile(module, - system_info, - symbol_file); - - - if (s == FOUND) { - std::ifstream in(symbol_file->c_str()); - getline(in, *symbol_data, std::string::traits_type::to_char_type( - std::string::traits_type::eof())); - in.close(); - } - - return s; -} diff --git a/tools/CrashReportViewer/CrashReporterSymbolSupplier.h b/tools/CrashReportViewer/CrashReporterSymbolSupplier.h deleted file mode 100644 index db0095df..00000000 --- a/tools/CrashReportViewer/CrashReporterSymbolSupplier.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - -#ifndef CRASHREPORTERSYMBOLSUPPLIER_H_ -#define CRASHREPORTERSYMBOLSUPPLIER_H_ - -#include -#include "google_breakpad/processor/symbol_supplier.h" - -using std::string; - -class CrashReporterSymbolSupplier : public google_breakpad::SymbolSupplier -{ -public: - CrashReporterSymbolSupplier(QString pUniboardSymFiles); - virtual ~CrashReporterSymbolSupplier() {} - - // Returns the path to the symbol file for the given module. - SymbolResult GetSymbolFile(const google_breakpad::CodeModule *module, - const google_breakpad::SystemInfo *system_info, - string *symbol_file); - - // Returns the path to the symbol file for the given module. - SymbolResult GetSymbolFile(const google_breakpad::CodeModule *module, - const google_breakpad::SystemInfo *system_info, - string *symbol_file, - string *symbol_data); - -private: - QFile mUniboardSymFile; - -}; -#endif /* CRASHREPORTERSYMBOLSUPPLIER_H_ */ diff --git a/tools/CrashReportViewer/CrashWindow.cpp b/tools/CrashReportViewer/CrashWindow.cpp deleted file mode 100644 index d5c93f0c..00000000 --- a/tools/CrashReportViewer/CrashWindow.cpp +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - -#include "CrashWindow.h" -#include "ui_CrashReportViewer.h" -#include "CrashReporterSymbolSupplier.h" - -CrashWindow::CrashWindow(QWidget* parent) : QDialog(parent) -{ - mCrashReporterUi = new Ui::UniboardCrashreporter(); - mCrashReporterUi->setupUi(this); - mCrashReporterUi->crashReportResult->setFont(QFont("Monaco", 11)); - - connect(mCrashReporterUi->viewReportButton, SIGNAL(clicked(bool)), this, SLOT(showReport())); - connect(mCrashReporterUi->dumpFileButton, SIGNAL(clicked(bool)), this, SLOT(chooseDumpFile())); - connect(mCrashReporterUi->symFileButton, SIGNAL(clicked(bool)), this, SLOT(chooseSymboleFile())); -} - -CrashWindow::~CrashWindow() -{ - // NOOP -} - -void CrashWindow::setDumpFilePath(const QString &fileName) -{ - mCrashReporterUi->dumpFilePath->setText(fileName); -} - -void CrashWindow::chooseDumpFile() -{ - QSettings settings("Mnemis", "CrashReporter"); - QString dumpFileName = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); - if (settings.contains("DumpFileName")) - { - dumpFileName = settings.value("DumpFileName").toString(); - } - QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), - dumpFileName, - tr("Dump file (*.dmp)")); - settings.setValue("DumpFileName", QVariant(fileName)); - setDumpFilePath(fileName); -} - -void CrashWindow::chooseSymboleFile() -{ - QSettings settings("Mnemis", "CrashReporter"); - QString symFileName = QDesktopServices::storageLocation(QDesktopServices::HomeLocation); - if (settings.contains("SymFileName")) - { - symFileName = settings.value("SymFileName").toString(); - } - QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), - symFileName, - tr("Symbol file (*.sym)")); - settings.setValue("SymFileName", QVariant(fileName)); - mCrashReporterUi->symFilePath->setText(fileName); -} - -//============================================================================= -int CrashWindow::PrintRegister(const char *name, u_int32_t value, int sequence) { - if (sequence % 4 == 0) { - mReport.append("\n"); - } - // string should not exceed 200 byte!!! - size_t BufSize = 2000; - char buf[BufSize]; - - snprintf(buf, BufSize, "%6s = 0x%08x ", name, value); - QString str = QString::fromAscii(buf); - mReport.append(str); - return ++sequence; -} - -//============================================================================= -void CrashWindow::PrintStack(const CallStack* stack, const string &cpu) { - int frame_count = stack->frames()->size(); - char buffer[1024]; - - for (int frame_index = 0; frame_index < frame_count; ++frame_index) { - const StackFrame *frame = stack->frames()->at(frame_index); - const CodeModule *module = frame->module; - // string should not exceed 200 byte!!! - size_t BufSize = 2000; - char buf[BufSize]; - snprintf(buf, BufSize, "%2d ", frame_index); - mReport.append(QString::fromAscii(buf)); - - if (module) { - // Module name (20 chars max) - strcpy(buffer, PathnameStripper::File(module->code_file()).c_str()); - int maxStr = 20; - buffer[maxStr] = 0; - snprintf(buf, BufSize, "%-*s", maxStr, buffer); - mReport.append(QString::fromAscii(buf)); - - - strcpy(buffer, module->version().c_str()); - buffer[maxStr] = 0; - snprintf(buf, BufSize, "%-*s",maxStr, buffer); - mReport.append(QString::fromAscii(buf)); - - u_int64_t instruction = frame->instruction; - - // PPC only: Adjust the instruction to match that of Crash reporter. The - // instruction listed is actually the return address. See the detailed - // comments in stackwalker_ppc.cc for more information. - if (cpu == "ppc" && frame_index) - instruction += 4; - snprintf(buf, BufSize, " 0x%08llx ", instruction); - mReport.append(QString::fromAscii(buf)); - - // Function name - if (!frame->function_name.empty()) { - snprintf(buf, BufSize, "%s", frame->function_name.c_str()); - mReport.append(QString::fromAscii(buf)); - if (!frame->source_file_name.empty()) { - string source_file = PathnameStripper::File(frame->source_file_name); - snprintf(buf, BufSize, " + 0x%llx (%s:%d)", - instruction - frame->source_line_base, - source_file.c_str(), frame->source_line); - mReport.append(QString::fromAscii(buf)); - } else { - snprintf(buf, BufSize, " + 0x%llx", instruction - frame->function_base); - mReport.append(QString::fromAscii(buf)); - } - } - } - mReport.append("\n"); - } -} - -//============================================================================= -void CrashWindow::PrintRegisters(const CallStack *stack, const string &cpu) { - int sequence = 0; - const StackFrame *frame = stack->frames()->at(0); - if (cpu == "x86") { - const StackFrameX86 *frame_x86 = - reinterpret_cast(frame); - - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EIP) - sequence = PrintRegister("eip", frame_x86->context.eip, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESP) - sequence = PrintRegister("esp", frame_x86->context.esp, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EBP) - sequence = PrintRegister("ebp", frame_x86->context.ebp, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EBX) - sequence = PrintRegister("ebx", frame_x86->context.ebx, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESI) - sequence = PrintRegister("esi", frame_x86->context.esi, sequence); - if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EDI) - sequence = PrintRegister("edi", frame_x86->context.edi, sequence); - if (frame_x86->context_validity == StackFrameX86::CONTEXT_VALID_ALL) { - sequence = PrintRegister("eax", frame_x86->context.eax, sequence); - sequence = PrintRegister("ecx", frame_x86->context.ecx, sequence); - sequence = PrintRegister("edx", frame_x86->context.edx, sequence); - sequence = PrintRegister("efl", frame_x86->context.eflags, sequence); - } - } else if (cpu == "ppc") { - const StackFramePPC *frame_ppc = - reinterpret_cast(frame); - - if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_ALL == - StackFramePPC::CONTEXT_VALID_ALL) { - sequence = PrintRegister("srr0", frame_ppc->context.srr0, sequence); - sequence = PrintRegister("srr1", frame_ppc->context.srr1, sequence); - sequence = PrintRegister("cr", frame_ppc->context.cr, sequence); - sequence = PrintRegister("xer", frame_ppc->context.xer, sequence); - sequence = PrintRegister("lr", frame_ppc->context.lr, sequence); - sequence = PrintRegister("ctr", frame_ppc->context.ctr, sequence); - sequence = PrintRegister("mq", frame_ppc->context.mq, sequence); - sequence = PrintRegister("vrsave", frame_ppc->context.vrsave, sequence); - - sequence = 0; - char buffer[5]; - for (int i = 0; i < MD_CONTEXT_PPC_GPR_COUNT; ++i) { - sprintf(buffer, "r%d", i); - sequence = PrintRegister(buffer, frame_ppc->context.gpr[i], sequence); - } - } else { - if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_SRR0) - sequence = PrintRegister("srr0", frame_ppc->context.srr0, sequence); - if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_GPR1) - sequence = PrintRegister("r1", frame_ppc->context.gpr[1], sequence); - } - } - - mReport.append("\n"); -} - -void CrashWindow::PrintModules(const CodeModules *modules) { - if (!modules) - return; - - mReport.append("\n"); - mReport.append("Loaded modules:\n"); - - u_int64_t main_address = 0; - const CodeModule *main_module = modules->GetMainModule(); - if (main_module) { - main_address = main_module->base_address(); - } - - unsigned int module_count = modules->module_count(); - for (unsigned int module_sequence = 0; - module_sequence < module_count; - ++module_sequence) { - const CodeModule *module = modules->GetModuleAtSequence(module_sequence); - assert(module); - u_int64_t base_address = module->base_address(); - // string should not exceed 200 byte!!! - size_t BufSize = 2000; - char buf[BufSize]; - - snprintf(buf, BufSize, "0x%08llx - 0x%08llx %s %s%s %s\n", - base_address, base_address + module->size() - 1, - PathnameStripper::File(module->code_file()).c_str(), - module->version().empty() ? "???" : module->version().c_str(), - main_module != NULL && base_address == main_address ? - " (main)" : "", - module->code_file().c_str()); - mReport.append(QString::fromAscii(buf)); - } -} - -void CrashWindow::showReport() -{ - qDebug() << "compute report"; - mReport.clear(); - QString minidump_file = mCrashReporterUi->dumpFilePath->text(); - BasicSourceLineResolver resolver; - - scoped_ptr symbol_supplier( - - new CrashReporterSymbolSupplier(mCrashReporterUi->symFilePath->text())); - scoped_ptr - minidump_processor(new MinidumpProcessor(symbol_supplier.get(), &resolver)); - ProcessState process_state; - if (minidump_processor->Process(minidump_file.toStdString(), &process_state) != - MinidumpProcessor::PROCESS_OK) { - mReport += "MinidumpProcessor::Process failed\n"; - return; - } - const SystemInfo *system_info = process_state.system_info(); - string cpu = system_info->cpu; - // Convert the time to a string - u_int32_t time_date_stamp = process_state.time_date_stamp(); - struct tm timestruct; - gmtime_r(reinterpret_cast(&time_date_stamp), ×truct); - char timestr[20]; - // string should not exceed 200 byte!!! - size_t BufSize = 2000; - char buf[BufSize]; - strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", ×truct); - snprintf(buf, BufSize, "Date: %s GMT\n", timestr); - mReport.append(QString::fromAscii(buf)); - snprintf(buf, BufSize, "Operating system: %s (%s)\n", system_info->os.c_str(), - system_info->os_version.c_str()); - mReport.append(QString::fromAscii(buf)); - snprintf(buf, BufSize, "Architecture: %s\n", cpu.c_str()); - mReport.append(QString::fromAscii(buf)); - - if (process_state.crashed()) { - snprintf(buf, BufSize, "Crash reason: %s\n", process_state.crash_reason().c_str()); - mReport.append(QString::fromAscii(buf)); - snprintf(buf, BufSize, "Crash address: 0x%llx\n", process_state.crash_address()); - mReport.append(QString::fromAscii(buf)); - } else { - mReport.append("No crash\n"); - } - - int requesting_thread = process_state.requesting_thread(); - if (requesting_thread != -1) { - mReport.append("\n"); - snprintf(buf, BufSize, "Thread %d (%s)\n", - requesting_thread, - process_state.crashed() ? "crashed" : - "requested dump, did not crash"); - mReport.append(QString::fromAscii(buf)); - PrintStack(process_state.threads()->at(requesting_thread), cpu); - } - - // Print all of the threads in the dump. - int thread_count = process_state.threads()->size(); - for (int thread_index = 0; thread_index < thread_count; ++thread_index) { - if (thread_index != requesting_thread) { - // Don't print the crash thread again, it was already printed. - mReport.append("\n"); - snprintf(buf, BufSize,"Thread %d\n", thread_index); - mReport.append(QString::fromAscii(buf)); - PrintStack(process_state.threads()->at(thread_index), cpu); - } - } - - // Print the crashed registers - if (requesting_thread != -1) { - snprintf(buf, BufSize,"\nThread %d:", requesting_thread); - mReport.append(QString::fromAscii(buf)); - PrintRegisters(process_state.threads()->at(requesting_thread), cpu); - } - - // Print information about modules - PrintModules(process_state.modules()); - mCrashReporterUi->crashReportResult->setPlainText(mReport); -} - - diff --git a/tools/CrashReportViewer/CrashWindow.h b/tools/CrashReportViewer/CrashWindow.h deleted file mode 100644 index 89a5907a..00000000 --- a/tools/CrashReportViewer/CrashWindow.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - -#ifndef CRASHWINDOW_H_ -#define CRASHWINDOW_H_ - -#include -#include "google_breakpad/processor/basic_source_line_resolver.h" -#include "google_breakpad/processor/call_stack.h" -#include "google_breakpad/processor/code_module.h" -#include "google_breakpad/processor/minidump.h" -#include "google_breakpad/processor/minidump_processor.h" -#include "google_breakpad/processor/process_state.h" -#include "google_breakpad/processor/stack_frame_cpu.h" -#include "google_breakpad/processor/system_info.h" -#include "processor/pathname_stripper.h" -#include "processor/scoped_ptr.h" -#include "processor/simple_symbol_supplier.h" - -using std::string; - -using google_breakpad::BasicSourceLineResolver; -using google_breakpad::CallStack; -using google_breakpad::CodeModule; -using google_breakpad::CodeModules; -using google_breakpad::MinidumpProcessor; -using google_breakpad::PathnameStripper; -using google_breakpad::ProcessState; -using google_breakpad::scoped_ptr; -using google_breakpad::StackFrame; -using google_breakpad::StackFramePPC; -using google_breakpad::StackFrameX86; -using google_breakpad::SystemInfo; - -namespace Ui -{ - class UniboardCrashreporter; -} - -class CrashWindow : public QDialog -{ - Q_OBJECT; -public: - CrashWindow(QWidget* parent = 0); - virtual ~CrashWindow(); - - void setDumpFilePath(const QString &fileName); - -private slots: - void showReport(); - void chooseDumpFile(); - void chooseSymboleFile(); - -private: - int PrintRegister(const char *name, u_int32_t value, int sequence); - void PrintStack(const CallStack* stack, const string &cpu); - void PrintRegisters(const CallStack *stack, const string &cpu); - void PrintModules(const CodeModules *modules); - Ui::UniboardCrashreporter* mCrashReporterUi; - QString mReport; -}; - -#endif /* CRASHWINDOW_H_ */ diff --git a/tools/CrashReportViewer/Info.plist b/tools/CrashReportViewer/Info.plist deleted file mode 100644 index 25a3d4b6..00000000 --- a/tools/CrashReportViewer/Info.plist +++ /dev/null @@ -1,35 +0,0 @@ - - - - - CFBundleDocumentTypes - - - CFBundleTypeName - com.microsoft.minidump - CFBundleTypeRole - Viewer - LSHandlerRank - Alternate - CFBundleTypeExtensions - - dmp - - - - CFBundleExecutable - Crash Report Viewer - CFBundleGetInfoString - Crash Report Viewer 1.0 - CFBundleIconFile - Bug.icns - CFBundleIdentifier - com.mnemis.uniboard.CrashReportViewer - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - UBCv - - diff --git a/tools/CrashReportViewer/main.cpp b/tools/CrashReportViewer/main.cpp deleted file mode 100644 index a3a00122..00000000 --- a/tools/CrashReportViewer/main.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - -#include -#include "CrashWindow.h" -#include "client/mac/handler/exception_handler.h" - -class CRVApplication : public QApplication -{ -public: - - CRVApplication(int &argc, char **argv) : QApplication(argc, argv) {} - - bool event(QEvent *e) - { - if (e->type() == QEvent::FileOpen) - { - window.setDumpFilePath(static_cast(e)->file()); - return true; - } - return QApplication::event(e); - } - - CrashWindow window; -}; - -int main(int argc, char *argv[]) -{ - CRVApplication app(argc, argv); - - app.window.show(); - - app.exec(); -} diff --git a/tools/CrashReportViewer/release.macx.sh b/tools/CrashReportViewer/release.macx.sh deleted file mode 100644 index c6e6247c..00000000 --- a/tools/CrashReportViewer/release.macx.sh +++ /dev/null @@ -1,69 +0,0 @@ -# -------------------------------------------------------------------- -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# --------------------------------------------------------------------- - -#!/bin/bash - -# Qt base directory -QTDIR=/usr/local/Trolltech/Qt-4.6.1 - -# Executables -MACDEPLOYQT="$QTDIR/bin/macdeployqt" -QMAKE="$QTDIR/bin/qmake" - -# Directories -BUILD_DIR="build/macx" - -function abort { - printf "\033[31merror:\033[0m $1\n" - exit 1 -} - -function warn { - if [ $testMode == 1 ]; then - printf "\033[33mwarning:\033[0m $1\n" - else - abort "$1" - fi -} - -function checkExecutable { - if [ ! -x "$1" ]; then - abort "$1 not found" - fi -} - -# Check for executables -checkExecutable "$MACDEPLOYQT" -checkExecutable "$QMAKE" - - -# delete the build directory -rm -rf "$BUILD_DIR" - -# generate Makefile (makefile.macx) -$QMAKE -spec macx-g++ -config release - -# build -make - -if [ $? != 0 ]; then - abort "compilation failed" -fi - -APP="$BUILD_DIR/Crash Report Viewer.app" - -# bundle Qt Frameorks (/Library/Framworks) into the app bundle -$MACDEPLOYQT "$APP" - diff --git a/tools/pdf2image/core/UBPlatformUtils.cpp b/tools/pdf2image/core/UBPlatformUtils.cpp deleted file mode 100644 index 8a09fd5e..00000000 --- a/tools/pdf2image/core/UBPlatformUtils.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - -#include - -#include "UBPlatformUtils.h" - - -QString UBPlatformUtils::applicationResourcesDirectory() -{ - return QCoreApplication::applicationDirPath() + "/resources"; -} diff --git a/tools/pdf2image/core/UBPlatformUtils.h b/tools/pdf2image/core/UBPlatformUtils.h deleted file mode 100644 index 58739593..00000000 --- a/tools/pdf2image/core/UBPlatformUtils.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - -#include - -class UBPlatformUtils -{ - public: - static QString applicationResourcesDirectory(); -}; diff --git a/tools/pdf2image/pdf2image.cpp b/tools/pdf2image/pdf2image.cpp deleted file mode 100644 index ae47b5f8..00000000 --- a/tools/pdf2image/pdf2image.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2012 Webdoc SA - * - * This file is part of Open-Sankoré. - * - * 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 - * "OpenSSL" library (or with modified versions of it that use the - * same license as the "OpenSSL" library). - * - * Open-Sankoré is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Open-Sankoré. If not, see . - */ - - -#include -#include -#include "core/UBPlatformUtils.h" - -void usage(QString progName) -{ - qDebug() << "usage:" << progName << "pdfFile pageNumber width height outputDir [imageFormat=png]"; - qDebug() << "pdfFile is the path to the pdf file"; - qDebug() << "imageFormat must be one of " << QImageWriter::supportedImageFormats(); -} - -int main(int argc, char *argv[]) -{ - QCoreApplication app(argc, argv); - - QPixmapCache::setCacheLimit(0); - - QStringList args = app.arguments(); - - qreal width, height; - QString pdfFile; - QString imageFormat = "png"; - QString outputDir = "."; - int pageNumber = 1; - qDebug() << UBPlatformUtils::applicationResourcesDirectory(); - if (args.count() >= 6 && args.count() <= 7) { - pdfFile = args.at(1); - pageNumber = args.at(2).toInt(); - width = args.at(3).toDouble(); - height = args.at(4).toDouble(); - outputDir = args.at(5); - if (args.count() == 7) { - imageFormat = args.at(6); - } - } else { - usage(args.at(0)); - return 1; - } - - QString fileName = QFileInfo(pdfFile).completeBaseName(); - - if (!QImageWriter::supportedImageFormats().contains(imageFormat.toAscii())) { - usage(args.at(0)); - return 1; - } - - XPDFRenderer pdf(pdfFile); - - if (!pdf.isValid()) { - qCritical() << fileName << "appears to be an invalid pdf file"; - return 1; - } - - if (pageNumber < 1 || pageNumber > pdf.pageCount()) { - qCritical() << fileName << "has" << pdf.pageCount() << "pages"; - return 1; - } - - //qDebug() << "Converting" << pdfFile << "(" << pageNumber << ") into" << imageFormat; - - QImage image(width, height, QImage::Format_ARGB32); - - QPainter p(&image); - - p.setBackground(Qt::transparent); - p.eraseRect(0, 0, width, height); - - qreal pdfWidth = pdf.pageSize(pageNumber).width(); - qreal pdfHeight = pdf.pageSize(pageNumber).height(); - qreal ratio = qMin(width / pdfWidth, height / pdfHeight); - p.scale(ratio, ratio); - if (width > pdfWidth) { - p.translate((pdfWidth - (width / ratio)) / -2, 0); - } - if (height > pdfHeight) { - p.translate(0, (pdfHeight - (height / ratio)) / -2); - } - pdf.render(&p, pageNumber); - - QString pageStr = QString("%1").arg(pageNumber, 5, 10, QChar('0')); - QString outputPath = outputDir + "/" + fileName + pageStr + "." + imageFormat; - bool ok = image.save(outputPath, imageFormat.toAscii().constData()); - - return ok ? 0 : 1; -} diff --git a/tools/pdf2image/pdf2image.pro b/tools/pdf2image/pdf2image.pro deleted file mode 100644 index 3ef307a4..00000000 --- a/tools/pdf2image/pdf2image.pro +++ /dev/null @@ -1,40 +0,0 @@ -TARGET = "pdf2image.bin" -TEMPLATE = app -CONFIG += console warn_off - -UNIBOARD_SRC = ../../src -DESTDIR = "build/Product" -OBJECTS_DIR = "build/objects" -MOC_DIR = "build/moc" -RCC_DIR = "build/rcc" -UI_DIR = "build/ui" - -PDF_FONTS.path = $$DESTDIR/resources -PDF_FONTS.files = ../../resources/fonts - -SCRIPT.path = $$DESTDIR -SCRIPT.files = resources/** - -QT_CORE.path = $$DESTDIR -QT_CORE.files = /home/mnemis/qtsdk-2009.02/qt/lib/libQtCore.so.4.5.1 - -QT_GUI.path = $$DESTDIR/ -QT_GUI.files = /home/mnemis/qtsdk-2009.02/qt/lib/libQtGui.so.4.5.1 - -SOURCES = pdf2image.cpp \ - core/UBPlatformUtils.cpp \ - $$UNIBOARD_SRC/pdf/PDFRenderer.cpp \ - $$UNIBOARD_SRC/pdf/XPDFRenderer.cpp - -HEADERS = $$UNIBOARD_SRC/pdf/PDFRenderer.h \ - $$UNIBOARD_SRC/pdf/XPDFRenderer.h - -include(../../thirdparty/libs.pri) - -INCLUDEPATH += $$UNIBOARD_SRC/pdf - -macx { - CONFIG -= app_bundle -} - -INSTALLS = PDF_FONTS QT_CORE QT_GUI SCRIPT diff --git a/tools/pdf2image/resources/pdf2image b/tools/pdf2image/resources/pdf2image deleted file mode 100644 index 6e0f9b1b..00000000 --- a/tools/pdf2image/resources/pdf2image +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -LD_LIBRARY_PATH=`dirname $0`:$LD_LIBRARY_PATH -export LD_LIBRARY_PATH -`dirname $0`/pdf2image $*