Commit d261320e authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

Merge branch 'master' of github.com:Sankore/Sankore-3.1

parents 9e5198fb 7b595aec
...@@ -53,6 +53,8 @@ include(src/desktop/desktop.pri) ...@@ -53,6 +53,8 @@ include(src/desktop/desktop.pri)
include(src/web/web.pri) include(src/web/web.pri)
include(src/softwareupdate/softwareupdate.pri) include(src/softwareupdate/softwareupdate.pri)
include(src/transition/transition.pri) include(src/transition/transition.pri)
include(src/customWidgets/customWidgets.pri)
include(src/interfaces/interfaces.pri)
DEPENDPATH += src/pdf-merger DEPENDPATH += src/pdf-merger
INCLUDEPATH += src/pdf-merger INCLUDEPATH += src/pdf-merger
...@@ -398,3 +400,4 @@ INSTALLS = UB_ETC \ ...@@ -398,3 +400,4 @@ INSTALLS = UB_ETC \
UB_THIRDPARTY_INTERACTIVE UB_THIRDPARTY_INTERACTIVE
OTHER_FILES += OTHER_FILES +=
...@@ -338,5 +338,14 @@ ...@@ -338,5 +338,14 @@
<file>images/download_close.png</file> <file>images/download_close.png</file>
<file>images/download_open.png</file> <file>images/download_open.png</file>
<file>images/tab_mask.png</file> <file>images/tab_mask.png</file>
<file>images/duration1.png</file>
<file>images/duration2.png</file>
<file>images/duration3.png</file>
<file>images/licenses/ccby.png</file>
<file>images/licenses/ccbync.png</file>
<file>images/licenses/ccbyncnd.png</file>
<file>images/licenses/ccbyncsa.png</file>
<file>images/licenses/ccbynd.png</file>
<file>images/licenses/ccbysa.png</file>
</qresource> </qresource>
</RCC> </RCC>
QWidget#DockPaletteWidgetBox, QWidget#DockPaletteWidgetBox,
QWidget#documentNavigator, QWidget#documentNavigator,
QWidget#UBLibPathViewer, QWidget#UBLibPathViewer,
QWidget#UBTeacherStudentAction,
QWidget#UBLibNavigatorWidget, QWidget#UBLibNavigatorWidget,
QWidget#UBLibItemProperties, QWidget#UBLibItemProperties,
QWidget#UBDownloadWidget QWidget#UBDownloadWidget,
QWidget#UBWidgetList,
QWidget#UBTeacherBarDropMediaZone,
QWidget#UBTBMediaContainer
{ {
background: #EEEEEE; background: #EEEEEE;
border-radius: 10px; border-radius: 10px;
border: 2px solid #999999; border: 2px solid #999999;
} }
QFrame#UBTBSeparator
{
background: #DDDDDD;
border-radius: 2px;
border: 1px solid #DDDDDD;
}
QWidget#UBMediaVideoContainer
{
background: #000000;
border-radius: 10px;
border: 2px solid #999999;
}
QWidget#UBTeacherBarPreviewWidget
{
background: #FFFFFF;
border-radius: 10px;
border: 2px solid #999999;
}
QLabel#UBTBPreviewSessionTitle
{
font-size: 12px;
}
QLabel#UBTeacherBarPreviewTitle
{
color: #555555;
font-size : 20px;
font-weight:bold;
padding-left:5px;
}
QLabel#UBMediaPlayerButton
{
padding: 0px 0px 0px 0px;
}
QLabel#UBTeacherBarPreviewSubtitle
{
color: #555555;
font-size : 15px;
font-weight:bold;
padding-left:5px;
}
QWidget#UBLibWebView QWidget#UBLibWebView
{ {
background: #EEEEEE; background: #EEEEEE;
...@@ -18,6 +67,30 @@ QWidget#UBLibWebView ...@@ -18,6 +67,30 @@ QWidget#UBLibWebView
border: 2px solid #999999; border: 2px solid #999999;
} }
QWidget#UBActionPreviewOwner
{
color: #555555;
font-size : 12px;
font-weight: bold;
}
QWidget#UBTeacherBarPreviewComments,
QWidget#UBTeacherBarTargetBox
{
border-radius: 10px;
border: white 2px solid;
padding: 5px 5px 5px 5px;
background-color: white;
}
QWidget#UBActionPreviewContent,
QTextEdit#UBCommentPreview
{
border-radius : 10px;
border: 2px solid #999999;
padding: 5px 5px 5px 5px;
}
QWebView#SearchEngineView QWebView#SearchEngineView
{ {
background:white; background:white;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
*/ */
#include "UBImportDocument.h" #include "UBImportDocument.h"
#include "UBMetadataDcSubsetAdaptor.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
...@@ -49,7 +48,7 @@ QStringList UBImportDocument::supportedExtentions() ...@@ -49,7 +48,7 @@ QStringList UBImportDocument::supportedExtentions()
QString UBImportDocument::importFileFilter() QString UBImportDocument::importFileFilter()
{ {
return tr("Sankore 3.1 (*.ubz)"); return tr("Open-Sankore (*.ubz)");
} }
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
*/ */
#include "UBImportImage.h" #include "UBImportImage.h"
#include "UBMetadataDcSubsetAdaptor.h"
#include "UBSvgSubsetAdaptor.h" #include "UBSvgSubsetAdaptor.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
*/ */
#include "UBImportPDF.h" #include "UBImportPDF.h"
#include "UBMetadataDcSubsetAdaptor.h"
#include "UBSvgSubsetAdaptor.h" #include "UBSvgSubsetAdaptor.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
......
...@@ -97,7 +97,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy) ...@@ -97,7 +97,7 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
// introduced in UB 4.2 // introduced in UB 4.2
xmlWriter.writeTextElement(nsDc, "identifier", proxy->metaData(UBSettings::documentIdentifer).toString()); xmlWriter.writeTextElement(nsDc, "identifier", proxy->metaData(UBSettings::documentIdentifer).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "version", UBSettings::currentFileVersion); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "version", UBSettings::currentFileVersion);
QString width = QString::number(proxy->defaultDocumentSize().width()); QString width = QString::number(proxy->defaultDocumentSize().width());
QString height = QString::number(proxy->defaultDocumentSize().height()); QString height = QString::number(proxy->defaultDocumentSize().height());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "size", QString("%1x%2").arg(width).arg(height)); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "size", QString("%1x%2").arg(width).arg(height));
...@@ -105,6 +105,15 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy) ...@@ -105,6 +105,15 @@ void UBMetadataDcSubsetAdaptor::persist(UBDocumentProxy* proxy)
// introduced in UB 4.4 // introduced in UB 4.4
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "updated-at", proxy->metaData(UBSettings::documentUpdatedAt).toString()); xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri, "updated-at", proxy->metaData(UBSettings::documentUpdatedAt).toString());
// introduced in OpenSankore 1.40.00
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionTitle,proxy->metaData(UBSettings::sessionTitle).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionTarget,proxy->metaData(UBSettings::sessionTarget).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionLicence,proxy->metaData(UBSettings::sessionLicence).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionKeywords,proxy->metaData(UBSettings::sessionKeywords).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionLevel,proxy->metaData(UBSettings::sessionLevel).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionTopic,proxy->metaData(UBSettings::sessionTopic).toString());
xmlWriter.writeTextElement(UBSettings::uniboardDocumentNamespaceUri,UBSettings::sessionAuthors,proxy->metaData(UBSettings::sessionAuthors).toString());
xmlWriter.writeEndElement(); //dc:Description xmlWriter.writeEndElement(); //dc:Description
xmlWriter.writeEndElement(); //RDF xmlWriter.writeEndElement(); //RDF
...@@ -204,7 +213,41 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath) ...@@ -204,7 +213,41 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
metadata.insert(UBSettings::documentUpdatedAt, xml.readElementText()); metadata.insert(UBSettings::documentUpdatedAt, xml.readElementText());
updatedAtFound = true; updatedAtFound = true;
} }
else if (xml.name() == UBSettings::sessionTitle // introduced in OpenSankore 1.40.00
&& xml.namespaceUri() == UBSettings::uniboardDocumentNamespaceUri)
{
metadata.insert(UBSettings::sessionTitle, xml.readElementText());
}
else if (xml.name() == UBSettings::sessionTarget // introduced in OpenSankore 1.40.00
&& xml.namespaceUri() == UBSettings::uniboardDocumentNamespaceUri)
{
metadata.insert(UBSettings::sessionTarget, xml.readElementText());
}
else if (xml.name() == UBSettings::sessionLicence // introduced in OpenSankore 1.40.00
&& xml.namespaceUri() == UBSettings::uniboardDocumentNamespaceUri)
{
metadata.insert(UBSettings::sessionLicence, xml.readElementText());
}
else if (xml.name() == UBSettings::sessionKeywords // introduced in OpenSankore 1.40.00
&& xml.namespaceUri() == UBSettings::uniboardDocumentNamespaceUri)
{
metadata.insert(UBSettings::sessionKeywords, xml.readElementText());
}
else if (xml.name() == UBSettings::sessionLevel // introduced in OpenSankore 1.40.00
&& xml.namespaceUri() == UBSettings::uniboardDocumentNamespaceUri)
{
metadata.insert(UBSettings::sessionLevel, xml.readElementText());
}
else if (xml.name() == UBSettings::sessionTopic // introduced in OpenSankore 1.40.00
&& xml.namespaceUri() == UBSettings::uniboardDocumentNamespaceUri)
{
metadata.insert(UBSettings::sessionTopic, xml.readElementText());
}
else if (xml.name() == UBSettings::sessionAuthors // introduced in OpenSankore 1.40.00
&& xml.namespaceUri() == UBSettings::uniboardDocumentNamespaceUri)
{
metadata.insert(UBSettings::sessionAuthors, xml.readElementText());
}
metadata.insert(UBSettings::documentVersion, docVersion); metadata.insert(UBSettings::documentVersion, docVersion);
} }
......
...@@ -193,6 +193,10 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() ...@@ -193,6 +193,10 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mLeftPalette->registerWidget(mpPageNavigWidget); mLeftPalette->registerWidget(mpPageNavigWidget);
mLeftPalette->addTab(mpPageNavigWidget); mLeftPalette->addTab(mpPageNavigWidget);
// The teacher bar widget will always be there
mLeftPalette->registerWidget(mpTeacherBarWidget);
mLeftPalette->addTab(mpTeacherBarWidget);
mLeftPalette->connectSignals(); mLeftPalette->connectSignals();
mRightPalette = new UBRightPalette(mContainer); mRightPalette = new UBRightPalette(mContainer);
...@@ -201,9 +205,7 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() ...@@ -201,9 +205,7 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mRightPalette->addTab(mpLibWidget); mRightPalette->addTab(mpLibWidget);
// The cache widget will be visible only if a cache is put on the page // The cache widget will be visible only if a cache is put on the page
mRightPalette->registerWidget(mpCachePropWidget); mRightPalette->registerWidget(mpCachePropWidget);
// The teacher bar widget will always be there
mRightPalette->registerWidget(mpTeacherBarWidget);
mRightPalette->addTab(mpTeacherBarWidget);
// The download widget will be part of the right palette but // The download widget will be part of the right palette but
// will become visible only when the first download starts // will become visible only when the first download starts
mRightPalette->registerWidget(mpDownloadWidget); mRightPalette->registerWidget(mpDownloadWidget);
...@@ -211,8 +213,8 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() ...@@ -211,8 +213,8 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
changeMode(eUBDockPaletteWidget_BOARD, true); changeMode(eUBDockPaletteWidget_BOARD, true);
// Hide the tabs that must be hidden // Hide the tabs that must be hidden
mRightPalette->removeTab(mpDownloadWidget->name()); mRightPalette->removeTab(mpDownloadWidget);
mRightPalette->removeTab(mpCachePropWidget->name()); mRightPalette->removeTab(mpCachePropWidget);
// mLeftPalette->showTabWidget(0); // mLeftPalette->showTabWidget(0);
// mRightPalette->showTabWidget(0); // mRightPalette->showTabWidget(0);
...@@ -692,7 +694,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is ...@@ -692,7 +694,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
{ {
case eUBDockPaletteWidget_BOARD: case eUBDockPaletteWidget_BOARD:
{ {
mLeftPalette->setParent(UBApplication::boardController->controlContainer()); mLeftPalette->assignParent(UBApplication::boardController->controlContainer());
mRightPalette->assignParent(UBApplication::boardController->controlContainer()); mRightPalette->assignParent(UBApplication::boardController->controlContainer());
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{ {
...@@ -721,7 +723,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is ...@@ -721,7 +723,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
case eUBDockPaletteWidget_DESKTOP: case eUBDockPaletteWidget_DESKTOP:
{ {
mLeftPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mLeftPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
mRightPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mRightPalette->assignParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView());
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{ {
...@@ -775,7 +777,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is ...@@ -775,7 +777,7 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
{ {
mLeftPalette->setVisible(leftPaletteVisible); mLeftPalette->setVisible(leftPaletteVisible);
mRightPalette->setVisible(rightPaletteVisible); mRightPalette->setVisible(rightPaletteVisible);
mLeftPalette->setParent(0); mLeftPalette->assignParent(0);
mRightPalette->assignParent(0); mRightPalette->assignParent(0);
if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL)
{ {
...@@ -788,9 +790,6 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is ...@@ -788,9 +790,6 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is
} }
else else
mKeyboardPalette->setParent(0); mKeyboardPalette->setParent(0);
// mKeyboardPalette->update();
} }
} }
break; break;
...@@ -998,7 +997,7 @@ void UBBoardPaletteManager::stopDownloads() ...@@ -998,7 +997,7 @@ void UBBoardPaletteManager::stopDownloads()
{ {
mDownloadInProgress = false; mDownloadInProgress = false;
mpDownloadWidget->setVisibleState(false); mpDownloadWidget->setVisibleState(false);
mRightPalette->removeTab(mpDownloadWidget->name()); mRightPalette->removeTab(mpDownloadWidget);
} }
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "UBDrawingController.h" #include "UBDrawingController.h"
#include "frameworks/UBGeometryUtils.h" #include "frameworks/UBGeometryUtils.h"
#include "frameworks/UBPlatformUtils.h"
#include "core/UBSettings.h" #include "core/UBSettings.h"
#include "core/UBMimeData.h" #include "core/UBMimeData.h"
...@@ -34,6 +35,8 @@ ...@@ -34,6 +35,8 @@
#include "gui/UBToolWidget.h" #include "gui/UBToolWidget.h"
#include "gui/UBResources.h" #include "gui/UBResources.h"
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "gui/UBMediaPlayer.h"
#include "gui/UBThumbnailWidget.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
...@@ -43,9 +46,9 @@ ...@@ -43,9 +46,9 @@
#include "domain/UBItem.h" #include "domain/UBItem.h"
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "../gui/UBThumbnailWidget.h"
#include "frameworks/UBPlatformUtils.h" #include "customWidgets/UBDraggableLabel.h"
#include "customWidgets/UBDraggableMedia.h"
#include "core/memcheck.h" #include "core/memcheck.h"
...@@ -864,7 +867,8 @@ void UBBoardView::dropEvent (QDropEvent *event) ...@@ -864,7 +867,8 @@ void UBBoardView::dropEvent (QDropEvent *event)
return; return;
} }
if(!event->source() || dynamic_cast<UBThumbnailWidget *>(event->source()) || dynamic_cast<QWebView*>(event->source())) qDebug() << event->source();
if(!event->source() || dynamic_cast<UBThumbnailWidget *>(event->source()) || dynamic_cast<QWebView*>(event->source()) || dynamic_cast<UBDraggableMediaPlayer *>(event->source()) || dynamic_cast<UBDraggableLabel *>(event->source()) || dynamic_cast<UBDraggableMedia *>(event->source()))
{ {
mController->processMimeData (event->mimeData (), mapToScene (event->pos ())); mController->processMimeData (event->mimeData (), mapToScene (event->pos ()));
event->acceptProposedAction (); event->acceptProposedAction ();
......
...@@ -722,7 +722,6 @@ void UBApplicationController::importFile(const QString& pFilePath) ...@@ -722,7 +722,6 @@ void UBApplicationController::importFile(const QString& pFilePath)
void UBApplicationController::useMultiScreen(bool use) void UBApplicationController::useMultiScreen(bool use)
{ {
mDisplayManager->setUseMultiScreen(use); mDisplayManager->setUseMultiScreen(use);
} }
......
...@@ -1102,16 +1102,35 @@ void UBPersistenceManager::persistTeacherBar(UBDocumentProxy* pDocumentProxy, in ...@@ -1102,16 +1102,35 @@ void UBPersistenceManager::persistTeacherBar(UBDocumentProxy* pDocumentProxy, in
// Set the <teacherBar> element values // Set the <teacherBar> element values
QDomElement teacherBarElem = teacherBarNode.toElement(); QDomElement teacherBarElem = teacherBarNode.toElement();
teacherBarElem.setAttribute("title", infos.title); teacherBarElem.setAttribute("title", infos.title);
teacherBarElem.setAttribute("phasis", infos.phasis);
teacherBarElem.setAttribute("duration", infos.Duration); QString qsAct;
teacherBarElem.setAttribute("equipment", infos.material); for(int i=0; i<infos.actions.size(); i++){
teacherBarElem.setAttribute("activity", infos.activity); if(0 != i){
teacherBarElem.setAttribute("action1Teacher", infos.action1Master); qsAct.append('@');
teacherBarElem.setAttribute("action1Student", infos.action1Student); }
teacherBarElem.setAttribute("action2Teacher", infos.action2Master); qsAct.append(infos.actions.at(i));
teacherBarElem.setAttribute("action2Student", infos.action2Student); }
teacherBarElem.setAttribute("action3Teacher", infos.action3Master); teacherBarElem.setAttribute("actions", qsAct);
teacherBarElem.setAttribute("action3Student", infos.action3Student);
QString qsMedias;
for(int j=0; j<infos.medias.size(); j++){
if(0 != j){
qsMedias.append('@');
}
qsMedias.append(infos.medias.at(j));
}
teacherBarElem.setAttribute("medias", qsMedias);
QString qsUrls;
for(int k=0; k<infos.urls.size(); k++){
if(0 != k){
qsUrls.append('@');
}
qsUrls.append(infos.urls.at(k));
}
teacherBarElem.setAttribute("links", qsUrls);
teacherBarElem.setAttribute("comments", infos.comments);
// Save the file // Save the file
f.write(domDoc.toString().toAscii()); f.write(domDoc.toString().toAscii());
...@@ -1142,16 +1161,10 @@ sTeacherBarInfos UBPersistenceManager::getTeacherBarInfos(UBDocumentProxy* pDocu ...@@ -1142,16 +1161,10 @@ sTeacherBarInfos UBPersistenceManager::getTeacherBarInfos(UBDocumentProxy* pDocu
QDomNode teacherBarNode = rootElem.namedItem("teacherBar"); QDomNode teacherBarNode = rootElem.namedItem("teacherBar");
infos.title = teacherBarNode.toElement().attributeNode("title").value(); infos.title = teacherBarNode.toElement().attributeNode("title").value();
infos.phasis = teacherBarNode.toElement().attributeNode("phasis").value().toInt(); infos.actions = teacherBarNode.toElement().attributeNode("actions").value().split("@");
infos.Duration = teacherBarNode.toElement().attributeNode("duration").value().toInt(); infos.medias = teacherBarNode.toElement().attributeNode("medias").value().split("@");
infos.material = teacherBarNode.toElement().attributeNode("equipment").value(); infos.urls = teacherBarNode.toElement().attributeNode("links").value().split("@");
infos.activity = teacherBarNode.toElement().attributeNode("activity").value().toInt(); infos.comments = teacherBarNode.toElement().attributeNode("comments").value();
infos.action1Master = teacherBarNode.toElement().attributeNode("action1Teacher").value();
infos.action1Student = teacherBarNode.toElement().attributeNode("action1Student").value();
infos.action2Master = teacherBarNode.toElement().attributeNode("action2Teacher").value();
infos.action2Student = teacherBarNode.toElement().attributeNode("action2Student").value();
infos.action3Master = teacherBarNode.toElement().attributeNode("action3Teacher").value();
infos.action3Student = teacherBarNode.toElement().attributeNode("action3Student").value();
} }
f.close(); f.close();
} }
......
...@@ -23,16 +23,10 @@ ...@@ -23,16 +23,10 @@
struct sTeacherBarInfos struct sTeacherBarInfos
{ {
QString title; QString title;
int phasis; QStringList actions;
int Duration; QStringList medias;
QString material; QStringList urls;
int activity; QString comments;
QString action1Master;
QString action1Student;
QString action2Master;
QString action2Student;
QString action3Master;
QString action3Student;
}; };
class UBDocument; class UBDocument;
...@@ -41,7 +35,7 @@ class UBGraphicsScene; ...@@ -41,7 +35,7 @@ class UBGraphicsScene;
class UBPersistenceManager : public QObject class UBPersistenceManager : public QObject
{ {
Q_OBJECT; Q_OBJECT
private: private:
UBPersistenceManager(QObject *pParent = 0); UBPersistenceManager(QObject *pParent = 0);
......
...@@ -36,6 +36,13 @@ QString UBSettings::documentSize = QString("Size"); ...@@ -36,6 +36,13 @@ QString UBSettings::documentSize = QString("Size");
QString UBSettings::documentIdentifer = QString("ID"); QString UBSettings::documentIdentifer = QString("ID");
QString UBSettings::documentVersion = QString("Version"); QString UBSettings::documentVersion = QString("Version");
QString UBSettings::documentUpdatedAt = QString("UpdatedAt"); QString UBSettings::documentUpdatedAt = QString("UpdatedAt");
QString UBSettings::sessionTitle = QString("sessionTitle");
QString UBSettings::sessionTarget = QString("sessionTarget");
QString UBSettings::sessionLicence = QString("sessionLicence");
QString UBSettings::sessionKeywords = QString("sessionAuthors");
QString UBSettings::sessionLevel = QString("sessionLevel");
QString UBSettings::sessionTopic = QString("sessionTopic");
QString UBSettings::sessionAuthors = QString("sessionAuthors");
QString UBSettings::trashedDocumentGroupNamePrefix = QString("_Trash:"); QString UBSettings::trashedDocumentGroupNamePrefix = QString("_Trash:");
......
...@@ -153,6 +153,13 @@ class UBSettings : public QObject ...@@ -153,6 +153,13 @@ class UBSettings : public QObject
static QString documentIdentifer; static QString documentIdentifer;
static QString documentVersion; static QString documentVersion;
static QString documentUpdatedAt; static QString documentUpdatedAt;
static QString sessionTitle;
static QString sessionTarget;
static QString sessionLicence;
static QString sessionKeywords;
static QString sessionLevel;
static QString sessionTopic;
static QString sessionAuthors;
static QString trashedDocumentGroupNamePrefix; static QString trashedDocumentGroupNamePrefix;
...@@ -266,8 +273,6 @@ class UBSettings : public QObject ...@@ -266,8 +273,6 @@ class UBSettings : public QObject
QMap<DocumentSizeRatio::Enum, QSize> documentSizes; QMap<DocumentSizeRatio::Enum, QSize> documentSizes;
//QSize defaultDocumentSize;
UBSetting* svgViewBoxMargin; UBSetting* svgViewBoxMargin;
UBSetting* pdfMargin; UBSetting* pdfMargin;
UBSetting* pdfPageFormat; UBSetting* pdfPageFormat;
......
#include <QMimeData>
#include <QDrag>
#include <QUrl>
#include "UBDraggableLabel.h"
UBDraggableLabel::UBDraggableLabel(QWidget *parent) :
QLabel(parent)
{
}
UBDraggableLabel::~UBDraggableLabel()
{
//NOOP
}
void UBDraggableLabel::loadImage(QString imagePath)
{
mSourcePath = imagePath;
QPixmap pix = QPixmap(mSourcePath);
setPixmap(pix);
setScaledContents(true);
}
void UBDraggableLabel::mousePressEvent(QMouseEvent *event)
{
Q_UNUSED(event);
QMimeData *mimeData = new QMimeData;
QList<QUrl> urls;
urls << QUrl::fromLocalFile(mSourcePath);
mimeData->setUrls(urls);
mimeData->setText(mSourcePath);
QDrag *drag = new QDrag(this);
drag->setMimeData(mimeData);
drag->start();
}
#ifndef UBDRAGGABLELABEL_H
#define UBDRAGGABLELABEL_H
#include <QLabel>
class UBDraggableLabel : public QLabel
{
Q_OBJECT
public:
UBDraggableLabel(QWidget *parent = 0);
~UBDraggableLabel();
void loadImage(QString imagePath);
signals:
public slots:
protected:
QString mSourcePath;
void mousePressEvent(QMouseEvent *event);
};
#endif // UBDRAGGABLELABEL_H
#include <QApplication>
#include <QUrl>
#include "UBDraggableMedia.h"
UBDraggableMedia::UBDraggableMedia(eMediaType type, QWidget *parent, const char *name):UBMediaWidget(type, parent, name)
{
}
UBDraggableMedia::~UBDraggableMedia()
{
}
void UBDraggableMedia::mousePressEvent(QMouseEvent* ev)
{
if(Qt::LeftButton == ev->button()){
mDragStartPos = ev->pos();
}
}
void UBDraggableMedia::mouseMoveEvent(QMouseEvent* ev)
{
if(!(ev->buttons() & Qt::LeftButton)){
return;
}
if((ev->pos() - mDragStartPos).manhattanLength() < QApplication::startDragDistance()){
return;
}
QDrag *drag = new QDrag(this);
QMimeData *mimeData = new QMimeData;
QList<QUrl> urls;
urls << QUrl(mFilePath);
mimeData->setText(mFilePath);
mimeData->setUrls(urls);
drag->setMimeData(mimeData);
Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction);
}
#ifndef UBDRAGGABLEMEDIA_H
#define UBDRAGGABLEMEDIA_H
#include "UBMediaWidget.h"
class UBDraggableMedia : public UBMediaWidget
{
public:
UBDraggableMedia(eMediaType type = eMediaType_Video, QWidget* parent=0, const char* name="UBDraggableMedia");
~UBDraggableMedia();
protected:
void mousePressEvent(QMouseEvent* ev);
void mouseMoveEvent(QMouseEvent* ev);
private:
QPoint mDragStartPos;
};
#endif // UBDRAGGABLEMEDIA_H
#ifndef UBGLOBALS_H
#define UBGLOBALS_H
#define DELETEPTR(ptr) if(NULL != ptr){ \
delete ptr; \
ptr = NULL; \
}
#endif // UBGLOBALS_H
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "core/UBApplication.h"
#include "UBGlobals.h"
#include "UBMediaWidget.h"
/**
* \brief Constructor
* @param type as the media type
* @param parent as the parent widget
* @param name as the object name
*/
UBMediaWidget::UBMediaWidget(eMediaType type, QWidget *parent, const char *name):QWidget(parent)
, mpMediaObject(NULL)
, mpVideoWidget(NULL)
, mpAudioOutput(NULL)
, mpPlayStopButton(NULL)
, mpPauseButton(NULL)
, mpSlider(NULL)
, mAutoUpdate(false)
, mGeneratingThumbnail(false)
, mBorder(5)
, mpMediaContainer(NULL)
, mpCover(NULL)
{
setObjectName(name);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
mType = type;
setLayout(&mLayout);
mpPlayStopButton = new UBMediaButton(this);
mpPlayStopButton->setPixmap(QPixmap(":images/play.svg"));
mpPauseButton = new UBMediaButton(this);
mpPauseButton->setPixmap(QPixmap(":images/pause.svg"));
mpPauseButton->setEnabled(false);
mpSlider = new QSlider(this);
mpSlider->setOrientation(Qt::Horizontal);
mpSlider->setMinimum(0);
mpSlider->setMaximum(0);
mSeekerLayout.addWidget(mpPlayStopButton, 0);
mSeekerLayout.addWidget(mpPauseButton, 0);
mSeekerLayout.addWidget(mpSlider, 1);
mSeekerLayout.setContentsMargins(0, 0, 0, 0);
connect(mpPlayStopButton, SIGNAL(clicked()), this, SLOT(onPlayStopClicked()));
connect(mpPauseButton, SIGNAL(clicked()), this, SLOT(onPauseClicked()));
connect(mpSlider, SIGNAL(valueChanged(int)), this, SLOT(onSliderChanged(int)));
}
/**
* \brief Destructor
*/
UBMediaWidget::~UBMediaWidget()
{
DELETEPTR(mpSlider);
DELETEPTR(mpPauseButton);
DELETEPTR(mpPlayStopButton);
DELETEPTR(mpAudioOutput);
DELETEPTR(mpVideoWidget);
DELETEPTR(mpMediaObject);
DELETEPTR(mpCover);
}
/**
* \brief Set the media file
* @param filePath as the media file path
*/
void UBMediaWidget::setFile(const QString &filePath)
{
Q_ASSERT("" != filePath);
mFilePath = filePath;
mpMediaObject = new Phonon::MediaObject(this);
mpMediaObject->setTickInterval(TICK_INTERVAL);
connect(mpMediaObject, SIGNAL(stateChanged(Phonon::State,Phonon::State)), this, SLOT(onStateChanged(Phonon::State,Phonon::State)));
connect(mpMediaObject, SIGNAL(totalTimeChanged(qint64)), this, SLOT(onTotalTimeChanged(qint64)));
connect(mpMediaObject, SIGNAL(tick(qint64)), this, SLOT(onTick(qint64)));
mpMediaObject->setCurrentSource(Phonon::MediaSource(filePath));
createMediaPlayer();
}
/**
* \brief Get the media type
* @returns the media type
*/
eMediaType UBMediaWidget::mediaType()
{
return mType;
}
void UBMediaWidget::showEvent(QShowEvent* event)
{
if(!mpVideoWidget){
mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout.addStretch(1);
mMediaLayout.addWidget(mpVideoWidget, 0);
mMediaLayout.addStretch(1);
Phonon::createPath(mpMediaObject, mpVideoWidget);
adaptSizeToVideo();
mpMediaObject->play();
mpMediaObject->stop();
}
QWidget::showEvent(event);
}
/**
* \brief Create the media player
*/
void UBMediaWidget::createMediaPlayer()
{
mpMediaContainer = new QWidget(this);
mpMediaContainer->setObjectName("UBMediaVideoContainer");
mpMediaContainer->setLayout(&mMediaLayout);
if(eMediaType_Video == mType){
mMediaLayout.setContentsMargins(10, 10, 25, 10);
if(isVisible()){
mpVideoWidget = new Phonon::VideoWidget(this);
mMediaLayout.addStretch(1);
mMediaLayout.addWidget(mpVideoWidget, 0);
mMediaLayout.addStretch(1);
Phonon::createPath(mpMediaObject, mpVideoWidget);
adaptSizeToVideo();
}
mpAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
Phonon::createPath(mpMediaObject, mpAudioOutput);
}else if(eMediaType_Audio == mType){
mMediaLayout.setContentsMargins(10, 10, 10, 10);
mpCover = new QLabel(mpMediaContainer);
mpMediaContainer->setStyleSheet(QString("background: none;"));
setAudioCover(":images/libpalette/soundIcon.svg");
mpCover->setScaledContents(true);
mMediaLayout.addStretch(1);
mMediaLayout.addWidget(mpCover, 0);
mMediaLayout.addStretch(1);
mpAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
Phonon::createPath(mpMediaObject, mpAudioOutput);
}
mLayout.addWidget(mpMediaContainer, 1);
mLayout.addLayout(&mSeekerLayout, 0);
}
/**
* \brief Adapt the widget size to the video in order to keep the good aspect ratio
*/
void UBMediaWidget::adaptSizeToVideo()
{
if(NULL != mpMediaContainer){
int origW = mpMediaContainer->width();
int origH = mpMediaContainer->height();
int newW = width();
float scaleFactor = (float)origW/(float)newW;
int newH = origH/scaleFactor;
resize(newW, height() + newH);
}
}
/**
* \brief Handle the media state change notification
* @param newState as the new state
* @param oldState as the old state
*/
void UBMediaWidget::onStateChanged(Phonon::State newState, Phonon::State oldState)
{
if(!mGeneratingThumbnail){
if(Phonon::LoadingState == oldState && Phonon::StoppedState == newState){
if(eMediaType_Video == mType){
// We do that here to generate the thumbnail of the video
mGeneratingThumbnail = true;
mpMediaObject->play();
mpMediaObject->pause();
mGeneratingThumbnail = false;
}
}else if(Phonon::PlayingState == oldState && Phonon::PausedState == newState){
mpPlayStopButton->setPixmap(QPixmap(":images/play.svg"));
mpPauseButton->setEnabled(false);
}else if((Phonon::PausedState == oldState && Phonon::PlayingState == newState) ||
(Phonon::StoppedState == oldState && Phonon::PlayingState == newState)){
mpPlayStopButton->setPixmap(QPixmap(":images/stop.svg"));
mpPauseButton->setEnabled(true);
}else if(Phonon::PlayingState == oldState && Phonon::StoppedState == newState){
mpPlayStopButton->setPixmap(QPixmap(":images/play.svg"));
mpPauseButton->setEnabled(false);
mpSlider->setValue(0);
}
}
}
/**
* \brief Handles the total time change notification
* @param total as the new total time
*/
void UBMediaWidget::onTotalTimeChanged(qint64 total)
{
mpSlider->setMaximum(total);
}
/**
* \brief Handles the tick notification
* @param currentTime as the current time
*/
void UBMediaWidget::onTick(qint64 currentTime)
{
mAutoUpdate = true;
mpSlider->setValue((int)currentTime);
mAutoUpdate = false;
}
/**
* \brief Handles the seeker value change notification
* @param value as the new seeker value
*/
void UBMediaWidget::onSliderChanged(int value)
{
if(!mAutoUpdate){
mpMediaObject->seek(value);
}
}
/**
* \brief Toggle Play-Stop
*/
void UBMediaWidget::onPlayStopClicked()
{
switch(mpMediaObject->state()){
case Phonon::PlayingState:
mpMediaObject->stop();
break;
case Phonon::StoppedState:
case Phonon::PausedState:
mpMediaObject->play();
break;
default:
break;
}
}
/**
* \brief Pause the media
*/
void UBMediaWidget::onPauseClicked()
{
mpMediaObject->pause();
}
/**
* Get the border
* @returns the actual border
*/
int UBMediaWidget::border()
{
return mBorder;
}
/**
* \brief Handles the resize event
* @param ev as the resize event
*/
void UBMediaWidget::resizeEvent(QResizeEvent* ev)
{
Q_UNUSED(ev);
}
/**
* \brief Set the audio cover
* @param coverPath as the cover image file path
*/
void UBMediaWidget::setAudioCover(const QString &coverPath)
{
if(NULL != mpCover){
mpCover->setPixmap(QPixmap(coverPath));
}
}
// -----------------------------------------------------------------------------------------------------------
/**
* \brief Constructor
* @param parent as the parent widget
* @param name as the object name
*/
UBMediaButton::UBMediaButton(QWidget *parent, const char *name):QLabel(parent)
, mPressed(false)
{
setObjectName(name);
resize(UBMEDIABUTTON_SIZE, UBMEDIABUTTON_SIZE);
setStyleSheet(QString("padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;"));
}
/**
* \brief Destructor
*/
UBMediaButton::~UBMediaButton()
{
}
/**
* \brief Handles the mouse press notification
* @param ev as the mouse press event
*/
void UBMediaButton::mousePressEvent(QMouseEvent* ev)
{
Q_UNUSED(ev);
mPressed = true;
}
/**
* \brief Handles the mouse release notification
* @param ev as the mouse release event
*/
void UBMediaButton::mouseReleaseEvent(QMouseEvent* ev)
{
Q_UNUSED(ev);
if(mPressed){
mPressed = false;
emit clicked();
}
}
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBMEDIAWIDGET_H
#define UBMEDIAWIDGET_H
#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QSlider>
#include <QMouseEvent>
#include <phonon/MediaObject>
#include <phonon/VideoWidget>
#include <phonon/AudioOutput>
#include "interfaces/IResizeable.h"
#define UBMEDIABUTTON_SIZE 32
#define TICK_INTERVAL 1000
/**
* \brief The media type
*/
typedef enum{
eMediaType_Video,
eMediaType_Audio
}eMediaType;
class UBMediaButton : public QLabel
{
Q_OBJECT
public:
UBMediaButton(QWidget* parent=0, const char* name="UBMediaButton");
~UBMediaButton();
signals:
void clicked();
protected:
void mousePressEvent(QMouseEvent* ev);
void mouseReleaseEvent(QMouseEvent* ev);
private:
/** And indicator of the press event in progress */
bool mPressed;
};
class UBMediaWidget : public QWidget
{
Q_OBJECT
public:
UBMediaWidget(eMediaType type = eMediaType_Video, QWidget* parent=0, const char* name="UBMediaWidget");
~UBMediaWidget();
void setFile(const QString& filePath);
eMediaType mediaType();
int border();
void setAudioCover(const QString& coverPath);
protected:
void resizeEvent(QResizeEvent* ev);
void showEvent(QShowEvent* event);
/** The current media file path */
QString mFilePath;
private slots:
void onPlayStopClicked();
void onPauseClicked();
void onStateChanged(Phonon::State newState, Phonon::State oldState);
void onTotalTimeChanged(qint64 total);
void onTick(qint64 currentTime);
void onSliderChanged(int value);
private:
void createMediaPlayer();
void adaptSizeToVideo();
/** The current media type */
eMediaType mType;
/** The media object */
Phonon::MediaObject* mpMediaObject;
/** The video renderer */
Phonon::VideoWidget* mpVideoWidget;
/** The audio renderer */
Phonon::AudioOutput* mpAudioOutput;
/** The principal layout of this widget */
QVBoxLayout mLayout;
/** The seeker layout */
QHBoxLayout mSeekerLayout;
/** The play-stop button */
UBMediaButton* mpPlayStopButton;
/** The pause button */
UBMediaButton* mpPauseButton;
/** The seeker slider */
QSlider* mpSlider;
/** An indicator of the seeker auto update in progress */
bool mAutoUpdate;
/** An indicator of the thumbnail generation in progress */
bool mGeneratingThumbnail;
/** The border */
int mBorder;
/** A widget that will contain the media */
QWidget* mpMediaContainer;
/** The media layout */
QHBoxLayout mMediaLayout;
/** The audio cover */
QLabel* mpCover;
};
#endif // UBMEDIAWIDGET_H
#include <QDebug>
#include <QScrollBar>
#include "UBGlobals.h"
#include "UBWidgetList.h"
UBWidgetList::UBWidgetList(QWidget* parent, eWidgetListOrientation orientation, const char* name):QScrollArea(parent)
, mpLayout(NULL)
, mpContainer(NULL)
, mMargin(5)
, mListElementsSpacing(10)
, mpEmptyLabel(NULL)
{
setObjectName(name);
mOrientation = orientation;
mpContainer = new QWidget(this);
mpEmptyLabel = new QLabel(this);
mpEmptyLabel->setObjectName("emptyString");
mpEmptyLabel->setWordWrap(true);
mpEmptyLabel->setAlignment(Qt::AlignCenter);
if(eWidgetListOrientation_Vertical == orientation){
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
mpLayout = new QVBoxLayout(mpContainer);
}
else{
setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
mpLayout = new QHBoxLayout(mpContainer);
}
mpLayout->setContentsMargins(margin(), margin(), margin(), margin());
mpContainer->setLayout(mpLayout);
setWidget(mpContainer);
}
UBWidgetList::~UBWidgetList()
{
DELETEPTR(mpEmptyLabel);
DELETEPTR(mpLayout);
DELETEPTR(mpContainer);
}
void UBWidgetList::addWidget(QWidget *widget)
{
if(NULL != mpLayout && NULL != widget){
widget->setParent(mpContainer);
mpEmptyLabel->setVisible(false);
mWidgetInfo[widget] = widget->size();
updateView(size());
mpLayout->addWidget(widget);
// This call is used only to refresh the size of the widgets
updateSizes();
}
}
void UBWidgetList::removeWidget(QWidget *widget)
{
if(NULL != mpLayout && NULL != widget){
mpLayout->removeWidget(widget);
mWidgetInfo.remove(widget);
widget->setVisible(false);
updateView(size());
if(0 == mpLayout->count()){
mpEmptyLabel->setVisible(true);
}
}
}
int UBWidgetList::scaleWidgets(QSize pSize)
{
// to remove the first spacing that shouldn't be there.
int result = -mListElementsSpacing;
foreach(QWidget* eachWidget, mWidgetInfo.keys()){
qreal scaleFactor = 0;
int newWidgetWidth = pSize.width();
int newWidgetHeight = pSize.height();
if(eWidgetListOrientation_Vertical == mOrientation){
scaleFactor = (float)mWidgetInfo[eachWidget].width() / (float)pSize.width();
newWidgetHeight = mWidgetInfo[eachWidget].height()/scaleFactor;
result += newWidgetHeight;
eachWidget->setMinimumHeight(newWidgetHeight- 1);
eachWidget->setMaximumHeight(newWidgetHeight);
}
else{
scaleFactor = (float)mWidgetInfo[eachWidget].height() / (float)pSize.height();
newWidgetWidth = mWidgetInfo[eachWidget].width()/scaleFactor;
result += newWidgetWidth;
eachWidget->setMinimumWidth(newWidgetWidth - 1);
eachWidget->setMaximumWidth(newWidgetWidth);
}
//Adding a vertical/horizontal space between each element of the list
result += mListElementsSpacing;
}
return result;
}
void UBWidgetList::scaleContainer(QSize pSize, int updateValue)
{
if(eWidgetListOrientation_Vertical == mOrientation)
mpContainer->resize(pSize.width(), updateValue);
else
mpContainer->resize(updateValue, pSize.height());
}
void UBWidgetList::updateView(QSize pSize)
{
// Widgets on list are resized automatically to fit the mpcontainer.
// so if you want to keep the aspect ratio you have to calculate
// the sum of the new widget height and give it to the mpContainer.
// The container resize will trig the widgets resize and the good
// height permits to respect the aspect ratio.
int updatedValue = scaleWidgets(pSize);
scaleContainer(pSize,updatedValue);
}
void UBWidgetList::resizeEvent(QResizeEvent *ev)
{
Q_UNUSED(ev);
mpEmptyLabel->setGeometry((width() - mpEmptyLabel->width()) / 2,
(height() - mpEmptyLabel->height()) /2,
mpEmptyLabel->width(),
mpEmptyLabel->height());
updateView(size());
updateSizes();
}
void UBWidgetList::updateSizes()
{
// Resize all the widgets
foreach(QWidget* eachWidget, mWidgetInfo.keys()){
if(NULL != eachWidget){
QSize originalSize = mWidgetInfo[eachWidget];
int currentWidth = mpContainer->width();
int currentHeight = mpContainer->height();
if(eWidgetListOrientation_Vertical == mOrientation){
if(verticalScrollBar()->isVisible()){
currentWidth -= verticalScrollBar()->width();
eachWidget->setStyleSheet(QString("margin-right:%0;").arg(verticalScrollBar()->width()));
}
float scaleFactor = (float)currentWidth/(float)originalSize.width();
currentHeight = originalSize.height()*scaleFactor;
}else{
if(horizontalScrollBar()->isVisible()){
currentHeight -= horizontalScrollBar()->height();
eachWidget->setStyleSheet(QString("padding-bottom:%0;").arg(horizontalScrollBar()->height()));
}
float scaleFactor = (float)currentHeight/(float)originalSize.height();
currentWidth = originalSize.width()*scaleFactor;
}
eachWidget->resize(currentWidth, currentHeight);
}
}
}
void UBWidgetList::setMargin(int margin)
{
mMargin = margin;
}
int UBWidgetList::margin()
{
return mMargin;
}
void UBWidgetList::setEmptyText(const QString &text)
{
if(NULL != mpEmptyLabel){
mpEmptyLabel->setText(text);
}
}
bool UBWidgetList::empty()
{
return mWidgetInfo.empty();
}
// TODO : - add onHover 'delete' button
#ifndef UBWIDGETLIST_H
#define UBWIDGETLIST_H
#include <QWidget>
#include <QScrollArea>
#include <QBoxLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QResizeEvent>
#include <QVector>
#include <QLabel>
#include "interfaces/IResizeable.h"
typedef enum{
eWidgetListOrientation_Vertical,
eWidgetListOrientation_Horizontal
}eWidgetListOrientation;
class UBWidgetList : public QScrollArea
{
Q_OBJECT
typedef struct
{
QSize size;
bool isResizable;
} sWidgetProperties;
public:
UBWidgetList(QWidget* parent=0, eWidgetListOrientation orientation = eWidgetListOrientation_Vertical, const char* name = "UBWidgetList");
~UBWidgetList();
void addWidget(QWidget* widget);
void removeWidget(QWidget* widget);
void setMargin(int margin);
void setEmptyText(const QString& text);
int margin();
bool empty();
void setListElementSpacing(int margin) { mListElementsSpacing = margin; }
int listElementsSpacing() {return mListElementsSpacing; }
protected:
void resizeEvent(QResizeEvent* ev);
private:
int scaleWidgets(QSize pSize);
void scaleContainer(QSize pSize, int updateValue);
void updateView(QSize pSize);
void updateSizes();
QBoxLayout* mpLayout;
QWidget* mpContainer;
eWidgetListOrientation mOrientation;
int mMargin;
int mListElementsSpacing;
QMap<QWidget*, QSize> mWidgetInfo;
QLabel* mpEmptyLabel;
};
#endif // UBWIDGETLIST_H
HEADERS += src/customWidgets/UBWidgetList.h \
src/customWidgets/UBDraggableLabel.h \
src/customWidgets/UBMediaWidget.h \
src/customWidgets/UBGlobals.h \
src/customWidgets/UBDraggableMedia.h
SOURCES += src/customWidgets/UBWidgetList.cpp \
src/customWidgets/UBDraggableLabel.cpp \
src/customWidgets/UBMediaWidget.cpp \
src/customWidgets/UBDraggableMedia.cpp
...@@ -888,12 +888,16 @@ void UBDesktopAnnotationController::TransparentWidgetResized() ...@@ -888,12 +888,16 @@ void UBDesktopAnnotationController::TransparentWidgetResized()
void UBDesktopAnnotationController::onTransparentWidgetResized() void UBDesktopAnnotationController::onTransparentWidgetResized()
{ {
int rW = UBApplication::boardController->paletteManager()->rightPalette()->width(); int rW = UBApplication::boardController->paletteManager()->rightPalette()->width();
int rH_ = UBApplication::boardController->paletteManager()->rightPalette()->height(); int lW = UBApplication::boardController->paletteManager()->leftPalette()->width();
int rH = mTransparentDrawingView->height(); int rH = mTransparentDrawingView->height();
UBApplication::boardController->paletteManager()->rightPalette()->resize(rW+1, rH); UBApplication::boardController->paletteManager()->rightPalette()->resize(rW+1, rH);
UBApplication::boardController->paletteManager()->rightPalette()->resize(rW, rH); UBApplication::boardController->paletteManager()->rightPalette()->resize(rW, rH);
UBApplication::boardController->paletteManager()->leftPalette()->resize(lW+1, rH);
UBApplication::boardController->paletteManager()->leftPalette()->resize(lW, rH);
// mRightPalette->resize(mRightPalette->width(), mTransparentDrawingView->height()); // mRightPalette->resize(mRightPalette->width(), mTransparentDrawingView->height());
} }
...@@ -923,6 +927,19 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) ...@@ -923,6 +927,19 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent)
UBApplication::boardController->paletteManager()->mKeyboardPalette->width(), UBApplication::boardController->paletteManager()->mKeyboardPalette->height()); UBApplication::boardController->paletteManager()->mKeyboardPalette->width(), UBApplication::boardController->paletteManager()->mKeyboardPalette->height());
} }
if(UBApplication::boardController->paletteManager()->leftPalette()->isVisible())
{
QRect leftPalette(UBApplication::boardController->paletteManager()->leftPalette()->geometry().x(),
UBApplication::boardController->paletteManager()->leftPalette()->geometry().y(),
UBApplication::boardController->paletteManager()->leftPalette()->width(),
UBApplication::boardController->paletteManager()->leftPalette()->height());
QRect tabsPalette(UBApplication::boardController->paletteManager()->leftPalette()->getTabPaletteRect());
p.drawRect(leftPalette);
p.drawRect(tabsPalette);
}
if(UBApplication::boardController->paletteManager()->rightPalette()->isVisible()) if(UBApplication::boardController->paletteManager()->rightPalette()->isVisible())
{ {
QRect rightPalette(UBApplication::boardController->paletteManager()->rightPalette()->geometry().x(), QRect rightPalette(UBApplication::boardController->paletteManager()->rightPalette()->geometry().x(),
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "board/UBBoardPaletteManager.h" #include "board/UBBoardPaletteManager.h"
#include "board/UBDrawingController.h" #include "board/UBDrawingController.h"
//#include "gui/UBKeyboardPalette.h"
#include "gui/UBThumbnailView.h" #include "gui/UBThumbnailView.h"
#include "gui/UBDocumentTreeWidget.h" #include "gui/UBDocumentTreeWidget.h"
...@@ -69,7 +68,6 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow) ...@@ -69,7 +68,6 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow)
, mToolsPalette(0) , mToolsPalette(0)
, mToolsPalettePositionned(false) , mToolsPalettePositionned(false)
, mTrashTi(0) , mTrashTi(0)
// , mKeyboardPalette(0)
{ {
setupViews(); setupViews();
setupToolbar(); setupToolbar();
......
...@@ -49,6 +49,14 @@ void UBDocumentProxy::init() ...@@ -49,6 +49,14 @@ void UBDocumentProxy::init()
setUuid(QUuid::createUuid()); setUuid(QUuid::createUuid());
setDefaultDocumentSize(UBSettings::settings()->pageSize->get().toSize()); setDefaultDocumentSize(UBSettings::settings()->pageSize->get().toSize());
setSessionTitle("");
setSessionTarget("");
setSessionLicence("");
setSessionKeywords("");
setSessionLevel("");
setSessionTopic("");
setSessionAuthor("");
} }
...@@ -196,6 +204,97 @@ void UBDocumentProxy::setUuid(const QUuid& uuid) ...@@ -196,6 +204,97 @@ void UBDocumentProxy::setUuid(const QUuid& uuid)
UBSettings::uniboardDocumentNamespaceUri + "/" + UBStringUtils::toCanonicalUuid(uuid)); UBSettings::uniboardDocumentNamespaceUri + "/" + UBStringUtils::toCanonicalUuid(uuid));
} }
QString UBDocumentProxy::sessionTitle() const
{
if(mMetaDatas.contains(UBSettings::sessionTitle))
return metaData(UBSettings::sessionTitle).toString();
else
return QString();
}
void UBDocumentProxy::setSessionTitle(const QString & sessionTitle)
{
setMetaData(UBSettings::sessionTitle,QVariant(sessionTitle));
}
QString UBDocumentProxy::sessionTarget() const
{
if(mMetaDatas.contains(UBSettings::sessionTarget))
return metaData(UBSettings::sessionTarget).toString();
else
return QString();
}
void UBDocumentProxy::setSessionTarget(const QString & sessionTarget)
{
setMetaData(UBSettings::sessionTarget,QVariant(sessionTarget));
}
QString UBDocumentProxy::sessionLicence() const
{
if(mMetaDatas.contains(UBSettings::sessionLicence))
return metaData(UBSettings::sessionLicence).toString();
else
return QString();
}
void UBDocumentProxy::setSessionLicence(const QString & sessionLicence)
{
setMetaData(UBSettings::sessionLicence,QVariant(sessionLicence));
}
void UBDocumentProxy::setSessionKeywords(const QString &kw)
{
setMetaData(UBSettings::sessionKeywords,QVariant(kw));
}
QString UBDocumentProxy::sessionKeywords()
{
if(mMetaDatas.contains(UBSettings::sessionKeywords))
return metaData(UBSettings::sessionKeywords).toString();
else
return QString();
}
void UBDocumentProxy::setSessionLevel(const QString &level)
{
setMetaData(UBSettings::sessionLevel,QVariant(level));
}
QString UBDocumentProxy::sessionLevel()
{
if(mMetaDatas.contains(UBSettings::sessionLevel))
return metaData(UBSettings::sessionLevel).toString();
else
return QString();
}
void UBDocumentProxy::setSessionTopic(const QString &topic)
{
setMetaData(UBSettings::sessionTopic,QVariant(topic));
}
QString UBDocumentProxy::sessionTopic()
{
if(mMetaDatas.contains(UBSettings::sessionTopic))
return metaData(UBSettings::sessionTopic).toString();
else
return QString();
}
void UBDocumentProxy::setSessionAuthor(const QString &authors)
{
setMetaData(UBSettings::sessionAuthors,QVariant(authors));
}
QString UBDocumentProxy::sessionAuthors()
{
if(mMetaDatas.contains(UBSettings::sessionAuthors))
return metaData(UBSettings::sessionAuthors).toString();
else
return QString();
}
bool UBDocumentProxy::isModified() const bool UBDocumentProxy::isModified() const
{ {
return mIsModified; return mIsModified;
......
...@@ -45,6 +45,21 @@ class UBDocumentProxy : public QObject ...@@ -45,6 +45,21 @@ class UBDocumentProxy : public QObject
QString name() const; QString name() const;
QString groupName() const; QString groupName() const;
QString sessionTitle() const;
void setSessionTitle(const QString& sessionTitle);
QString sessionTarget() const;
void setSessionTarget(const QString& sessionTarget);
QString sessionLicence() const;
void setSessionLicence(const QString& sessionLicence);
void setSessionKeywords(const QString& kw);
QString sessionKeywords();
void setSessionLevel(const QString& level);
QString sessionLevel();
void setSessionTopic(const QString& topic);
QString sessionTopic();
void setSessionAuthor(const QString& authors);
QString sessionAuthors();
QSize defaultDocumentSize() const; QSize defaultDocumentSize() const;
void setDefaultDocumentSize(QSize pSize); void setDefaultDocumentSize(QSize pSize);
......
...@@ -1770,7 +1770,6 @@ void UBGraphicsScene::addMask(const QPointF &center) ...@@ -1770,7 +1770,6 @@ void UBGraphicsScene::addMask(const QPointF &center)
QRectF rect = UBApplication::boardController->activeScene()->normalizedSceneRect(); QRectF rect = UBApplication::boardController->activeScene()->normalizedSceneRect();
rect.setRect(center.x() - rect.width()/4, center.y() - rect.height()/4, rect.width()/2 , rect.height()/2); rect.setRect(center.x() - rect.width()/4, center.y() - rect.height()/4, rect.width()/2 , rect.height()/2);
QPointF origin = center.isNull() ? rect.bottomRight() : center;
curtain->setRect(rect); curtain->setRect(rect);
UBGraphicsItem::assignZValue(curtain, toolLayerStart + toolOffsetCurtain); UBGraphicsItem::assignZValue(curtain, toolLayerStart + toolOffsetCurtain);
......
...@@ -57,12 +57,10 @@ void UBActionPalette::init(Qt::Orientation orientation) ...@@ -57,12 +57,10 @@ void UBActionPalette::init(Qt::Orientation orientation)
mToolButtonStyle = Qt::ToolButtonIconOnly; mToolButtonStyle = Qt::ToolButtonIconOnly;
mButtons.clear(); mButtons.clear();
QBoxLayout *layout = 0;
if (orientation == Qt::Horizontal) if (orientation == Qt::Horizontal)
layout = new QHBoxLayout(this); new QHBoxLayout(this);
else else
layout = new QVBoxLayout(this); new QVBoxLayout(this);
updateLayout(); updateLayout();
} }
......
...@@ -222,7 +222,7 @@ void UBCachePropertiesWidget::onCloseClicked() ...@@ -222,7 +222,7 @@ void UBCachePropertiesWidget::onCloseClicked()
emit cacheListEmpty(); emit cacheListEmpty();
} }
emit hideTab(name()); emit hideTab(this);
} }
} }
...@@ -300,7 +300,7 @@ void UBCachePropertiesWidget::updateCurrentCache() ...@@ -300,7 +300,7 @@ void UBCachePropertiesWidget::updateCurrentCache()
if("Cache" == it->data(Qt::UserRole).toString()) if("Cache" == it->data(Qt::UserRole).toString())
{ {
setEnabled(true); setEnabled(true);
emit showTab(name()); emit showTab(this);
mpCurrentCache = dynamic_cast<UBGraphicsCache*>(it); mpCurrentCache = dynamic_cast<UBGraphicsCache*>(it);
if((NULL != mpCurrentCache) && (!mCaches.contains(mpCurrentCache))) if((NULL != mpCurrentCache) && (!mCaches.contains(mpCurrentCache)))
{ {
...@@ -331,7 +331,7 @@ void UBCachePropertiesWidget::updateCurrentCache() ...@@ -331,7 +331,7 @@ void UBCachePropertiesWidget::updateCurrentCache()
// 1 - that this page has no cache // 1 - that this page has no cache
// 2 - we are not in Board mode // 2 - we are not in Board mode
// 3 - we are in Board mode, but show desktop (as really - Desktop mode) // 3 - we are in Board mode, but show desktop (as really - Desktop mode)
emit hideTab(name()); emit hideTab(this);
mpCurrentCache = NULL; mpCurrentCache = NULL;
setDisabled(true); setDisabled(true);
} }
...@@ -346,6 +346,6 @@ void UBCachePropertiesWidget::onSizeChanged(int newSize) ...@@ -346,6 +346,6 @@ void UBCachePropertiesWidget::onSizeChanged(int newSize)
void UBCachePropertiesWidget::onCacheEnabled() void UBCachePropertiesWidget::onCacheEnabled()
{ {
emit showTab(name()); emit showTab(this);
} }
...@@ -567,19 +567,15 @@ void UBDockPalette::addTab(UBDockPaletteWidget *widget) ...@@ -567,19 +567,15 @@ void UBDockPalette::addTab(UBDockPaletteWidget *widget)
* \brief Remove the given tab * \brief Remove the given tab
* @param widgetName as the tab widget name * @param widgetName as the tab widget name
*/ */
void UBDockPalette::removeTab(const QString &widgetName) void UBDockPalette::removeTab(UBDockPaletteWidget* widget)
{ {
for(int i = 0; i < mTabWidgets.size(); i++) int nWidget = mTabWidgets.indexOf(widget);
if( nWidget >= 0 )
{ {
UBDockPaletteWidget* pCrntWidget = mTabWidgets.at(i); mpStackWidget->removeWidget(widget);
if(NULL != pCrntWidget && (pCrntWidget->name() == widgetName)) mTabWidgets.remove(nWidget);
{ widget->hide();
mpStackWidget->removeWidget(pCrntWidget); update();
mTabWidgets.remove(i);
pCrntWidget->hide();
update();
break;
}
} }
resizeTabs(); resizeTabs();
mCurrentTab = qMax(mCurrentTab - 1, 0); mCurrentTab = qMax(mCurrentTab - 1, 0);
...@@ -607,17 +603,12 @@ int UBDockPalette::tabSpacing() ...@@ -607,17 +603,12 @@ int UBDockPalette::tabSpacing()
* \brief Show the given widget * \brief Show the given widget
* @param widgetName as the given widget name * @param widgetName as the given widget name
*/ */
void UBDockPalette::onShowTabWidget(const QString &widgetName) void UBDockPalette::onShowTabWidget(UBDockPaletteWidget* widget)
{ {
for(int i = 0; i < mRegisteredWidgets.size(); i++) if (mRegisteredWidgets.contains(widget))
{ {
UBDockPaletteWidget* pCrntWidget = mRegisteredWidgets.at(i); widget->setVisibleState(true);
if(NULL != pCrntWidget && (pCrntWidget->name() == widgetName)) addTab(widget);
{
pCrntWidget->setVisibleState(true);
addTab(pCrntWidget);
break;
}
} }
} }
...@@ -625,16 +616,13 @@ void UBDockPalette::onShowTabWidget(const QString &widgetName) ...@@ -625,16 +616,13 @@ void UBDockPalette::onShowTabWidget(const QString &widgetName)
* \brief Hide the given widget * \brief Hide the given widget
* @param widgetName as the given widget name * @param widgetName as the given widget name
*/ */
void UBDockPalette::onHideTabWidget(const QString &widgetName) void UBDockPalette::onHideTabWidget(UBDockPaletteWidget* widget)
{ {
for(int i = 0; i < mRegisteredWidgets.size(); i++){ if (mRegisteredWidgets.contains(widget))
UBDockPaletteWidget* pCrntWidget = mRegisteredWidgets.at(i); {
if(NULL != pCrntWidget && (pCrntWidget->name() == widgetName)){ widget->setVisibleState(false);
pCrntWidget->setVisibleState(false); removeTab(widget);
break;
}
} }
removeTab(widgetName);
} }
/** /**
...@@ -644,8 +632,8 @@ void UBDockPalette::connectSignals() ...@@ -644,8 +632,8 @@ void UBDockPalette::connectSignals()
{ {
for(int i=0; i < mRegisteredWidgets.size(); i++) for(int i=0; i < mRegisteredWidgets.size(); i++)
{ {
connect(mRegisteredWidgets.at(i), SIGNAL(showTab(QString)), this, SLOT(onShowTabWidget(QString))); connect(mRegisteredWidgets.at(i), SIGNAL(showTab(UBDockPaletteWidget*)), this, SLOT(onShowTabWidget(UBDockPaletteWidget*)));
connect(mRegisteredWidgets.at(i), SIGNAL(hideTab(QString)), this, SLOT(onHideTabWidget(QString))); connect(mRegisteredWidgets.at(i), SIGNAL(hideTab(UBDockPaletteWidget*)), this, SLOT(onHideTabWidget(UBDockPaletteWidget*)));
} }
} }
...@@ -747,7 +735,7 @@ bool UBDockPalette::switchMode(eUBDockPaletteWidgetMode mode) ...@@ -747,7 +735,7 @@ bool UBDockPalette::switchMode(eUBDockPaletteWidgetMode mode)
} }
else else
{ {
removeTab(pNextWidget->name()); removeTab(pNextWidget);
} }
} }
} }
......
...@@ -111,8 +111,9 @@ public: ...@@ -111,8 +111,9 @@ public:
void setBackgroundBrush(const QBrush& brush); void setBackgroundBrush(const QBrush& brush);
void registerWidget(UBDockPaletteWidget* widget); void registerWidget(UBDockPaletteWidget* widget);
void addTab(UBDockPaletteWidget* widget); void addTab(UBDockPaletteWidget* widget);
void removeTab(const QString& widgetName); void removeTab(UBDockPaletteWidget* widget);
void connectSignals(); void connectSignals();
...@@ -129,8 +130,8 @@ public: ...@@ -129,8 +130,8 @@ public:
eUBDockPaletteType paletteType(){return mPaletteType;} eUBDockPaletteType paletteType(){return mPaletteType;}
public slots: public slots:
void onShowTabWidget(const QString& widgetName); void onShowTabWidget(UBDockPaletteWidget* widget);
void onHideTabWidget(const QString& widgetName); void onHideTabWidget(UBDockPaletteWidget* widget);
void onAllDownloadsFinished(); void onAllDownloadsFinished();
protected: protected:
......
...@@ -27,6 +27,15 @@ QString UBDockPaletteWidget::name() ...@@ -27,6 +27,15 @@ QString UBDockPaletteWidget::name()
return mName; return mName;
} }
/**
* When a widget registers a mode it means that it would be displayed on that mode
*/
void UBDockPaletteWidget::registerMode(eUBDockPaletteWidgetMode mode)
{
if(!mRegisteredModes.contains(mode))
mRegisteredModes.append(mode);
}
void UBDockPaletteWidget::slot_changeMode(eUBDockPaletteWidgetMode newMode) void UBDockPaletteWidget::slot_changeMode(eUBDockPaletteWidgetMode newMode)
{ {
this->setVisible(this->visibleInMode( newMode )); this->setVisible(this->visibleInMode( newMode ));
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
#include <QPixmap> #include <QPixmap>
#include <QString> #include <QString>
/**
* This enum defines the different mode availables.
*/
typedef enum typedef enum
{ {
eUBDockPaletteWidget_BOARD, eUBDockPaletteWidget_BOARD,
...@@ -25,14 +29,16 @@ public: ...@@ -25,14 +29,16 @@ public:
QPixmap iconToLeft(); QPixmap iconToLeft();
QString name(); QString name();
virtual bool visibleInMode(eUBDockPaletteWidgetMode mode) = NULL; virtual bool visibleInMode(eUBDockPaletteWidgetMode mode) = 0;
void registerMode(eUBDockPaletteWidgetMode mode);
bool visibleState(){return mVisibleState;} bool visibleState(){return mVisibleState;}
void setVisibleState(bool state){mVisibleState = state;} void setVisibleState(bool state){mVisibleState = state;}
signals: signals:
void hideTab(const QString& widgetName); void hideTab(UBDockPaletteWidget* widget);
void showTab(const QString& widgetName); void showTab(UBDockPaletteWidget* widget);
public slots: public slots:
void slot_changeMode(eUBDockPaletteWidgetMode newMode); void slot_changeMode(eUBDockPaletteWidgetMode newMode);
...@@ -44,7 +50,7 @@ protected: ...@@ -44,7 +50,7 @@ protected:
QString mName; QString mName;
/* The current widget available mode list */ /* The current widget available mode list */
//QVector<eUBDockPaletteWidgetMode> mRegisteredModes; QVector<eUBDockPaletteWidgetMode> mRegisteredModes;
bool mVisibleState; bool mVisibleState;
}; };
......
This diff is collapsed.
#ifndef UBUBMediaPlayer_H
#define UBUBMediaPlayer_H
#include <QtGui/QWidget>
#include <QtGui/QApplication>
#include <QtCore/QTimerEvent>
#include <QtGui/QShowEvent>
#include <QtGui/QIcon>
#include <QtCore/QBasicTimer>
#include <QtGui/QAction>
#include <phonon/audiooutput.h>
#include <phonon/backendcapabilities.h>
#include <phonon/effect.h>
#include <phonon/effectparameter.h>
#include <phonon/effectwidget.h>
#include <phonon/mediaobject.h>
#include <phonon/seekslider.h>
#include <phonon/videowidget.h>
#include <phonon/volumeslider.h>
QT_BEGIN_NAMESPACE
class QPushButton;
class QLabel;
class QSlider;
class QTextEdit;
QT_END_NAMESPACE
class UBMediaPlayer;
class MediaVideoWidget : public Phonon::VideoWidget
{
Q_OBJECT;
public:
MediaVideoWidget(UBMediaPlayer *player, QWidget *parent = 0);
protected:
void timerEvent(QTimerEvent *e);
private:
UBMediaPlayer* m_player;
QBasicTimer m_timer;
// QAction m_action;
};
class UBMediaPlayer : public QWidget
{
Q_OBJECT
public:
UBMediaPlayer();
void setFile(const QString &text);
void setLocation(const QString &location);
void setVolume(qreal volume);
public slots:
void openFile();
void rewind();
void forward();
// void updateTime();
void finished();
void playPause();
protected:
void resizeEvent(QResizeEvent* pEvent);
private slots:
void stateChanged(Phonon::State newstate, Phonon::State oldstate);
void bufferStatus(int percent);
void openUrl();
void hasVideoChanged(bool);
private:
void initVideoWindow();
QIcon playIcon;
QIcon pauseIcon;
QPushButton *playButton;
// QPushButton *rewindButton;
// QPushButton *forwardButton;
Phonon::SeekSlider *slider;
// QLabel *timeLabel;
QLabel *progressLabel;
// QLabel *info;
QWidget m_videoWindow;
Phonon::MediaObject m_MediaObject;
Phonon::AudioOutput m_AudioOutput;
MediaVideoWidget *m_videoWidget;
Phonon::Path m_audioOutputPath;
};
class UBDraggableMediaPlayer : public UBMediaPlayer
{
Q_OBJECT
public:
UBDraggableMediaPlayer();
void setFile(const QString &text);
protected:
QString mSourcePath;
void mousePressEvent(QMouseEvent *event);
};
#endif // UBUBMediaPlayer_H
#include "UBTBDocumentEditWidget.h"
#include "customWidgets/UBGlobals.h"
UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QWidget *parent, const char *name):QWidget(parent)
, mpPageViewButton(NULL)
, mpPreviewButton(NULL)
, mpTitleLabel(NULL)
, mpTitle(NULL)
, mpTargetLabel(NULL)
, mpTarget(NULL)
, mpMetadataLabel(NULL)
, mpLicenseLabel(NULL)
, mpLicenseCombox(NULL)
, mpKeywords(NULL)
, mpLevel(NULL)
, mpTopic(NULL)
, mpAuthor(NULL)
, mpKeywordLabel(NULL)
, mpLevelLabel(NULL)
, mpTopicLabel(NULL)
, mpAuthorLabel(NULL)
{
setObjectName(name);
mpDataMgr = pDataMgr;
setLayout(&mLayout);
mLayout.setContentsMargins(0, 0, 0, 0);
mpContainer = new QWidget(this);
mpContainer->setObjectName("DockPaletteWidgetBox");
mLayout.addWidget(mpContainer, 1);
mpContainer->setLayout(&mContainerLayout);
// Title
mpTitleLabel = new QLabel(tr("Session Title"), mpContainer);
mpTitleLabel->setAlignment(Qt::AlignLeft);
mpTitleLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mContainerLayout.addWidget(mpTitleLabel, 0);
mpTitle = new QLineEdit(mpContainer);
mpTitle->setObjectName("DockPaletteWidgetLineEdit");
mContainerLayout.addWidget(mpTitle, 0);
mContainerLayout.addWidget(&mTitleSeparator);
// Target
mpTargetLabel = new QLabel(tr("Session Target"), mpContainer);
mpTargetLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mContainerLayout.addWidget(mpTargetLabel, 0);
mpTarget = new QTextEdit(mpContainer);
mpTarget->setObjectName("UBTeacherBarTargetBox");
mContainerLayout.addWidget(mpTarget, 1);
mContainerLayout.addWidget(&mTargetSeparator);
// Metadata
mpMetadataLabel = new QLabel(tr("Metadata"), mpContainer);
mpMetadataLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mpMetadataLabel->setAlignment(Qt::AlignLeft);
mContainerLayout.addWidget(mpMetadataLabel, 0);
mpKeywords = new QLineEdit(this);
mpKeywords->setObjectName("DockPaletteWidgetLineEdit");
mpLevel = new QComboBox(this);
mpLevel->setObjectName("DockPaletteWidgetComboBox");
mpTopic = new QComboBox(this);
mpTopic->setObjectName("DockPaletteWidgetComboBox");
mpAuthor = new QLineEdit(this);
mpAuthor->setObjectName("DockPaletteWidgetLineEdit");
mpKeywordLabel = new QLabel(tr("Keywords:"), this);
mpLevelLabel = new QLabel(tr("Level:"), this);
mpTopicLabel = new QLabel(tr("Topic:"), this);
mpAuthorLabel = new QLabel(tr("Author"), this);
mKeywordLayout.addWidget(mpKeywordLabel, 0);
mKeywordLayout.addWidget(mpKeywords, 1);
mLevelLayout.addWidget(mpLevelLabel, 0);
mLevelLayout.addWidget(mpLevel, 1);
mTopicLayout.addWidget(mpTopicLabel, 0);
mTopicLayout.addWidget(mpTopic, 1);
mAuthorLayout.addWidget(mpAuthorLabel, 0);
mAuthorLayout.addWidget(mpAuthor, 1);
mContainerLayout.addLayout(&mKeywordLayout, 0);
mContainerLayout.addLayout(&mLevelLayout, 0);
mContainerLayout.addLayout(&mTopicLayout, 0);
mContainerLayout.addLayout(&mAuthorLayout, 0);
mContainerLayout.addWidget(&mLicenseSeparator);
// License
mpLicenseLabel = new QLabel(tr("License"), mpContainer);
mpLicenseLabel->setAlignment(Qt::AlignLeft);
mpLicenseLabel->setObjectName("UBTeacherBarPreviewSubtitle");
mContainerLayout.addWidget(mpLicenseLabel, 0);
mpLicenseCombox = new QComboBox(this);
mpLicenseCombox->setObjectName("DockPaletteWidgetComboBox");
QStringList qslLicenses;
qslLicenses << "CC BY";
qslLicenses << "CC BY-ND";
qslLicenses << "CC BY-NC-SA";
qslLicenses << "CC BY-SA";
qslLicenses << "CC BY-NC";
qslLicenses << "CC BY-NC-ND";
mpLicenseCombox->addItems(qslLicenses);
mContainerLayout.addWidget(mpLicenseCombox);
mpPageViewButton = new QPushButton(tr("Page View"), this);
mpPageViewButton->setObjectName("DockPaletteWidgetButton");
mPreviewLayout.addWidget(mpPageViewButton, 0);
mpPreviewButton = new QPushButton(tr("Preview"), this);
mpPreviewButton->setObjectName("DockPaletteWidgetButton");
mPreviewLayout.addWidget(mpPreviewButton, 0);
mPreviewLayout.addStretch(1);
mLayout.addLayout(&mPreviewLayout, 0);
connect(mpPageViewButton, SIGNAL(clicked()), this, SLOT(onPageView()));
connect(mpPreviewButton, SIGNAL(clicked()), this, SLOT(onPreview()));
connect(mpTitle, SIGNAL(textChanged(QString)), this, SLOT(onSessionTitleChanged()));
connect(mpTarget, SIGNAL(textChanged()), this, SLOT(onSessionTargetChanged()));
connect(mpLicenseCombox, SIGNAL(currentIndexChanged(int)), this, SLOT(onLicenseCurrentIndexChanged(int)));
connect(mpKeywords, SIGNAL(textChanged(QString)), this, SLOT(onKeywordChanged(QString)));
connect(mpLevel, SIGNAL(currentIndexChanged(QString)), this, SLOT(onLevelChanged(QString)));
connect(mpTopic, SIGNAL(currentIndexChanged(QString)), this, SLOT(onTopicChanged(QString)));
connect(mpAuthor, SIGNAL(textChanged(QString)), this, SLOT(onAuthorChanged(QString)));
}
UBTBDocumentEditWidget::~UBTBDocumentEditWidget()
{
DELETEPTR(mpTitleLabel);
DELETEPTR(mpTitle);
DELETEPTR(mpTargetLabel);
DELETEPTR(mpTarget);
DELETEPTR(mpMetadataLabel);
DELETEPTR(mpKeywordLabel);
DELETEPTR(mpLevelLabel);
DELETEPTR(mpTopicLabel);
DELETEPTR(mpAuthorLabel);
DELETEPTR(mpKeywords);
DELETEPTR(mpLevel);
DELETEPTR(mpTopic);
DELETEPTR(mpAuthor);
DELETEPTR(mpLicenseLabel);
DELETEPTR(mpLicenseCombox);
DELETEPTR(mpPageViewButton);
DELETEPTR(mpPreviewButton);
}
void UBTBDocumentEditWidget::onPageView()
{
emit changeTBState(eTeacherBarState_PageEdit);
}
void UBTBDocumentEditWidget::onPreview()
{
emit changeTBState(eTeacherBarState_DocumentPreview);
}
void UBTBDocumentEditWidget::onSessionTitleChanged()
{
mpDataMgr->setSessionTitle(mpTitle->text());
emit valueChanged();
}
void UBTBDocumentEditWidget::onSessionTargetChanged()
{
mpDataMgr->setSessionTarget(mpTarget->document()->toPlainText());
emit valueChanged();
}
void UBTBDocumentEditWidget::onLicenseCurrentIndexChanged(int selection)
{
mpDataMgr->setSessionLicence((eLicense)selection);
emit valueChanged();
}
void UBTBDocumentEditWidget::updateFields()
{
mpTitle->setText(mpDataMgr->sessionTitle());
mpTarget->setPlainText(mpDataMgr->sessionTarget());
mpKeywords->setText(mpDataMgr->keywords());
// TODO: retrieve the level
// TODO retrieve the topic
mpAuthor->setText(mpDataMgr->authors());
}
void UBTBDocumentEditWidget::clearFields()
{
mpTitle->setText("");
mpTarget->setPlainText("");
}
void UBTBDocumentEditWidget::onKeywordChanged(const QString &kw)
{
mpDataMgr->setKeywords(kw);
emit valueChanged();
}
void UBTBDocumentEditWidget::onLevelChanged(const QString &level)
{
mpDataMgr->setLevel(level);
emit valueChanged();
}
void UBTBDocumentEditWidget::onTopicChanged(const QString &topic)
{
mpDataMgr->setTopic(topic);
emit valueChanged();
}
void UBTBDocumentEditWidget::onAuthorChanged(const QString &authors)
{
mpDataMgr->setAuthors(authors);
emit valueChanged();
}
#ifndef UBTBDOCUMENTEDITWIDGET_H
#define UBTBDOCUMENTEDITWIDGET_H
#include <QVBoxLayout>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QTextEdit>
#include <QComboBox>
#include "UBTeacherBarDataMgr.h"
class UBTBDocumentEditWidget : public QWidget
{
Q_OBJECT
public:
UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QWidget* parent=0, const char* name="UBTBDocumentEditWidget");
~UBTBDocumentEditWidget();
void updateFields();
void clearFields();
signals:
void changeTBState(eTeacherBarState state);
void valueChanged();
private slots:
void onPageView();
void onPreview();
void onSessionTitleChanged();
void onSessionTargetChanged();
void onLicenseCurrentIndexChanged(int selection);
void onKeywordChanged(const QString& kw);
void onLevelChanged(const QString& level);
void onTopicChanged(const QString& topic);
void onAuthorChanged(const QString& authors);
private:
QVBoxLayout mLayout;
QHBoxLayout mPageLayout;
QHBoxLayout mPreviewLayout;
QVBoxLayout mContainerLayout;
QPushButton* mpPageViewButton;
QPushButton* mpPreviewButton;
UBTBSeparator mTitleSeparator;
UBTBSeparator mTargetSeparator;
UBTBSeparator mLicenseSeparator;
QHBoxLayout mKeywordLayout;
QHBoxLayout mLevelLayout;
QHBoxLayout mTopicLayout;
QHBoxLayout mAuthorLayout;
QWidget* mpContainer;
QLabel* mpTitleLabel;
QLineEdit* mpTitle;
QLabel* mpTargetLabel;
QTextEdit* mpTarget;
QLabel* mpMetadataLabel;
QLabel* mpLicenseLabel;
QComboBox* mpLicenseCombox;
QLineEdit* mpKeywords;
QComboBox* mpLevel;
QComboBox* mpTopic;
QLineEdit* mpAuthor;
QLabel* mpKeywordLabel;
QLabel* mpLevelLabel;
QLabel* mpTopicLabel;
QLabel* mpAuthorLabel;
UBTeacherBarDataMgr* mpDataMgr;
};
#endif // UBTBDOCUMENTEDITWIDGET_H
#include "customWidgets/UBGlobals.h"
#include "UBTBDocumentPreviewWidget.h"
UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataMgr, QWidget *parent, const char *name):QWidget(parent)
, mpPageViewButton(NULL)
, mpEditButton(NULL)
{
setObjectName(name);
mpDataMgr = pDataMgr;
setLayout(&mLayout);
mpPageViewButton = new QPushButton(tr("Page View"), this);
mpPageViewButton->setObjectName("DockPaletteWidgetButton");
mPageLayout.addStretch(1);
mPageLayout.addWidget(mpPageViewButton, 0);
mPageLayout.addStretch(1);
mLayout.addLayout(&mPageLayout);
// TODO : Add the elements here
mpEditButton = new QPushButton(tr("Edit"), this);
mpEditButton->setObjectName("DockPaletteWidgetButton");
mPreviewLayout.addStretch(1);
mPreviewLayout.addWidget(mpEditButton, 0);
mPreviewLayout.addStretch(1);
mLayout.addLayout(&mPreviewLayout);
connect(mpPageViewButton, SIGNAL(clicked()), this, SLOT(onPageView()));
connect(mpEditButton, SIGNAL(clicked()), this, SLOT(onEdit()));
}
UBTBDocumentPreviewWidget::~UBTBDocumentPreviewWidget()
{
DELETEPTR(mpPageViewButton);
DELETEPTR(mpEditButton);
}
void UBTBDocumentPreviewWidget::onEdit()
{
emit changeTBState(eTeacherBarState_DocumentEdit);
}
void UBTBDocumentPreviewWidget::onPageView()
{
emit changeTBState(eTeacherBarState_PagePreview);
}
void UBTBDocumentPreviewWidget::updateFields()
{
}
void UBTBDocumentPreviewWidget::clearFields()
{
}
#ifndef UBTBDOCUMENTPREVIEWWIDGET_H
#define UBTBDOCUMENTPREVIEWWIDGET_H
#include <QVBoxLayout>
#include <QPushButton>
#include "UBTeacherBarDataMgr.h"
class UBTBDocumentPreviewWidget : public QWidget
{
Q_OBJECT
public:
UBTBDocumentPreviewWidget(UBTeacherBarDataMgr* pDataMgr, QWidget* parent=0, const char* name="UBTBDocumentPreviewWidget");
~UBTBDocumentPreviewWidget();
void updateFields();
void clearFields();
signals:
void changeTBState(eTeacherBarState state);
private slots:
void onPageView();
void onEdit();
private:
QVBoxLayout mLayout;
QHBoxLayout mPageLayout;
QHBoxLayout mPreviewLayout;
QPushButton* mpPageViewButton;
QPushButton* mpEditButton;
UBTeacherBarDataMgr* mpDataMgr;
};
#endif // UBTBDOCUMENTPREVIEWWIDGET_H
This diff is collapsed.
#ifndef UBTBPAGEEDITWIDGET_H
#define UBTBPAGEEDITWIDGET_H
#include <QString>
#include <QTextEdit>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QComboBox>
#include <QLabel>
#include <QPushButton>
#include "core/UBPersistenceManager.h"
#include "customWidgets/UBWidgetList.h"
#include "interfaces/IDropable.h"
#include "UBTeacherBarDataMgr.h"
class UBTeacherStudentAction : public QWidget
{
Q_OBJECT
public:
UBTeacherStudentAction(QWidget* parent=0, const char* name="UBTeacherStudentAction");
~UBTeacherStudentAction();
QString text();
QString comboValue();
void setComboValue(int value);
void setText(const QString& text);
private:
QTextEdit* mpText;
QHBoxLayout* mpLayout;
QVBoxLayout* mpComboLayout;
QComboBox* mpCombo;
};
class UBUrlWidget : public QWidget
{
public:
UBUrlWidget(QWidget* parent=0, const char* name="UBUrlWidget");
~UBUrlWidget();
QString url();
void setUrl(const QString& url);
QString title(){return mpTitle->text();}
void setTitle(const QString& title){mpTitle->setText(title);}
private:
QVBoxLayout* mpLayout;
QHBoxLayout* mpLabelLayout;
QHBoxLayout* mpTitleLayout;
QLabel* mpUrlLabel;
QLineEdit* mpUrl;
QLabel* mpTitleLabel;
QLineEdit* mpTitle;
};
class UBTBMediaContainer : public UBWidgetList
, public IDropable
{
Q_OBJECT
public:
UBTBMediaContainer(QWidget* parent=0, const char* name="UBTBMediaContainer");
~UBTBMediaContainer();
QStringList mediaUrls();
QWidget* generateMediaWidget(const QString& url);
void cleanMedias();
signals:
void mediaDropped(const QString& url);
protected:
void dropEvent(QDropEvent* pEvent);
void dragEnterEvent(QDragEnterEvent* pEvent);
void dragMoveEvent(QDragMoveEvent* pEvent);
void dragLeaveEvent(QDragLeaveEvent* pEvent);
private:
void addMedia(const QString& mediaPath);
QStringList mMediaList;
};
class UBTBPageEditWidget : public QWidget
{
Q_OBJECT
public:
UBTBPageEditWidget(UBTeacherBarDataMgr* pDataMgr, QWidget* parent=0, const char* name="UBTBPageEditWidget");
~UBTBPageEditWidget();
void saveFields();
void updateFields();
void clearFields();
signals:
void valueChanged();
void changeTBState(eTeacherBarState state);
private slots:
void onTitleChanged();
void onCommentsChanged();
void onActionButton();
void onLinkButton();
void onMediaDropped(const QString& url);
void onDocumentEditClicked();
void onPagePreviewClicked();
private:
QVBoxLayout mLayout;
QHBoxLayout mTitleLayout;
QVBoxLayout mContainerLayout;
QHBoxLayout mActionLayout;
QHBoxLayout mLinkLayout;
QHBoxLayout mDocumentViewLayout;
QHBoxLayout mPagePreviewLayout;
UBTeacherBarDataMgr* mpDataMgr;
QLabel* mpTitleLabel;
QLineEdit* mpTitle;
QLabel* mpMediaLabel;
UBTBMediaContainer* mpMediaContainer;
QLabel* mpActionLabel;
UBWidgetList* mpActions;
QPushButton* mpActionButton;
QLabel* mpLinkLabel;
UBWidgetList* mpLinks;
QPushButton* mpLinkButton;
QLabel* mpCommentLabel;
QTextEdit* mpComments;
QPushButton* mpDocumentEditbutton;
QPushButton* mpPagePreviewButton;
QWidget* mpContainer;
QVector<UBTeacherStudentAction*> mActions;
QVector<UBUrlWidget*> mUrls;
QVector<QWidget*> mMedias;
QStringList mMediaUrls;
bool mClearingFields;
};
#endif // UBTBPAGEEDITWIDGET_H
#include "UBTeacherBarDataMgr.h"
#include "core/UBApplication.h"
#include "core/UBPersistenceManager.h"
#include "board/UBBoardController.h"
#include "customWidgets/UBGlobals.h"
#include "adaptors/UBMetadataDcSubsetAdaptor.h"
UBTeacherBarDataMgr::UBTeacherBarDataMgr()
{
}
UBTeacherBarDataMgr::~UBTeacherBarDataMgr()
{
}
void UBTeacherBarDataMgr::clearLists()
{
mActionList.clear();
mUrlList.clear();
mMediaList.clear();
mMediaUrls.clear();
}
void UBTeacherBarDataMgr::saveContent()
{
// Store the page information in the UBZ
sTeacherBarInfos infos;
// Page Title
infos.title = mPageTitle;
// Actions
foreach(sAction action, mActionList){
infos.actions << QString("%0;%1").arg(action.type).arg(action.content);
}
// Media
foreach(QString media, mMediaUrls){
infos.medias << media;
}
// Links
foreach(sLink link, mUrlList){
if("" != link.title && "" != link.link){
infos.urls << QString("%0;%1").arg(link.title).arg(link.link);
}
}
// Comments
infos.comments = mComments;
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument();
if(documentProxy){
UBPersistenceManager::persistenceManager()->persistTeacherBar(documentProxy, UBApplication::boardController->activeSceneIndex(), infos);
documentProxy->setSessionTitle(mSessionTitle);
documentProxy->setSessionTarget(mSessionTarget);
documentProxy->setSessionLicence(QString("%0").arg(mSessionLicence));
documentProxy->setSessionKeywords(mAuthors);
documentProxy->setSessionLevel(mLevel);
documentProxy->setSessionTopic(mTopic);
documentProxy->setSessionAuthor(mAuthors);
UBMetadataDcSubsetAdaptor::persist(documentProxy);
}
}
void UBTeacherBarDataMgr::loadContent(bool docChanged)
{
clearLists();
UBDocumentProxy* documentProxy = UBApplication::boardController->activeDocument();
sTeacherBarInfos nextInfos = UBPersistenceManager::persistenceManager()->getTeacherBarInfos(documentProxy, UBApplication::boardController->activeSceneIndex());
if(true/*docChanged*/){
mSessionTitle = documentProxy->sessionTitle();
mSessionTarget = documentProxy->sessionTarget();
mSessionLicence = (eLicense)documentProxy->sessionLicence().toInt();
mKeywords = documentProxy->sessionKeywords();
mLevel = documentProxy->sessionLevel();
mTopic = documentProxy->sessionTopic();
mAuthors = documentProxy->sessionAuthors();
}
// Page Title
mPageTitle = nextInfos.title;
// Actions
foreach(QString eachAction, nextInfos.actions){
QStringList qslAction = eachAction.split(";");
if(2 <= qslAction.size()){
sAction action;
action.type = qslAction.at(0).toInt();
action.content = qslAction.at(1);
mActionList << action;
}
}
// Media URL
if((nextInfos.medias.size() == 1) && (nextInfos.medias.at(0) == "")){
// Do not retrieve it
}
else{
mMediaUrls = nextInfos.medias;
}
// Links
foreach(QString eachUrl, nextInfos.urls){
QStringList qslUrl = eachUrl.split(';');
if(2 <= qslUrl.size()){
sLink link;
link.title = qslUrl.at(0);
link.link = qslUrl.at(1);
mUrlList << link;
}
}
// Comments
mComments = nextInfos.comments;
}
// ------------------------------------------------------------------------------------
UBTBSeparator::UBTBSeparator(QWidget *parent, const char *name):QFrame(parent)
{
setObjectName("UBTBSeparator");
setMinimumHeight(5);
setMaximumHeight(5);
}
UBTBSeparator::~UBTBSeparator()
{
}
// ------------------------------------------------------------------------------------
UBTBLicenseWidget::UBTBLicenseWidget(QWidget *parent, const char *name):QWidget(parent)
{
setObjectName(name);
setLayout(&mLayout);
mpIcon = new QLabel(this);
mpText = new QLabel(this);
mpText->setWordWrap(true);
mLayout.addWidget(mpIcon);
mLayout.addWidget(mpText);
}
UBTBLicenseWidget::~UBTBLicenseWidget()
{
DELETEPTR(mpIcon);
DELETEPTR(mpText);
}
void UBTBLicenseWidget::setLicense(eLicense lic)
{
switch(lic){
case eLicense_CCBY:
mpIcon->setPixmap(QPixmap(":images/licenses/ccby.png"));
mpText->setText(tr("Creative Common License %0").arg("CC BY"));
break;
case eLicense_CCBYND:
mpIcon->setPixmap(QPixmap(":images/licenses/ccbynd.png"));
mpText->setText(tr("Creative Common License %0").arg("CC BY-ND"));
break;
case eLicense_CCBYNCSA:
mpIcon->setPixmap(QPixmap(":images/licenses/ccbyncsa.png"));
mpText->setText(tr("Creative Common License %0").arg("CC BY-NC-SA"));
break;
case eLicense_CCBYSA:
mpIcon->setPixmap(QPixmap(":images/licenses/ccbysa.png"));
mpText->setText(tr("Creative Common License %0").arg("CC BY-SA"));
break;
case eLicense_CCBYNC:
mpIcon->setPixmap(QPixmap(":images/licenses/ccbync.png"));
mpText->setText(tr("Creative Common License %0").arg("CC BY-NC"));
break;
case eLicense_CCBYNCND:
mpIcon->setPixmap(QPixmap(":images/licenses/ccbyncnd.png"));
mpText->setText(tr("Creative Common License %0").arg("CC BY-NC-ND"));
break;
}
}
#ifndef UBTEACHERBARDATAMGR_H
#define UBTEACHERBARDATAMGR_H
#include <QString>
#include <QWidget>
#include <QTextEdit>
#include <QLineEdit>
#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QComboBox>
#include <QFrame>
typedef enum{
eTeacherBarState_DocumentEdit,
eTeacherBarState_DocumentPreview,
eTeacherBarState_PageEdit,
eTeacherBarState_PagePreview
}eTeacherBarState;
typedef enum{
eActionOwner_Teacher,
eActionOwner_Student
}eActionOwner;
typedef struct{
int type;
QString content;
}sAction;
typedef struct{
QString title;
QString link;
}sLink;
typedef enum{
eLicense_CCBY,
eLicense_CCBYND,
eLicense_CCBYNCSA,
eLicense_CCBYSA,
eLicense_CCBYNC,
eLicense_CCBYNCND
}eLicense;
class UBTBSeparator : public QFrame
{
public:
UBTBSeparator(QWidget* parent=0, const char* name="UBTBSeparator");
~UBTBSeparator();
};
class UBTBLicenseWidget : public QWidget
{
public:
UBTBLicenseWidget(QWidget* parent=0, const char* name="UBTBLicenseWidget");
~UBTBLicenseWidget();
void setLicense(eLicense lic);
private:
QHBoxLayout mLayout;
QLabel* mpIcon;
QLabel* mpText;
};
class UBTeacherBarDataMgr
{
public:
UBTeacherBarDataMgr();
~UBTeacherBarDataMgr();
// Session Title
void setSessionTitle(const QString& title){mSessionTitle = title;}
QString sessionTitle(){return mSessionTitle;}
// Session Target
void setSessionTarget(const QString& target){mSessionTarget = target;}
QString sessionTarget(){return mSessionTarget;}
// Licence
void setSessionLicence(eLicense licence){mSessionLicence = licence;}
eLicense sessionLicence(){return mSessionLicence;}
// Page Title
void setPageTitle(const QString& title){mPageTitle = title;}
QString pageTitle(){return mPageTitle;}
// Actions
QVector<sAction>* actions(){return &mActionList;}
// Medias
QVector<QWidget*>* medias(){return &mMediaList;}
void addMediaUrl(const QString& url){mMediaUrls << url;}
QStringList* mediaUrls(){return &mMediaUrls;}
// Urls
QVector<sLink>* urls(){return &mUrlList;}
// Comments
void setComments(const QString& c){mComments = c;}
QString comments(){return mComments;}
// Keywords
void setKeywords(const QString& kw){mKeywords = kw;}
QString keywords(){return mKeywords;}
// Level
void setLevel(const QString& level){mLevel = level;}
QString level(){return mLevel;}
// Topic
void setTopic(const QString& topic){mTopic = topic;}
QString topic(){return mTopic;}
// Authors
void setAuthors(const QString& authors){mAuthors = authors;}
QString authors(){return mAuthors;}
// Others
void clearLists();
void saveContent();
void loadContent(bool docChanged = false);
private:
QString mSessionTitle;
QString mSessionTarget;
eLicense mSessionLicence;
QString mPageTitle;
QString mComments;
QString mKeywords;
QString mLevel;
QString mTopic;
QString mAuthors;
QVector<sAction> mActionList;
QVector<sLink> mUrlList;
QVector<QWidget*> mMediaList;
QStringList mMediaUrls;
};
#endif // UBTEACHERBARDATAMGR_H
This diff is collapsed.
#ifndef UBTEACHERBARPREVIEWWIDGET_H
#define UBTEACHERBARPREVIEWWIDGET_H
#include <QLabel>
#include <QVBoxLayout>
#include <QPushButton>
#include "core/UBPersistenceManager.h"
#include "customWidgets/UBWidgetList.h"
#include "customWidgets/UBMediaWidget.h"
#include "customWidgets/UBDraggableMedia.h"
#include "customWidgets/UBDraggableLabel.h"
#include "UBTeacherBarDataMgr.h"
class UBTeacherBarPreviewMedia : public QWidget
{
Q_OBJECT
public:
UBTeacherBarPreviewMedia(QWidget* parent=0, const char* name="UBTeacherBarPreviewMedia");
~UBTeacherBarPreviewMedia();
// int loadMedia(QStringList pMedias);
void loadWidgets(QList<QWidget*> pWidgetList, bool isResizable = true);
void cleanMedia();
private:
UBWidgetList* mWidget;
QVBoxLayout mLayout;
QMap<QWidget*,QString>mWidgetList;
};
class UBActionPreview : public QWidget
{
public:
UBActionPreview(QWidget* parent=0, const char* name="UBActionPreview");
~UBActionPreview();
void setOwner(int owner);
void setContent(const QString& content);
private:
QLabel* mpOwner;
QTextEdit* mpContent;
QVBoxLayout mLayout;
QHBoxLayout mOwnerLayout;
};
class UBTBPreviewContainer : public UBWidgetList
{
public:
UBTBPreviewContainer(QWidget* parent=0, const char* name="UBTBPreviewContainer");
~UBTBPreviewContainer();
};
class UBTeacherBarPreviewWidget : public QWidget
{
Q_OBJECT
public:
UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataMgr, QWidget* parent=0, const char* name="UBTeacherBarPreviewWidget");
~UBTeacherBarPreviewWidget();
void updateFields();
void clearFields();
signals:
void showEditMode();
protected:
void showEvent(QShowEvent* ev);
private slots:
void onEdit();
void onActiveSceneChanged();
private:
void generateActions();
void generateMedias();
void generateLinks();
void generateComments();
QVBoxLayout mLayout;
QHBoxLayout mEditLayout;
QPushButton* mpEditButton;
// Titles
QVBoxLayout mTitleLayout;
UBTBSeparator mTitleSeparator;
QWidget mTitleContainer;
QLabel* mpSessionTitle;
QLabel* mpTitle;
QLabel* mpTitleLabel;
QLabel* mpPageNbrLabel;
UBTBPreviewContainer* mpContentContainer;
// Schedule
QLabel* mpScheduleLabel;
// License
UBTBSeparator mLicenseSeparator;
// TODO : replace the QLabel of the license by a widget done for that!
UBTBLicenseWidget* mpLicenseLabel;
/** Pointer to the datas */
UBTeacherBarDataMgr* mpDataMgr;
/** The list of stored widgets */
QList<QWidget*> mStoredWidgets;
/** A temporary action widget */
UBActionPreview* mpTmpAction;
/** A temporary media widget */
UBTeacherBarPreviewMedia* mpTmpMedia;
/** A temporary link */
QLabel* mpTmpLink;
/** A temporary comments field */
QTextEdit* mpTmpComment;
/** A temporary media object */
UBDraggableMedia* mTmpMedia;
/** A temporary label object */
UBDraggableLabel* mpTmpLabel;
};
#endif // UBTEACHERBARPREVIEWWIDGET_H
This diff is collapsed.
...@@ -7,38 +7,24 @@ ...@@ -7,38 +7,24 @@
#include <QLabel> #include <QLabel>
#include <QTextEdit> #include <QTextEdit>
#include <QLineEdit> #include <QLineEdit>
#include <QCheckBox>
#include <QTabWidget>
#include <QButtonGroup>
#include <QPushButton>
#include <QComboBox> #include <QComboBox>
#include <QStackedWidget>
#include "UBDockPaletteWidget.h" #include "UBDockPaletteWidget.h"
#include "customWidgets/UBWidgetList.h"
#include "interfaces/IDropable.h"
#include "UBTeacherBarDataMgr.h"
#include "UBTBDocumentPreviewWidget.h"
#include "UBTBPageEditWidget.h"
#include "UBTeacherBarPreviewWidget.h"
#include "UBTBDocumentEditWidget.h"
#define LABEL_MINWIDHT 80 #define LABEL_MINWIDHT 80
class UBTeacherStudentAction : public QWidget
{
Q_OBJECT
public:
UBTeacherStudentAction(int actionNumber, QWidget* parent=0, const char* name="UBTeacherStudentAction");
~UBTeacherStudentAction();
QString teacherText();
QString studentText();
void setTeacherText(QString text);
void setStudentText(QString text);
QTextEdit* teacher();
QTextEdit* student();
private:
int mActionNumber;
QLabel* mpActionLabel;
QLabel* mpTeacherLabel;
QLabel* mpStudentLabel;
QTextEdit* mpTeacher;
QTextEdit* mpStudent;
QVBoxLayout* mpLayout;
QHBoxLayout* mpTeacherLayout;
QHBoxLayout* mpStudentLayout;
};
class UBTeacherBarWidget : public UBDockPaletteWidget class UBTeacherBarWidget : public UBDockPaletteWidget
{ {
Q_OBJECT Q_OBJECT
...@@ -48,41 +34,34 @@ public: ...@@ -48,41 +34,34 @@ public:
bool visibleInMode(eUBDockPaletteWidgetMode mode) bool visibleInMode(eUBDockPaletteWidgetMode mode)
{ {
return mode == eUBDockPaletteWidget_BOARD; return (mode == eUBDockPaletteWidget_BOARD) || (mode == eUBDockPaletteWidget_DESKTOP);
} }
void loadContent(bool docChanged = false);
public slots: public slots:
void saveContent(); void saveContent();
void loadContent();
private slots: private slots:
void loadContentInfos();
void onValueChanged(); void onValueChanged();
void onTitleTextChanged(const QString& text); void onShowEditMode();
void onEquipmentTextChanged(const QString& text); void onTBStateChanged(eTeacherBarState state);
void onActiveDocumentChanged();
private: private:
void populateCombos(); bool isEmpty();
QVBoxLayout mLayout;
QStackedWidget* mpStackWidget;
eTeacherBarState mState;
UBTBPageEditWidget* mpPageEditWidget;
UBTeacherBarPreviewWidget* mpPreview;
UBTBDocumentPreviewWidget* mpDocPreviewWidget;
UBTBDocumentEditWidget* mpDocEditWidget;
QVBoxLayout* mpLayout; UBTeacherBarDataMgr mData;
QHBoxLayout* mpTitleLayout;
QHBoxLayout* mpPhasisLayout;
QHBoxLayout* mpDurationLayout;
QHBoxLayout* mpEquipmentLayout;
QHBoxLayout* mpActivityLayout;
QLabel* mpTitleLabel;
QLabel* mpPhasisLabel;
QLabel* mpDurationLabel;
QLabel* mpEquipmentLabel;
QLabel* mpActivityLabel;
QLineEdit* mpTitle;
QLineEdit* mpEquipment;
QComboBox* mpPhasis;
QComboBox* mpDuration;
QComboBox* mpActivity;
UBTeacherStudentAction* mpAction1;
UBTeacherStudentAction* mpAction2;
UBTeacherStudentAction* mpAction3;
QWidget* mpContainer;
QVBoxLayout* mpContainerLayout;
}; };
#endif // UBTEACHERBARWIDGET_H #endif // UBTEACHERBARWIDGET_H
...@@ -35,6 +35,11 @@ class UBVideoPlayer : public QWidget ...@@ -35,6 +35,11 @@ class UBVideoPlayer : public QWidget
return mVideoPlayer; return mVideoPlayer;
} }
void loadMedia(QUrl url)
{
mVideoPlayer->load(Phonon::MediaSource(url));
}
protected: protected:
Phonon::VideoPlayer* mVideoPlayer; Phonon::VideoPlayer* mVideoPlayer;
......
...@@ -26,27 +26,33 @@ HEADERS += src/gui/UBThumbnailView.h \ ...@@ -26,27 +26,33 @@ HEADERS += src/gui/UBThumbnailView.h \
src/gui/UBActionPalette.h \ src/gui/UBActionPalette.h \
src/gui/UBFavoriteToolPalette.h \ src/gui/UBFavoriteToolPalette.h \
src/gui/UBKeyboardPalette.h \ src/gui/UBKeyboardPalette.h \
src/gui/UBNavigatorPalette.h \ src/gui/UBNavigatorPalette.h \
src/gui/UBDocumentNavigator.h \ src/gui/UBDocumentNavigator.h \
src/gui/UBDockPalette.h \ src/gui/UBDockPalette.h \
src/gui/UBPropertyPalette.h \ src/gui/UBPropertyPalette.h \
src/gui/UBLibNavigatorWidget.h \ src/gui/UBLibNavigatorWidget.h \
src/gui/UBLibItemProperties.h \ src/gui/UBLibItemProperties.h \
src/gui/UBLibActionBar.h \ src/gui/UBLibActionBar.h \
src/gui/UBLibraryWidget.h \ src/gui/UBLibraryWidget.h \
src/gui/UBLibPathViewer.h \ src/gui/UBLibPathViewer.h \
src/gui/UBUpdateDlg.h \ src/gui/UBUpdateDlg.h \
src/gui/UBDockPaletteWidget.h \ src/gui/UBDockPaletteWidget.h \
src/gui/UBLeftPalette.h \ src/gui/UBLeftPalette.h \
src/gui/UBRightPalette.h \ src/gui/UBRightPalette.h \
src/gui/UBPageNavigationWidget.h \ src/gui/UBPageNavigationWidget.h \
src/gui/UBLibWidget.h \ src/gui/UBLibWidget.h \
src/gui/UBMagnifer.h \ src/gui/UBMagnifer.h \
src/gui/UBCachePropertiesWidget.h \ src/gui/UBCachePropertiesWidget.h \
src/gui/UBTeacherBarWidget.h \ src/gui/UBTeacherBarWidget.h \
src/gui/UBLibWebView.h \ src/gui/UBLibWebView.h \
src/gui/UBDownloadWidget.h \ src/gui/UBDownloadWidget.h \
src/gui/UBDockDownloadWidget.h src/gui/UBDockDownloadWidget.h \
src/gui/UBMediaPlayer.h \
src/gui/UBTeacherBarDataMgr.h \
src/gui/UBTBDocumentEditWidget.h \
src/gui/UBTBDocumentPreviewWidget.h \
src/gui/UBTeacherBarPreviewWidget.h \
src/gui/UBTBPageEditWidget.h
SOURCES += src/gui/UBThumbnailView.cpp \ SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBFloatingPalette.cpp \ src/gui/UBFloatingPalette.cpp \
...@@ -75,27 +81,33 @@ SOURCES += src/gui/UBThumbnailView.cpp \ ...@@ -75,27 +81,33 @@ SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBActionPalette.cpp \ src/gui/UBActionPalette.cpp \
src/gui/UBFavoriteToolPalette.cpp \ src/gui/UBFavoriteToolPalette.cpp \
src/gui/UBKeyboardPalette.cpp \ src/gui/UBKeyboardPalette.cpp \
src/gui/UBNavigatorPalette.cpp \ src/gui/UBNavigatorPalette.cpp \
src/gui/UBDocumentNavigator.cpp \ src/gui/UBDocumentNavigator.cpp \
src/gui/UBDockPalette.cpp \ src/gui/UBDockPalette.cpp \
src/gui/UBPropertyPalette.cpp \ src/gui/UBPropertyPalette.cpp \
src/gui/UBLibNavigatorWidget.cpp \ src/gui/UBLibNavigatorWidget.cpp \
src/gui/UBLibItemProperties.cpp \ src/gui/UBLibItemProperties.cpp \
src/gui/UBLibActionBar.cpp \ src/gui/UBLibActionBar.cpp \
src/gui/UBLibraryWidget.cpp \ src/gui/UBLibraryWidget.cpp \
src/gui/UBLibPathViewer.cpp \ src/gui/UBLibPathViewer.cpp \
src/gui/UBUpdateDlg.cpp \ src/gui/UBUpdateDlg.cpp \
src/gui/UBDockPaletteWidget.cpp \ src/gui/UBDockPaletteWidget.cpp \
src/gui/UBLeftPalette.cpp \ src/gui/UBLeftPalette.cpp \
src/gui/UBRightPalette.cpp \ src/gui/UBRightPalette.cpp \
src/gui/UBPageNavigationWidget.cpp \ src/gui/UBPageNavigationWidget.cpp \
src/gui/UBLibWidget.cpp \ src/gui/UBLibWidget.cpp \
src/gui/UBMagnifer.cpp \ src/gui/UBMagnifer.cpp \
src/gui/UBCachePropertiesWidget.cpp \ src/gui/UBCachePropertiesWidget.cpp \
src/gui/UBTeacherBarWidget.cpp \ src/gui/UBTeacherBarWidget.cpp \
src/gui/UBLibWebView.cpp \ src/gui/UBLibWebView.cpp \
src/gui/UBDownloadWidget.cpp \ src/gui/UBDownloadWidget.cpp \
src/gui/UBDockDownloadWidget.cpp src/gui/UBDockDownloadWidget.cpp \
src/gui/UBMediaPlayer.cpp \
src/gui/UBTeacherBarDataMgr.cpp \
src/gui/UBTBDocumentEditWidget.cpp \
src/gui/UBTBDocumentPreviewWidget.cpp \
src/gui/UBTeacherBarPreviewWidget.cpp \
src/gui/UBTBPageEditWidget.cpp
win32 { win32 {
......
#ifndef IDROPABLE_H
#define IDROPABLE_H
#include <QDropEvent>
#include <QDragEnterEvent>
#include <QDragLeaveEvent>
#include <QDragMoveEvent>
class IDropable
{
public:
virtual ~IDropable(){}
protected:
virtual void dropEvent(QDropEvent* pEvent) = 0;
virtual void dragEnterEvent(QDragEnterEvent* pEvent) = 0;
virtual void dragMoveEvent(QDragMoveEvent* pEvent) = 0;
virtual void dragLeaveEvent(QDragLeaveEvent* pEvent) = 0;
};
#endif // IDROPABLE_H
#ifndef IRESIZEABLE_H
#define IRESIZEABLE_H
#include <QResizeEvent>
class IResizeable
{
public:
~IResizeable();
protected:
virtual void resizeEvent(QResizeEvent* pEvent) = 0;
};
#endif // IRESIZEABLE_H
HEADERS += src/interfaces/IDropable.h \
src/interfaces/IDropable.h \
src/interfaces/IResizeable.h
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "core/UBSetting.h" #include "core/UBSetting.h"
#include "gui/UBMainWindow.h" #include "gui/UBMainWindow.h"
#include "gui/UBVideoPlayer.h" //#include "gui/UBVideoPlayer.h"
#include "network/UBNetworkAccessManager.h" #include "network/UBNetworkAccessManager.h"
#include "network/UBServerXMLHttpRequest.h" #include "network/UBServerXMLHttpRequest.h"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "frameworks/UBPlatformUtils.h" #include "frameworks/UBPlatformUtils.h"
#include "UBWebController.h" #include "UBWebController.h"
#include "UBOEmbedParser.h"
#include "UBTrapFlashController.h" #include "UBTrapFlashController.h"
#include "web/browser/WBBrowserWindow.h" #include "web/browser/WBBrowserWindow.h"
...@@ -79,6 +80,7 @@ UBWebController::UBWebController(UBMainWindow* mainWindow) ...@@ -79,6 +80,7 @@ UBWebController::UBWebController(UBMainWindow* mainWindow)
} }
UBWebController::~UBWebController() UBWebController::~UBWebController()
{ {
// NOOP // NOOP
...@@ -95,6 +97,7 @@ void UBWebController::initialiazemOEmbedProviders() ...@@ -95,6 +97,7 @@ void UBWebController::initialiazemOEmbedProviders()
mOEmbedProviders << "metacafe.com"; mOEmbedProviders << "metacafe.com";
mOEmbedProviders << "qik.com"; mOEmbedProviders << "qik.com";
mOEmbedProviders << "slideshare"; mOEmbedProviders << "slideshare";
mOEmbedProviders << "5min.com";
mOEmbedProviders << "twitpic.com"; mOEmbedProviders << "twitpic.com";
mOEmbedProviders << "viddler.com"; mOEmbedProviders << "viddler.com";
mOEmbedProviders << "vimeo.com"; mOEmbedProviders << "vimeo.com";
...@@ -323,8 +326,6 @@ void UBWebController::activePageChanged() ...@@ -323,8 +326,6 @@ void UBWebController::activePageChanged()
mTrapFlashController->updateTrapFlashFromPage((*mCurrentWebBrowser)->currentTabWebView()->page()->currentFrame()); mTrapFlashController->updateTrapFlashFromPage((*mCurrentWebBrowser)->currentTabWebView()->page()->currentFrame());
} }
mMainWindow->actionWebTrap->setChecked(false); mMainWindow->actionWebTrap->setChecked(false);
QUrl latestUrl = (*mCurrentWebBrowser)->currentTabWebView()->url(); QUrl latestUrl = (*mCurrentWebBrowser)->currentTabWebView()->url();
...@@ -333,7 +334,6 @@ void UBWebController::activePageChanged() ...@@ -333,7 +334,6 @@ void UBWebController::activePageChanged()
//UBApplication::mainWindow->actionWebOEmbed->setEnabled(hasEmbeddedContent()); //UBApplication::mainWindow->actionWebOEmbed->setEnabled(hasEmbeddedContent());
// And remove this line once the previous one is uncommented // And remove this line once the previous one is uncommented
UBApplication::mainWindow->actionWebOEmbed->setEnabled(isOEmbedable(latestUrl)); UBApplication::mainWindow->actionWebOEmbed->setEnabled(isOEmbedable(latestUrl));
UBApplication::mainWindow->actionEduMedia->setEnabled(isEduMedia(latestUrl)); UBApplication::mainWindow->actionEduMedia->setEnabled(isEduMedia(latestUrl));
emit activeWebPageChanged((*mCurrentWebBrowser)->currentTabWebView()); emit activeWebPageChanged((*mCurrentWebBrowser)->currentTabWebView());
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <QtGui> #include <QtGui>
#include <QtWebKit> #include <QtWebKit>
#include "web/UBOEmbedParser.h" #include "UBOEmbedParser.h"
class WBBrowserWindow; class WBBrowserWindow;
class UBApplication; class UBApplication;
...@@ -30,6 +30,7 @@ class UBWebToolsPalette; ...@@ -30,6 +30,7 @@ class UBWebToolsPalette;
class WBWebView; class WBWebView;
class UBServerXMLHttpRequest; class UBServerXMLHttpRequest;
class UBWebController : public QObject class UBWebController : public QObject
{ {
Q_OBJECT; Q_OBJECT;
...@@ -104,27 +105,35 @@ class UBWebController : public QObject ...@@ -104,27 +105,35 @@ class UBWebController : public QObject
void lookForEmbedContent(QString* pHtml, QString tag, QString attribute, QList<QUrl>* pList); void lookForEmbedContent(QString* pHtml, QString tag, QString attribute, QList<QUrl>* pList);
void checkForOEmbed(QString* pHtml); void checkForOEmbed(QString* pHtml);
QStackedWidget mStackedWidget[TotalNumberOfWebInstances]; QStackedWidget mStackedWidget[TotalNumberOfWebInstances];
UBMainWindow *mMainWindow; UBMainWindow *mMainWindow;
WBBrowserWindow* mWebBrowserList[TotalNumberOfWebInstances]; WBBrowserWindow* mWebBrowserList[TotalNumberOfWebInstances];
WBBrowserWindow** mCurrentWebBrowser; WBBrowserWindow** mCurrentWebBrowser;
QWidget* mBrowserWidget; QWidget* mBrowserWidget;
UBTrapFlashController* mTrapFlashController; UBTrapFlashController* mTrapFlashController;
UBWebToolsPalette** mToolsCurrentPalette; UBWebToolsPalette** mToolsCurrentPalette;
UBWebToolsPalette* mToolsPaletteList[TotalNumberOfWebInstances]; UBWebToolsPalette* mToolsPaletteList[TotalNumberOfWebInstances];
// UBKeyboardPalette** mKeyboardCurrentPalette; // UBKeyboardPalette** mKeyboardCurrentPalette;
// UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances]; // UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances];
bool mToolsPalettePositionned; bool mToolsPalettePositionned;
bool mToolsPalettePositionnedList[TotalNumberOfWebInstances]; bool mToolsPalettePositionnedList[TotalNumberOfWebInstances];
bool mDownloadViewIsVisible; bool mDownloadViewIsVisible;
QStringList mOEmbedProviders; QStringList mOEmbedProviders;
UBOEmbedParser mOEmbedParser; UBOEmbedParser mOEmbedParser;
private slots: private slots:
void activePageChanged(); void activePageChanged();
void trapFlash(); void trapFlash();
void toggleWebTrap(bool checked); void toggleWebTrap(bool checked);
void onOEmbedParsed(QVector<sOEmbedContent> contents); void onOEmbedParsed(QVector<sOEmbedContent> contents);
...@@ -137,6 +146,7 @@ class UBWebController : public QObject ...@@ -137,6 +146,7 @@ class UBWebController : public QObject
* @param pCapturedPixmap QPixmap corresponding to the capture. * @param pCapturedPixmap QPixmap corresponding to the capture.
*/ */
void imageCaptured(const QPixmap& pCapturedPixmap, bool pageMode, const QUrl& source); void imageCaptured(const QPixmap& pCapturedPixmap, bool pageMode, const QUrl& source);
void activeWebPageChanged(WBWebView* pWebView); void activeWebPageChanged(WBWebView* pWebView);
}; };
......
This diff is collapsed.
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