Commit 82bc6590 authored by Anna Udovichenko's avatar Anna Udovichenko

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

Conflicts:
	src/board/UBFeaturesController.cpp
	src/gui/UBFeaturesWidget.cpp
parents ffc9b5c3 214e0711
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "core/UBDocumentManager.h" #include "core/UBDocumentManager.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/memcheck.h"
UBExportCFF::UBExportCFF(QObject *parent) UBExportCFF::UBExportCFF(QObject *parent)
......
...@@ -58,10 +58,10 @@ ...@@ -58,10 +58,10 @@
#include "UBBoardController.h" #include "UBBoardController.h"
#include "core/memcheck.h"
#include "document/UBDocumentController.h" #include "document/UBDocumentController.h"
#include "core/memcheck.h"
UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardController* pBoardController) UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardController* pBoardController)
: QObject(container) : QObject(container)
, mKeyboardPalette(0) , mKeyboardPalette(0)
...@@ -81,7 +81,9 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll ...@@ -81,7 +81,9 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
, mPendingPanButtonPressed(false) , mPendingPanButtonPressed(false)
, mPendingEraseButtonPressed(false) , mPendingEraseButtonPressed(false)
, mpPageNavigWidget(NULL) , mpPageNavigWidget(NULL)
#ifdef USE_WEB_WIDGET
, mpLibWidget(NULL) , mpLibWidget(NULL)
#endif
, mpCachePropWidget(NULL) , mpCachePropWidget(NULL)
, mpDownloadWidget(NULL) , mpDownloadWidget(NULL)
, mpDesktopLibWidget(NULL) , mpDesktopLibWidget(NULL)
...@@ -132,7 +134,9 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() ...@@ -132,7 +134,9 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mpPageNavigWidget = new UBPageNavigationWidget(); mpPageNavigWidget = new UBPageNavigationWidget();
#ifdef USE_WEB_WIDGET
mpLibWidget = new UBLibWidget(); mpLibWidget = new UBLibWidget();
#endif
mpCachePropWidget = new UBCachePropertiesWidget(); mpCachePropWidget = new UBCachePropertiesWidget();
...@@ -159,8 +163,11 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() ...@@ -159,8 +163,11 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mRightPalette->addTab(mpFeaturesWidget); mRightPalette->addTab(mpFeaturesWidget);
//Do not show deprecated lib widget to prevent collisions. Uncomment to return lib widget //Do not show deprecated lib widget to prevent collisions. Uncomment to return lib widget
// mRightPalette->registerWidget(mpLibWidget);
// mRightPalette->addTab(mpLibWidget); #ifdef USE_WEB_WIDGET
mRightPalette->registerWidget(mpLibWidget);
mRightPalette->addTab(mpLibWidget);
#endif
// 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
...@@ -841,10 +848,10 @@ void UBBoardPaletteManager::addItemToLibrary() ...@@ -841,10 +848,10 @@ void UBBoardPaletteManager::addItemToLibrary()
} }
QImage image = mPixmap.toImage(); QImage image = mPixmap.toImage();
if(NULL != mpLibWidget) #ifdef USE_WEB_WIDGET
{ mpLibWidget->libNavigator()->libraryWidget()->libraryController()->importImageOnLibrary(image);
mpLibWidget->libNavigator()->libraryWidget()->libraryController()->importImageOnLibrary(image); #endif
}
} }
else else
{ {
......
...@@ -43,6 +43,10 @@ class UBMainWindow; ...@@ -43,6 +43,10 @@ class UBMainWindow;
class UBApplicationController; class UBApplicationController;
class UBDockTeacherGuideWidget; class UBDockTeacherGuideWidget;
// Uncomment this to use old-styles lib paletter
// #define USE_WEB_WIDGET
class UBBoardPaletteManager : public QObject class UBBoardPaletteManager : public QObject
{ {
Q_OBJECT Q_OBJECT
...@@ -125,8 +129,12 @@ class UBBoardPaletteManager : public QObject ...@@ -125,8 +129,12 @@ class UBBoardPaletteManager : public QObject
/** The page navigator widget */ /** The page navigator widget */
UBPageNavigationWidget* mpPageNavigWidget; UBPageNavigationWidget* mpPageNavigWidget;
#ifdef USE_WEB_WIDGET
/** The library widget */ /** The library widget */
UBLibWidget* mpLibWidget; UBLibWidget* mpLibWidget;
#endif
/** The cache properties widget */ /** The cache properties widget */
UBCachePropertiesWidget* mpCachePropWidget; UBCachePropertiesWidget* mpCachePropWidget;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include <QMetaType> #include <QMetaType>
#include <QObject> #include <QObject>
#include <QWidget> #include <QWidget>
#include <QSet>
#include <QVector> #include <QVector>
#include <QString> #include <QString>
#include <QPixmap> #include <QPixmap>
...@@ -58,7 +59,7 @@ public: ...@@ -58,7 +59,7 @@ public:
UBFeaturesController(QWidget *parentWidget); UBFeaturesController(QWidget *parentWidget);
virtual ~UBFeaturesController(); virtual ~UBFeaturesController();
QList <UBFeature>* getFeatures()const { return featuresList; } const QList <UBFeature>& getFeatures()const { return featuresList; }
const QString& getRootPath()const { return rootPath; } const QString& getRootPath()const { return rootPath; }
...@@ -88,7 +89,7 @@ private: ...@@ -88,7 +89,7 @@ private:
static UBFeatureElementType fileTypeFromUrl( const QString &path ); static UBFeatureElementType fileTypeFromUrl( const QString &path );
QList <UBFeature> *featuresList; QList <UBFeature> featuresList;
UBFeature *rootElement; UBFeature *rootElement;
QString mUserAudioDirectoryPath; QString mUserAudioDirectoryPath;
...@@ -131,7 +132,7 @@ private: ...@@ -131,7 +132,7 @@ private:
UBFeature shapesElement; UBFeature shapesElement;
UBFeature searchElement; UBFeature searchElement;
QSet <QString> *favoriteSet; QSet <QString> favoriteSet;
}; };
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include "UBActionableWidget.h" #include "UBActionableWidget.h"
#include "core/memcheck.h"
UBActionableWidget::UBActionableWidget(QWidget *parent, const char *name):QWidget(parent) UBActionableWidget::UBActionableWidget(QWidget *parent, const char *name):QWidget(parent)
, mShowActions(false) , mShowActions(false)
{ {
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "globals/UBGlobals.h" #include "globals/UBGlobals.h"
#include "UBMediaWidget.h" #include "UBMediaWidget.h"
#include "core/memcheck.h"
/** /**
* \brief Constructor * \brief Constructor
* @param type as the media type * @param type as the media type
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include "UBAbstractUndoCommand.h" #include "UBAbstractUndoCommand.h"
#include "core/memcheck.h"
UBAbstractUndoCommand::UBAbstractUndoCommand() UBAbstractUndoCommand::UBAbstractUndoCommand()
{ {
// NOOP // NOOP
......
#include "UBAngleWidget.h" #include "UBAngleWidget.h"
#include <QPainter> #include <QPainter>
#include "core/memcheck.h"
UBAngleWidget::UBAngleWidget(QWidget *parent) UBAngleWidget::UBAngleWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
......
This diff is collapsed.
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
#include "UBGraphicsWidgetItem.h" #include "UBGraphicsWidgetItem.h"
#include "domain/UBAbstractWidget.h" #include "domain/UBAbstractWidget.h"
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsVideoItem.h"
#include "web/UBWebController.h" #include "web/UBWebController.h"
...@@ -93,6 +96,8 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec ...@@ -93,6 +96,8 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec
void UBGraphicsItemDelegate::init() void UBGraphicsItemDelegate::init()
{ {
mToolBarItem = new UBGraphicsToolBarItem(delegated());
mFrame = new UBGraphicsDelegateFrame(this, QRectF(0, 0, 0, 0), mFrameWidth, mRespectRatio); mFrame = new UBGraphicsDelegateFrame(this, QRectF(0, 0, 0, 0), mFrameWidth, mRespectRatio);
mFrame->hide(); mFrame->hide();
mFrame->setFlag(QGraphicsItem::ItemIsSelectable, true); mFrame->setFlag(QGraphicsItem::ItemIsSelectable, true);
...@@ -123,10 +128,13 @@ void UBGraphicsItemDelegate::init() ...@@ -123,10 +128,13 @@ void UBGraphicsItemDelegate::init()
foreach(DelegateButton* button, mButtons) foreach(DelegateButton* button, mButtons)
{ {
if (button->getSection() != Qt::TitleBarArea)
{
button->hide(); button->hide();
button->setFlag(QGraphicsItem::ItemIsSelectable, true); button->setFlag(QGraphicsItem::ItemIsSelectable, true);
} }
} }
}
UBGraphicsItemDelegate::~UBGraphicsItemDelegate() UBGraphicsItemDelegate::~UBGraphicsItemDelegate()
...@@ -292,13 +300,20 @@ void UBGraphicsItemDelegate::positionHandles() ...@@ -292,13 +300,20 @@ void UBGraphicsItemDelegate::positionHandles()
updateButtons(true); updateButtons(true);
if (mToolBarItem->isVisibleOnBoard())
{
updateToolBar();
mToolBarItem->show();
}
} else { } else {
foreach(DelegateButton* button, mButtons) foreach(DelegateButton* button, mButtons)
button->hide(); button->hide();
mFrame->hide(); mFrame->hide();
mToolBarItem->hide();
} }
} }
void UBGraphicsItemDelegate::setZOrderButtonsVisible(bool visible) void UBGraphicsItemDelegate::setZOrderButtonsVisible(bool visible)
{ {
if (visible) { if (visible) {
...@@ -335,6 +350,7 @@ void UBGraphicsItemDelegate::remove(bool canUndo) ...@@ -335,6 +350,7 @@ void UBGraphicsItemDelegate::remove(bool canUndo)
scene->removeItem(mFrame); scene->removeItem(mFrame);
scene->removeItem(mDelegated); scene->removeItem(mDelegated);
scene->removeItem(mToolBarItem);
if (canUndo) if (canUndo)
{ {
...@@ -577,14 +593,16 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated) ...@@ -577,14 +593,16 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
int i = 1, j = 0, k = 0; int i = 1, j = 0, k = 0;
while ((i + j + k) < mButtons.size()) { while ((i + j + k) < mButtons.size()) {
DelegateButton* button = mButtons[i + j]; DelegateButton* button = mButtons[i + j];
button->setParentItem(mFrame);
button->setTransform(tr);
if (button->getSection() == Qt::TopLeftSection) { if (button->getSection() == Qt::TopLeftSection) {
button->setParentItem(mFrame);
button->setPos(topX + (i++ * 1.6 * mFrameWidth * mAntiScaleRatio), topY); button->setPos(topX + (i++ * 1.6 * mFrameWidth * mAntiScaleRatio), topY);
button->setTransform(tr);
} else if (button->getSection() == Qt::BottomLeftSection) { } else if (button->getSection() == Qt::BottomLeftSection) {
button->setParentItem(mFrame);
button->setPos(bottomX + (++j * 1.6 * mFrameWidth * mAntiScaleRatio), bottomY); button->setPos(bottomX + (++j * 1.6 * mFrameWidth * mAntiScaleRatio), bottomY);
} else if (button->getSection() == Qt::NoSection) { button->setTransform(tr);
} else if (button->getSection() == Qt::TitleBarArea || button->getSection() == Qt::NoSection){
++k; ++k;
} }
if (!button->scene()) if (!button->scene())
...@@ -599,9 +617,65 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated) ...@@ -599,9 +617,65 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
} }
} }
void UBGraphicsItemDelegate::updateToolBar()
{
QTransform transformForToolbarButtons;
transformForToolbarButtons.scale(mAntiScaleRatio, 1);
QRectF toolBarRect = mToolBarItem->rect();
toolBarRect.setWidth(delegated()->boundingRect().width() - 10);
mToolBarItem->setRect(toolBarRect);
if (mToolBarItem->isShifting())
mToolBarItem->setPos(delegated()->boundingRect().bottomLeft() + QPointF(5 * mAntiScaleRatio, 0));
else mToolBarItem->setPos(delegated()->boundingRect().bottomLeft() - QPointF(-5 * mAntiScaleRatio, mToolBarItem->rect().height() * 1.1 * mAntiScaleRatio));
int offsetOnToolBar = 5 * mAntiScaleRatio;
QList<QGraphicsItem*> itemList = mToolBarItem->itemsOnToolBar();
foreach (QGraphicsItem* item, itemList)
{
item->setPos(offsetOnToolBar, 0);
offsetOnToolBar += (item->boundingRect().width() + 5) * mAntiScaleRatio;
item->setTransform(transformForToolbarButtons);
item->show();
}
mToolBarItem->setOffsetOnToolBar(offsetOnToolBar);
QTransform tr;
tr.scale(1, mAntiScaleRatio);
mToolBarItem->setTransform(tr);
}
void UBGraphicsItemDelegate::setButtonsVisible(bool visible) void UBGraphicsItemDelegate::setButtonsVisible(bool visible)
{ {
foreach(DelegateButton* pButton, mButtons){ foreach(DelegateButton* pButton, mButtons){
pButton->setVisible(visible); pButton->setVisible(visible);
} }
} }
UBGraphicsToolBarItem::UBGraphicsToolBarItem(QGraphicsItem * parent) :
QGraphicsRectItem(parent),
mShifting(true),
mVisible(false),
mMinWidth(200)
{
QRectF rect = this->rect();
rect.setHeight(26);
this->setRect(rect);
setBrush(QColor(UBSettings::paletteColor));
setPen(Qt::NoPen);
hide();
}
void UBGraphicsToolBarItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option);
Q_UNUSED(widget);
QPainterPath path;
path.addRoundedRect(rect(), 10, 10);
painter->fillPath(path, brush());
}
\ No newline at end of file
...@@ -84,6 +84,31 @@ class DelegateButton: public QGraphicsSvgItem ...@@ -84,6 +84,31 @@ class DelegateButton: public QGraphicsSvgItem
}; };
class UBGraphicsToolBarItem : public QGraphicsRectItem, public QObject
{
public:
UBGraphicsToolBarItem(QGraphicsItem * parent = 0);
virtual ~UBGraphicsToolBarItem() {};
bool isVisibleOnBoard() const { return mVisible; }
void setVisibleOnBoard(bool visible) { mVisible = visible; }
bool isShifting() const { return mShifting; }
void setShifting(bool shifting) { mShifting = shifting; }
int offsetOnToolBar() const { return mOffsetOnToolBar; }
void setOffsetOnToolBar(int pOffset) { mOffsetOnToolBar = pOffset; }
QList<QGraphicsItem*> itemsOnToolBar() const { return mItemsOnToolBar; }
void setItemsOnToolBar(QList<QGraphicsItem*> itemsOnToolBar) { mItemsOnToolBar = itemsOnToolBar;}
int minWidth() { return mMinWidth; }
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
private:
bool mShifting;
bool mVisible;
int mOffsetOnToolBar;
int mMinWidth;
QList<QGraphicsItem*> mItemsOnToolBar;
};
class UBGraphicsItemDelegate : public QObject class UBGraphicsItemDelegate : public QObject
{ {
...@@ -138,6 +163,10 @@ class UBGraphicsItemDelegate : public QObject ...@@ -138,6 +163,10 @@ class UBGraphicsItemDelegate : public QObject
void setButtonsVisible(bool visible); void setButtonsVisible(bool visible);
UBGraphicsToolBarItem* getToolBarItem() const { return mToolBarItem; }
qreal antiScaleRatio() const { return mAntiScaleRatio; }
signals: signals:
void showOnDisplayChanged(bool shown); void showOnDisplayChanged(bool shown);
void lockChanged(bool locked); void lockChanged(bool locked);
...@@ -183,12 +212,17 @@ class UBGraphicsItemDelegate : public QObject ...@@ -183,12 +212,17 @@ class UBGraphicsItemDelegate : public QObject
QList<DelegateButton*> mButtons; QList<DelegateButton*> mButtons;
UBGraphicsToolBarItem* mToolBarItem;
protected slots: protected slots:
virtual void gotoContentSource(bool checked); virtual void gotoContentSource(bool checked);
private: private:
void updateFrame(); void updateFrame();
void updateButtons(bool showUpdated = false); void updateButtons(bool showUpdated = false);
void updateToolBar();
QPointF mOffset; QPointF mOffset;
QTransform mPreviousTransform; QTransform mPreviousTransform;
......
...@@ -19,12 +19,12 @@ ...@@ -19,12 +19,12 @@
#include "UBGraphicsScene.h" #include "UBGraphicsScene.h"
#include "core/memcheck.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "core/memcheck.h"
UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, const QSet<QGraphicsItem*>& pRemovedItems, UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, const QSet<QGraphicsItem*>& pRemovedItems,
const QSet<QGraphicsItem*>& pAddedItems) const QSet<QGraphicsItem*>& pAddedItems)
: mScene(pScene) : mScene(pScene)
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "core/memcheck.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
bool UBGraphicsMediaItem::sIsMutedByDefault = false; bool UBGraphicsMediaItem::sIsMutedByDefault = false;
UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent) UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsItem *parent)
......
#include "UBGraphicsStrokesGroup.h" #include "UBGraphicsStrokesGroup.h"
#include "core/memcheck.h"
UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent):QGraphicsItemGroup(parent) UBGraphicsStrokesGroup::UBGraphicsStrokesGroup(QGraphicsItem *parent):QGraphicsItemGroup(parent)
{ {
mDelegate = new UBGraphicsItemDelegate(this, 0, true, true); mDelegate = new UBGraphicsItemDelegate(this, 0, true, true);
......
...@@ -24,9 +24,10 @@ ...@@ -24,9 +24,10 @@
#include "domain/UBGraphicsDelegateFrame.h" #include "domain/UBGraphicsDelegateFrame.h"
#include "core/UBSettings.h" #include "core/UBSettings.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "core/memcheck.h"
const int UBGraphicsTextItemDelegate::sMinPixelSize = 8; const int UBGraphicsTextItemDelegate::sMinPixelSize = 8;
const int UBGraphicsTextItemDelegate::sMinPointSize = 8; const int UBGraphicsTextItemDelegate::sMinPointSize = 8;
...@@ -94,17 +95,21 @@ void UBGraphicsTextItemDelegate::buildButtons() ...@@ -94,17 +95,21 @@ void UBGraphicsTextItemDelegate::buildButtons()
{ {
UBGraphicsItemDelegate::buildButtons(); UBGraphicsItemDelegate::buildButtons();
mFontButton = new DelegateButton(":/images/font.svg", mDelegated, mFrame, Qt::TopLeftSection); mFontButton = new DelegateButton(":/images/font.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
mColorButton = new DelegateButton(":/images/color.svg", mDelegated, mFrame, Qt::TopLeftSection); mColorButton = new DelegateButton(":/images/color.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
mDecreaseSizeButton = new DelegateButton(":/images/minus.svg", mDelegated, mFrame, Qt::TopLeftSection); mDecreaseSizeButton = new DelegateButton(":/images/minus.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
mIncreaseSizeButton = new DelegateButton(":/images/plus.svg", mDelegated, mFrame, Qt::TopLeftSection); mIncreaseSizeButton = new DelegateButton(":/images/plus.svg", mDelegated, mToolBarItem, Qt::TitleBarArea);
connect(mFontButton, SIGNAL(clicked(bool)), this, SLOT(pickFont())); connect(mFontButton, SIGNAL(clicked(bool)), this, SLOT(pickFont()));
connect(mColorButton, SIGNAL(clicked(bool)), this, SLOT(pickColor())); connect(mColorButton, SIGNAL(clicked(bool)), this, SLOT(pickColor()));
connect(mDecreaseSizeButton, SIGNAL(clicked(bool)), this, SLOT(decreaseSize())); connect(mDecreaseSizeButton, SIGNAL(clicked(bool)), this, SLOT(decreaseSize()));
connect(mIncreaseSizeButton, SIGNAL(clicked(bool)), this, SLOT(increaseSize())); connect(mIncreaseSizeButton, SIGNAL(clicked(bool)), this, SLOT(increaseSize()));
mButtons << mFontButton << mColorButton << mDecreaseSizeButton << mIncreaseSizeButton; QList<QGraphicsItem*> itemsOnToolBar;
itemsOnToolBar << mFontButton << mColorButton << mDecreaseSizeButton << mIncreaseSizeButton;
mToolBarItem->setItemsOnToolBar(itemsOnToolBar);
mToolBarItem->setVisibleOnBoard(true);
} }
void UBGraphicsTextItemDelegate::contentsChanged() void UBGraphicsTextItemDelegate::contentsChanged()
......
This diff is collapsed.
/* /*
* This program is free software: you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef UBGRAPHICSVIDEOITEMDELEGATE_H_ #ifndef UBGRAPHICSVIDEOITEMDELEGATE_H_
#define UBGRAPHICSVIDEOITEMDELEGATE_H_ #define UBGRAPHICSVIDEOITEMDELEGATE_H_
#include <QtGui> #include <QtGui>
#include <phonon/MediaObject> #include <phonon/MediaObject>
#include "core/UB.h" #include "core/UB.h"
#include "UBGraphicsItemDelegate.h" #include "UBGraphicsItemDelegate.h"
class QGraphicsSceneMouseEvent; class QGraphicsSceneMouseEvent;
class QGraphicsItem; class QGraphicsItem;
class UBGraphicsVideoItem; class UBGraphicsVideoItem;
class DelegateVideoControl: public QGraphicsRectItem class DelegateVideoControl: public QGraphicsRectItem
{ {
public: public:
DelegateVideoControl(UBGraphicsVideoItem* pDelegated, QGraphicsItem * parent = 0); DelegateVideoControl(UBGraphicsVideoItem* pDelegated, QGraphicsItem * parent = 0);
virtual ~DelegateVideoControl() virtual ~DelegateVideoControl()
{ {
// NOOP // NOOP
} }
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget); QWidget *widget);
QPainterPath shape() const; QPainterPath shape() const;
void setAntiScale(qreal antiScale){ mAntiScale = antiScale; } void setAntiScale(qreal antiScale){ mAntiScale = antiScale; }
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void updateTicker(qint64 time); void updateTicker(qint64 time);
void totalTimeChanged( qint64 newTotalTime); void totalTimeChanged( qint64 newTotalTime);
protected: protected:
void seekToMousePos(QPointF mousePos); void seekToMousePos(QPointF mousePos);
UBGraphicsVideoItem* mDelegate; UBGraphicsVideoItem* mDelegate;
bool mDisplayCurrentTime; bool mDisplayCurrentTime;
qreal mAntiScale; qreal mAntiScale;
qint64 mCurrentTimeInMs; qint64 mCurrentTimeInMs;
qint64 mTotalTimeInMs; qint64 mTotalTimeInMs;
}; private:
int mStartWidth;
QRectF mBalloon;
class UBGraphicsVideoItemDelegate : public UBGraphicsItemDelegate };
{
Q_OBJECT
class UBGraphicsVideoItemDelegate : public UBGraphicsItemDelegate
public: {
UBGraphicsVideoItemDelegate(UBGraphicsVideoItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent = 0); Q_OBJECT
virtual ~UBGraphicsVideoItemDelegate();
public:
virtual void positionHandles(); UBGraphicsVideoItemDelegate(UBGraphicsVideoItem* pDelegated, Phonon::MediaObject* pMedia, QObject * parent = 0);
virtual ~UBGraphicsVideoItemDelegate();
public slots:
virtual void positionHandles();
void toggleMute();
void updateTicker(qint64 time); public slots:
protected slots: void toggleMute();
void updateTicker(qint64 time);
virtual void remove(bool canUndo = true);
protected slots:
void togglePlayPause();
virtual void remove(bool canUndo = true);
void mediaStateChanged ( Phonon::State newstate, Phonon::State oldstate );
void togglePlayPause();
void updatePlayPauseState();
void mediaStateChanged ( Phonon::State newstate, Phonon::State oldstate );
void totalTimeChanged( qint64 newTotalTime);
void updatePlayPauseState();
protected:
void totalTimeChanged( qint64 newTotalTime);
virtual void buildButtons();
protected:
private:
virtual void buildButtons();
UBGraphicsVideoItem* delegated();
private:
DelegateButton* mPlayPauseButton;
DelegateButton* mStopButton; UBGraphicsVideoItem* delegated();
DelegateButton* mMuteButton;
DelegateVideoControl *mVideoControl; DelegateButton* mPlayPauseButton;
DelegateButton* mStopButton;
Phonon::MediaObject* mMedia; DelegateButton* mMuteButton;
DelegateVideoControl *mVideoControl;
};
Phonon::MediaObject* mMedia;
};
#endif /* UBGRAPHICSVIDEOITEMDELEGATE_H_ */
#endif /* UBGRAPHICSVIDEOITEMDELEGATE_H_ */
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "domain/ubgraphicsgroupcontaineritemdelegate.h" #include "domain/ubgraphicsgroupcontaineritemdelegate.h"
#include "domain/UBGraphicsScene.h" #include "domain/UBGraphicsScene.h"
#include "core/memcheck.h"
UBGraphicsGroupContainerItem::UBGraphicsGroupContainerItem(QGraphicsItem *parent) UBGraphicsGroupContainerItem::UBGraphicsGroupContainerItem(QGraphicsItem *parent)
: QGraphicsItemGroup(parent) : QGraphicsItemGroup(parent)
{ {
......
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
#include "domain/UBGraphicsDelegateFrame.h" #include "domain/UBGraphicsDelegateFrame.h"
#include "domain/ubgraphicsgroupcontaineritem.h" #include "domain/ubgraphicsgroupcontaineritem.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "core/memcheck.h"
UBGraphicsGroupContainerItemDelegate::UBGraphicsGroupContainerItemDelegate(QGraphicsItem *pDelegated, QObject *parent) : UBGraphicsGroupContainerItemDelegate::UBGraphicsGroupContainerItemDelegate(QGraphicsItem *pDelegated, QObject *parent) :
UBGraphicsItemDelegate(pDelegated, parent), mDestroyGroupButton(0) UBGraphicsItemDelegate(pDelegated, parent), mDestroyGroupButton(0)
......
...@@ -15,12 +15,13 @@ ...@@ -15,12 +15,13 @@
#include "UBCoreGraphicsScene.h" #include "UBCoreGraphicsScene.h"
#include "core/memcheck.h"
#include "domain/UBGraphicsAudioItem.h" #include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsVideoItem.h" #include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsMediaItem.h" #include "domain/UBGraphicsMediaItem.h"
#include "domain/UBGraphicsWidgetItem.h" #include "domain/UBGraphicsWidgetItem.h"
#include "core/memcheck.h"
UBCoreGraphicsScene::UBCoreGraphicsScene(QObject * parent) UBCoreGraphicsScene::UBCoreGraphicsScene(QObject * parent)
: QGraphicsScene ( parent ) : QGraphicsScene ( parent )
{ {
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#include "globals/UBGlobals.h" #include "globals/UBGlobals.h"
#include "core/memcheck.h"
UBDockDownloadWidget::UBDockDownloadWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent, name) UBDockDownloadWidget::UBDockDownloadWidget(QWidget *parent, const char *name):UBDockPaletteWidget(parent, name)
, mpLayout(NULL) , mpLayout(NULL)
, mpDLWidget(NULL) , mpDLWidget(NULL)
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include "UBDockTeacherGuideWidget.h" #include "UBDockTeacherGuideWidget.h"
#include "UBTeacherGuideWidget.h" #include "UBTeacherGuideWidget.h"
#include "core/memcheck.h"
UBDockTeacherGuideWidget::UBDockTeacherGuideWidget(QWidget* parent, const char* name): UBDockTeacherGuideWidget::UBDockTeacherGuideWidget(QWidget* parent, const char* name):
UBDockPaletteWidget(parent,name) UBDockPaletteWidget(parent,name)
......
#include "UBFeaturesActionBar.h" #include "UBFeaturesActionBar.h"
#include "core/memcheck.h"
UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWidget* parent, const char* name ) : QWidget (parent) UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWidget* parent, const char* name ) : QWidget (parent)
, featuresController(controller) , featuresController(controller)
......
...@@ -205,9 +205,9 @@ public: ...@@ -205,9 +205,9 @@ public:
Qt::DropActions supportedDropActions() const { return Qt::MoveAction | Qt::CopyAction; } Qt::DropActions supportedDropActions() const { return Qt::MoveAction | Qt::CopyAction; }
void setFeaturesList( QList <UBFeature> *flist ) { featuresList = flist; } void setFeaturesList(const QList <UBFeature> &flist ) { featuresList = flist; }
private: private:
QList <UBFeature> *featuresList; QList <UBFeature> featuresList;
}; };
class UBFeaturesProxyModel : public QSortFilterProxyModel class UBFeaturesProxyModel : public QSortFilterProxyModel
......
...@@ -18,12 +18,13 @@ ...@@ -18,12 +18,13 @@
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/UBDownloadManager.h" #include "core/UBDownloadManager.h"
#include "core/memcheck.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
#include "globals/UBGlobals.h" #include "globals/UBGlobals.h"
#include "core/memcheck.h"
/** /**
* \brief Constructor * \brief Constructor
......
...@@ -16,10 +16,11 @@ ...@@ -16,10 +16,11 @@
#include "UBLibWidget.h" #include "UBLibWidget.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/memcheck.h"
#include "globals/UBGlobals.h" #include "globals/UBGlobals.h"
#include "core/memcheck.h"
static int lowBoundForSlider = 40; static int lowBoundForSlider = 40;
static int topBoundForSlider = 120; static int topBoundForSlider = 120;
static int tickIntervalForSlider = 10; static int tickIntervalForSlider = 10;
......
...@@ -20,10 +20,11 @@ ...@@ -20,10 +20,11 @@
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "core/memcheck.h"
#include "core/UBDownloadManager.h" #include "core/UBDownloadManager.h"
#include "board/UBBoardPaletteManager.h" #include "board/UBBoardPaletteManager.h"
#include "core/memcheck.h"
/** /**
* \brief Constructor * \brief Constructor
* @param parent as the parent widget * @param parent as the parent widget
......
#include <QDomDocument> #include <QDomDocument>
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
...@@ -9,7 +8,7 @@ ...@@ -9,7 +8,7 @@
#include "UBLibWebView.h" #include "UBLibWebView.h"
#include "core/memcheck.h"
UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent) UBLibWebView::UBLibWebView(QWidget* parent, const char* name):QWidget(parent)
, mpView(NULL) , mpView(NULL)
......
...@@ -17,10 +17,11 @@ ...@@ -17,10 +17,11 @@
#include "UBLibWidget.h" #include "UBLibWidget.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/memcheck.h"
#include "globals/UBGlobals.h" #include "globals/UBGlobals.h"
#include "core/memcheck.h"
/** /**
* \brief Constructor * \brief Constructor
* @param parent as the parent widget * @param parent as the parent widget
......
...@@ -14,12 +14,13 @@ ...@@ -14,12 +14,13 @@
*/ */
#include "UBPageNavigationWidget.h" #include "UBPageNavigationWidget.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h" #include "board/UBBoardController.h"
#include "globals/UBGlobals.h" #include "globals/UBGlobals.h"
#include "core/memcheck.h"
/** /**
* \brief Constructor * \brief Constructor
* @param parent as the parent widget * @param parent as the parent widget
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include <QModelIndex> #include <QModelIndex>
#include "UBTGWidgetTreeDelegate.h" #include "UBTGWidgetTreeDelegate.h"
#include "core/memcheck.h"
UBTGWidgetTreeDelegate::UBTGWidgetTreeDelegate(QObject *parent) : UBTGWidgetTreeDelegate::UBTGWidgetTreeDelegate(QObject *parent) :
QStyledItemDelegate(parent) QStyledItemDelegate(parent)
{ {
......
#include "UBTeacherGuideDelegate.h" #include "UBTeacherGuideDelegate.h"
#include "core/memcheck.h"
UBTeacherGuideDelegate::UBTeacherGuideDelegate() UBTeacherGuideDelegate::UBTeacherGuideDelegate()
{ {
......
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
#include "document/UBDocumentProxy.h" #include "document/UBDocumentProxy.h"
#include "document/UBDocumentController.h" #include "document/UBDocumentController.h"
#include "core/memcheck.h"
#define UBTG_SEPARATOR_FIXED_HEIGHT 3 #define UBTG_SEPARATOR_FIXED_HEIGHT 3
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
/*************************************************************************** /***************************************************************************
* class UBAddItem * * class UBAddItem *
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <QtGlobal> #include <QtGlobal>
#include "CCITTFaxDecode.h" #include "CCITTFaxDecode.h"
#include "core/memcheck.h"
using namespace merge_lib; using namespace merge_lib;
bool CCITTFaxDecode::encode(std::string & decoded) bool CCITTFaxDecode::encode(std::string & decoded)
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include <QtGlobal> #include <QtGlobal>
#include "DCTDecode.h" #include "DCTDecode.h"
#include "core/memcheck.h"
using namespace merge_lib; using namespace merge_lib;
bool DCTDecode::encode(std::string & decoded) bool DCTDecode::encode(std::string & decoded)
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <QtGlobal> #include <QtGlobal>
#include "JBIG2Decode.h" #include "JBIG2Decode.h"
#include "core/memcheck.h"
using namespace merge_lib; using namespace merge_lib;
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "UBOEmbedParser.h" #include "UBOEmbedParser.h"
#include "core/memcheck.h"
UBOEmbedParser::UBOEmbedParser(QObject *parent, const char* name) UBOEmbedParser::UBOEmbedParser(QObject *parent, const char* name)
{ {
Q_UNUSED(parent); Q_UNUSED(parent);
......
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