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;
}
void hasMediaChanged(bool hasMedia);
void showOnDisplayChanged(bool shown);
virtual QUrl mediaFileUrl() const
{
return mMediaFileUrl;
@ -138,6 +135,8 @@ public slots:
void toggleMute();
void activeSceneChanged();
void hasMediaChanged(bool hasMedia);
void showOnDisplayChanged(bool shown);
protected:

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

Loading…
Cancel
Save