Commit 2b678dd9 authored by Ivan Ilin's avatar Ivan Ilin

UBTeacherGuideWidget conflict resolved manually

parents 09f1c235 d6de8439
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "domain/UBGraphicsTextItem.h" #include "domain/UBGraphicsTextItem.h"
#include "domain/UBAbstractWidget.h" #include "domain/UBAbstractWidget.h"
#include "domain/UBGraphicsStroke.h" #include "domain/UBGraphicsStroke.h"
#include "domain/UBGraphicsStrokesGroup.h"
#include "domain/UBItem.h" #include "domain/UBItem.h"
#include "tools/UBGraphicsRuler.h" #include "tools/UBGraphicsRuler.h"
...@@ -42,6 +43,7 @@ ...@@ -42,6 +43,7 @@
#include "board/UBBoardView.h" #include "board/UBBoardView.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "board/UBDrawingController.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
#include "frameworks/UBStringUtils.h" #include "frameworks/UBStringUtils.h"
...@@ -311,6 +313,8 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -311,6 +313,8 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mFileVersion = 40100; // default to 4.1.0 mFileVersion = 40100; // default to 4.1.0
UBGraphicsStroke* annotationGroup = 0; UBGraphicsStroke* annotationGroup = 0;
UBGraphicsStrokesGroup* strokesGroup = 0;
UBDrawingController* dc = UBDrawingController::drawingController();
while (!mXmlReader.atEnd()) while (!mXmlReader.atEnd())
{ {
...@@ -433,6 +437,10 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -433,6 +437,10 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
else else
annotationGroup = new UBGraphicsStroke(); annotationGroup = new UBGraphicsStroke();
if(eDrawingMode_Vector == dc->drawingMode()){
strokesGroup = new UBGraphicsStrokesGroup();
}
QStringRef ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value"); QStringRef ubZValue = mXmlReader.attributes().value(mNamespaceUri, "z-value");
if (!ubZValue.isNull()) if (!ubZValue.isNull())
...@@ -475,7 +483,13 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -475,7 +483,13 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
polygonItem->setStroke(annotationGroup); polygonItem->setStroke(annotationGroup);
} }
if(eDrawingMode_Vector == dc->drawingMode()){
if(strokesGroup){
strokesGroup->addToGroup(polygonItem);
}
}else{
scene->addItem(polygonItem); scene->addItem(polygonItem);
}
polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic)); polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic));
...@@ -494,7 +508,13 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -494,7 +508,13 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
polygonItem->setStroke(annotationGroup); polygonItem->setStroke(annotationGroup);
} }
if(eDrawingMode_Vector == dc->drawingMode()){
if(strokesGroup){
strokesGroup->addToGroup(polygonItem);
}
}else{
scene->addItem(polygonItem); scene->addItem(polygonItem);
}
polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic)); polygonItem->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Graphic));
polygonItem->show(); polygonItem->show();
...@@ -816,6 +836,10 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -816,6 +836,10 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
{ {
if (mXmlReader.name() == "g") if (mXmlReader.name() == "g")
{ {
if(strokesGroup && scene){
scene->addItem(strokesGroup);
}
if (annotationGroup) if (annotationGroup)
{ {
if (!annotationGroup->polygons().empty()) if (!annotationGroup->polygons().empty())
...@@ -931,7 +955,6 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene() ...@@ -931,7 +955,6 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
{ {
QGraphicsItem *item = items.takeFirst(); QGraphicsItem *item = items.takeFirst();
UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*> (item); UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*> (item);
if (polygonItem && polygonItem->isVisible()) if (polygonItem && polygonItem->isVisible())
......
...@@ -146,6 +146,11 @@ void UBDisplayManager::setDisplayWidget(QWidget* pDisplayWidget) ...@@ -146,6 +146,11 @@ void UBDisplayManager::setDisplayWidget(QWidget* pDisplayWidget)
{ {
if(pDisplayWidget && (pDisplayWidget != mDisplayWidget)) if(pDisplayWidget && (pDisplayWidget != mDisplayWidget))
{ {
if (mDisplayWidget)
{
pDisplayWidget->setGeometry(mDisplayWidget->geometry());
pDisplayWidget->setWindowFlags(mDisplayWidget->windowFlags());
}
mDisplayWidget = pDisplayWidget; mDisplayWidget = pDisplayWidget;
// !!!! Should be included into Windows after QT recompilation // !!!! Should be included into Windows after QT recompilation
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
......
...@@ -621,7 +621,6 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy, ...@@ -621,7 +621,6 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
mSceneCache.insert(pDocumentProxy, pSceneIndex, pScene); mSceneCache.insert(pDocumentProxy, pSceneIndex, pScene);
emit documentCommitted(pDocumentProxy); emit documentCommitted(pDocumentProxy);
} }
......
...@@ -297,6 +297,8 @@ QString UBDocumentProxy::sessionAuthors() ...@@ -297,6 +297,8 @@ QString UBDocumentProxy::sessionAuthors()
QDateTime UBDocumentProxy::documentDate() QDateTime UBDocumentProxy::documentDate()
{ {
qDebug()<< UBSettings::documentDate;
qDebug()<<mMetaDatas;
if(mMetaDatas.contains(UBSettings::documentDate)) if(mMetaDatas.contains(UBSettings::documentDate))
return UBStringUtils::fromUtcIsoDate(metaData(UBSettings::documentDate).toString()); return UBStringUtils::fromUtcIsoDate(metaData(UBSettings::documentDate).toString());
return QDateTime::currentDateTime(); return QDateTime::currentDateTime();
......
...@@ -207,7 +207,7 @@ void UBGraphicsItemDelegate::setMimeData(QMimeData *mimeData) ...@@ -207,7 +207,7 @@ void UBGraphicsItemDelegate::setMimeData(QMimeData *mimeData)
bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event) bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
if((NULL != mMimeData) && ((event->pos() - mDragStartPosition).manhattanLength() < QApplication::startDragDistance())) if(NULL != mMimeData)
{ {
QDrag* mDrag = new QDrag(event->widget()); QDrag* mDrag = new QDrag(event->widget());
mDrag->setMimeData(mMimeData); mDrag->setMimeData(mMimeData);
...@@ -227,7 +227,7 @@ bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event) ...@@ -227,7 +227,7 @@ bool UBGraphicsItemDelegate::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
return true; return true;
} }
else else
return true; return false;
} }
bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event) bool UBGraphicsItemDelegate::weelEvent(QGraphicsSceneWheelEvent *event)
......
...@@ -723,10 +723,10 @@ void UBTeacherGuidePageZeroEditionWidget::onActiveSceneChanged() ...@@ -723,10 +723,10 @@ void UBTeacherGuidePageZeroEditionWidget::onActiveSceneChanged()
{ {
UBDocumentProxy* documentProxy = UBApplication::documentController ? UBApplication::documentController->getCurrentDocument() : 0; UBDocumentProxy* documentProxy = UBApplication::documentController ? UBApplication::documentController->getCurrentDocument() : 0;
if(UBApplication::documentController && UBApplication::boardController->activeSceneIndex() == 0){ if(UBApplication::documentController && UBApplication::boardController->activeSceneIndex() == 0){
QDateTime creationDate = documentProxy->documentDate(); // QDateTime creationDate = documentProxy->documentDate();
mpCreationLabel->setText(tr("Created the:") + creationDate.toString(Qt::SystemLocaleShortDate)); // mpCreationLabel->setText(tr("Created the:") + creationDate.toString(Qt::SystemLocaleShortDate));
QDateTime updatedDate = documentProxy->lastUpdate(); // QDateTime updatedDate = documentProxy->lastUpdate();
mpLastModifiedLabel->setText(tr("Updated the:") + updatedDate.toString(Qt::SystemLocaleShortDate)); // mpLastModifiedLabel->setText(tr("Updated the:") + updatedDate.toString(Qt::SystemLocaleShortDate));
} }
} }
...@@ -767,8 +767,10 @@ void UBTeacherGuidePageZeroEditionWidget::switchToMode(tUBTGZeroPageMode mode) ...@@ -767,8 +767,10 @@ void UBTeacherGuidePageZeroEditionWidget::switchToMode(tUBTGZeroPageMode mode)
mpLicenceValueLabel->setText(mpLicenceBox->currentText()); mpLicenceValueLabel->setText(mpLicenceBox->currentText());
QStringList licenceIconList; QStringList licenceIconList;
licenceIconList << ":images/licenses/ccby.png" << ":images/licenses/ccbynd.png" << ":images/licenses/ccbysa.png" << ":images/licenses/ccbync.png" << ":images/licenses/ccbyncnd.png" << ":images/licenses/ccbyncsa.png"; licenceIconList << ":images/licenses/ccby.png" << ":images/licenses/ccbynd.png" << ":images/licenses/ccbysa.png" << ":images/licenses/ccbync.png" << ":images/licenses/ccbyncnd.png" << ":images/licenses/ccbyncsa.png";
if(mpLicenceBox->currentIndex() < 6){ int licenceBoxCurrentIndex = mpLicenceBox->currentIndex();
// mpLicenceIcon->setPixmap(licenceIconList.at(mpLicenceBox->currentIndex())); // -1 is return if there is no values on the box
if(licenceBoxCurrentIndex > 0 && licenceBoxCurrentIndex < licenceIconList.count()){
mpLicenceIcon->setPixmap(licenceIconList.at(licenceBoxCurrentIndex));
mpLicenceIcon->show(); mpLicenceIcon->show();
} }
mpLicenceValueLabel->show(); mpLicenceValueLabel->show();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment