Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Ivan Ilin 13 years ago
commit 93e08950bc
  1. 68
      resources/i18n/sankore_es.ts
  2. 25
      src/adaptors/UBSvgSubsetAdaptor.cpp
  3. 6
      src/board/UBBoardController.cpp
  4. 52
      src/domain/UBGraphicsScene.cpp

@ -769,35 +769,35 @@
</message> </message>
<message utf8="true"> <message utf8="true">
<source>Open-Sankoré</source> <source>Open-Sankoré</source>
<translation type="unfinished"></translation> <translation>Open-Sankoré</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<source>Quit Open-Sankoré</source> <source>Quit Open-Sankoré</source>
<translation type="unfinished"></translation> <translation>Salir de Open-Sankoré</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<source>Open-Sankoré Editor</source> <source>Open-Sankoré Editor</source>
<translation type="unfinished"></translation> <translation>Editor Open-Sankoré</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<source>Show Open-Sankoré Widgets Editor</source> <source>Show Open-Sankoré Widgets Editor</source>
<translation type="unfinished"></translation> <translation>Editor de widget Open-Sankoré</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<source>Hide Open-Sankoré</source> <source>Hide Open-Sankoré</source>
<translation type="unfinished"></translation> <translation>Ocultar Open-Sankoré</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<source>Hide Open-Sankoré Application</source> <source>Hide Open-Sankoré Application</source>
<translation type="unfinished"></translation> <translation>Ocultar aplicación Open-Sankoré</translation>
</message> </message>
<message> <message>
<source>Import Uniboard Documents</source> <source>Import Uniboard Documents</source>
<translation type="unfinished"></translation> <translation>Importar documentos Uniboard</translation>
</message> </message>
<message> <message>
<source>Import old Sankore or Uniboard documents</source> <source>Import old Sankore or Uniboard documents</source>
<translation type="unfinished"></translation> <translation>Importar viejos documentos de Sankore o Uniboard</translation>
</message> </message>
</context> </context>
<context> <context>
@ -855,7 +855,7 @@
<name>QuaZipFile</name> <name>QuaZipFile</name>
<message> <message>
<source>ZIP/UNZIP API error %1</source> <source>ZIP/UNZIP API error %1</source>
<translation type="unfinished"></translation> <translation>Error en API ZIP/UNZIP %1</translation>
</message> </message>
</context> </context>
<context> <context>
@ -1210,11 +1210,11 @@
<name>UBDownloadWidget</name> <name>UBDownloadWidget</name>
<message> <message>
<source>Downloading files</source> <source>Downloading files</source>
<translation type="unfinished"></translation> <translation>Descargando archivos</translation>
</message> </message>
<message> <message>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished">Cancelar</translation> <translation>Cancelar</translation>
</message> </message>
</context> </context>
<context> <context>
@ -1343,7 +1343,7 @@
</message> </message>
<message> <message>
<source>Editable</source> <source>Editable</source>
<translation type="unfinished"></translation> <translation>Editable</translation>
</message> </message>
</context> </context>
<context> <context>
@ -1780,7 +1780,7 @@ Do you want to ignore these errors for this host?</source>
<name>UBTeacherBarWidget</name> <name>UBTeacherBarWidget</name>
<message> <message>
<source>Title</source> <source>Title</source>
<translation type="unfinished">Título</translation> <translation>Título</translation>
</message> </message>
<message> <message>
<source>Phasis</source> <source>Phasis</source>
@ -1788,15 +1788,15 @@ Do you want to ignore these errors for this host?</source>
</message> </message>
<message> <message>
<source>Duration</source> <source>Duration</source>
<translation type="unfinished"></translation> <translation>Duración</translation>
</message> </message>
<message> <message>
<source>Equipment</source> <source>Equipment</source>
<translation type="unfinished"></translation> <translation>Equipamiento</translation>
</message> </message>
<message> <message>
<source>Activity</source> <source>Activity</source>
<translation type="unfinished"></translation> <translation>Actividad</translation>
</message> </message>
<message> <message>
<source></source> <source></source>
@ -1804,62 +1804,62 @@ Do you want to ignore these errors for this host?</source>
</message> </message>
<message> <message>
<source>I discover</source> <source>I discover</source>
<translation type="unfinished"></translation> <translation>Yo descubro</translation>
</message> </message>
<message> <message>
<source>I experiment</source> <source>I experiment</source>
<translation type="unfinished"></translation> <translation>Yo experimento</translation>
</message> </message>
<message> <message>
<source>I train myself</source> <source>I train myself</source>
<translation type="unfinished"></translation> <translation>Yo aprendo sólo</translation>
</message> </message>
<message> <message>
<source>I play</source> <source>I play</source>
<translation type="unfinished"></translation> <translation>Yo juego</translation>
</message> </message>
<message> <message>
<source>I memorize</source> <source>I memorize</source>
<translation type="unfinished"></translation> <translation>Yo memorizo</translation>
</message> </message>
<message> <message>
<source>Short</source> <source>Short</source>
<translation type="unfinished"></translation> <translation>Corto</translation>
</message> </message>
<message> <message>
<source>Middle</source> <source>Middle</source>
<translation type="unfinished"></translation> <translation>Medio</translation>
</message> </message>
<message> <message>
<source>Long</source> <source>Long</source>
<translation type="unfinished"></translation> <translation>Largo</translation>
</message> </message>
<message> <message>
<source>Alone</source> <source>Alone</source>
<translation type="unfinished"></translation> <translation>Sólo</translation>
</message> </message>
<message> <message>
<source>By Group</source> <source>By Group</source>
<translation type="unfinished"></translation> <translation>En grupo</translation>
</message> </message>
<message> <message>
<source>All together</source> <source>All together</source>
<translation type="unfinished"></translation> <translation>Todos juntos</translation>
</message> </message>
</context> </context>
<context> <context>
<name>UBTeacherStudentAction</name> <name>UBTeacherStudentAction</name>
<message> <message>
<source>Action %0</source> <source>Action %0</source>
<translation type="unfinished"></translation> <translation>Acción %0</translation>
</message> </message>
<message> <message>
<source>Teacher</source> <source>Teacher</source>
<translation type="unfinished"></translation> <translation>Profesor</translation>
</message> </message>
<message> <message>
<source>Student</source> <source>Student</source>
<translation type="unfinished"></translation> <translation>Alumno</translation>
</message> </message>
</context> </context>
<context> <context>
@ -1965,7 +1965,7 @@ Por favor reinicie la aplicación para acceder a los documentos actualizados.</t
</message> </message>
<message> <message>
<source>Remind me later</source> <source>Remind me later</source>
<translation type="unfinished"></translation> <translation>Recordarme más tarde</translation>
</message> </message>
</context> </context>
<context> <context>
@ -2085,11 +2085,11 @@ Por favor reinicie la aplicación para acceder a los documentos actualizados.</t
<name>UniboardSankoreTransition</name> <name>UniboardSankoreTransition</name>
<message> <message>
<source>Import old Uniboard/Sankore documents</source> <source>Import old Uniboard/Sankore documents</source>
<translation type="unfinished"></translation> <translation>Importar documentos antiguos de Uniboard/Sankore</translation>
</message> </message>
<message> <message>
<source>There are no documents that should be imported</source> <source>There are no documents that should be imported</source>
<translation type="unfinished"></translation> <translation>No hay documentos a importar</translation>
</message> </message>
</context> </context>
<context> <context>
@ -2603,7 +2603,7 @@ p, li { white-space: pre-wrap; }
</message> </message>
<message utf8="true"> <message utf8="true">
<source>Open-Sankoré</source> <source>Open-Sankoré</source>
<translation type="unfinished"></translation> <translation>Open-Sankoré</translation>
</message> </message>
<message utf8="true"> <message utf8="true">
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;

