Fixed wrong connects in media item.

preferencesAboutTextFull
Aleksei Kanash 12 years ago
parent f6585ab884
commit 5b68ea125a
  1. 5
      src/domain/UBGraphicsMediaItem.h
  2. 13
      src/domain/UBGraphicsMediaItemDelegate.cpp

@ -85,9 +85,6 @@ public:
return Type; return Type;
} }
void hasMediaChanged(bool hasMedia);
void showOnDisplayChanged(bool shown);
virtual QUrl mediaFileUrl() const virtual QUrl mediaFileUrl() const
{ {
return mMediaFileUrl; return mMediaFileUrl;
@ -138,6 +135,8 @@ public slots:
void toggleMute(); void toggleMute();
void activeSceneChanged(); void activeSceneChanged();
void hasMediaChanged(bool hasMedia);
void showOnDisplayChanged(bool shown);
protected: protected:

@ -74,17 +74,13 @@ void UBGraphicsMediaItemDelegate::buildButtons()
{ {
mPlayPauseButton = new DelegateButton(":/images/play.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); mPlayPauseButton = new DelegateButton(":/images/play.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mPlayPauseButton, SIGNAL(clicked(bool)), this, SLOT(togglePlayPause())); connect(mPlayPauseButton, SIGNAL(clicked(bool)), this, SLOT(togglePlayPause()));
connect(mPlayPauseButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
mStopButton = new DelegateButton(":/images/stop.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); mStopButton = new DelegateButton(":/images/stop.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mStopButton, SIGNAL(clicked(bool)), mMedia, SLOT(stop())); connect(mStopButton, SIGNAL(clicked(bool)), mMedia, SLOT(stop()));
connect(mStopButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem); mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem);
mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true); mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true);
UBGraphicsItem::assignZValue(mMediaControl, delegated()->zValue()); UBGraphicsItem::assignZValue(mMediaControl, delegated()->zValue());
connect(mMediaControl, SIGNAL(used()), mToolBarShowTimer, SLOT(start()));
if (delegated()->isMuted()) if (delegated()->isMuted())
mMuteButton = new DelegateButton(":/images/soundOff.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); mMuteButton = new DelegateButton(":/images/soundOff.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
@ -93,7 +89,6 @@ void UBGraphicsMediaItemDelegate::buildButtons()
connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute())); connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute()));
connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image
connect(mMuteButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
mButtons << mPlayPauseButton << mStopButton << mMuteButton; mButtons << mPlayPauseButton << mStopButton << mMuteButton;
@ -101,6 +96,14 @@ void UBGraphicsMediaItemDelegate::buildButtons()
mToolBarItem->setVisibleOnBoard(true); mToolBarItem->setVisibleOnBoard(true);
mToolBarItem->setShifting(false); mToolBarItem->setShifting(false);
if (mToolBarShowTimer)
{
connect(mPlayPauseButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
connect(mStopButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
connect(mMediaControl, SIGNAL(used()), mToolBarShowTimer, SLOT(start()));
connect(mMuteButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start()));
}
UBGraphicsMediaItem *audioItem = dynamic_cast<UBGraphicsMediaItem*>(mDelegated); UBGraphicsMediaItem *audioItem = dynamic_cast<UBGraphicsMediaItem*>(mDelegated);
if (audioItem) if (audioItem)
{ {

Loading…
Cancel
Save