|
|
@ -132,7 +132,7 @@ void UBBoardController::init() |
|
|
|
, this, SLOT(lastWindowClosed())); |
|
|
|
, this, SLOT(lastWindowClosed())); |
|
|
|
|
|
|
|
|
|
|
|
connect(UBDownloadManager::downloadManager(), SIGNAL(downloadModalFinished()), this, SLOT(onDownloadModalFinished())); |
|
|
|
connect(UBDownloadManager::downloadManager(), SIGNAL(downloadModalFinished()), this, SLOT(onDownloadModalFinished())); |
|
|
|
connect(UBDownloadManager::downloadManager(), SIGNAL(addDownloadedFileToBoard(bool,QUrl,QString,QByteArray,QPointF,QSize,bool)), this, SLOT(downloadFinished(bool,QUrl,QString,QByteArray,QPointF,QSize,bool))); |
|
|
|
connect(UBDownloadManager::downloadManager(), SIGNAL(addDownloadedFileToBoard(bool,QUrl,QUrl,QString,QByteArray,QPointF,QSize,bool)), this, SLOT(downloadFinished(bool,QUrl,QUrl,QString,QByteArray,QPointF,QSize,bool))); |
|
|
|
|
|
|
|
|
|
|
|
UBDocumentProxy* doc = UBPersistenceManager::persistenceManager()->createDocument(); |
|
|
|
UBDocumentProxy* doc = UBPersistenceManager::persistenceManager()->createDocument(); |
|
|
|
|
|
|
|
|
|
|
@ -563,7 +563,12 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBMimeType::Enum itemMimeType; |
|
|
|
UBMimeType::Enum itemMimeType; |
|
|
|
QString contentTypeHeader = UBFileSystemUtils::mimeTypeFromFileName(item->sourceUrl().toLocalFile()); |
|
|
|
|
|
|
|
|
|
|
|
QString srcFile = item->sourceUrl().toLocalFile(); |
|
|
|
|
|
|
|
if (srcFile.isEmpty()) |
|
|
|
|
|
|
|
srcFile = item->sourceUrl().toString(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString contentTypeHeader = UBFileSystemUtils::mimeTypeFromFileName(srcFile); |
|
|
|
if(NULL != qgraphicsitem_cast<UBGraphicsGroupContainerItem*>(commonItem)) |
|
|
|
if(NULL != qgraphicsitem_cast<UBGraphicsGroupContainerItem*>(commonItem)) |
|
|
|
itemMimeType = UBMimeType::Group; |
|
|
|
itemMimeType = UBMimeType::Group; |
|
|
|
else
|
|
|
|
else
|
|
|
@ -588,8 +593,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item) |
|
|
|
if (mitem) |
|
|
|
if (mitem) |
|
|
|
{ |
|
|
|
{ |
|
|
|
sourceUrl = mitem->mediaFileUrl(); |
|
|
|
sourceUrl = mitem->mediaFileUrl(); |
|
|
|
|
|
|
|
downloadURL(sourceUrl, srcFile, itemPos, QSize(itemSize.width(), itemSize.height()), false, false);
|
|
|
|
} |
|
|
|
} |
|
|
|
}break; |
|
|
|
}return NULL; // async operation
|
|
|
|
|
|
|
|
|
|
|
|
case UBMimeType::VectorImage: |
|
|
|
case UBMimeType::VectorImage: |
|
|
|
{ |
|
|
|
{ |
|
|
@ -662,7 +668,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item) |
|
|
|
if (retItem) |
|
|
|
if (retItem) |
|
|
|
return retItem; |
|
|
|
return retItem; |
|
|
|
|
|
|
|
|
|
|
|
UBItem *createdItem = downloadFinished(true, sourceUrl, contentTypeHeader, pData, itemPos, QSize(itemSize.width(), itemSize.height()), false); |
|
|
|
UBItem *createdItem = downloadFinished(true, sourceUrl, sourceUrl, contentTypeHeader, pData, itemPos, QSize(itemSize.width(), itemSize.height()), false); |
|
|
|
if (createdItem) |
|
|
|
if (createdItem) |
|
|
|
{ |
|
|
|
{ |
|
|
|
createdItem->setSourceUrl(item->sourceUrl()); |
|
|
|
createdItem->setSourceUrl(item->sourceUrl()); |
|
|
@ -676,6 +682,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item) |
|
|
|
|
|
|
|
|
|
|
|
retItem = dynamic_cast<UBGraphicsItem *>(createdItem); |
|
|
|
retItem = dynamic_cast<UBGraphicsItem *>(createdItem); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return retItem; |
|
|
|
return retItem; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -961,7 +968,7 @@ void UBBoardController::groupButtonClicked() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const QSize& pSize, bool isBackground, bool internalData) |
|
|
|
void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, const QPointF& pPos, const QSize& pSize, bool isBackground, bool internalData) |
|
|
|
{ |
|
|
|
{ |
|
|
|
qDebug() << "something has been dropped on the board! Url is: " << url.toString(); |
|
|
|
qDebug() << "something has been dropped on the board! Url is: " << url.toString(); |
|
|
|
QString sUrl = url.toString(); |
|
|
|
QString sUrl = url.toString(); |
|
|
@ -972,7 +979,7 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const |
|
|
|
|
|
|
|
|
|
|
|
if(sUrl.startsWith("uniboardTool://")) |
|
|
|
if(sUrl.startsWith("uniboardTool://")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
downloadFinished(true, url, "application/vnd.mnemis-uniboard-tool", QByteArray(), pPos, pSize, isBackground); |
|
|
|
downloadFinished(true, url, QUrl(), "application/vnd.mnemis-uniboard-tool", QByteArray(), pPos, pSize, isBackground); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (sUrl.startsWith("file://") || sUrl.startsWith("/")) |
|
|
|
else if (sUrl.startsWith("file://") || sUrl.startsWith("/")) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -985,22 +992,37 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const |
|
|
|
|| contentType.startsWith("application/widget") |
|
|
|
|| contentType.startsWith("application/widget") |
|
|
|
|| contentType.startsWith("application/vnd.apple-widget"); |
|
|
|
|| contentType.startsWith("application/vnd.apple-widget"); |
|
|
|
|
|
|
|
|
|
|
|
QFile file(fileName); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (shouldLoadFileData) |
|
|
|
if (shouldLoadFileData) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QFile file(fileName); |
|
|
|
file.open(QIODevice::ReadOnly); |
|
|
|
file.open(QIODevice::ReadOnly); |
|
|
|
|
|
|
|
downloadFinished(true, formedUrl, QUrl(), contentType, file.readAll(), pPos, pSize, isBackground, internalData); |
|
|
|
downloadFinished(true, formedUrl, contentType, file.readAll(), pPos, pSize, isBackground, internalData); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (shouldLoadFileData) |
|
|
|
|
|
|
|
file.close(); |
|
|
|
file.close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// media items should be copyed in separate thread
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sDownloadFileDesc desc; |
|
|
|
|
|
|
|
desc.modal = false; |
|
|
|
|
|
|
|
desc.srcUrl = sUrl; |
|
|
|
|
|
|
|
desc.originalSrcUrl = contentSourceUrl; |
|
|
|
|
|
|
|
desc.currentSize = 0; |
|
|
|
|
|
|
|
desc.name = QFileInfo(url.toString()).fileName(); |
|
|
|
|
|
|
|
desc.totalSize = 0; // The total size will be retrieved during the download
|
|
|
|
|
|
|
|
desc.pos = pPos; |
|
|
|
|
|
|
|
desc.size = pSize; |
|
|
|
|
|
|
|
desc.isBackground = isBackground; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBDownloadManager::downloadManager()->addFileToDownload(desc); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
// When we fall there, it means that we are dropping something from the web to the board
|
|
|
|
// When we fall there, it means that we are dropping something from the web to the board
|
|
|
|
sDownloadFileDesc desc; |
|
|
|
sDownloadFileDesc desc; |
|
|
|
desc.modal = true; |
|
|
|
desc.modal = true; |
|
|
|
desc.url = url.toString(); |
|
|
|
desc.srcUrl = url.toString(); |
|
|
|
desc.currentSize = 0; |
|
|
|
desc.currentSize = 0; |
|
|
|
desc.name = QFileInfo(url.toString()).fileName(); |
|
|
|
desc.name = QFileInfo(url.toString()).fileName(); |
|
|
|
desc.totalSize = 0; // The total size will be retrieved during the download
|
|
|
|
desc.totalSize = 0; // The total size will be retrieved during the download
|
|
|
@ -1023,7 +1045,7 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString pContentTypeHeader, |
|
|
|
UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl contentUrl, QString pContentTypeHeader, |
|
|
|
QByteArray pData, QPointF pPos, QSize pSize, |
|
|
|
QByteArray pData, QPointF pPos, QSize pSize, |
|
|
|
bool isBackground, bool internalData) |
|
|
|
bool isBackground, bool internalData) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -1158,11 +1180,9 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri |
|
|
|
qDebug() << "accepting mime type" << mimeType << "as video"; |
|
|
|
qDebug() << "accepting mime type" << mimeType << "as video"; |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsMediaItem *mediaVideoItem = 0; |
|
|
|
UBGraphicsMediaItem *mediaVideoItem = 0; |
|
|
|
|
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
if (pData.length() > 0) |
|
|
|
if (pData.length() > 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString destFile; |
|
|
|
QString destFile; |
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(),
|
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(),
|
|
|
|
sourceUrl.toString(), |
|
|
|
sourceUrl.toString(), |
|
|
@ -1179,16 +1199,19 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri |
|
|
|
QUrl url = QUrl::fromLocalFile(destFile); |
|
|
|
QUrl url = QUrl::fromLocalFile(destFile); |
|
|
|
|
|
|
|
|
|
|
|
mediaVideoItem = mActiveScene->addMedia(url, false, pPos); |
|
|
|
mediaVideoItem = mActiveScene->addMedia(url, false, pPos); |
|
|
|
|
|
|
|
|
|
|
|
mediaVideoItem->setSourceUrl(sourceUrl); |
|
|
|
|
|
|
|
mediaVideoItem->setUuid(uuid); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
mediaVideoItem = addVideo(sourceUrl, false, pPos); |
|
|
|
qDebug() << sourceUrl.toString(); |
|
|
|
|
|
|
|
mediaVideoItem = addVideo(sourceUrl, false, pPos, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(mediaVideoItem){ |
|
|
|
if(mediaVideoItem){ |
|
|
|
|
|
|
|
if (contentUrl.isEmpty()) |
|
|
|
|
|
|
|
mediaVideoItem->setSourceUrl(sourceUrl); |
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
mediaVideoItem->setSourceUrl(contentUrl); |
|
|
|
|
|
|
|
mediaVideoItem->setUuid(uuid); |
|
|
|
connect(this, SIGNAL(activeSceneChanged()), mediaVideoItem, SLOT(activeSceneChanged())); |
|
|
|
connect(this, SIGNAL(activeSceneChanged()), mediaVideoItem, SLOT(activeSceneChanged())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1202,10 +1225,9 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsMediaItem *audioMediaItem = 0; |
|
|
|
UBGraphicsMediaItem *audioMediaItem = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
if (pData.length() > 0) |
|
|
|
if (pData.length() > 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString destFile; |
|
|
|
QString destFile; |
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(),
|
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(),
|
|
|
|
sourceUrl.toString(), |
|
|
|
sourceUrl.toString(), |
|
|
@ -1222,16 +1244,18 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri |
|
|
|
QUrl url = QUrl::fromLocalFile(destFile); |
|
|
|
QUrl url = QUrl::fromLocalFile(destFile); |
|
|
|
|
|
|
|
|
|
|
|
audioMediaItem = mActiveScene->addMedia(url, false, pPos); |
|
|
|
audioMediaItem = mActiveScene->addMedia(url, false, pPos); |
|
|
|
|
|
|
|
|
|
|
|
audioMediaItem->setSourceUrl(sourceUrl); |
|
|
|
|
|
|
|
audioMediaItem->setUuid(uuid); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
audioMediaItem = addAudio(sourceUrl, false, pPos); |
|
|
|
audioMediaItem = addAudio(sourceUrl, false, pPos, true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(audioMediaItem){ |
|
|
|
if(audioMediaItem){ |
|
|
|
|
|
|
|
if (contentUrl.isEmpty()) |
|
|
|
|
|
|
|
audioMediaItem->setSourceUrl(sourceUrl); |
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
audioMediaItem->setSourceUrl(contentUrl); |
|
|
|
|
|
|
|
audioMediaItem->setUuid(uuid); |
|
|
|
connect(this, SIGNAL(activeSceneChanged()), audioMediaItem, SLOT(activeSceneChanged())); |
|
|
|
connect(this, SIGNAL(activeSceneChanged()), audioMediaItem, SLOT(activeSceneChanged())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2027,23 +2051,28 @@ void UBBoardController::grabScene(const QRectF& pSceneRect) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsMediaItem* UBBoardController::addVideo(const QUrl& pSourceUrl, bool startPlay, const QPointF& pos) |
|
|
|
UBGraphicsMediaItem* UBBoardController::addVideo(const QUrl& pSourceUrl, bool startPlay, const QPointF& pos, bool bUseSource) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
QUrl concreteUrl = pSourceUrl; |
|
|
|
QUrl concreteUrl = pSourceUrl; |
|
|
|
|
|
|
|
|
|
|
|
QString destFile; |
|
|
|
// media file is not in document folder yet
|
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(),
|
|
|
|
if (!bUseSource) |
|
|
|
pSourceUrl.toLocalFile(), |
|
|
|
|
|
|
|
UBPersistenceManager::videoDirectory, |
|
|
|
|
|
|
|
uuid, |
|
|
|
|
|
|
|
destFile); |
|
|
|
|
|
|
|
if (!b) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
showMessage(tr("Add file operation failed: file copying error")); |
|
|
|
QString destFile; |
|
|
|
return NULL; |
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(),
|
|
|
|
} |
|
|
|
pSourceUrl.toLocalFile(), |
|
|
|
concreteUrl = QUrl::fromLocalFile(destFile); |
|
|
|
UBPersistenceManager::videoDirectory, |
|
|
|
|
|
|
|
uuid, |
|
|
|
|
|
|
|
destFile); |
|
|
|
|
|
|
|
if (!b) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
showMessage(tr("Add file operation failed: file copying error")); |
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
concreteUrl = QUrl::fromLocalFile(destFile); |
|
|
|
|
|
|
|
}// else we just use source Url.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsMediaItem* vi = mActiveScene->addMedia(concreteUrl, startPlay, pos); |
|
|
|
UBGraphicsMediaItem* vi = mActiveScene->addMedia(concreteUrl, startPlay, pos); |
|
|
|
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); |
|
|
|
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); |
|
|
@ -2057,23 +2086,27 @@ UBGraphicsMediaItem* UBBoardController::addVideo(const QUrl& pSourceUrl, bool st |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsMediaItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool startPlay, const QPointF& pos) |
|
|
|
UBGraphicsMediaItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool startPlay, const QPointF& pos, bool bUseSource) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
QUuid uuid = QUuid::createUuid(); |
|
|
|
QUrl concreteUrl = pSourceUrl; |
|
|
|
QUrl concreteUrl = pSourceUrl; |
|
|
|
|
|
|
|
|
|
|
|
QString destFile; |
|
|
|
// media file is not in document folder yet
|
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(),
|
|
|
|
if (!bUseSource) |
|
|
|
pSourceUrl.toLocalFile(),
|
|
|
|
|
|
|
|
UBPersistenceManager::audioDirectory, |
|
|
|
|
|
|
|
uuid, |
|
|
|
|
|
|
|
destFile); |
|
|
|
|
|
|
|
if (!b) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
showMessage(tr("Add file operation failed: file copying error")); |
|
|
|
QString destFile; |
|
|
|
return NULL; |
|
|
|
bool b = UBPersistenceManager::persistenceManager()->addFileToDocument(selectedDocument(),
|
|
|
|
} |
|
|
|
pSourceUrl.toLocalFile(), |
|
|
|
concreteUrl = QUrl::fromLocalFile(destFile); |
|
|
|
UBPersistenceManager::audioDirectory, |
|
|
|
|
|
|
|
uuid, |
|
|
|
|
|
|
|
destFile); |
|
|
|
|
|
|
|
if (!b) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
showMessage(tr("Add file operation failed: file copying error")); |
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
concreteUrl = QUrl::fromLocalFile(destFile); |
|
|
|
|
|
|
|
}// else we just use source Url.
|
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsMediaItem* ai = mActiveScene->addMedia(concreteUrl, startPlay, pos); |
|
|
|
UBGraphicsMediaItem* ai = mActiveScene->addMedia(concreteUrl, startPlay, pos); |
|
|
|
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); |
|
|
|
selectedDocument()->setMetaData(UBSettings::documentUpdatedAt, UBStringUtils::toUtcIsoDateTime(QDateTime::currentDateTime())); |
|
|
@ -2247,7 +2280,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint |
|
|
|
|
|
|
|
|
|
|
|
if("" != url) |
|
|
|
if("" != url) |
|
|
|
{ |
|
|
|
{ |
|
|
|
downloadURL(url, pPos); |
|
|
|
downloadURL(url, QString(), pPos); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -2267,7 +2300,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint |
|
|
|
foreach(const QUrl url, urls){ |
|
|
|
foreach(const QUrl url, urls){ |
|
|
|
QPointF pos(pPos + QPointF(index * 15, index * 15)); |
|
|
|
QPointF pos(pPos + QPointF(index * 15, index * 15)); |
|
|
|
|
|
|
|
|
|
|
|
downloadURL(url, pos, QSize(), false, internalData); |
|
|
|
downloadURL(url, QString(), pos, QSize(), false, internalData); |
|
|
|
index++; |
|
|
|
index++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2293,7 +2326,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint |
|
|
|
// Sometimes, it is possible to have an URL as text. we check here if it is the case
|
|
|
|
// Sometimes, it is possible to have an URL as text. we check here if it is the case
|
|
|
|
QString qsTmp = pMimeData->text().remove(QRegExp("[\\0]")); |
|
|
|
QString qsTmp = pMimeData->text().remove(QRegExp("[\\0]")); |
|
|
|
if(qsTmp.startsWith("http")){ |
|
|
|
if(qsTmp.startsWith("http")){ |
|
|
|
downloadURL(QUrl(qsTmp), pPos); |
|
|
|
downloadURL(QUrl(qsTmp), QString(), pPos); |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
mActiveScene->addTextHtml(pMimeData->html(), pPos); |
|
|
|
mActiveScene->addTextHtml(pMimeData->html(), pPos); |
|
|
@ -2307,7 +2340,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint |
|
|
|
QString qsUrl = UBPlatformUtils::urlFromClipboard(); |
|
|
|
QString qsUrl = UBPlatformUtils::urlFromClipboard(); |
|
|
|
if("" != qsUrl){ |
|
|
|
if("" != qsUrl){ |
|
|
|
// We finally got the url of the dropped ressource! Let's import it!
|
|
|
|
// We finally got the url of the dropped ressource! Let's import it!
|
|
|
|
downloadURL(qsUrl, pPos); |
|
|
|
downloadURL(qsUrl, qsUrl, pPos); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|