enabled flash on linux. Add dependence when installing Sankore

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 782a518c6a
commit 0b4dc7241a
  1. 70
      src/board/UBBoardController.cpp

@ -918,60 +918,50 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
else if (mimeType.startsWith("application/x-shockwave-flash")) else if (mimeType.startsWith("application/x-shockwave-flash"))
{ {
bool acceptFlash = true;
#ifdef Q_WS_X11 qDebug() << "accepting mime type" << mimeType << "as flash";
acceptFlash = false;
#endif
if (acceptFlash)
{
qDebug() << "accepting mime type" << mimeType << "as flash";
QString sUrl = sourceUrl.toString(); QString sUrl = sourceUrl.toString();
if (sUrl.startsWith("file://") || sUrl.startsWith("/")) if (sUrl.startsWith("file://") || sUrl.startsWith("/"))
{ {
sUrl = sourceUrl.toLocalFile(); sUrl = sourceUrl.toLocalFile();
} }
QTemporaryFile* eduMediaFile = 0; QTemporaryFile* eduMediaFile = 0;
if (sUrl.toLower().contains("edumedia-sciences.com")) if (sUrl.toLower().contains("edumedia-sciences.com"))
{
eduMediaFile = new QTemporaryFile("XXXXXX.swf");
if (eduMediaFile->open())
{ {
eduMediaFile = new QTemporaryFile("XXXXXX.swf"); eduMediaFile->write(pData);
if (eduMediaFile->open()) QFileInfo fi(*eduMediaFile);
{ sUrl = fi.absoluteFilePath();
eduMediaFile->write(pData);
QFileInfo fi(*eduMediaFile);
sUrl = fi.absoluteFilePath();
}
} }
}
QSize size; QSize size;
if (pSize.height() > 0 && pSize.width() > 0)
size = pSize;
else
size = mActiveScene->nominalSize() * .8;
QString widgetUrl = UBW3CWidget::createNPAPIWrapper(sUrl, mimeType, size); if (pSize.height() > 0 && pSize.width() > 0)
size = pSize;
else
size = mActiveScene->nominalSize() * .8;
if (widgetUrl.length() > 0) QString widgetUrl = UBW3CWidget::createNPAPIWrapper(sUrl, mimeType, size);
{
UBGraphicsWidgetItem *widgetItem = mActiveScene->addW3CWidget(QUrl::fromLocalFile(widgetUrl), pPos);
widgetItem->setSourceUrl(sourceUrl); if (widgetUrl.length() > 0)
{
UBGraphicsWidgetItem *widgetItem = mActiveScene->addW3CWidget(QUrl::fromLocalFile(widgetUrl), pPos);
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); widgetItem->setSourceUrl(sourceUrl);
}
if (eduMediaFile) UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
delete eduMediaFile;
}
else
{
UBApplication::showMessage(tr("Flash is not supported on Sankore Linux"));
} }
if (eduMediaFile)
delete eduMediaFile;
} }
else if (mimeType.startsWith("application/pdf")) else if (mimeType.startsWith("application/pdf"))
{ {

Loading…
Cancel
Save