Go to content source action is Delegate Button now. It showed for widgets, images and media items.

Some warnings removed.
Fixed source url for async copyed files.
preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent 8724a01a71
commit 26038ffcd0
  1. 2
      src/core/UBDownloadManager.cpp
  2. 1
      src/domain/UBGraphicsDelegateFrame.cpp
  3. 21
      src/domain/UBGraphicsItemDelegate.cpp
  4. 7
      src/domain/UBGraphicsItemDelegate.h
  5. 2
      src/domain/UBGraphicsMediaItem.cpp
  6. 2
      src/domain/UBGraphicsMediaItemDelegate.cpp
  7. 2
      src/domain/UBGraphicsPixmapItem.cpp
  8. 2
      src/domain/UBGraphicsSvgItem.cpp
  9. 2
      src/domain/UBGraphicsWidgetItemDelegate.cpp

@ -78,7 +78,7 @@ void UBAsyncLocalFileDownloader::run()
QFile::remove(mTo); QFile::remove(mTo);
} }
else 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() void UBAsyncLocalFileDownloader::abort()

@ -381,7 +381,6 @@ QSizeF UBGraphicsDelegateFrame::resizeDelegate(qreal moveX, qreal moveY)
return incVector; return incVector;
} }
void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event) void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{ {
if (None == mCurrentTool) if (None == mCurrentTool)

@ -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) : QObject(parent)
, mDelegated(pDelegated) , mDelegated(pDelegated)
, mDeleteButton(NULL) , mDeleteButton(NULL)
@ -164,6 +164,7 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec
, mMimeData(NULL) , mMimeData(NULL)
, mFlippable(false) , mFlippable(false)
, mToolBarUsed(useToolBar) , mToolBarUsed(useToolBar)
, mShowGoContentButton(showGoContentButton)
{ {
connect(UBApplication::boardController, SIGNAL(zoomChanged(qreal)), this, SLOT(onZoomChanged())); connect(UBApplication::boardController, SIGNAL(zoomChanged(qreal)), this, SLOT(onZoomChanged()));
} }
@ -189,6 +190,13 @@ void UBGraphicsItemDelegate::init()
connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu())); connect(mMenuButton, SIGNAL(clicked()), this, SLOT(showMenu()));
mButtons << mMenuButton; 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 = new DelegateButton(":/images/z_layer_up.svg", mDelegated, mFrame, Qt::BottomLeftSection);
mZOrderUpButton->setShowProgressIndicator(true); mZOrderUpButton->setShowProgressIndicator(true);
connect(mZOrderUpButton, SIGNAL(clicked()), this, SLOT(increaseZLevelUp())); 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<UBItem*>(mDelegated); UBItem* item = dynamic_cast<UBItem*>(mDelegated);
if(item && !item->sourceUrl().isEmpty()) 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/eyeOpened.svg"), QIcon::Normal, QIcon::On);
showIcon.addPixmap(QPixmap(":/images/eyeClosed.svg"), QIcon::Normal, QIcon::Off); showIcon.addPixmap(QPixmap(":/images/eyeClosed.svg"), QIcon::Normal, QIcon::Off);
mShowOnDisplayAction->setIcon(showIcon); 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() void UBGraphicsItemDelegate::updateMenuActionState()

@ -207,7 +207,7 @@ class UBGraphicsItemDelegate : public QObject
Q_OBJECT Q_OBJECT
public: 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(); virtual ~UBGraphicsItemDelegate();
@ -287,6 +287,7 @@ class UBGraphicsItemDelegate : public QObject
//buttons from the top left section of delegate frame //buttons from the top left section of delegate frame
DelegateButton* mDeleteButton; DelegateButton* mDeleteButton;
DelegateButton* mDuplicateButton; DelegateButton* mDuplicateButton;
DelegateButton *mContentSourceButton;
DelegateButton* mMenuButton; DelegateButton* mMenuButton;
//buttons from the bottom left section of delegate frame //buttons from the bottom left section of delegate frame
@ -308,7 +309,7 @@ class UBGraphicsItemDelegate : public QObject
UBGraphicsToolBarItem* mToolBarItem; UBGraphicsToolBarItem* mToolBarItem;
protected slots: protected slots:
virtual void gotoContentSource(bool checked); virtual void gotoContentSource();
private: private:
void updateFrame(); void updateFrame();
@ -330,6 +331,8 @@ private:
/** A boolean saying that this object can be flippable (mirror effect) */ /** A boolean saying that this object can be flippable (mirror effect) */
bool mFlippable; bool mFlippable;
bool mToolBarUsed; bool mToolBarUsed;
bool mShowGoContentButton;
}; };

@ -195,7 +195,7 @@ void UBGraphicsMediaItem::setSourceUrl(const QUrl &pSourceUrl)
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget); UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget) if (pAudioWidget)
{ {
pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toLocalFile())); pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toString()));
} }
UBItem::setSourceUrl(pSourceUrl); UBItem::setSourceUrl(pSourceUrl);

@ -32,7 +32,7 @@
#include "core/memcheck.h" #include "core/memcheck.h"
UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent) UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent)
: UBGraphicsItemDelegate(pDelegated, parent, true, false) : UBGraphicsItemDelegate(pDelegated, parent, true, false, true, true)
, mMedia(pMedia) , mMedia(pMedia)
, mToolBarShowTimer(NULL) , mToolBarShowTimer(NULL)
, m_iToolBarShowingInterval(5000) , m_iToolBarShowingInterval(5000)

@ -28,7 +28,7 @@
UBGraphicsPixmapItem::UBGraphicsPixmapItem(QGraphicsItem* parent) UBGraphicsPixmapItem::UBGraphicsPixmapItem(QGraphicsItem* parent)
: QGraphicsPixmapItem(parent) : QGraphicsPixmapItem(parent)
{ {
setDelegate(new UBGraphicsItemDelegate(this, 0, true)); setDelegate(new UBGraphicsItemDelegate(this, 0, true, false, true, true));
Delegate()->init(); Delegate()->init();
Delegate()->setFlippable(true); Delegate()->setFlippable(true);
Delegate()->setRotatable(true); Delegate()->setRotatable(true);

@ -53,7 +53,7 @@ void UBGraphicsSvgItem::init()
{ {
setData(UBGraphicsItemData::ItemLayerType, UBItemLayerType::Object); 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()->init();
Delegate()->setFlippable(true); Delegate()->setFlippable(true);
Delegate()->setRotatable(true); Delegate()->setRotatable(true);

@ -30,7 +30,7 @@
#include "core/memcheck.h" #include "core/memcheck.h"
UBGraphicsWidgetItemDelegate::UBGraphicsWidgetItemDelegate(UBGraphicsWidgetItem* pDelegated, int widgetType) UBGraphicsWidgetItemDelegate::UBGraphicsWidgetItemDelegate(UBGraphicsWidgetItem* pDelegated, int widgetType)
: UBGraphicsItemDelegate(pDelegated, 0, true, false, false) : UBGraphicsItemDelegate(pDelegated, 0, true, false, false, true)
, freezeAction(0) , freezeAction(0)
, setAsToolAction(0) , setAsToolAction(0)
{ {

Loading…
Cancel
Save