Commit 46e6b57e authored by Ivan Ilyin's avatar Ivan Ilyin

group fixes conflict merged

parents 408811c5 70db4955
...@@ -62,7 +62,8 @@ nmake release-install ...@@ -62,7 +62,8 @@ nmake release-install
copy %BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm build\win32\release\product\i18n\ copy %BASE_QT_TRANSLATIONS_DIRECTORY%\qt_*.qm build\win32\release\product\i18n\
copy resources\customizations build\win32\release\product\ mkdir build\win32\release\product\customizations
xcopy /s resources\customizations\* build\win32\release\product\customizations
del build\win32\release\product\i18n\qt_help* del build\win32\release\product\i18n\qt_help*
......
...@@ -1961,7 +1961,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::audioItemToLinkedAudio(UBGraphicsAud ...@@ -1961,7 +1961,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::audioItemToLinkedAudio(UBGraphicsAud
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "position", QString("%1").arg(pos)); mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "position", QString("%1").arg(pos));
} }
QString audioFileHref = audioItem->mediaFileUrl().toString(); QString audioFileHref = audioItem->mediaFileUrl().toLocalFile();
mXmlWriter.writeAttribute(nsXLink, "href", audioFileHref); mXmlWriter.writeAttribute(nsXLink, "href", audioFileHref);
mXmlWriter.writeEndElement(); mXmlWriter.writeEndElement();
} }
...@@ -1986,7 +1986,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::videoItemToLinkedVideo(UBGraphicsVid ...@@ -1986,7 +1986,7 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::videoItemToLinkedVideo(UBGraphicsVid
mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "position", QString("%1").arg(pos)); mXmlWriter.writeAttribute(UBSettings::uniboardDocumentNamespaceUri, "position", QString("%1").arg(pos));
} }
QString videoFileHref = videoItem->mediaFileUrl().toString(); QString videoFileHref = videoItem->mediaFileUrl().toLocalFile();
mXmlWriter.writeAttribute(nsXLink, "href", videoFileHref); mXmlWriter.writeAttribute(nsXLink, "href", videoFileHref);
mXmlWriter.writeEndElement(); mXmlWriter.writeEndElement();
} }
......
...@@ -33,18 +33,14 @@ ...@@ -33,18 +33,14 @@
#include "core/memcheck.h" #include "core/memcheck.h"
QList<QPixmap> UBThumbnailAdaptor::load(UBDocumentProxy* proxy) void UBThumbnailAdaptor::generateMissingThumbnails(UBDocumentProxy* proxy)
{ {
QList<QPixmap> thumbnails;
if (!proxy || proxy->persistencePath().isEmpty())
return thumbnails;
//compatibility with older formats (<= 4.0.b.2.0) : generate missing thumbnails
int existingPageCount = proxy->pageCount(); int existingPageCount = proxy->pageCount();
QString thumbFileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.thumbnail.jpg", existingPageCount); for (int iPageNo = 0; iPageNo < existingPageCount; ++iPageNo)
{
QString thumbFileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.thumbnail.jpg", iPageNo);
QFile thumbFile(thumbFileName); QFile thumbFile(thumbFileName);
if (!thumbFile.exists()) if (!thumbFile.exists())
...@@ -53,9 +49,7 @@ QList<QPixmap> UBThumbnailAdaptor::load(UBDocumentProxy* proxy) ...@@ -53,9 +49,7 @@ QList<QPixmap> UBThumbnailAdaptor::load(UBDocumentProxy* proxy)
int thumbCount = 0; int thumbCount = 0;
for(int i = 0 ; i < existingPageCount; i++) UBGraphicsScene* scene = UBSvgSubsetAdaptor::loadScene(proxy, iPageNo);
{
UBGraphicsScene* scene = UBSvgSubsetAdaptor::loadScene(proxy, i);
if (scene) if (scene)
{ {
...@@ -64,24 +58,25 @@ QList<QPixmap> UBThumbnailAdaptor::load(UBDocumentProxy* proxy) ...@@ -64,24 +58,25 @@ QList<QPixmap> UBThumbnailAdaptor::load(UBDocumentProxy* proxy)
if (displayMessage && thumbCount == 1) if (displayMessage && thumbCount == 1)
UBApplication::showMessage(tr("Generating preview thumbnails ...")); UBApplication::showMessage(tr("Generating preview thumbnails ..."));
persistScene(proxy->persistencePath(), scene, i); persistScene(proxy->persistencePath(), scene, iPageNo);
}
else{
if(i==0){
// we are working a document without zero page but on a system that enable it
// we have to create an empty zero scene
scene = new UBGraphicsScene(proxy);
UBSvgSubsetAdaptor::persistScene(proxy,scene,0);
persistScene(proxy->persistencePath(),scene,i);
thumbCount++;
}
}
} }
if (displayMessage && thumbCount > 0) if (displayMessage && thumbCount > 0)
UBApplication::showMessage(tr("%1 thumbnails generated ...").arg(thumbCount)); UBApplication::showMessage(tr("%1 thumbnails generated ...").arg(thumbCount));
} }
}
}
QList<QPixmap> UBThumbnailAdaptor::load(UBDocumentProxy* proxy)
{
QList<QPixmap> thumbnails;
if (!proxy || proxy->persistencePath().isEmpty())
return thumbnails;
//compatibility with older formats (<= 4.0.b.2.0) : generate missing thumbnails
generateMissingThumbnails(proxy);
//end compatibility with older format //end compatibility with older format
...@@ -113,39 +108,10 @@ QPixmap UBThumbnailAdaptor::load(UBDocumentProxy* proxy, int index) ...@@ -113,39 +108,10 @@ QPixmap UBThumbnailAdaptor::load(UBDocumentProxy* proxy, int index)
{ {
int existingPageCount = proxy->pageCount(); int existingPageCount = proxy->pageCount();
if (!proxy || proxy->persistencePath().size() == 0 || index < 0 || index >= existingPageCount) if (!proxy || proxy->persistencePath().size() == 0 || index < 0 || index > existingPageCount)
return QPixmap(); return QPixmap();
//compatibility with older formats (<= 4.0.b.2.0) : generate missing thumbnails //compatibility with older formats (<= 4.0.b.2.0) : generate missing thumbnails
generateMissingThumbnails(proxy);
QString thumbFileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.thumbnail.jpg", existingPageCount);
QFile thumbFile(thumbFileName);
if (!thumbFile.exists())
{
bool displayMessage = (existingPageCount > 5);
int thumbCount = 0;
for(int i = 0 ; i < existingPageCount; i++)
{
UBGraphicsScene* scene = UBSvgSubsetAdaptor::loadScene(proxy, i);
if (scene)
{
thumbCount++;
if (displayMessage && thumbCount == 1)
UBApplication::showMessage(tr("Generating preview thumbnails ..."));
persistScene(proxy->persistencePath(), scene, i);
}
}
if (displayMessage && thumbCount > 0)
UBApplication::showMessage(tr("%1 thumbnails generated ...").arg(thumbCount));
}
//end compatibility with older format //end compatibility with older format
QString fileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.thumbnail.jpg", index); QString fileName = proxy->persistencePath() + UBFileSystemUtils::digitFileFormat("/page%1.thumbnail.jpg", index);
......
...@@ -29,6 +29,7 @@ private: UBThumbnailAdaptor() {} ...@@ -29,6 +29,7 @@ private: UBThumbnailAdaptor() {}
public: public:
static void persistScene(const QString& pDocPath, UBGraphicsScene* pScene, int pageIndex, bool overrideModified = false); static void persistScene(const QString& pDocPath, UBGraphicsScene* pScene, int pageIndex, bool overrideModified = false);
static void generateMissingThumbnails(UBDocumentProxy* proxy);
static QList<QPixmap> load(UBDocumentProxy* proxy); static QList<QPixmap> load(UBDocumentProxy* proxy);
static QPixmap load(UBDocumentProxy* proxy, int index); static QPixmap load(UBDocumentProxy* proxy, int index);
......
...@@ -45,7 +45,7 @@ UBDrawingController::UBDrawingController(QObject * parent) ...@@ -45,7 +45,7 @@ UBDrawingController::UBDrawingController(QObject * parent)
, mActiveRuler(NULL) , mActiveRuler(NULL)
, mStylusTool((UBStylusTool::Enum)-1) , mStylusTool((UBStylusTool::Enum)-1)
, mLatestDrawingTool((UBStylusTool::Enum)-1) , mLatestDrawingTool((UBStylusTool::Enum)-1)
, mDrawingMode(/*DRAWING_MODE*/eDrawingMode_Vector) , mDrawingMode(DRAWING_MODE)
{ {
connect(UBSettings::settings(), SIGNAL(colorContextChanged()), this, SIGNAL(colorPaletteChanged())); connect(UBSettings::settings(), SIGNAL(colorContextChanged()), this, SIGNAL(colorPaletteChanged()));
...@@ -114,7 +114,7 @@ void UBDrawingController::setStylusTool(int tool) ...@@ -114,7 +114,7 @@ void UBDrawingController::setStylusTool(int tool)
UBApplication::mainWindow->actionPen->setChecked(true); UBApplication::mainWindow->actionPen->setChecked(true);
else if (mStylusTool == UBStylusTool::Eraser){ else if (mStylusTool == UBStylusTool::Eraser){
UBApplication::mainWindow->actionEraser->setChecked(true); UBApplication::mainWindow->actionEraser->setChecked(true);
//mDrawingMode = eDrawingMode_Artistic; mDrawingMode = eDrawingMode_Artistic;
} }
else if (mStylusTool == UBStylusTool::Marker) else if (mStylusTool == UBStylusTool::Marker)
UBApplication::mainWindow->actionMarker->setChecked(true); UBApplication::mainWindow->actionMarker->setChecked(true);
......
...@@ -848,7 +848,12 @@ QString UBPersistenceManager::teacherGuideAbsoluteObjectPath(UBDocumentProxy* pD ...@@ -848,7 +848,12 @@ QString UBPersistenceManager::teacherGuideAbsoluteObjectPath(UBDocumentProxy* pD
QString UBPersistenceManager::addObjectToTeacherGuideDirectory(UBDocumentProxy* pDocumentProxy, QString pPath) QString UBPersistenceManager::addObjectToTeacherGuideDirectory(UBDocumentProxy* pDocumentProxy, QString pPath)
{ {
QFileInfo fi(pPath.replace("file://","")); QString path = pPath;
//windows
path.replace("file:///","");
//others
path.replace("file://","");
QFileInfo fi(path);
QString uuid = QUuid::createUuid(); QString uuid = QUuid::createUuid();
if (!fi.exists() || !pDocumentProxy) if (!fi.exists() || !pDocumentProxy)
...@@ -862,7 +867,7 @@ QString UBPersistenceManager::addObjectToTeacherGuideDirectory(UBDocumentProxy* ...@@ -862,7 +867,7 @@ QString UBPersistenceManager::addObjectToTeacherGuideDirectory(UBDocumentProxy*
QDir dir; QDir dir;
dir.mkdir(pDocumentProxy->persistencePath() + "/" + UBPersistenceManager::teacherGuideDirectory); dir.mkdir(pDocumentProxy->persistencePath() + "/" + UBPersistenceManager::teacherGuideDirectory);
QFile source(pPath); QFile source(path);
source.copy(destPath); source.copy(destPath);
} }
......
...@@ -96,6 +96,8 @@ UBItem* UBGraphicsAudioItem::deepCopy() const ...@@ -96,6 +96,8 @@ UBItem* UBGraphicsAudioItem::deepCopy() const
UBGraphicsAudioItem *copy = new UBGraphicsAudioItem(audioUrl, parentItem()); UBGraphicsAudioItem *copy = new UBGraphicsAudioItem(audioUrl, parentItem());
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), copy, SLOT(activeSceneChanged()));
copy->setPos(this->pos()); copy->setPos(this->pos());
copy->setTransform(this->transform()); copy->setTransform(this->transform());
copy->setFlag(QGraphicsItem::ItemIsMovable, true); copy->setFlag(QGraphicsItem::ItemIsMovable, true);
......
This diff is collapsed.
...@@ -69,6 +69,8 @@ UBItem* UBGraphicsVideoItem::deepCopy() const ...@@ -69,6 +69,8 @@ UBItem* UBGraphicsVideoItem::deepCopy() const
UBGraphicsVideoItem *copy = new UBGraphicsVideoItem(videoUrl, parentItem()); UBGraphicsVideoItem *copy = new UBGraphicsVideoItem(videoUrl, parentItem());
connect(UBApplication::boardController, SIGNAL(activeSceneChanged()), copy, SLOT(activeSceneChanged()));
copy->setPos(this->pos()); copy->setPos(this->pos());
copy->setTransform(this->transform()); copy->setTransform(this->transform());
copy->setFlag(QGraphicsItem::ItemIsMovable, true); copy->setFlag(QGraphicsItem::ItemIsMovable, true);
......
...@@ -247,6 +247,8 @@ QString UBW3CWidget::createNPAPIWrapperInDir(const QString& pUrl, const QDir& pD ...@@ -247,6 +247,8 @@ QString UBW3CWidget::createNPAPIWrapperInDir(const QString& pUrl, const QDir& pD
{ {
QString url = pUrl; QString url = pUrl;
// if the file name start with file:// it has be removed because QFileInfo doesn't support this form // if the file name start with file:// it has be removed because QFileInfo doesn't support this form
//
url = url.replace("file:///","");
url = url.replace("file://",""); url = url.replace("file://","");
QString name = pName; QString name = pName;
...@@ -304,6 +306,7 @@ QString UBW3CWidget::createNPAPIWrapperInDir(const QString& pUrl, const QDir& pD ...@@ -304,6 +306,7 @@ QString UBW3CWidget::createNPAPIWrapperInDir(const QString& pUrl, const QDir& pD
if (fi.exists()){ if (fi.exists()){
QString target = widgetLibraryPath + "/" + fi.fileName(); QString target = widgetLibraryPath + "/" + fi.fileName();
QString source = pUrl; QString source = pUrl;
source.replace("file:///","");
source.replace("file://",""); source.replace("file://","");
QFile::copy(source, target); QFile::copy(source, target);
} }
......
...@@ -533,7 +533,13 @@ void UBTeacherGuidePresentationWidget::showData(QVector<tUBGEElementNode*> data) ...@@ -533,7 +533,13 @@ void UBTeacherGuidePresentationWidget::showData(QVector<tUBGEElementNode*> data)
newWidgetItem->setText(0,element->attributes.value("title")); newWidgetItem->setText(0,element->attributes.value("title"));
newWidgetItem->setData(0,tUBTGTreeWidgetItemRole_HasAnAction,tUBTGActionAssociateOnClickItem_MEDIA); newWidgetItem->setData(0,tUBTGTreeWidgetItemRole_HasAnAction,tUBTGActionAssociateOnClickItem_MEDIA);
newWidgetItem->setData(0,Qt::FontRole, QVariant(QFont(QApplication::font().family(),11))); newWidgetItem->setData(0,Qt::FontRole, QVariant(QFont(QApplication::font().family(),11)));
newWidgetItem->setData(0, TG_USER_ROLE_MIME_TYPE, UBApplication::boardController->activeDocument()->persistencePath()+ "/" + element->attributes.value("relativePath")); QString mimeTypeString;
#ifdef Q_WS_WIN
mimeTypeString = QUrl::fromLocalFile(UBApplication::boardController->activeDocument()->persistencePath()+ "/" + element->attributes.value("relativePath")).toString();
#else
mimeTypeString = UBApplication::boardController->activeDocument()->persistencePath()+ "/" + element->attributes.value("relativePath");
#endif
newWidgetItem->setData(0, TG_USER_ROLE_MIME_TYPE, mimeTypeString);
newWidgetItem->setFlags(Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsSelectable); newWidgetItem->setFlags(Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsSelectable);
mpRootWidgetItem->addChild(newWidgetItem); mpRootWidgetItem->addChild(newWidgetItem);
......
...@@ -230,11 +230,14 @@ void UBTGAdaptableText::bottomMargin(int newValue) ...@@ -230,11 +230,14 @@ void UBTGAdaptableText::bottomMargin(int newValue)
* class UBTGDraggableWeb * * class UBTGDraggableWeb *
***************************************************************************/ ***************************************************************************/
UBDraggableWeb::UBDraggableWeb(QString& relativePath, QWidget* parent): QWebView(parent) UBDraggableWeb::UBDraggableWeb(QString& relativePath, QWidget* parent): QWebView(parent)
, mRelativePath(relativePath)
, mDragStartPosition(QPoint(-1,-1)) , mDragStartPosition(QPoint(-1,-1))
, mDragStarted(false) , mDragStarted(false)
{ {
if(!relativePath.startsWith("file://"))
mRelativePath = QUrl::fromLocalFile(relativePath).toString();
else
mRelativePath = relativePath;
//NOOP //NOOP
} }
...@@ -499,7 +502,11 @@ void UBTGMediaWidget::mousePressEvent(QMouseEvent *event) ...@@ -499,7 +502,11 @@ void UBTGMediaWidget::mousePressEvent(QMouseEvent *event)
QDrag *drag = new QDrag(this); QDrag *drag = new QDrag(this);
QMimeData *mimeData = new QMimeData(); QMimeData *mimeData = new QMimeData();
QList<QUrl> urlList; QList<QUrl> urlList;
#ifdef Q_WS_WIN
urlList << QUrl::fromLocalFile(mMediaPath);
#else
urlList << QUrl(mMediaPath); urlList << QUrl(mMediaPath);
#endif
mimeData->setUrls(urlList); mimeData->setUrls(urlList);
drag->setMimeData(mimeData); drag->setMimeData(mimeData);
......
...@@ -842,7 +842,7 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState() ...@@ -842,7 +842,7 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState()
} }
} }
} }
if(UBSettings::settings()->teacherGuidePageZeroActivated and sceneIndex()<=1) if(UBSettings::settings()->teacherGuidePageZeroActivated && sceneIndex()<=1)
bCanMoveUp = false; bCanMoveUp = false;
if(bCanDelete || bCanMoveUp || bCanMoveDown) if(bCanDelete || bCanMoveUp || bCanMoveDown)
......
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