@ -2423,8 +2423,23 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::curtainItemToSvg(UBGraphicsCurtainIt
*/ */
mXmlWriter.writeStartElement(UBSettings::uniboardDocumentNamespaceUri, "curtain"); 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); //graphicsItemToSvg(curtainItem);
QString zs;
zs.setNum(curtainItem->zValue(), 'f'); // 'f' keeps precision
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "z-value", zs);
UBItem* ubItem = dynamic_cast<UBItem*>(curtainItem);
if (ubItem)
{
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "uuid", UBStringUtils::toCanonicalUuid(ubItem->uuid()));
}
mXmlWriter.writeEndElement(); mXmlWriter.writeEndElement();
} }
@ -2436,13 +2451,17 @@ UBGraphicsCurtainItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::curtainItemFromSvg
graphicsItemFromSvg(curtainItem); graphicsItemFromSvg(curtainItem);
QStringRef svgX = mXmlReader.attributes().value("x");
QStringRef svgY = mXmlReader.attributes().value("y");
QStringRef svgWidth = mXmlReader.attributes().value("width"); QStringRef svgWidth = mXmlReader.attributes().value("width");
QStringRef svgHeight = mXmlReader.attributes().value("height"); 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.setWidth(svgWidth.toString().toFloat());
rect.setHeight(svgHeight.toString().toFloat()); rect.setHeight(svgHeight.toString().toFloat());
rect.translate(- rect.center());
curtainItem->setRect(rect); curtainItem->setRect(rect);

