diff --git a/src/core/UBDownloadManager.cpp b/src/core/UBDownloadManager.cpp index 24116d2e..f60a8996 100644 --- a/src/core/UBDownloadManager.cpp +++ b/src/core/UBDownloadManager.cpp @@ -78,7 +78,7 @@ void UBAsyncLocalFileDownloader::run() QFile::remove(mTo); } else - emit signal_asyncCopyFinished(mDesc.id, !mTo.isEmpty(), QUrl::fromLocalFile(mTo), QUrl::fromLocalFile(mDesc.originalSrcUrl), "", NULL, mDesc.pos, mDesc.size, mDesc.isBackground); + emit signal_asyncCopyFinished(mDesc.id, !mTo.isEmpty(), QUrl::fromLocalFile(mTo), QUrl(mDesc.originalSrcUrl), "", NULL, mDesc.pos, mDesc.size, mDesc.isBackground); } void UBAsyncLocalFileDownloader::abort() diff --git a/src/domain/UBGraphicsDelegateFrame.cpp b/src/domain/UBGraphicsDelegateFrame.cpp index 24a17ffc..37596515 100644 --- a/src/domain/UBGraphicsDelegateFrame.cpp +++ b/src/domain/UBGraphicsDelegateFrame.cpp @@ -381,7 +381,6 @@ QSizeF UBGraphicsDelegateFrame::resizeDelegate(qreal moveX, qreal moveY) return incVector; } - void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { if (None == mCurrentTool) diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 54986d83..b01190c5 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -144,7 +144,7 @@ void DelegateButton::startShowProgress() } } -UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObject * parent, bool respectRatio, bool canRotate, bool useToolBar) +UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObject * parent, bool respectRatio, bool canRotate, bool useToolBar, bool showGoContentButton) : QObject(parent) , mDelegated(pDelegated) , mDeleteButton(NULL) @@ -164,6 +164,7 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec , mMimeData(NULL) , mFlippable(false) , mToolBarUsed(useToolBar) + , mShowGoContentButton(showGoContentButton) { connect(UBApplication::boardController, SIGNAL(zoomChanged(qreal)), this, SLOT(onZoomChanged())); } @@ -189,6 +190,13 @@ void UBGraphicsItemDelegate::init() connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu())); mButtons << mMenuButton; + if (mShowGoContentButton) + { + mContentSourceButton = new DelegateButton(":/images/home.svg", mDelegated, mFrame, Qt::TopLeftSection); + connect(mContentSourceButton, SIGNAL(clicked()), this, SLOT(gotoContentSource())); + mButtons << mContentSourceButton; + } + mZOrderUpButton = new DelegateButton(":/images/z_layer_up.svg", mDelegated, mFrame, Qt::BottomLeftSection); mZOrderUpButton->setShowProgressIndicator(true); connect(mZOrderUpButton, SIGNAL(clicked()), this, SLOT(increaseZLevelUp())); @@ -550,10 +558,8 @@ void UBGraphicsItemDelegate::showHide(bool show) } -void UBGraphicsItemDelegate::gotoContentSource(bool checked) +void UBGraphicsItemDelegate::gotoContentSource() { - Q_UNUSED(checked) - UBItem* item = dynamic_cast(mDelegated); if(item && !item->sourceUrl().isEmpty()) @@ -624,13 +630,6 @@ void UBGraphicsItemDelegate::decorateMenu(QMenu* menu) showIcon.addPixmap(QPixmap(":/images/eyeOpened.svg"), QIcon::Normal, QIcon::On); showIcon.addPixmap(QPixmap(":/images/eyeClosed.svg"), QIcon::Normal, QIcon::Off); mShowOnDisplayAction->setIcon(showIcon); - - mGotoContentSourceAction = menu->addAction(tr("Go to Content Source"), this, SLOT(gotoContentSource(bool))); - - QIcon sourceIcon; - sourceIcon.addPixmap(QPixmap(":/images/toolbar/internet.png"), QIcon::Normal, QIcon::On); - mGotoContentSourceAction->setIcon(sourceIcon); - } void UBGraphicsItemDelegate::updateMenuActionState() diff --git a/src/domain/UBGraphicsItemDelegate.h b/src/domain/UBGraphicsItemDelegate.h index 418ae80a..4a3cadf4 100644 --- a/src/domain/UBGraphicsItemDelegate.h +++ b/src/domain/UBGraphicsItemDelegate.h @@ -207,7 +207,7 @@ class UBGraphicsItemDelegate : public QObject Q_OBJECT public: - UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObject * parent = 0, bool respectRatio = true, bool canRotate = false, bool useToolBar = true); + UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObject * parent = 0, bool respectRatio = true, bool canRotate = false, bool useToolBar = true, bool showGoContentButton = false); virtual ~UBGraphicsItemDelegate(); @@ -287,6 +287,7 @@ class UBGraphicsItemDelegate : public QObject //buttons from the top left section of delegate frame DelegateButton* mDeleteButton; DelegateButton* mDuplicateButton; + DelegateButton *mContentSourceButton; DelegateButton* mMenuButton; //buttons from the bottom left section of delegate frame @@ -308,7 +309,7 @@ class UBGraphicsItemDelegate : public QObject UBGraphicsToolBarItem* mToolBarItem; protected slots: - virtual void gotoContentSource(bool checked); + virtual void gotoContentSource(); private: void updateFrame(); @@ -330,6 +331,8 @@ private: /** A boolean saying that this object can be flippable (mirror effect) */ bool mFlippable; bool mToolBarUsed; + + bool mShowGoContentButton; }; diff --git a/src/domain/UBGraphicsMediaItem.cpp b/src/domain/UBGraphicsMediaItem.cpp index 9d3c8705..74b378f8 100644 --- a/src/domain/UBGraphicsMediaItem.cpp +++ b/src/domain/UBGraphicsMediaItem.cpp @@ -195,7 +195,7 @@ void UBGraphicsMediaItem::setSourceUrl(const QUrl &pSourceUrl) UBAudioPresentationWidget* pAudioWidget = dynamic_cast(mAudioWidget); if (pAudioWidget) { - pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toLocalFile())); + pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toString())); } UBItem::setSourceUrl(pSourceUrl); diff --git a/src/domain/UBGraphicsMediaItemDelegate.cpp b/src/domain/UBGraphicsMediaItemDelegate.cpp index 6a99a174..18263cd2 100644 --- a/src/domain/UBGraphicsMediaItemDelegate.cpp +++ b/src/domain/UBGraphicsMediaItemDelegate.cpp @@ -32,7 +32,7 @@ #include "core/memcheck.h" UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent) - : UBGraphicsItemDelegate(pDelegated, parent, true, false) + : UBGraphicsItemDelegate(pDelegated, parent, true, false, true, true) , mMedia(pMedia) , mToolBarShowTimer(NULL) , m_iToolBarShowingInterval(5000) diff --git a/src/domain/UBGraphicsPixmapItem.cpp b/src/domain/UBGraphicsPixmapItem.cpp index f771032d..0c870336 100644 --- a/src/domain/UBGraphicsPixmapItem.cpp +++ b/src/domain/UBGraphicsPixmapItem.cpp @@ -28,7 +28,7 @@ UBGraphicsPixmapItem::UBGraphicsPixmapItem(QGraphicsItem* parent) : QGraphicsPixmapItem(parent) { - setDelegate(new UBGraphicsItemDelegate(this, 0, true)); + setDelegate(new UBGraphicsItemDelegate(this, 0, true, false, true, true)); Delegate()->init(); Delegate()->setFlippable(true); Delegate()->setRotatable(true); diff --git a/src/domain/UBGraphicsSvgItem.cpp b/src/domain/UBGraphicsSvgItem.cpp index dfa402c9..c30da859 100644 --- a/src/domain/UBGraphicsSvgItem.cpp +++ b/src/domain/UBGraphicsSvgItem.cpp @@ -53,7 +53,7 @@ void UBGraphicsSvgItem::init() { setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object); - setDelegate(new UBGraphicsItemDelegate(this, 0, true, true, false)); + setDelegate(new UBGraphicsItemDelegate(this, 0, true, true, false, true)); Delegate()->init(); Delegate()->setFlippable(true); Delegate()->setRotatable(true); diff --git a/src/domain/UBGraphicsWidgetItemDelegate.cpp b/src/domain/UBGraphicsWidgetItemDelegate.cpp index 9d250038..76920497 100644 --- a/src/domain/UBGraphicsWidgetItemDelegate.cpp +++ b/src/domain/UBGraphicsWidgetItemDelegate.cpp @@ -30,7 +30,7 @@ #include "core/memcheck.h" UBGraphicsWidgetItemDelegate::UBGraphicsWidgetItemDelegate(UBGraphicsWidgetItem* pDelegated, int widgetType) - : UBGraphicsItemDelegate(pDelegated, 0, true, false, false) + : UBGraphicsItemDelegate(pDelegated, 0, true, false, false, true) , freezeAction(0) , setAsToolAction(0) {