summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-17 17:38:37 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-17 17:38:50 (GMT)
commita61adccf96a8ceefbf1150966adda3f6d226ec6d (patch)
tree7f01b588860f34b27f9c68146b603948d391bb8c /demos
parent334b2a93d461ae9a8b258fff1971fb775b13bb68 (diff)
parentecc202c0410125c944f156b5d0de67f093c02723 (diff)
downloadQt-a61adccf96a8ceefbf1150966adda3f6d226ec6d.zip
Qt-a61adccf96a8ceefbf1150966adda3f6d226ec6d.tar.gz
Qt-a61adccf96a8ceefbf1150966adda3f6d226ec6d.tar.bz2
Merge oslo-staging-2/4.6 into upstream/4.6
Diffstat (limited to 'demos')
-rw-r--r--demos/qmediaplayer/mediaplayer.cpp21
-rw-r--r--demos/qmediaplayer/mediaplayer.h2
-rw-r--r--demos/qtdemo/itemcircleanimation.cpp1
3 files changed, 23 insertions, 1 deletions
diff --git a/demos/qmediaplayer/mediaplayer.cpp b/demos/qmediaplayer/mediaplayer.cpp
index 624bab7..267a225 100644
--- a/demos/qmediaplayer/mediaplayer.cpp
+++ b/demos/qmediaplayer/mediaplayer.cpp
@@ -355,13 +355,13 @@ void MediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate)
switch (newstate) {
case Phonon::ErrorState:
- QMessageBox::warning(this, "Phonon Mediaplayer", m_MediaObject.errorString(), QMessageBox::Close);
if (m_MediaObject.errorType() == Phonon::FatalError) {
playButton->setEnabled(false);
rewindButton->setEnabled(false);
} else {
m_MediaObject.pause();
}
+ QMessageBox::warning(this, "Phonon Mediaplayer", m_MediaObject.errorString(), QMessageBox::Close);
break;
case Phonon::PausedState:
case Phonon::StoppedState:
@@ -471,6 +471,8 @@ void MediaPlayer::effectChanged()
void MediaPlayer::showSettingsDialog()
{
+ playPauseForDialog();
+
if (!settingsDialog)
initSettingsDialog();
@@ -516,6 +518,8 @@ void MediaPlayer::showSettingsDialog()
m_videoWidget->setScaleMode(oldScale);
ui->audioEffectsCombo->setCurrentIndex(currentEffect);
}
+
+ playPauseForDialog();
}
void MediaPlayer::initVideoWindow()
@@ -652,10 +656,25 @@ void MediaPlayer::setFile(const QString &fileName)
m_MediaObject.play();
}
+void MediaPlayer::playPauseForDialog()
+{
+ // If we're running on a small screen, we want to pause the video
+ // when popping up dialogs.
+ if (m_hasSmallScreen &&
+ (Phonon::PlayingState == m_MediaObject.state() ||
+ Phonon::PausedState == m_MediaObject.state()))
+ playPause();
+}
+
void MediaPlayer::openFile()
{
+ playPauseForDialog();
+
QStringList fileNames = QFileDialog::getOpenFileNames(this, QString(),
QDesktopServices::storageLocation(QDesktopServices::MusicLocation));
+
+ playPauseForDialog();
+
m_MediaObject.clearQueue();
if (fileNames.size() > 0) {
QString fileName = fileNames[0];
diff --git a/demos/qmediaplayer/mediaplayer.h b/demos/qmediaplayer/mediaplayer.h
index 08db0e5..a1c3d92 100644
--- a/demos/qmediaplayer/mediaplayer.h
+++ b/demos/qmediaplayer/mediaplayer.h
@@ -111,6 +111,8 @@ private slots:
void hasVideoChanged(bool);
private:
+ void playPauseForDialog();
+
QIcon playIcon;
QIcon pauseIcon;
QMenu *fileMenu;
diff --git a/demos/qtdemo/itemcircleanimation.cpp b/demos/qtdemo/itemcircleanimation.cpp
index 8c94eb7..74c3e6a 100644
--- a/demos/qtdemo/itemcircleanimation.cpp
+++ b/demos/qtdemo/itemcircleanimation.cpp
@@ -302,6 +302,7 @@ void ItemCircleAnimation::setupGuides()
int y = 20;
this->qtGuide1 = new GuideCircle(QRectF(x, y, 260, 260), -36, 342);
+ this->currGuide = 0;
new GuideLine(QPointF(x + 240, y + 268), this->qtGuide1);
new GuideLine(QPointF(x + 265, y + 246), this->qtGuide1);
new GuideLine(QPointF(x + 158, y + 134), this->qtGuide1);