Fixed undo stack for background objects.

preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent 1a799632ab
commit 197ba3a5f4
  1. 14
      src/board/UBBoardController.cpp

@ -950,6 +950,10 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
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();
QGraphicsItem *oldBackgroundObject = NULL;
if (isBackground)
oldBackgroundObject = mActiveScene->backgroundObject();
if(sUrl.startsWith("uniboardTool://")) if(sUrl.startsWith("uniboardTool://"))
{ {
downloadFinished(true, url, "application/vnd.mnemis-uniboard-tool", QByteArray(), pPos, pSize, isBackground); downloadFinished(true, url, "application/vnd.mnemis-uniboard-tool", QByteArray(), pPos, pSize, isBackground);
@ -990,6 +994,16 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
UBDownloadManager::downloadManager()->addFileToDownload(desc); UBDownloadManager::downloadManager()->addFileToDownload(desc);
} }
if (isBackground && oldBackgroundObject != mActiveScene->backgroundObject())
{
if (mActiveScene->isURStackIsEnabled()) { //should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand* uc = new UBGraphicsItemUndoCommand(mActiveScene, oldBackgroundObject, mActiveScene->backgroundObject());
UBApplication::undoStack->push(uc);
}
}
} }

Loading…
Cancel
Save