Commit b0f92177 authored by Michael Pyne's avatar Michael Pyne

Add some kind of informative error message if a file cannot be played since I've been seeing

situations (which I cannot reproduce :( ) where JuK will just stop playing for no reason which I
suspect is rooted in here somewhere.

Adds a new string so I guess we'll see how the Semantic Markup fares. :)

svn path=/trunk/KDE/kdemultimedia/juk/; revision=831187
parent d28b2104
......@@ -477,6 +477,15 @@ void PlayerManager::slotTick(qint64 msec)
void PlayerManager::slotStateChanged(Phonon::State newstate)
{
if(newstate == Phonon::ErrorState) {
QString errorMessage =
i18nc(
"%1 will be the /path/to/file, %2 will be some string from Phonon describing the error",
"JuK is unable to play the audio file<nl><filename>%1</filename><nl>"
"for the following reason:<nl><message>%2</message>",
m_file.absFilePath(),
m_media->errorString()
);
switch(m_media->errorType()) {
case Phonon::NoError:
kDebug() << "received a state change to ErrorState but errorType is NoError!?";
......@@ -484,13 +493,13 @@ void PlayerManager::slotStateChanged(Phonon::State newstate)
case Phonon::NormalError:
forward();
KMessageBox::information(0, m_media->errorString());
KMessageBox::information(0, errorMessage);
break;
case Phonon::FatalError:
// stop playback
stop();
KMessageBox::sorry(0, m_media->errorString());
KMessageBox::sorry(0, errorMessage);
break;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment