From 658a1c889530a890c5438c4330e302e6760f6754 Mon Sep 17 00:00:00 2001 From: "Mario Izquierdo (mariodebian)" Date: Tue, 17 Jan 2012 11:43:08 +0100 Subject: [PATCH 1/6] Update Spanish translation --- resources/i18n/sankore_es.ts | 68 ++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/resources/i18n/sankore_es.ts b/resources/i18n/sankore_es.ts index 3ddd9826..1ceeccf4 100644 --- a/resources/i18n/sankore_es.ts +++ b/resources/i18n/sankore_es.ts @@ -769,35 +769,35 @@ Open-Sankoré - + Open-Sankoré Quit Open-Sankoré - + Salir de Open-Sankoré Open-Sankoré Editor - + Editor Open-Sankoré Show Open-Sankoré Widgets Editor - + Editor de widget Open-Sankoré Hide Open-Sankoré - + Ocultar Open-Sankoré Hide Open-Sankoré Application - + Ocultar aplicación Open-Sankoré Import Uniboard Documents - + Importar documentos Uniboard Import old Sankore or Uniboard documents - + Importar viejos documentos de Sankore o Uniboard @@ -855,7 +855,7 @@ QuaZipFile ZIP/UNZIP API error %1 - + Error en API ZIP/UNZIP %1 @@ -1210,11 +1210,11 @@ UBDownloadWidget Downloading files - + Descargando archivos Cancel - Cancelar + Cancelar @@ -1343,7 +1343,7 @@ Editable - + Editable @@ -1780,7 +1780,7 @@ Do you want to ignore these errors for this host? UBTeacherBarWidget Title - Título + Título Phasis @@ -1788,15 +1788,15 @@ Do you want to ignore these errors for this host? Duration - + Duración Equipment - + Equipamiento Activity - + Actividad @@ -1804,62 +1804,62 @@ Do you want to ignore these errors for this host? I discover - + Yo descubro I experiment - + Yo experimento I train myself - + Yo aprendo sólo I play - + Yo juego I memorize - + Yo memorizo Short - + Corto Middle - + Medio Long - + Largo Alone - + Sólo By Group - + En grupo All together - + Todos juntos UBTeacherStudentAction Action %0 - + Acción %0 Teacher - + Profesor Student - + Alumno @@ -1965,7 +1965,7 @@ Por favor reinicie la aplicación para acceder a los documentos actualizados. Remind me later - + Recordarme más tarde @@ -2085,11 +2085,11 @@ Por favor reinicie la aplicación para acceder a los documentos actualizados.UniboardSankoreTransition Import old Uniboard/Sankore documents - + Importar documentos antiguos de Uniboard/Sankore There are no documents that should be imported - + No hay documentos a importar @@ -2603,7 +2603,7 @@ p, li { white-space: pre-wrap; } Open-Sankoré - + Open-Sankoré <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> From 39cade6922353e4d4712425abccd629b27783c84 Mon Sep 17 00:00:00 2001 From: Anatoly Mihalchenko Date: Tue, 17 Jan 2012 15:43:23 +0300 Subject: [PATCH 2/6] Enhancements for zooming of PDF document (related to 204). --- src/board/UBBoardController.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 46ebf85b..0c31fc63 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -1519,12 +1519,17 @@ void UBBoardController::updateSystemScaleFactor() if (mActiveScene) { QSize pageNominalSize = mActiveScene->nominalSize(); - QSize controlSize = controlViewport(); + //we're going to keep scale factor untouched if the size is custom + QMap sizesMap = UBSettings::settings()->documentSizes; + if(pageNominalSize == sizesMap.value(DocumentSizeRatio::Ratio16_9) || pageNominalSize == sizesMap.value(DocumentSizeRatio::Ratio4_3)) + { + QSize controlSize = controlViewport(); - qreal hFactor = ((qreal)controlSize.width()) / ((qreal)pageNominalSize.width()); - qreal vFactor = ((qreal)controlSize.height()) / ((qreal)pageNominalSize.height()); + qreal hFactor = ((qreal)controlSize.width()) / ((qreal)pageNominalSize.width()); + qreal vFactor = ((qreal)controlSize.height()) / ((qreal)pageNominalSize.height()); - newScaleFactor = qMin(hFactor, vFactor); + newScaleFactor = qMin(hFactor, vFactor); + } } if (mSystemScaleFactor != newScaleFactor) @@ -1543,7 +1548,6 @@ void UBBoardController::updateSystemScaleFactor() mControlView->setTransform(scalingTransform); mControlView->horizontalScrollBar()->setValue(viewState.horizontalPosition); mControlView->verticalScrollBar()->setValue(viewState.verticalPostition); - } From 912561c2297fe771334ac7a429c3244b0c2a7275 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Tue, 17 Jan 2012 14:48:45 +0200 Subject: [PATCH 3/6] Fixs to SANKORE-363. --- src/domain/UBGraphicsScene.cpp | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 95b05d01..269a87a6 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1951,7 +1951,37 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent) UBGraphicsItem *ubgi = dynamic_cast(item); if (ubgi) { - ubgi->remove(); + bool bRemove = true; + switch (item->type()) + { + case UBGraphicsW3CWidgetItem::Type: + { + UBGraphicsW3CWidgetItem *wc3_widget = dynamic_cast(item); + if (0 != wc3_widget) + if (wc3_widget->hasFocus()) + bRemove = false; + break; + } + case UBGraphicsAppleWidgetItem::Type: + { + UBGraphicsAppleWidgetItem *Apple_widget = dynamic_cast(item); + if (0 !=Apple_widget) + if (Apple_widget->hasFocus()) + bRemove = false; + break; + } + case UBGraphicsTextItem::Type: + { + UBGraphicsTextItem *text_item = dynamic_cast(item); + if (0 != text_item) + if (text_item->hasFocus()) + bRemove = false; + break; + } + } + + if (bRemove) + ubgi->remove(); } } } From e0d1c8ce8a8b271c2df7e47f19c3cf43e9359ebe Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Tue, 17 Jan 2012 16:12:37 +0200 Subject: [PATCH 4/6] Final fix for SANKORE-363 --- src/domain/UBGraphicsScene.cpp | 61 +++++++++++++++++----------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 269a87a6..50f3a7b2 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1948,40 +1948,41 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent) { foreach(QGraphicsItem* item, si) { - UBGraphicsItem *ubgi = dynamic_cast(item); - if (ubgi) + switch (item->type()) { - bool bRemove = true; - switch (item->type()) + case UBGraphicsW3CWidgetItem::Type: { - case UBGraphicsW3CWidgetItem::Type: - { - UBGraphicsW3CWidgetItem *wc3_widget = dynamic_cast(item); - if (0 != wc3_widget) - if (wc3_widget->hasFocus()) - bRemove = false; - break; - } - case UBGraphicsAppleWidgetItem::Type: - { - UBGraphicsAppleWidgetItem *Apple_widget = dynamic_cast(item); - if (0 !=Apple_widget) - if (Apple_widget->hasFocus()) - bRemove = false; - break; - } - case UBGraphicsTextItem::Type: - { - UBGraphicsTextItem *text_item = dynamic_cast(item); - if (0 != text_item) - if (text_item->hasFocus()) - bRemove = false; - break; - } + UBGraphicsW3CWidgetItem *wc3_widget = dynamic_cast(item); + if (0 != wc3_widget) + if (!wc3_widget->hasFocus()) + wc3_widget->remove(); + break; + } + case UBGraphicsAppleWidgetItem::Type: + { + UBGraphicsAppleWidgetItem *Apple_widget = dynamic_cast(item); + if (0 !=Apple_widget) + if (!Apple_widget->hasFocus()) + Apple_widget->remove(); + break; + } + case UBGraphicsTextItem::Type: + { + UBGraphicsTextItem *text_item = dynamic_cast(item); + if (0 != text_item) + if (!text_item->hasFocus()) + text_item->remove(); + break; } - if (bRemove) - ubgi->remove(); + default: + { + UBGraphicsItem *ubgi = dynamic_cast(item); + if (0 != ubgi) + ubgi->remove(); + else + UBCoreGraphicsScene::removeItem(item); + } } } } From b891c42a4d99990c6130e1cabdbd4c4b00d12fc1 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Wed, 18 Jan 2012 16:33:58 +0200 Subject: [PATCH 5/6] Fixed Mask (curtain item) posision after exporting and importing. (a part of SANKPRE-223?) --- src/adaptors/UBSvgSubsetAdaptor.cpp | 25 ++++++++++++++++++++++--- src/domain/UBGraphicsScene.cpp | 15 +++++++-------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/adaptors/UBSvgSubsetAdaptor.cpp b/src/adaptors/UBSvgSubsetAdaptor.cpp index cae29ac5..d9319887 100644 --- a/src/adaptors/UBSvgSubsetAdaptor.cpp +++ b/src/adaptors/UBSvgSubsetAdaptor.cpp @@ -2424,8 +2424,23 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::curtainItemToSvg(UBGraphicsCurtainIt */ mXmlWriter.writeStartElement(UBSettings::uniboardDocumentNamespaceUri, "curtain"); + mXmlWriter.writeAttribute("x", QString("%1").arg(curtainItem->boundingRect().center().x())); + mXmlWriter.writeAttribute("y", QString("%1").arg(curtainItem->boundingRect().center().y())); + mXmlWriter.writeAttribute("width", QString("%1").arg(curtainItem->boundingRect().width())); + mXmlWriter.writeAttribute("height", QString("%1").arg(curtainItem->boundingRect().height())); + mXmlWriter.writeAttribute("transform", toSvgTransform(curtainItem->sceneMatrix())); + + //graphicsItemToSvg(curtainItem); + QString zs; + zs.setNum(curtainItem->zValue(), 'f'); // 'f' keeps precision + mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "z-value", zs); + + UBItem* ubItem = dynamic_cast(curtainItem); - graphicsItemToSvg(curtainItem); + if (ubItem) + { + mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "uuid", UBStringUtils::toCanonicalUuid(ubItem->uuid())); + } mXmlWriter.writeEndElement(); } @@ -2437,13 +2452,17 @@ UBGraphicsCurtainItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::curtainItemFromSvg graphicsItemFromSvg(curtainItem); + QStringRef svgX = mXmlReader.attributes().value("x"); + QStringRef svgY = mXmlReader.attributes().value("y"); QStringRef svgWidth = mXmlReader.attributes().value("width"); QStringRef svgHeight = mXmlReader.attributes().value("height"); - QRectF rect = curtainItem->rect(); + + QRect rect; + rect.setX(svgX.toString().toFloat()-svgWidth.toString().toFloat()/2); + rect.setY(svgY.toString().toFloat()-svgHeight.toString().toFloat()/2); rect.setWidth(svgWidth.toString().toFloat()); rect.setHeight(svgHeight.toString().toFloat()); - rect.translate(- rect.center()); curtainItem->setRect(rect); diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 50f3a7b2..0419b3bf 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1771,18 +1771,17 @@ void UBGraphicsScene::addMask(const QPointF ¢er) view = (QGraphicsView*)UBApplication::boardController->displayView(); else view = (QGraphicsView*)UBApplication::boardController->controlView(); +*/ - // curtain->setZValue(toolLayerStart + toolOffsetCurtain); - UBGraphicsItem::assignZValue(curtain, toolLayerStart + toolOffsetCurtain); - - QRectF rect = UBApplication::boardController->activeScene()->normalizedSceneRect(); - rect.setSize(QSizeF(rect.width()/2, rect.height()/2)); - - QPointF origin = center.isNull() ? rect.bottomRight() : center; - curtain->setRect(rect.translated(origin - rect.topLeft() / 2)); addItem(curtain); + QRectF rect = UBApplication::boardController->activeScene()->normalizedSceneRect(); + rect.setRect(center.x() - rect.width()/4, center.y() - rect.height()/4, rect.width()/2 , rect.height()/2); + QPointF origin = center.isNull() ? rect.bottomRight() : center; + curtain->setRect(rect);//rect.translated(origin - rect.topLeft() / 2)); + UBGraphicsItem::assignZValue(curtain, toolLayerStart + toolOffsetCurtain); + curtain->setVisible(true); curtain->setSelected(true); setModified(true); From 2608ba9d9d6e93de8cd7878ef915eb770c181bb1 Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Wed, 18 Jan 2012 16:50:10 +0200 Subject: [PATCH 6/6] Fix to 223 --- src/domain/UBGraphicsScene.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp index 0419b3bf..995c70f0 100644 --- a/src/domain/UBGraphicsScene.cpp +++ b/src/domain/UBGraphicsScene.cpp @@ -1765,21 +1765,13 @@ void UBGraphicsScene::addMask(const QPointF ¢er) { UBGraphicsCurtainItem* curtain = new UBGraphicsCurtainItem(); // mem : owned and destroyed by the scene mTools << curtain; - QGraphicsView* view; - - if(UBApplication::applicationController->displayManager()->hasDisplay()) - view = (QGraphicsView*)UBApplication::boardController->displayView(); - else - view = (QGraphicsView*)UBApplication::boardController->controlView(); -*/ - addItem(curtain); QRectF rect = UBApplication::boardController->activeScene()->normalizedSceneRect(); rect.setRect(center.x() - rect.width()/4, center.y() - rect.height()/4, rect.width()/2 , rect.height()/2); QPointF origin = center.isNull() ? rect.bottomRight() : center; - curtain->setRect(rect);//rect.translated(origin - rect.topLeft() / 2)); + curtain->setRect(rect); UBGraphicsItem::assignZValue(curtain, toolLayerStart + toolOffsetCurtain); curtain->setVisible(true);