diff --git a/resources/i18n/sankore_fr.ts b/resources/i18n/sankore_fr.ts
index 4d57becf..278bf04a 100644
--- a/resources/i18n/sankore_fr.ts
+++ b/resources/i18n/sankore_fr.ts
@@ -1111,9 +1111,9 @@
Are you sure you want to remove %n page(s) from the selected document '%1'?
-
-
-
+
+ Êtes-vous sûr de bien vouloir effacer %n page de ce document '%1'?
+ Êtes-vous sûr de bien vouloir effacer %n pages de ce document '%1'?
@@ -1204,7 +1204,6 @@
%1 pages copied
-
diff --git a/src/api/UBWidgetUniboardAPI.cpp b/src/api/UBWidgetUniboardAPI.cpp
index e0bce653..72a6c627 100644
--- a/src/api/UBWidgetUniboardAPI.cpp
+++ b/src/api/UBWidgetUniboardAPI.cpp
@@ -294,7 +294,6 @@ int UBWidgetUniboardAPI::currentPageNumber()
return UBApplication::boardController->activeSceneIndex() + 1;
}
-
void UBWidgetUniboardAPI::showMessage(const QString& message)
{
UBApplication::boardController->showMessage(message, false);
@@ -429,6 +428,22 @@ void UBWidgetUniboardAPI::sendFileMetadata(QString metaData)
UBApplication::boardController->displayMetaData(qmMetaDatas);
}
+void UBWidgetUniboardAPI::enableDropOnWidget()
+{
+ mGraphicsWidget->setAcceptDrops(true);
+}
+
+QString UBWidgetUniboardAPI::downloadUrl(QString objectUrl)
+{
+ qDebug() << "UBWidgetUniboardAPI : " << objectUrl;
+ QUrl widgetUrl = mGraphicsWidget->widgetWebView()->widgetUrl();
+ QString destFileName =widgetUrl.toString()+ "/objects/" + QUuid::createUuid().toString();
+ QFile(objectUrl).copy(destFileName);
+ qDebug() << "destFileName : " << destFileName;
+ return destFileName.remove(widgetUrl.toString());
+}
+
+
UBDocumentDatastoreAPI::UBDocumentDatastoreAPI(UBGraphicsW3CWidgetItem *graphicsWidget)
: UBW3CWebStorage(graphicsWidget)
, mGraphicsW3CWidget(graphicsWidget)
diff --git a/src/api/UBWidgetUniboardAPI.h b/src/api/UBWidgetUniboardAPI.h
index aba494dc..5c8790e5 100644
--- a/src/api/UBWidgetUniboardAPI.h
+++ b/src/api/UBWidgetUniboardAPI.h
@@ -234,6 +234,19 @@ class UBWidgetUniboardAPI : public QObject
*/
void sendFileMetadata(QString metaData);
+
+ // widget download
+ /**
+ * If the widget support a the drop of an object it will notify sankore about this.
+ */
+ void enableDropOnWidget ();
+
+ /**
+ * When an object is dropped on a widget, this one send us the informations to download it locally.
+ * this method download the object on the widget directory and return the path of the downloaded object
+ */
+ QString downloadUrl(QString objectUrl);
+
private:
QString uuid();
diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp
index 7eac5b9e..f96d2d99 100644
--- a/src/board/UBBoardController.cpp
+++ b/src/board/UBBoardController.cpp
@@ -1055,7 +1055,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
}
else if (sourceUrl.toString() == UBToolsManager::manager()->mask.id)
{
- mActiveScene->addMask();
+ mActiveScene->addMask(pPos);
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
}
else
diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp
index d5ff09e6..8b02b856 100644
--- a/src/board/UBBoardView.cpp
+++ b/src/board/UBBoardView.cpp
@@ -708,23 +708,100 @@ UBBoardView::drawItems (QPainter *painter, int numItems,
}
}
-void
-UBBoardView::dragEnterEvent (QDragEnterEvent *event)
+void UBBoardView::dragEnterEvent (QDragEnterEvent *event)
{
- // TODO UB 4.x be smarter with drag accept code .... we cannot handle everything ...
- event->acceptProposedAction ();
+ // TODO UB 4.x be smarter with drag accept code .... we cannot handle everything ...
+ event->acceptProposedAction ();
}
-void
-UBBoardView::dragMoveEvent (QDragMoveEvent *event)
+void UBBoardView::dragMoveEvent (QDragMoveEvent *event)
{
- event->acceptProposedAction ();
+ QGraphicsItem* graphicsItemAtPos = itemAt(event->pos().x(),event->pos().y());
+ UBGraphicsWidgetItem* graphicsWidget = dynamic_cast(graphicsItemAtPos);
+
+ if (graphicsWidget && graphicsWidget->acceptDrops()){
+ QPoint newPoint(graphicsWidget->mapFromScene(mapToScene(event->pos())).toPoint());
+ QDragMoveEvent newEvent(newPoint, event->dropAction(), event->mimeData(), event->mouseButtons(), event->keyboardModifiers());
+ QApplication::sendEvent(graphicsWidget->widgetWebView(),&newEvent);
+ return;
+ }
+
+ event->acceptProposedAction();
}
-void
-UBBoardView::dropEvent (QDropEvent *event)
+QList UBBoardView::processMimeData(const QMimeData* pMimeData)
+{
+ QList result;
+ if(pMimeData->hasHtml())
+ {
+ QString qsHtml = pMimeData->html();
+ result.append(QUrl(UBApplication::urlFromHtml(qsHtml)));
+ }
+
+ if (pMimeData->hasUrls())
+ {
+ result.append(pMimeData->urls());
+ return result;
+ }
+
+ if (pMimeData->hasImage())
+ {
+ qWarning() << "Not supported yet";
+ }
+
+ if (pMimeData->hasText())
+ {
+ if("" != pMimeData->text()){
+ // Sometimes, it is possible to have an URL as text. we check here if it is the case
+ QString qsTmp = pMimeData->text().remove(QRegExp("[\\0]"));
+ if(qsTmp.startsWith("http")){
+ result.append(QUrl(qsTmp));
+ }
+ else{
+ qWarning() << "what to do with this : " << pMimeData->text();
+ //mActiveScene->addText(pMimeData->text(), pPos);
+ }
+ }
+ else{
+#ifdef Q_WS_MACX
+ // With Safari, in 95% of the drops, the mime datas are hidden in Apple Web Archive pasteboard type.
+ // This is due to the way Safari is working so we have to dig into the pasteboard in order to retrieve
+ // the data.
+ QString qsUrl = UBPlatformUtils::urlFromClipboard();
+ if("" != qsUrl){
+ // We finally got the url of the dropped ressource! Let's import it!
+ result.append(QUrl(qsUrl));
+ }
+#endif
+ }
+ }
+ return result;
+}
+
+
+void UBBoardView::dropEvent (QDropEvent *event)
{
qDebug() << event->source();
+ QGraphicsItem* graphicsItemAtPos = itemAt(event->pos().x(),event->pos().y());
+ UBGraphicsWidgetItem* graphicsWidget = dynamic_cast(graphicsItemAtPos);
+
+ bool acceptDrops(false);
+ if (graphicsWidget) {
+ acceptDrops = graphicsWidget->acceptDrops();
+ graphicsWidget->setAcceptDrops(true);
+ }
+ if (graphicsWidget && graphicsWidget->acceptDrops()){
+ // A new event is build to avoid problem related to different way to pass the mime type
+ // A parsing is done to try to provide a mimeType with only urls.
+ QMimeData mimeData;
+ mimeData.setData("Text",processMimeData(event->mimeData()).at(0).toString().toAscii());
+ QPoint newPoint(graphicsWidget->mapFromScene(mapToScene(event->pos())).toPoint());
+ QDropEvent cleanedEvent(newPoint, event->dropAction(), &mimeData, event->mouseButtons(), event->keyboardModifiers());
+ QApplication::sendEvent(graphicsWidget->widgetWebView(),&cleanedEvent);
+ cleanedEvent.acceptProposedAction();
+ event->acceptProposedAction();
+ return;
+ }
if(!event->source() || dynamic_cast(event->source()) || dynamic_cast(event->source()))
{
mController->processMimeData (event->mimeData (), mapToScene (event->pos ()));
diff --git a/src/board/UBBoardView.h b/src/board/UBBoardView.h
index feb37a21..17532ded 100644
--- a/src/board/UBBoardView.h
+++ b/src/board/UBBoardView.h
@@ -86,6 +86,7 @@ class UBBoardView : public QGraphicsView
return (ok && (itemLayerType >= mStartLayer && itemLayerType <= mEndLayer));
}
+ QList processMimeData(const QMimeData* pMimeData);
UBBoardController* mController;
diff --git a/src/core/main.cpp b/src/core/main.cpp
index a85d5a29..aa5c6918 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -33,112 +33,112 @@
*/
void ub_message_output(QtMsgType type, const char *msg) {
- // We must temporarily remove the handler to avoid the infinite recursion of
- // ub_message_output -> qt_message_output -> ub_message_output -> qt_message_output ...
- QtMsgHandler previousHandler = qInstallMsgHandler(0);
+ // We must temporarily remove the handler to avoid the infinite recursion of
+ // ub_message_output -> qt_message_output -> ub_message_output -> qt_message_output ...
+ QtMsgHandler previousHandler = qInstallMsgHandler(0);
#if defined(QT_NO_DEBUG)
- // Suppress qDebug output in release builds
- if (type != QtDebugMsg)
- {
- qt_message_output(type, msg);
- }
+ // Suppress qDebug output in release builds
+ if (type != QtDebugMsg)
+ {
+ qt_message_output(type, msg);
+ }
#else
- // Default output in debug builds
- qt_message_output(type, msg);
+ // Default output in debug builds
+ qt_message_output(type, msg);
#endif
- if (UBApplication::app() && UBApplication::app()->isVerbose()) {
- QString logFileNamePath = UBSettings::uniboardDataDirectory()
- + "/log/uniboard.log";
- QFile logFile(logFileNamePath);
+ if (UBApplication::app() && UBApplication::app()->isVerbose()) {
+ QString logFileNamePath = UBSettings::uniboardDataDirectory()
+ + "/log/uniboard.log";
+ QFile logFile(logFileNamePath);
- if (logFile.exists() && logFile.size() > 10000000)
- logFile.remove();
+ if (logFile.exists() && logFile.size() > 10000000)
+ logFile.remove();
- if (logFile.open(QIODevice::Append | QIODevice::Text)) {
- QTextStream out(&logFile);
- out << QDateTime::currentDateTime().toString(Qt::ISODate)
- << " " << msg << "\n";
- logFile.close();
- }
- }
+ if (logFile.open(QIODevice::Append | QIODevice::Text)) {
+ QTextStream out(&logFile);
+ out << QDateTime::currentDateTime().toString(Qt::ISODate)
+ << " " << msg << "\n";
+ logFile.close();
+ }
+ }
- qInstallMsgHandler(previousHandler);
+ qInstallMsgHandler(previousHandler);
}
int main(int argc, char *argv[])
{
-// Uncomment next section to have memory leaks information
-// tracing in VC++ debug mode under Windows
-/*
+ // Uncomment next section to have memory leaks information
+ // tracing in VC++ debug mode under Windows
+ /*
#if defined(_MSC_VER) && defined(_DEBUG)
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
*/
- Q_INIT_RESOURCE(sankore);
+ Q_INIT_RESOURCE(sankore);
- qInstallMsgHandler(ub_message_output);
+ qInstallMsgHandler(ub_message_output);
#if defined(Q_WS_X11)
- qDebug() << "Setting GraphicsSystem to raster";
- QApplication::setGraphicsSystem("raster");
+ qDebug() << "Setting GraphicsSystem to raster";
+ QApplication::setGraphicsSystem("raster");
#endif
- UBApplication app("Sankore", argc, argv);
-
- //BUGFIX:
- //when importing a sankore file that contains a non standard character
- //the codecForLocale or the codecForCString is used to convert the file path
- //into a const char*. This is why in french windows setup the codec name shouldn't be
- //set to UTF-8. For example, setting UTF-8, will convert "Haïti" into "HaÂ-ti.
+ UBApplication app("Sankore", argc, argv);
+
+ //BUGFIX:
+ //when importing a sankore file that contains a non standard character
+ //the codecForLocale or the codecForCString is used to convert the file path
+ //into a const char*. This is why in french windows setup the codec name shouldn't be
+ //set to UTF-8. For example, setting UTF-8, will convert "Haïti" into "HaÂ-ti.
- QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
+ QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
- QStringList args = app.arguments();
+ QStringList args = app.arguments();
+
+ QString dumpPath = UBSettings::uniboardDataDirectory() + "/log";
+ QDir logDir(dumpPath);
+ if (!logDir.exists())
+ logDir.mkdir(dumpPath);
- QString dumpPath = UBSettings::uniboardDataDirectory() + "/log";
- QDir logDir(dumpPath);
- if (!logDir.exists())
- logDir.mkdir(dumpPath);
+ QString fileToOpen;
- QString fileToOpen;
+ if (args.size() > 1) {
+ // On Windows/Linux first argument is the file that has been double clicked.
+ // On Mac OSX we use FileOpen QEvent to manage opening file in current instance. So we will never
+ // have file to open as a parameter on OSX.
- if (args.size() > 1) {
- // On Windows/Linux first argument is the file that has been double clicked.
- // On Mac OSX we use FileOpen QEvent to manage opening file in current instance. So we will never
- // have file to open as a parameter on OSX.
+ QFile f(args[1]);
- QFile f(args[1]);
+ if (f.exists()) {
+ fileToOpen += args[1];
- if (f.exists()) {
- fileToOpen += args[1];
+ if (app.sendMessage(UBSettings::appPingMessage, 20000)) {
+ app.sendMessage(fileToOpen, 1000000);
+ return 0;
+ }
+ }
+ }
- if (app.sendMessage(UBSettings::appPingMessage, 20000)) {
- app.sendMessage(fileToOpen, 1000000);
- return 0;
- }
- }
- }
+ app.initialize(false);
- app.initialize(false);
+ QObject::connect(&app, SIGNAL(messageReceived(const QString&)), &app,
+ SLOT(handleOpenMessage(const QString&)));
- QObject::connect(&app, SIGNAL(messageReceived(const QString&)), &app,
- SLOT(handleOpenMessage(const QString&)));
+ int result = app.exec(fileToOpen);
- int result = app.exec(fileToOpen);
+ app.cleanup();
- app.cleanup();
+ qDebug() << "application is quitting";
- qDebug() << "application is quitting";
-
- return result;
+ return result;
}
diff --git a/src/domain/UBAbstractWidget.cpp b/src/domain/UBAbstractWidget.cpp
index ba747581..0a598156 100644
--- a/src/domain/UBAbstractWidget.cpp
+++ b/src/domain/UBAbstractWidget.cpp
@@ -26,8 +26,6 @@
#include "network/UBNetworkAccessManager.h"
-#include "api/UBWidgetUniboardAPI.h"
-
#include "web/UBWebPage.h"
#include "web/UBWebKitUtils.h"
#include "web/UBWebController.h"
@@ -49,9 +47,15 @@ UBAbstractWidget::UBAbstractWidget(const QUrl& pWidgetUrl, QWidget *parent)
, mIsFrozen(false)
, mIsTakingSnapshot(false)
{
+ setAcceptDrops(true);
setPage(new UBWebPage(this));
+ QWebView::settings()->setAttribute(QWebSettings::JavaEnabled, true);
QWebView::settings()->setAttribute(QWebSettings::PluginsEnabled, true);
QWebView::settings()->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
+ QWebView::settings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
+ QWebView::settings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
+ QWebView::settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
+ QWebView::settings()->setAttribute(QWebSettings::DnsPrefetchEnabled, true);
QWebView::page()->setNetworkAccessManager(UBNetworkAccessManager::defaultAccessManager());
@@ -312,7 +316,6 @@ void UBAbstractWidget::mousePressEvent(QMouseEvent *event)
event->accept();
return;
}
-
UBRoutedMouseEventWebView::mousePressEvent(event);
mMouseIsPressed = true;
}
@@ -353,7 +356,6 @@ void UBAbstractWidget::mouseReleaseEvent(QMouseEvent *event)
mFirstReleaseAfterMove = true;
}
-
QWebView * UBAbstractWidget::createWindow(QWebPage::WebWindowType type)
{
if (type == QWebPage::WebBrowserWindow)
diff --git a/src/domain/UBAppleWidget.cpp b/src/domain/UBAppleWidget.cpp
index 8e61ef27..19c388da 100644
--- a/src/domain/UBAppleWidget.cpp
+++ b/src/domain/UBAppleWidget.cpp
@@ -15,11 +15,8 @@
#include "UBAppleWidget.h"
-
#include
-#include "api/UBWidgetUniboardAPI.h"
-
#include "web/UBWebKitUtils.h"
#include "network/UBNetworkAccessManager.h"
diff --git a/src/domain/UBGraphicsProxyWidget.h b/src/domain/UBGraphicsProxyWidget.h
index 3b7fea29..4f27e574 100644
--- a/src/domain/UBGraphicsProxyWidget.h
+++ b/src/domain/UBGraphicsProxyWidget.h
@@ -53,7 +53,6 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
-// UBGraphicsItemDelegate* mDelegate;
};
#endif /* UBGRAPHICSPROXYWIDGET_H_ */
diff --git a/src/domain/UBGraphicsScene.cpp b/src/domain/UBGraphicsScene.cpp
index cbbbe593..693c7d48 100644
--- a/src/domain/UBGraphicsScene.cpp
+++ b/src/domain/UBGraphicsScene.cpp
@@ -1763,8 +1763,8 @@ void UBGraphicsScene::addCache()
UBApplication::boardController->notifyPageChanged();
}
-void UBGraphicsScene::addMask()
-{
+void UBGraphicsScene::addMask(const QPointF ¢er)
+{
UBGraphicsCurtainItem* curtain = new UBGraphicsCurtainItem(); // mem : owned and destroyed by the scene
mTools << curtain;
QGraphicsView* view;
@@ -1774,17 +1774,16 @@ void UBGraphicsScene::addMask()
else
view = (QGraphicsView*)UBApplication::boardController->controlView();
- QPolygonF polygon = view->mapToScene(view->rect());
-
-// curtain->setZValue(toolLayerStart + toolOffsetCurtain);
+ // curtain->setZValue(toolLayerStart + toolOffsetCurtain);
UBGraphicsItem::assignZValue(curtain, toolLayerStart + toolOffsetCurtain);
+
+ QRectF rect = UBApplication::boardController->activeScene()->normalizedSceneRect();
+ rect.setSize(QSizeF(rect.width()/2, rect.height()/2));
+
+ QPointF origin = center.isNull() ? rect.bottomRight() : center;
+ curtain->setRect(rect.translated(origin - rect.topLeft() / 2));
- QRectF rect = polygon.boundingRect();
- qreal xScale = view->matrix().m11();
- qreal yScale = view->matrix().m22();
- rect.adjust(120 / xScale, 80 / yScale, -120 / xScale, -80 / yScale);
- curtain->setRect(rect);
- addItem(curtain);
+ addItem(curtain);
curtain->setVisible(true);
curtain->setSelected(true);
diff --git a/src/domain/UBGraphicsScene.h b/src/domain/UBGraphicsScene.h
index 416c2344..26f8355c 100644
--- a/src/domain/UBGraphicsScene.h
+++ b/src/domain/UBGraphicsScene.h
@@ -175,7 +175,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void addTriangle(QPointF center);
void addMagnifier(UBMagnifierParams params);
- void addMask();
+ void addMask(const QPointF ¢er = QPointF());
void addCache();
class SceneViewState
diff --git a/src/domain/UBGraphicsWidgetItem.cpp b/src/domain/UBGraphicsWidgetItem.cpp
index a786e55a..ca2d578f 100644
--- a/src/domain/UBGraphicsWidgetItem.cpp
+++ b/src/domain/UBGraphicsWidgetItem.cpp
@@ -34,6 +34,7 @@ UBGraphicsWidgetItem::UBGraphicsWidgetItem(QGraphicsItem *parent, int widgetType
, mShouldMoveWidget(false)
, mUniboardAPI(0)
{
+ setAcceptDrops(false);
UBGraphicsWidgetItemDelegate* delegate = new UBGraphicsWidgetItemDelegate(this, widgetType);
delegate->init();
setDelegate(delegate);
@@ -366,7 +367,6 @@ UBItem* UBGraphicsW3CWidgetItem::deepCopy() const
UBGraphicsW3CWidgetItem *copy = new UBGraphicsW3CWidgetItem(mWebKitWidget->widgetUrl(), parentItem());
copy->setPos(this->pos());
-// copy->setZValue(this->zValue());
UBGraphicsItem::assignZValue(copy, this->zValue());
copy->setTransform(this->transform());
copy->setFlag(QGraphicsItem::ItemIsMovable, true);
diff --git a/src/gui/UBLibWebView.cpp b/src/gui/UBLibWebView.cpp
index 332c4e0a..b02af11d 100644
--- a/src/gui/UBLibWebView.cpp
+++ b/src/gui/UBLibWebView.cpp
@@ -29,7 +29,6 @@ UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent)
mpWebSettings = QWebSettings::globalSettings();
mpWebSettings->setAttribute(QWebSettings::JavaEnabled, true);
mpWebSettings->setAttribute(QWebSettings::PluginsEnabled, true);
- mpWebSettings->setAttribute(QWebSettings::JavaEnabled, true);
mpWebSettings->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, true);
mpWebSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, true);
mpWebSettings->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
diff --git a/src/web/UBRoutedMouseEventWebView.cpp b/src/web/UBRoutedMouseEventWebView.cpp
index 21fc3f14..e81be76c 100644
--- a/src/web/UBRoutedMouseEventWebView.cpp
+++ b/src/web/UBRoutedMouseEventWebView.cpp
@@ -93,4 +93,3 @@ void UBRoutedMouseEventWebView::wheelEvent(QWheelEvent* ev)
p->event(ev);
}
}
-
diff --git a/src/web/UBRoutedMouseEventWebView.h b/src/web/UBRoutedMouseEventWebView.h
index cde88e88..29aec978 100644
--- a/src/web/UBRoutedMouseEventWebView.h
+++ b/src/web/UBRoutedMouseEventWebView.h
@@ -31,6 +31,7 @@ class UBRoutedMouseEventWebView : public QWebView
public:
UBRoutedMouseEventWebView(QWidget * parent = 0 );
virtual ~UBRoutedMouseEventWebView();
+
protected:
virtual void mouseMoveEvent(QMouseEvent* ev);
virtual void mousePressEvent(QMouseEvent* ev);
@@ -38,7 +39,6 @@ class UBRoutedMouseEventWebView : public QWebView
virtual void mouseReleaseEvent(QMouseEvent* ev);
virtual void contextMenuEvent(QContextMenuEvent* ev);
virtual void wheelEvent(QWheelEvent* ev);
-
};
#endif /* UBROUTEDMOUSEEVENTWEBVIEW_H_ */
diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp
index f556872f..92b592ed 100644
--- a/src/web/UBWebController.cpp
+++ b/src/web/UBWebController.cpp
@@ -59,7 +59,6 @@ UBWebController::UBWebController(UBMainWindow* mainWindow)
, mBrowserWidget(0)
, mTrapFlashController(0)
, mToolsCurrentPalette(0)
-// , mKeyboardCurrentPalette(0)
, mToolsPalettePositionned(false)
, mDownloadViewIsVisible(false)
{
@@ -117,7 +116,6 @@ void UBWebController::webBrowserInstance()
{
mCurrentWebBrowser = &mWebBrowserList[WebBrowser];
mToolsCurrentPalette = &mToolsPaletteList[WebBrowser];
-// mKeyboardCurrentPalette = &mKeyboardPaletteList[WebBrowser];
mToolsPalettePositionned = mToolsPalettePositionnedList[WebBrowser];
if (!(*mCurrentWebBrowser))
{
@@ -196,8 +194,6 @@ void UBWebController::tutorialWebInstance()
else
{
mCurrentWebBrowser = &mWebBrowserList[Tutorial];
-// mToolsCurrentPalette = &mToolsPaletteList[Tutorial];
-// mKeyboardCurrentPalette = &mKeyboardPaletteList[Tutorial];
mToolsPalettePositionned = &mToolsPalettePositionnedList[Tutorial];
if (!(*mCurrentWebBrowser))
{
@@ -255,7 +251,6 @@ void UBWebController::paraschoolWebInstance()
else {
mCurrentWebBrowser = &mWebBrowserList[Paraschool];
mToolsCurrentPalette = &mToolsPaletteList[Paraschool];
-// mKeyboardCurrentPalette = &mKeyboardPaletteList[Paraschool];
mToolsPalettePositionned = &mToolsPalettePositionnedList[Paraschool];
if (!(*mCurrentWebBrowser)){
(*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow, true);
@@ -434,7 +429,6 @@ void UBWebController::setupPalettes()
{
(*mToolsCurrentPalette) = new UBWebToolsPalette((*mCurrentWebBrowser),false);
-// (*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser);
#ifndef Q_WS_WIN
if (UBPlatformUtils::hasVirtualKeyboard() && UBApplication::boardController->paletteManager()->mKeyboardPalette)
connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(closed()),
@@ -449,14 +443,10 @@ void UBWebController::setupPalettes()
connect(mMainWindow->actionWebShowHideOnDisplay, SIGNAL(toggled(bool)), this, SLOT(toogleMirroring(bool)));
connect(mMainWindow->actionWebTrap, SIGNAL(toggled(bool)), this, SLOT(toggleWebTrap(bool)));
-#ifndef Q_WS_MACX
- connect(mMainWindow->actionVirtualKeyboard, SIGNAL(toggled(bool)), this, SLOT(showKeyboard(bool)));
-#endif
+
(*mToolsCurrentPalette)->hide();
(*mToolsCurrentPalette)->adjustSizeAndPosition();
-// (*mKeyboardCurrentPalette)->adjustSizeAndPosition();
-
if (controlView()){
int left = controlView()->width() - 20 - (*mToolsCurrentPalette)->width();
int top = (controlView()->height() - (*mToolsCurrentPalette)->height()) / 2;
@@ -479,15 +469,6 @@ void UBWebController::toggleWebTrap(bool checked)
}
}
-// void UBWebController::showKeyboard(bool checked)
-// {
-// if (mKeyboardCurrentPalette
-// && (*mKeyboardCurrentPalette))
-// {
-// (*mKeyboardCurrentPalette)->setVisible(checked);
-// }
-// }
-
void UBWebController::toggleWebToolsPalette(bool checked)
{
(*mToolsCurrentPalette)->setVisible(checked);
@@ -662,8 +643,6 @@ void UBWebController::captureEduMedia()
{
QWebElementCollection objects = webView->page()->currentFrame()->findAllElements("object");
- bool found = false;
-
foreach(QWebElement object, objects)
{
foreach(QWebElement param, object.findAll("param"))
@@ -675,8 +654,6 @@ void UBWebController::captureEduMedia()
QString langValue;
QString hostValue;
- found = true;
-
QStringList flashVars = value.split("&");
foreach(QString flashVar, flashVars)
diff --git a/src/web/UBWebController.h b/src/web/UBWebController.h
index 8faa752d..03a0829a 100644
--- a/src/web/UBWebController.h
+++ b/src/web/UBWebController.h
@@ -29,7 +29,6 @@ class UBMainWindow;
class UBWebToolsPalette;
class WBWebView;
class UBServerXMLHttpRequest;
-//class UBKeyboardPalette;
class UBWebController : public QObject
{
@@ -127,6 +126,7 @@ class UBWebController : public QObject
void activePageChanged();
void trapFlash();
void toggleWebTrap(bool checked);
+
void onOEmbedParsed(QVector contents);
// void showKeyboard(bool checked);