summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-11-16 15:42:19 (GMT)
committeraxis <qt-info@nokia.com>2009-11-16 15:42:19 (GMT)
commit9da9339e4ced8d8c54a4585d3e94cbe6a2d9c574 (patch)
treed8975be83884fb9957e01f1d19210b23f0588e4f /demos
parent8d174d68216bf7290b36fa02332e04f1eda829db (diff)
parent6df2f295c7efddac12de87f8bfa347ab28761a6b (diff)
downloadQt-9da9339e4ced8d8c54a4585d3e94cbe6a2d9c574.zip
Qt-9da9339e4ced8d8c54a4585d3e94cbe6a2d9c574.tar.gz
Qt-9da9339e4ced8d8c54a4585d3e94cbe6a2d9c574.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-staging2
Diffstat (limited to 'demos')
-rw-r--r--demos/qmediaplayer/mediaplayer.cpp21
-rw-r--r--demos/qmediaplayer/mediaplayer.h2
2 files changed, 22 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;