@ -1517,6 +1517,10 @@ void UBBoardController::updateSystemScaleFactor()
if (mActiveScene) if (mActiveScene)
{ {
QSize pageNominalSize = mActiveScene->nominalSize(); QSize pageNominalSize = mActiveScene->nominalSize();
//we're going to keep scale factor untouched if the size is custom
QMap<DocumentSizeRatio::Enum, QSize> sizesMap = UBSettings::settings()->documentSizes;
if(pageNominalSize == sizesMap.value(DocumentSizeRatio::Ratio16_9) || pageNominalSize == sizesMap.value(DocumentSizeRatio::Ratio4_3))
{
QSize controlSize = controlViewport(); QSize controlSize = controlViewport();
qreal hFactor = ((qreal)controlSize.width()) / ((qreal)pageNominalSize.width()); qreal hFactor = ((qreal)controlSize.width()) / ((qreal)pageNominalSize.width());
@ -1524,6 +1528,7 @@ void UBBoardController::updateSystemScaleFactor()
newScaleFactor = qMin(hFactor, vFactor); newScaleFactor = qMin(hFactor, vFactor);
} }
}
if (mSystemScaleFactor != newScaleFactor) if (mSystemScaleFactor != newScaleFactor)
{ {
@ -1541,7 +1546,6 @@ void UBBoardController::updateSystemScaleFactor()
mControlView->setTransform(scalingTransform); mControlView->setTransform(scalingTransform);
mControlView->horizontalScrollBar()->setValue(viewState.horizontalPosition); mControlView->horizontalScrollBar()->setValue(viewState.horizontalPosition);
mControlView->verticalScrollBar()->setValue(viewState.verticalPostition); mControlView->verticalScrollBar()->setValue(viewState.verticalPostition);
} }

@ -1765,23 +1765,14 @@ void UBGraphicsScene::addMask(const QPointF &center)
{ {
UBGraphicsCurtainItem* curtain = new UBGraphicsCurtainItem(); // mem : owned and destroyed by the scene UBGraphicsCurtainItem* curtain = new UBGraphicsCurtainItem(); // mem : owned and destroyed by the scene
mTools << curtain; mTools << curtain;
QGraphicsView* view;
if(UBApplication::applicationController->displayManager()->hasDisplay()) addItem(curtain);
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(); QRectF rect = UBApplication::boardController->activeScene()->normalizedSceneRect();
rect.setSize(QSizeF(rect.width()/2, rect.height()/2)); 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; QPointF origin = center.isNull() ? rect.bottomRight() : center;
curtain->setRect(rect.translated(origin - rect.topLeft() / 2)); curtain->setRect(rect);
UBGraphicsItem::assignZValue(curtain, toolLayerStart + toolOffsetCurtain);
addItem(curtain);
curtain->setVisible(true); curtain->setVisible(true);
curtain->setSelected(true); curtain->setSelected(true);
@ -1948,10 +1939,41 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent)
{ {
foreach(QGraphicsItem* item, si) foreach(QGraphicsItem* item, si)
{ {
UBGraphicsItem *ubgi = dynamic_cast<UBGraphicsItem*>(item); switch (item->type())
if (ubgi) {
case UBGraphicsW3CWidgetItem::Type:
{
UBGraphicsW3CWidgetItem *wc3_widget = dynamic_cast<UBGraphicsW3CWidgetItem*>(item);
if (0 != wc3_widget)
if (!wc3_widget->hasFocus())
wc3_widget->remove();
break;
}
case UBGraphicsAppleWidgetItem::Type:
{
UBGraphicsAppleWidgetItem *Apple_widget = dynamic_cast<UBGraphicsAppleWidgetItem*>(item);
if (0 !=Apple_widget)
if (!Apple_widget->hasFocus())
Apple_widget->remove();
break;
}
case UBGraphicsTextItem::Type:
{
UBGraphicsTextItem *text_item = dynamic_cast<UBGraphicsTextItem*>(item);
if (0 != text_item)
if (!text_item->hasFocus())
text_item->remove();
break;
}
default:
{ {
UBGraphicsItem *ubgi = dynamic_cast<UBGraphicsItem*>(item);
if (0 != ubgi)
ubgi->remove(); ubgi->remove();
else
UBCoreGraphicsScene::removeItem(item);
}
} }
} }
} }

Loading…
Cancel
Save