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"))
{
bool acceptFlash = true;
#ifdef Q_WS_X11
acceptFlash = false;
#endif
if (acceptFlash)
{
qDebug() << "accepting mime type" << mimeType << "as flash";
qDebug() << "accepting mime type" << mimeType << "as flash";
QString sUrl = sourceUrl.toString();
QString sUrl = sourceUrl.toString();
if (sUrl.startsWith("file://") || sUrl.startsWith("/"))
{
sUrl = sourceUrl.toLocalFile();
}
if (sUrl.startsWith("file://") || sUrl.startsWith("/"))
{
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");
if (eduMediaFile->open())
{
eduMediaFile->write(pData);
QFileInfo fi(*eduMediaFile);
sUrl = fi.absoluteFilePath();
}
eduMediaFile->write(pData);
QFileInfo fi(*eduMediaFile);
sUrl = fi.absoluteFilePath();
}
}
QSize size;
if (pSize.height() > 0 && pSize.width() > 0)
size = pSize;
else
size = mActiveScene->nominalSize() * .8;
QSize size;
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)
{
UBGraphicsWidgetItem *widgetItem = mActiveScene->addW3CWidget(QUrl::fromLocalFile(widgetUrl), pPos);
QString widgetUrl = UBW3CWidget::createNPAPIWrapper(sUrl, mimeType, size);
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)
delete eduMediaFile;
}
else
{
UBApplication::showMessage(tr("Flash is not supported on Sankore Linux"));
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
}
if (eduMediaFile)
delete eduMediaFile;
}
else if (mimeType.startsWith("application/pdf"))
{

Loading…
Cancel
Save