X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2FMediaView.cpp;h=66fc5ec1bcd681e7689651befa701a4250f4d807;hb=49d6762255a28e67a5923ab4ed5a1a8ec6542730;hp=ca4ff292bcf39a83eb6a9b0e86853846c5229abe;hpb=d1f0fac328bdf71b840ac6ac9f6fed8f324d02bb;p=minitube diff --git a/src/MediaView.cpp b/src/MediaView.cpp index ca4ff29..66fc5ec 100644 --- a/src/MediaView.cpp +++ b/src/MediaView.cpp @@ -124,7 +124,6 @@ MediaView::MediaView(QWidget *parent) : QWidget(parent) { #ifdef APP_DEMO demoTimer = new QTimer(this); demoTimer->setSingleShot(true); - demoTimer->setInterval(60000); connect(demoTimer, SIGNAL(timeout()), SLOT(demoMessage())); #endif @@ -196,10 +195,17 @@ void MediaView::disappear() { } void MediaView::handleError(QString message) { + // if (message.indexOf("movie atom") != -1 || message.indexOf("Could not open") != -1) { + QTimer::singleShot(1000, this, SLOT(startPlaying())); + return; + // } + + /* videoAreaWidget->showError(message); skippedVideo = listModel->activeVideo(); // recover from errors by skipping to the next video errorTimer->start(2000); + */ } void MediaView::stateChanged(Phonon::State newState, Phonon::State /*oldState*/) @@ -408,6 +414,10 @@ void MediaView::downloadStatusChanged() { void MediaView::startPlaying() { if (reallyStopped) return; + if (!downloadItem) { + skip(); + return; + } // go! qDebug() << "Playing" << downloadItem->currentFilename(); @@ -594,11 +604,13 @@ void MediaView::demoMessage() { if (mediaObject->state() != Phonon::PlayingState) return; mediaObject->pause(); - QMessageBox msgBox; + QMessageBox msgBox(this); msgBox.setIconPixmap(QPixmap(":/images/app.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation)); msgBox.setText(tr("This is just the demo version of %1.").arg(Constants::APP_NAME)); msgBox.setInformativeText(tr("It allows you to test the application and see if it works for you.")); msgBox.setModal(true); + // make it a "sheet" on the Mac + msgBox.setWindowModality(Qt::WindowModal); QPushButton *quitButton = msgBox.addButton(tr("Continue"), QMessageBox::RejectRole); QPushButton *buyButton = msgBox.addButton(tr("Get the full version"), QMessageBox::ActionRole);