Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
56eceb66
Commit
56eceb66
authored
May 07, 2012
by
Ivan Ilyin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
f4fffe47
17dd8564
Changes
43
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
2228 additions
and
1613 deletions
+2228
-1613
style.qss
resources/style.qss
+7
-0
UBExportCFF.cpp
src/adaptors/UBExportCFF.cpp
+1
-0
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+15
-8
UBBoardPaletteManager.h
src/board/UBBoardPaletteManager.h
+192
-184
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+145
-54
UBFeaturesController.h
src/board/UBFeaturesController.h
+50
-22
main.cpp
src/core/main.cpp
+1
-1
UBActionableWidget.cpp
src/customWidgets/UBActionableWidget.cpp
+2
-0
UBMediaWidget.cpp
src/customWidgets/UBMediaWidget.cpp
+2
-0
UBAbstractUndoCommand.cpp
src/domain/UBAbstractUndoCommand.cpp
+2
-0
UBAngleWidget.cpp
src/domain/UBAngleWidget.cpp
+2
-0
UBGraphicsDelegateFrame.cpp
src/domain/UBGraphicsDelegateFrame.cpp
+802
-794
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+98
-3
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+37
-17
UBGraphicsItemUndoCommand.cpp
src/domain/UBGraphicsItemUndoCommand.cpp
+2
-2
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+2
-2
UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.cpp
+2
-0
UBGraphicsTextItemDelegate.cpp
src/domain/UBGraphicsTextItemDelegate.cpp
+11
-6
UBGraphicsVideoItemDelegate.cpp
src/domain/UBGraphicsVideoItemDelegate.cpp
+351
-336
UBGraphicsVideoItemDelegate.h
src/domain/UBGraphicsVideoItemDelegate.h
+116
-114
ubgraphicsgroupcontaineritem.cpp
src/domain/ubgraphicsgroupcontaineritem.cpp
+2
-0
ubgraphicsgroupcontaineritemdelegate.cpp
src/domain/ubgraphicsgroupcontaineritemdelegate.cpp
+2
-1
UBCoreGraphicsScene.cpp
src/frameworks/UBCoreGraphicsScene.cpp
+2
-1
UBDockDownloadWidget.cpp
src/gui/UBDockDownloadWidget.cpp
+2
-0
UBDockTeacherGuideWidget.cpp
src/gui/UBDockTeacherGuideWidget.cpp
+2
-0
UBFeaturesActionBar.cpp
src/gui/UBFeaturesActionBar.cpp
+19
-0
UBFeaturesActionBar.h
src/gui/UBFeaturesActionBar.h
+2
-1
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+289
-53
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+43
-7
UBLibItemProperties.cpp
src/gui/UBLibItemProperties.cpp
+2
-1
UBLibNavigatorWidget.cpp
src/gui/UBLibNavigatorWidget.cpp
+2
-1
UBLibPathViewer.cpp
src/gui/UBLibPathViewer.cpp
+2
-1
UBLibWebView.cpp
src/gui/UBLibWebView.cpp
+1
-2
UBLibWidget.cpp
src/gui/UBLibWidget.cpp
+2
-1
UBPageNavigationWidget.cpp
src/gui/UBPageNavigationWidget.cpp
+2
-1
UBTGWidgetTreeDelegate.cpp
src/gui/UBTGWidgetTreeDelegate.cpp
+2
-0
UBTeacherGuideDelegate.cpp
src/gui/UBTeacherGuideDelegate.cpp
+1
-0
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+2
-0
UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp
+2
-0
CCITTFaxDecode.cpp
src/pdf-merger/CCITTFaxDecode.cpp
+2
-0
DCTDecode.cpp
src/pdf-merger/DCTDecode.cpp
+2
-0
JBIG2Decode.cpp
src/pdf-merger/JBIG2Decode.cpp
+1
-0
UBOEmbedParser.cpp
src/web/UBOEmbedParser.cpp
+2
-0
No files found.
resources/style.qss
View file @
56eceb66
...
...
@@ -26,6 +26,13 @@ QWidget#UBLibWebView
border: 2px solid #999999;
}
QWidget#UBFeaturesWebView
{
background: #EEEEEE;
border-radius : 10px;
border: 2px solid #999999;
}
QListView
{
background: #EEEEEE;
...
...
src/adaptors/UBExportCFF.cpp
View file @
56eceb66
...
...
@@ -3,6 +3,7 @@
#include "document/UBDocumentProxy.h"
#include "core/UBDocumentManager.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
UBExportCFF
::
UBExportCFF
(
QObject
*
parent
)
...
...
src/board/UBBoardPaletteManager.cpp
View file @
56eceb66
...
...
@@ -58,10 +58,10 @@
#include "UBBoardController.h"
#include "core/memcheck.h"
#include "document/UBDocumentController.h"
#include "core/memcheck.h"
UBBoardPaletteManager
::
UBBoardPaletteManager
(
QWidget
*
container
,
UBBoardController
*
pBoardController
)
:
QObject
(
container
)
,
mKeyboardPalette
(
0
)
...
...
@@ -81,7 +81,9 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
,
mPendingPanButtonPressed
(
false
)
,
mPendingEraseButtonPressed
(
false
)
,
mpPageNavigWidget
(
NULL
)
#ifdef USE_WEB_WIDGET
,
mpLibWidget
(
NULL
)
#endif
,
mpCachePropWidget
(
NULL
)
,
mpDownloadWidget
(
NULL
)
,
mpDesktopLibWidget
(
NULL
)
...
...
@@ -132,7 +134,9 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mpPageNavigWidget
=
new
UBPageNavigationWidget
();
#ifdef USE_WEB_WIDGET
mpLibWidget
=
new
UBLibWidget
();
#endif
mpCachePropWidget
=
new
UBCachePropertiesWidget
();
...
...
@@ -159,8 +163,11 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mRightPalette
->
addTab
(
mpFeaturesWidget
);
//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
...
...
@@ -841,10 +848,10 @@ void UBBoardPaletteManager::addItemToLibrary()
}
QImage
image
=
mPixmap
.
toImage
();
if
(
NULL
!=
mpLibWidget
)
{
#ifdef USE_WEB_WIDGET
mpLibWidget
->
libNavigator
()
->
libraryWidget
()
->
libraryController
()
->
importImageOnLibrary
(
image
);
}
#endif
}
else
{
...
...
src/board/UBBoardPaletteManager.h
View file @
56eceb66
...
...
@@ -43,6 +43,10 @@ class UBMainWindow;
class
UBApplicationController
;
class
UBDockTeacherGuideWidget
;
// Uncomment this to use old-styles lib paletter
// #define USE_WEB_WIDGET
class
UBBoardPaletteManager
:
public
QObject
{
Q_OBJECT
...
...
@@ -125,8 +129,12 @@ class UBBoardPaletteManager : public QObject
/** The page navigator widget */
UBPageNavigationWidget
*
mpPageNavigWidget
;
#ifdef USE_WEB_WIDGET
/** The library widget */
UBLibWidget
*
mpLibWidget
;
#endif
/** The cache properties widget */
UBCachePropertiesWidget
*
mpCachePropWidget
;
...
...
src/board/UBFeaturesController.cpp
View file @
56eceb66
This diff is collapsed.
Click to expand it.
src/board/UBFeaturesController.h
View file @
56eceb66
...
...
@@ -4,9 +4,13 @@
#include <QMetaType>
#include <QObject>
#include <QWidget>
#include <QSet>
#include <QVector>
#include <QString>
#include <QPixmap>
#include <QMap>
#include <QUrl>
#include <QByteArray>
//#include "UBDockPaletteWidget.h"
...
...
@@ -19,7 +23,8 @@ enum UBFeatureElementType
FEATURE_INTERNAL
,
FEATURE_ITEM
,
FEATURE_TRASH
,
FEATURE_FAVORITE
FEATURE_FAVORITE
,
FEATURE_SEARCH
};
class
UBFeature
...
...
@@ -27,21 +32,30 @@ class UBFeature
public
:
UBFeature
()
{;}
//UBFeature(const UBFeature &f);
UBFeature
(
const
QString
&
url
,
const
QPixmap
&
icon
,
const
QString
&
name
,
const
Q
String
&
realPath
,
UBFeatureElementType
type
=
FEATURE_CATEGORY
);
UBFeature
(
const
QString
&
url
,
const
QPixmap
&
icon
,
const
QString
&
name
,
const
Q
Url
&
realPath
,
UBFeatureElementType
type
=
FEATURE_CATEGORY
);
virtual
~
UBFeature
()
{;}
QString
getName
()
const
{
return
mName
;
}
QPixmap
getThumbnail
()
const
{
return
mThumbnail
;}
QString
get
Url
()
const
{
return
virtualPath
;
}
QString
get
VirtualPath
()
const
{
return
virtualPath
;
}
//QString getPath() const { return mPath; };
QString
getFullPath
()
const
{
return
mPath
;
}
QUrl
getFullPath
()
const
{
return
mPath
;
}
QString
getFullVirtualPath
()
const
{
return
virtualPath
+
"/"
+
mName
;
}
QString
getUrl
()
const
;
UBFeatureElementType
getType
()
const
{
return
elementType
;
}
bool
isFolder
()
const
;
bool
isDeletable
()
const
;
bool
operator
==
(
const
UBFeature
&
f
)
const
;
bool
operator
!=
(
const
UBFeature
&
f
)
const
;
const
QMap
<
QString
,
QString
>
&
getMetadata
()
const
{
return
metadata
;
}
void
setMetadata
(
const
QMap
<
QString
,
QString
>
&
data
)
{
metadata
=
data
;
}
private
:
QString
virtualPath
;
QPixmap
mThumbnail
;
QString
mName
;
Q
String
mPath
;
Q
Url
mPath
;
UBFeatureElementType
elementType
;
QMap
<
QString
,
QString
>
metadata
;
};
Q_DECLARE_METATYPE
(
UBFeature
)
...
...
@@ -57,10 +71,14 @@ public:
const
QString
&
getRootPath
()
const
{
return
rootPath
;
}
void
addItemToPage
(
const
UBFeature
&
item
);
void
addItemToPage
(
const
UBFeature
&
item
);
void
addItemAsBackground
(
const
UBFeature
&
item
);
const
UBFeature
&
getCurrentElement
()
const
{
return
currentElement
;
}
void
setCurrentElement
(
const
UBFeature
&
elem
)
{
currentElement
=
elem
;
}
const
UBFeature
&
getTrashElement
()
const
{
return
trashElement
;
}
UBFeature
addDownloadedFile
(
const
QUrl
&
sourceUrl
,
const
QByteArray
&
pData
);
UBFeature
moveItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
);
UBFeature
copyItemToFolder
(
const
QUrl
&
url
,
const
UBFeature
&
destination
);
void
deleteItem
(
const
QUrl
&
url
);
...
...
@@ -71,34 +89,37 @@ public:
static
QString
fileNameFromUrl
(
const
QUrl
&
url
);
static
QPixmap
thumbnailForFile
(
const
QString
&
path
);
static
bool
isDeletable
(
const
QUrl
&
url
);
private
:
void
initDirectoryTree
();
void
fileSystemScan
(
const
Q
String
&
currPath
,
const
QString
&
currVirtualPath
);
void
fileSystemScan
(
const
Q
Url
&
currPath
,
const
QString
&
currVirtualPath
);
static
QPixmap
createThumbnail
(
const
QString
&
path
);
//void addImageToCurrentPage( const QString &path );
void
loadFavoriteList
();
void
saveFavoriteList
();
UBFeature
getDestinationForItem
(
const
QUrl
&
url
);
static
UBFeatureElementType
fileTypeFromUrl
(
const
QString
&
path
);
QList
<
UBFeature
>
*
featuresList
;
UBFeature
*
rootElement
;
Q
String
mUserAudioDirectoryPath
;
Q
String
mUserVideoDirectoryPath
;
Q
String
mUserPicturesDirectoryPath
;
Q
String
mUserInteractiveDirectoryPath
;
Q
String
mUserAnimationDirectoryPath
;
Q
Url
mUserAudioDirectoryPath
;
Q
Url
mUserVideoDirectoryPath
;
Q
Url
mUserPicturesDirectoryPath
;
Q
Url
mUserInteractiveDirectoryPath
;
Q
Url
mUserAnimationDirectoryPath
;
QString
libraryPath
;
QString
mLibAudioDirectoryPath
;
QString
mLibVideoDirectoryPath
;
QString
mLibPicturesDirectoryPath
;
QString
mLibInteractiveDirectoryPath
;
QString
mLibAnimationDirectoryPath
;
QString
mLibApplicationsDirectoryPath
;
QString
mLibShapesDirectoryPath
;
QString
trashDirectoryPath
;
QUrl
mLibAudioDirectoryPath
;
QUrl
mLibVideoDirectoryPath
;
QUrl
mLibPicturesDirectoryPath
;
QUrl
mLibInteractiveDirectoryPath
;
QUrl
mLibAnimationDirectoryPath
;
QUrl
mLibApplicationsDirectoryPath
;
QUrl
mLibShapesDirectoryPath
;
QUrl
trashDirectoryPath
;
QUrl
mLibSearchDirectoryPath
;
QString
rootPath
;
QString
audiosPath
;
...
...
@@ -115,8 +136,15 @@ private:
UBFeature
currentElement
;
UBFeature
trashElement
;
UBFeature
favoriteElement
;
QSet
<
QString
>
*
favoriteSet
;
UBFeature
audiosElement
;
UBFeature
moviesElement
;
UBFeature
picturesElement
;
UBFeature
interactElement
;
UBFeature
flashElement
;
UBFeature
shapesElement
;
UBFeature
webSearchElement
;
QSet
<
QUrl
>
*
favoriteSet
;
};
...
...
src/core/main.cpp
View file @
56eceb66
...
...
@@ -72,7 +72,7 @@ int main(int argc, char *argv[])
// Uncomment next section to have memory leaks information
// tracing in VC++ debug mode under Windows
/*
/*
#if defined(_MSC_VER) && defined(_DEBUG)
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif
...
...
src/customWidgets/UBActionableWidget.cpp
View file @
56eceb66
...
...
@@ -18,6 +18,8 @@
#include "UBActionableWidget.h"
#include "core/memcheck.h"
UBActionableWidget
::
UBActionableWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mShowActions
(
false
)
{
...
...
src/customWidgets/UBMediaWidget.cpp
View file @
56eceb66
...
...
@@ -16,6 +16,8 @@
#include "globals/UBGlobals.h"
#include "UBMediaWidget.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param type as the media type
...
...
src/domain/UBAbstractUndoCommand.cpp
View file @
56eceb66
...
...
@@ -15,6 +15,8 @@
#include "UBAbstractUndoCommand.h"
#include "core/memcheck.h"
UBAbstractUndoCommand
::
UBAbstractUndoCommand
()
{
// NOOP
...
...
src/domain/UBAngleWidget.cpp
View file @
56eceb66
#include "UBAngleWidget.h"
#include <QPainter>
#include "core/memcheck.h"
UBAngleWidget
::
UBAngleWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
...
...
src/domain/UBGraphicsDelegateFrame.cpp
View file @
56eceb66
...
...
@@ -390,6 +390,9 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QSizeF
newSize
=
resizableItem
->
size
()
+
incVector
;
if
(
!
(
mDelegate
->
getToolBarItem
()
->
isVisibleOnBoard
()
&&
(
newSize
.
width
()
<
mDelegate
->
getToolBarItem
()
->
minWidth
()
/
mDelegate
->
antiScaleRatio
()
||
newSize
.
height
()
<
mDelegate
->
getToolBarItem
()
->
minWidth
()
/
mDelegate
->
antiScaleRatio
()
*
3
/
4
)))
resizableItem
->
resize
(
newSize
);
}
}
...
...
@@ -579,6 +582,11 @@ void UBGraphicsDelegateFrame::setVisible(bool visible)
void
UBGraphicsDelegateFrame
::
positionHandles
()
{
QRectF
itemRect
=
delegated
()
->
boundingRect
();
if
(
mDelegate
->
getToolBarItem
()
->
isVisibleOnBoard
()
&&
mDelegate
->
getToolBarItem
()
->
isShifting
())
itemRect
.
setHeight
(
itemRect
.
height
()
+
mDelegate
->
getToolBarItem
()
->
rect
().
height
()
*
mDelegate
->
antiScaleRatio
()
*
1.1
);
QTransform
itemTransform
=
delegated
()
->
sceneTransform
();
QPointF
topLeft
=
itemTransform
.
map
(
itemRect
.
topLeft
());
QPointF
topRight
=
itemTransform
.
map
(
itemRect
.
topRight
());
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
56eceb66
...
...
@@ -37,6 +37,9 @@
#include "UBGraphicsWidgetItem.h"
#include "domain/UBAbstractWidget.h"
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsVideoItem.h"
#include "web/UBWebController.h"
...
...
@@ -47,6 +50,27 @@
class
UBGraphicsParaschoolEditorWidgetItem
;
DelegateButton
::
DelegateButton
(
const
QString
&
fileName
,
QGraphicsItem
*
pDelegated
,
QGraphicsItem
*
parent
,
Qt
::
WindowFrameSection
section
)
:
QGraphicsSvgItem
(
fileName
,
parent
)
,
mDelegated
(
pDelegated
)
,
mIsTransparentToMouseEvent
(
false
)
,
mButtonAlignmentSection
(
section
)
{
setAcceptedMouseButtons
(
Qt
::
LeftButton
);
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Control
));
}
DelegateButton
::~
DelegateButton
()
{
// NOOP
}
void
DelegateButton
::
setFileName
(
const
QString
&
fileName
)
{
QGraphicsSvgItem
::
setSharedRenderer
(
new
QSvgRenderer
(
fileName
,
this
));
}
void
DelegateButton
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
// make sure delegate is selected, to avoid control being hidden
...
...
@@ -93,6 +117,8 @@ UBGraphicsItemDelegate::UBGraphicsItemDelegate(QGraphicsItem* pDelegated, QObjec
void
UBGraphicsItemDelegate
::
init
()
{
mToolBarItem
=
new
UBGraphicsToolBarItem
(
delegated
());
mFrame
=
new
UBGraphicsDelegateFrame
(
this
,
QRectF
(
0
,
0
,
0
,
0
),
mFrameWidth
,
mRespectRatio
);
mFrame
->
hide
();
mFrame
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
@@ -122,11 +148,14 @@ void UBGraphicsItemDelegate::init()
buildButtons
();
foreach
(
DelegateButton
*
button
,
mButtons
)
{
if
(
button
->
getSection
()
!=
Qt
::
TitleBarArea
)
{
button
->
hide
();
button
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
}
}
}
UBGraphicsItemDelegate
::~
UBGraphicsItemDelegate
()
...
...
@@ -292,13 +321,20 @@ void UBGraphicsItemDelegate::positionHandles()
updateButtons
(
true
);
if
(
mToolBarItem
->
isVisibleOnBoard
())
{
updateToolBar
();
mToolBarItem
->
show
();
}
}
else
{
foreach
(
DelegateButton
*
button
,
mButtons
)
button
->
hide
();
mFrame
->
hide
();
mToolBarItem
->
hide
();
}
}
void
UBGraphicsItemDelegate
::
setZOrderButtonsVisible
(
bool
visible
)
{
if
(
visible
)
{
...
...
@@ -335,6 +371,7 @@ void UBGraphicsItemDelegate::remove(bool canUndo)
scene
->
removeItem
(
mFrame
);
scene
->
removeItem
(
mDelegated
);
scene
->
removeItem
(
mToolBarItem
);
if
(
canUndo
)
{
...
...
@@ -577,14 +614,16 @@ void UBGraphicsItemDelegate::updateButtons(bool showUpdated)
int
i
=
1
,
j
=
0
,
k
=
0
;
while
((
i
+
j
+
k
)
<
mButtons
.
size
())
{
DelegateButton
*
button
=
mButtons
[
i
+
j
];
button
->
setParentItem
(
mFrame
);
button
->
setTransform
(
tr
);
if
(
button
->
getSection
()
==
Qt
::
TopLeftSection
)
{
button
->
setParentItem
(
mFrame
);
button
->
setPos
(
topX
+
(
i
++
*
1.6
*
mFrameWidth
*
mAntiScaleRatio
),
topY
);
button
->
setTransform
(
tr
);
}
else
if
(
button
->
getSection
()
==
Qt
::
BottomLeftSection
)
{
button
->
setParentItem
(
mFrame
);
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
;
}
if
(
!
button
->
scene
())
...
...
@@ -599,9 +638,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
)
{
foreach
(
DelegateButton
*
pButton
,
mButtons
){
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
src/domain/UBGraphicsItemDelegate.h
View file @
56eceb66
...
...
@@ -35,30 +35,16 @@ class DelegateButton: public QGraphicsSvgItem
Q_OBJECT
public
:
DelegateButton
(
const
QString
&
fileName
,
QGraphicsItem
*
pDelegated
,
QGraphicsItem
*
parent
=
0
,
Qt
::
WindowFrameSection
section
=
Qt
::
TopLeftSection
)
:
QGraphicsSvgItem
(
fileName
,
parent
)
,
mDelegated
(
pDelegated
)
,
mIsTransparentToMouseEvent
(
false
)
,
mButtonAlignmentSection
(
section
)
{
setAcceptedMouseButtons
(
Qt
::
LeftButton
);
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Control
));
}
DelegateButton
(
const
QString
&
fileName
,
QGraphicsItem
*
pDelegated
,
QGraphicsItem
*
parent
=
0
,
Qt
::
WindowFrameSection
section
=
Qt
::
TopLeftSection
);
virtual
~
DelegateButton
()
{
// NOOP
}
virtual
~
DelegateButton
();
void
setTransparentToMouseEvent
(
bool
tr
)
{
mIsTransparentToMouseEvent
=
tr
;
}
void
setFileName
(
const
QString
&
fileName
)
{
QGraphicsSvgItem
::
setSharedRenderer
(
new
QSvgRenderer
(
fileName
,
this
));
}
void
setFileName
(
const
QString
&
fileName
);
void
setSection
(
Qt
::
WindowFrameSection
section
)
{
mButtonAlignmentSection
=
section
;}
Qt
::
WindowFrameSection
getSection
()
const
{
return
mButtonAlignmentSection
;}
...
...
@@ -84,6 +70,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
{
...
...
@@ -138,6 +149,10 @@ class UBGraphicsItemDelegate : public QObject
void
setButtonsVisible
(
bool
visible
);
UBGraphicsToolBarItem
*
getToolBarItem
()
const
{
return
mToolBarItem
;
}
qreal
antiScaleRatio
()
const
{
return
mAntiScaleRatio
;
}
signals
:
void
showOnDisplayChanged
(
bool
shown
);
void
lockChanged
(
bool
locked
);
...
...
@@ -183,12 +198,17 @@ class UBGraphicsItemDelegate : public QObject
QList
<
DelegateButton
*>
mButtons
;
UBGraphicsToolBarItem
*
mToolBarItem
;
protected
slots
:
virtual
void
gotoContentSource
(
bool
checked
);
private
:
void
updateFrame
();
void
updateButtons
(
bool
showUpdated
=
false
);
void
updateToolBar
();
QPointF
mOffset
;
QTransform
mPreviousTransform
;
...
...
src/domain/UBGraphicsItemUndoCommand.cpp
View file @
56eceb66
...
...
@@ -19,12 +19,12 @@
#include "UBGraphicsScene.h"
#include "core/memcheck.h"
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
UBGraphicsItemUndoCommand
::
UBGraphicsItemUndoCommand
(
UBGraphicsScene
*
pScene
,
const
QSet
<
QGraphicsItem
*>&
pRemovedItems
,
const
QSet
<
QGraphicsItem
*>&
pAddedItems
)
:
mScene
(
pScene
)
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
56eceb66
...
...
@@ -23,10 +23,10 @@
#include "board/UBBoardController.h"
#include "core/memcheck.h"
#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
bool
UBGraphicsMediaItem
::
sIsMutedByDefault
=
false
;
UBGraphicsMediaItem
::
UBGraphicsMediaItem
(
const
QUrl
&
pMediaFileUrl
,
QGraphicsItem
*
parent
)
...
...
src/domain/UBGraphicsStrokesGroup.cpp
View file @
56eceb66
#include "UBGraphicsStrokesGroup.h"
#include "core/memcheck.h"
UBGraphicsStrokesGroup
::
UBGraphicsStrokesGroup
(
QGraphicsItem
*
parent
)
:
QGraphicsItemGroup
(
parent
)
{
mDelegate
=
new
UBGraphicsItemDelegate
(
this
,
0
,
true
,
true
);
...
...
src/domain/UBGraphicsTextItemDelegate.cpp
View file @
56eceb66
...
...
@@ -24,9 +24,10 @@
#include "domain/UBGraphicsDelegateFrame.h"
#include "core/UBSettings.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
const
int
UBGraphicsTextItemDelegate
::
sMinPixelSize
=
8
;
const
int
UBGraphicsTextItemDelegate
::
sMinPointSize
=
8
;
...
...
@@ -94,17 +95,21 @@ void UBGraphicsTextItemDelegate::buildButtons()
{
UBGraphicsItemDelegate
::
buildButtons
();
mFontButton
=
new
DelegateButton
(
":/images/font.svg"
,
mDelegated
,
m
Frame
,
Qt
::
TopLeftSection
);
mColorButton
=
new
DelegateButton
(
":/images/color.svg"
,
mDelegated
,
m
Frame
,
Qt
::
TopLeftSection
);
mDecreaseSizeButton
=
new
DelegateButton
(
":/images/minus.svg"
,
mDelegated
,
m
Frame
,
Qt
::
TopLeftSection
);
mIncreaseSizeButton
=
new
DelegateButton
(
":/images/plus.svg"
,
mDelegated
,
m
Frame
,
Qt
::
TopLeftSection
);
mFontButton
=
new
DelegateButton
(
":/images/font.svg"
,
mDelegated
,
m
ToolBarItem
,
Qt
::
TitleBarArea
);
mColorButton
=
new
DelegateButton
(
":/images/color.svg"
,
mDelegated
,
m
ToolBarItem
,
Qt
::
TitleBarArea
);
mDecreaseSizeButton
=
new
DelegateButton
(
":/images/minus.svg"
,
mDelegated
,
m
ToolBarItem
,
Qt
::
TitleBarArea
);
mIncreaseSizeButton
=
new
DelegateButton
(
":/images/plus.svg"
,
mDelegated
,
m
ToolBarItem
,
Qt
::
TitleBarArea
);
connect
(
mFontButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
pickFont
()));
connect
(
mColorButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
pickColor
()));
connect
(
mDecreaseSizeButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
decreaseSize
()));
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
()
...
...
src/domain/UBGraphicsVideoItemDelegate.cpp
View file @
56eceb66
...
...
@@ -39,22 +39,19 @@ UBGraphicsVideoItemDelegate::UBGraphicsVideoItemDelegate(UBGraphicsVideoItem* pD
void
UBGraphicsVideoItemDelegate
::
buildButtons
()
{
mPlayPauseButton
=
new
DelegateButton
(
":/images/play.svg"
,
mDelegated
,
m
Frame
);
mPlayPauseButton
=
new
DelegateButton
(
":/images/play.svg"
,
mDelegated
,
m
ToolBarItem
,
Qt
::
TitleBarArea
);
mStopButton
=
new
DelegateButton
(
":/images/stop.svg"
,
mDelegated
,
mFrame
);
mStopButton
->
hide
();
mStopButton
=
new
DelegateButton
(
":/images/stop.svg"
,
mDelegated
,
mToolBarItem
,
Qt
::
TitleBarArea
);
if
(
delegated
()
->
isMuted
())
mMuteButton
=
new
DelegateButton
(
":/images/soundOff.svg"
,
mDelegated
,
mFrame
);
else
mMuteButton
=
new
DelegateButton
(
":/images/soundOn.svg"
,
mDelegated
,
mFrame
);
mMuteButton
->
hide
();
mVideoControl
=
new
DelegateVideoControl
(
delegated
(),
mFrame
);
mVideoControl
=
new
DelegateVideoControl
(
delegated
(),
mToolBarItem
);
UBGraphicsItem
::
assignZValue
(
mVideoControl
,
delegated
()
->
zValue
());
mVideoControl
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
if
(
delegated
()
->
isMuted
())
mMuteButton
=
new
DelegateButton
(
":/images/soundOff.svg"
,
mDelegated
,
mToolBarItem
,
Qt
::
TitleBarArea
);
else
mMuteButton
=
new
DelegateButton
(
":/images/soundOn.svg"
,
mDelegated
,
mToolBarItem
,
Qt
::
TitleBarArea
);
connect
(
mPlayPauseButton
,
SIGNAL
(
clicked
(
bool
)),
this
,
SLOT
(
togglePlayPause
()));
connect
(
mStopButton
,
SIGNAL
(
clicked
(
bool
)),
mMedia
,
SLOT
(
stop
()));
connect
(
mMuteButton
,
SIGNAL
(
clicked
(
bool
)),
delegated
(),
SLOT
(
toggleMute
()));
...
...
@@ -62,6 +59,10 @@ void UBGraphicsVideoItemDelegate::buildButtons()
mButtons
<<
mPlayPauseButton
<<
mStopButton
<<
mMuteButton
;
QList
<
QGraphicsItem
*>
itemsOnToolBar
;
itemsOnToolBar
<<
mPlayPauseButton
<<
mStopButton
<<
mVideoControl
<<
mMuteButton
;
mToolBarItem
->
setItemsOnToolBar
(
itemsOnToolBar
);
mMedia
->
setTickInterval
(
50
);
connect
(
mMedia
,
SIGNAL
(
stateChanged
(
Phonon
::
State
,
Phonon
::
State
)),
this
,
SLOT
(
mediaStateChanged
(
Phonon
::
State
,
Phonon
::
State
)));
...
...
@@ -69,6 +70,8 @@ void UBGraphicsVideoItemDelegate::buildButtons()
connect
(
mMedia
,
SIGNAL
(
tick
(
qint64
)),
this
,
SLOT
(
updateTicker
(
qint64
)));
connect
(
mMedia
,
SIGNAL
(
totalTimeChanged
(
qint64
)),
this
,
SLOT
(
totalTimeChanged
(
qint64
)));
mToolBarItem
->
setVisibleOnBoard
(
true
);
mToolBarItem
->
setShifting
(
false
);
}
...
...
@@ -86,21 +89,24 @@ void UBGraphicsVideoItemDelegate::positionHandles()
{
qreal
scaledFrameWidth
=
mFrameWidth
*
mAntiScaleRatio
;
int
offset
=
0
;
foreach
(
DelegateButton
*
button
,
mButtons
)
{
if
(
button
->
getSection
()
==
Qt
::
TitleBarArea
)
offset
+=
button
->
boundingRect
().
width
()
*
mAntiScaleRatio
;
}
qreal
width
=
mFrame
->
rect
().
width
();
qreal
height
=
mFrame
->
rect
().
height
();
qreal
x
=
mFrame
->
rect
().
left
();
qreal
y
=
mFrame
->
rect
().
top
();
mVideoControl
->
setRect
(
mVideoControl
->
rect
().
x
()
,
scaledFrameWidth
/
6
-
0.5
,
(
mToolBarItem
->
rect
().
width
()
-
35
-
offset
)
/
mAntiScaleRatio
,
(
2
*
scaledFrameWidth
)
/
mAntiScaleRatio
);
mVideoControl
->
setRect
(
x
+
2
*
scaledFrameWidth
,
y
+
height
-
3
*
scaledFrameWidth
,
width
-
4
*
scaledFrameWidth
,
2
*
scaledFrameWidth
);
offset
+=
(
mVideoControl
->
rect
().
width
()
+
5
)
*
mAntiScaleRatio
;
mMuteButton
->
setPos
(
offset
,
0
);
if
(
!
mVideoControl
->
scene
())
{
mVideoControl
->
setParentItem
(
m
Frame
);
//update parent for the case the item has been previously removed from scene
mVideoControl
->
setParentItem
(
m
ToolBarItem
);
//update parent for the case the item has been previously removed from scene
mDelegated
->
scene
()
->
addItem
(
mVideoControl
);
}
...
...
@@ -215,12 +221,17 @@ DelegateVideoControl::DelegateVideoControl(UBGraphicsVideoItem* pDelegated, QGra
,
mAntiScale
(
1.0
)
,
mCurrentTimeInMs
(
0
)
,
mTotalTimeInMs
(
0
)
,
mStartWidth
(
200
)
{
setAcceptedMouseButtons
(
Qt
::
LeftButton
);
setBrush
(
QBrush
(
UBSettings
::
paletteColor
));
setBrush
(
QBrush
(
Qt
::
white
));
setPen
(
Qt
::
NoPen
);
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Control
));
QRectF
rect
=
this
->
rect
();
rect
.
setWidth
(
mStartWidth
);
this
->
setRect
(
rect
);
}
...
...
@@ -250,8 +261,8 @@ void DelegateVideoControl::paint(QPainter *painter,
{
painter
->
setBrush
(
UBSettings
::
paletteColor
);
painter
->
setPen
(
QPen
(
Qt
::
NoPen
));
QRectF
balloon
(
rect
().
x
()
+
position
-
frameWidth
,
rect
().
y
()
-
(
frameWidth
*
1.2
),
2
*
frameWidth
,
frameWidth
);
painter
->
drawRoundedRect
(
balloon
,
frameWidth
/
2
,
frameWidth
/
2
);
mBalloon
.
setRect
(
rect
().
x
()
+
position
-
frameWidth
,
rect
().
y
()
-
(
frameWidth
*
1.2
),
2
*
frameWidth
,
frameWidth
);
painter
->
drawRoundedRect
(
mBalloon
,
frameWidth
/
2
,
frameWidth
/
2
);
QTime
t
;
t
=
t
.
addMSecs
(
mCurrentTimeInMs
<
0
?
0
:
mCurrentTimeInMs
);
...
...
@@ -259,7 +270,7 @@ void DelegateVideoControl::paint(QPainter *painter,
f
.
setPointSizeF
(
f
.
pointSizeF
()
*
mAntiScale
);
painter
->
setFont
(
f
);
painter
->
setPen
(
Qt
::
white
);
painter
->
drawText
(
balloon
,
Qt
::
AlignCenter
,
t
.
toString
(
"m:ss"
));
painter
->
drawText
(
mBalloon
,
Qt
::
AlignCenter
,
t
.
toString
(
"m:ss"
));
}
}
...
...
@@ -298,9 +309,13 @@ void DelegateVideoControl::mousePressEvent(QGraphicsSceneMouseEvent *event)
void
DelegateVideoControl
::
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
if
(
shape
().
contains
(
event
->
pos
()
-
QPointF
(
mBalloon
.
width
()
/
2
,
0
))
&&
shape
().
contains
(
event
->
pos
()
+
QPointF
(
mBalloon
.
width
()
/
2
,
0
)))
{
seekToMousePos
(
event
->
pos
());
update
();
event
->
accept
();
}
}
...
...
src/domain/UBGraphicsVideoItemDelegate.h
View file @
56eceb66
...
...
@@ -63,6 +63,9 @@ class DelegateVideoControl: public QGraphicsRectItem
qint64
mCurrentTimeInMs
;
qint64
mTotalTimeInMs
;
private
:
int
mStartWidth
;
QRectF
mBalloon
;
};
...
...
@@ -107,7 +110,6 @@ class UBGraphicsVideoItemDelegate : public UBGraphicsItemDelegate
DelegateVideoControl
*
mVideoControl
;
Phonon
::
MediaObject
*
mMedia
;
};
...
...
src/domain/ubgraphicsgroupcontaineritem.cpp
View file @
56eceb66
...
...
@@ -6,6 +6,8 @@
#include "domain/ubgraphicsgroupcontaineritemdelegate.h"
#include "domain/UBGraphicsScene.h"
#include "core/memcheck.h"
UBGraphicsGroupContainerItem
::
UBGraphicsGroupContainerItem
(
QGraphicsItem
*
parent
)
:
QGraphicsItemGroup
(
parent
)
{
...
...
src/domain/ubgraphicsgroupcontaineritemdelegate.cpp
View file @
56eceb66
...
...
@@ -8,9 +8,10 @@
#include "domain/UBGraphicsDelegateFrame.h"
#include "domain/ubgraphicsgroupcontaineritem.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
UBGraphicsGroupContainerItemDelegate
::
UBGraphicsGroupContainerItemDelegate
(
QGraphicsItem
*
pDelegated
,
QObject
*
parent
)
:
UBGraphicsItemDelegate
(
pDelegated
,
parent
),
mDestroyGroupButton
(
0
)
...
...
src/frameworks/UBCoreGraphicsScene.cpp
View file @
56eceb66
...
...
@@ -15,12 +15,13 @@
#include "UBCoreGraphicsScene.h"
#include "core/memcheck.h"
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsVideoItem.h"
#include "domain/UBGraphicsMediaItem.h"
#include "domain/UBGraphicsWidgetItem.h"
#include "core/memcheck.h"
UBCoreGraphicsScene
::
UBCoreGraphicsScene
(
QObject
*
parent
)
:
QGraphicsScene
(
parent
)
{
...
...
src/gui/UBDockDownloadWidget.cpp
View file @
56eceb66
...
...
@@ -17,6 +17,8 @@
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
UBDockDownloadWidget
::
UBDockDownloadWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
,
name
)
,
mpLayout
(
NULL
)
,
mpDLWidget
(
NULL
)
...
...
src/gui/UBDockTeacherGuideWidget.cpp
View file @
56eceb66
...
...
@@ -19,6 +19,8 @@
#include "UBDockTeacherGuideWidget.h"
#include "UBTeacherGuideWidget.h"
#include "core/memcheck.h"
UBDockTeacherGuideWidget
::
UBDockTeacherGuideWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
,
name
)
...
...
src/gui/UBFeaturesActionBar.cpp
View file @
56eceb66
#include "UBFeaturesActionBar.h"
#include "core/memcheck.h"
UBFeaturesActionBar
::
UBFeaturesActionBar
(
UBFeaturesController
*
controller
,
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
featuresController
(
controller
)
...
...
@@ -143,6 +144,16 @@ void UBFeaturesActionBar::setButtons()
mpRemoveFavoriteBtn
->
show
();
mpNewFolderBtn
->
hide
();
break
;
case
IN_TRASH
:
mpFavoriteBtn
->
hide
();
mpSocialBtn
->
hide
();
mSearchBar
->
show
();
//mpSearchBtn->show();
//mpDeleteBtn->hide();
mpCloseBtn
->
hide
();
//mpRemoveFavoriteBtn->show();
mpNewFolderBtn
->
hide
();
break
;
default
:
break
;
}
...
...
@@ -169,7 +180,9 @@ void UBFeaturesActionBar::dragMoveEvent(QDragMoveEvent *event)
void
UBFeaturesActionBar
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
{
if
(
event
->
mimeData
()
->
hasFormat
(
"text/uri-list"
))
{
event
->
acceptProposedAction
();
}
}
void
UBFeaturesActionBar
::
dropEvent
(
QDropEvent
*
event
)
...
...
@@ -177,6 +190,12 @@ void UBFeaturesActionBar::dropEvent( QDropEvent *event )
QWidget
*
dest
=
childAt
(
event
->
pos
()
);
if
(
dest
==
mpDeleteBtn
)
{
QList
<
QUrl
>
urls
=
event
->
mimeData
()
->
urls
();
foreach
(
QUrl
url
,
urls
)
{
if
(
!
UBFeaturesController
::
isDeletable
(
url
)
)
return
;
}
event
->
setDropAction
(
Qt
::
MoveAction
);
event
->
accept
();
emit
deleteElements
(
*
event
->
mimeData
()
);
...
...
src/gui/UBFeaturesActionBar.h
View file @
56eceb66
...
...
@@ -12,7 +12,8 @@ enum UBFeaturesActionBarState
IN_ROOT
,
IN_FOLDER
,
IN_PROPERTIES
,
IN_FAVORITE
IN_FAVORITE
,
IN_TRASH
};
class
UBFeaturesActionBar
:
public
QWidget
...
...
src/gui/UBFeaturesWidget.cpp
View file @
56eceb66
This diff is collapsed.
Click to expand it.
src/gui/UBFeaturesWidget.h
View file @
56eceb66
...
...
@@ -18,12 +18,15 @@
#include "UBDockPaletteWidget.h"
//#include "UBLibActionBar.h"
#include "board/UBFeaturesController.h"
#include "api/UBWidgetUniboardAPI.h"
#include "UBFeaturesActionBar.h"
#include "UBRubberBand.h"
#define THUMBNAIL_WIDTH 400
#define ID_LISTVIEW 0
#define ID_PROPERTIES 1
#define ID_WEBVIEW 2
class
UBListModel
;
...
...
@@ -37,6 +40,7 @@ class UBFeaturesPathViewer;
class
UBFeatureProperties
;
class
UBFeatureItemButton
;
class
UBFeaturesListView
;
class
UBFeaturesWebView
;
class
UBFeaturesWidget
:
public
UBDockPaletteWidget
{
...
...
@@ -58,6 +62,7 @@ public:
private
:
void
switchToListView
();
void
switchToProperties
();
void
switchToWebView
();
UBFeaturesController
*
controller
;
...
...
@@ -78,8 +83,10 @@ private:
QGraphicsScene
*
pathScene
;
UBFeaturesActionBar
*
mActionBar
;
UBFeatureProperties
*
featureProperties
;
UBFeaturesWebView
*
webView
;
QStackedWidget
*
stackedWidget
;
int
currentStackedWidget
;
QModelIndex
trashIndex
;
private
slots
:
...
...
@@ -92,6 +99,8 @@ private slots:
void
addToFavorite
(
const
QMimeData
&
);
void
removeFromFavorite
(
const
QMimeData
&
);
void
thumbnailSizeChanged
(
int
);
void
onDisplayMetadata
(
QMap
<
QString
,
QString
>
);
void
onAddDownloadedFileToLibrary
(
bool
,
QUrl
,
QString
,
QByteArray
);
protected
:
bool
eventFilter
(
QObject
*
target
,
QEvent
*
event
);
};
...
...
@@ -105,8 +114,32 @@ public:
protected
:
virtual
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
virtual
void
dropEvent
(
QDropEvent
*
event
);
/*virtual void mousePressEvent( QMouseEvent *event );
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mouseReleaseEvent( QMouseEvent *event );*/
private
:
//UBRubberBand *rubberBand;
//QPoint rubberOrigin;
};
class
UBFeaturesWebView
:
public
QWidget
{
Q_OBJECT
public
:
UBFeaturesWebView
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBFeaturesWebView"
);
~
UBFeaturesWebView
();
void
showElement
(
const
UBFeature
&
elem
);
private
slots
:
void
onLoadFinished
(
bool
ok
);
private
:
QWebView
*
mpView
;
QWebSettings
*
mpWebSettings
;
QVBoxLayout
*
mpLayout
;
UBWidgetUniboardAPI
*
mpSankoreAPI
;
};
class
UBFeatureProperties
:
public
QWidget
{
...
...
@@ -119,28 +152,31 @@ public:
protected
:
//
void resizeEvent(QResizeEvent *event);
//
void showEvent(QShowEvent *event);
void
resizeEvent
(
QResizeEvent
*
event
);
void
showEvent
(
QShowEvent
*
event
);
private
slots
:
void
onAddToPage
();
//
void onAddToLib();
//
void onSetAsBackground();
void
onAddToLib
();
void
onSetAsBackground
();
//void onBack();
private
:
void
populateMetadata
();
void
adaptSize
();
QVBoxLayout
*
mpLayout
;
QHBoxLayout
*
mpButtonLayout
;
UBFeatureItemButton
*
mpAddPageButton
;
UBFeatureItemButton
*
mpAddToLibButton
;
UBFeatureItemButton
*
mpSetAsBackgroundButton
;
QLabel
*
mpObjInfoLabel
;
//
QTreeWidget* mpObjInfos;
QTreeWidget
*
mpObjInfos
;
QLabel
*
mpThumbnail
;
QPixmap
*
mpOrigPixmap
;
int
maxThumbHeight
;
UBFeature
*
mpElement
;
//
QTreeWidgetItem* mpItem;
QTreeWidgetItem
*
mpItem
;
};
...
...
@@ -174,7 +210,7 @@ public:
Qt
::
DropActions
supportedDropActions
()
const
{
return
Qt
::
MoveAction
|
Qt
::
CopyAction
;
}
void
setFeaturesList
(
QList
<
UBFeature
>
*
flist
)
{
featuresList
=
flist
;
}
void
setFeaturesList
(
QList
<
UBFeature
>
*
flist
)
{
featuresList
=
flist
;
}
private
:
QList
<
UBFeature
>
*
featuresList
;
};
...
...
src/gui/UBLibItemProperties.cpp
View file @
56eceb66
...
...
@@ -18,12 +18,13 @@
#include "core/UBApplication.h"
#include "core/UBDownloadManager.h"
#include "core/memcheck.h"
#include "frameworks/UBFileSystemUtils.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
/**
* \brief Constructor
...
...
src/gui/UBLibNavigatorWidget.cpp
View file @
56eceb66
...
...
@@ -16,10 +16,11 @@
#include "UBLibWidget.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
static
int
lowBoundForSlider
=
40
;
static
int
topBoundForSlider
=
120
;
static
int
tickIntervalForSlider
=
10
;
...
...
src/gui/UBLibPathViewer.cpp
View file @
56eceb66
...
...
@@ -20,10 +20,11 @@
#include "core/UBApplication.h"
#include "board/UBBoardController.h"
#include "core/memcheck.h"
#include "core/UBDownloadManager.h"
#include "board/UBBoardPaletteManager.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent widget
...
...
src/gui/UBLibWebView.cpp
View file @
56eceb66
#include <QDomDocument>
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
...
...
@@ -9,7 +8,7 @@
#include "UBLibWebView.h"
#include "core/memcheck.h"
UBLibWebView
::
UBLibWebView
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpView
(
NULL
)
...
...
src/gui/UBLibWidget.cpp
View file @
56eceb66
...
...
@@ -17,10 +17,11 @@
#include "UBLibWidget.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent widget
...
...
src/gui/UBPageNavigationWidget.cpp
View file @
56eceb66
...
...
@@ -14,12 +14,13 @@
*/
#include "UBPageNavigationWidget.h"
#include "core/UBApplication.h"
#include "core/memcheck.h"
#include "board/UBBoardController.h"
#include "globals/UBGlobals.h"
#include "core/memcheck.h"
/**
* \brief Constructor
* @param parent as the parent widget
...
...
src/gui/UBTGWidgetTreeDelegate.cpp
View file @
56eceb66
...
...
@@ -7,6 +7,8 @@
#include <QModelIndex>
#include "UBTGWidgetTreeDelegate.h"
#include "core/memcheck.h"
UBTGWidgetTreeDelegate
::
UBTGWidgetTreeDelegate
(
QObject
*
parent
)
:
QStyledItemDelegate
(
parent
)
{
...
...
src/gui/UBTeacherGuideDelegate.cpp
View file @
56eceb66
#include "UBTeacherGuideDelegate.h"
#include "core/memcheck.h"
UBTeacherGuideDelegate
::
UBTeacherGuideDelegate
()
{
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
56eceb66
...
...
@@ -40,6 +40,8 @@
#include "document/UBDocumentProxy.h"
#include "document/UBDocumentController.h"
#include "core/memcheck.h"
#define UBTG_SEPARATOR_FIXED_HEIGHT 3
...
...
src/gui/UBTeacherGuideWidgetsTools.cpp
View file @
56eceb66
...
...
@@ -32,6 +32,8 @@
#include "frameworks/UBFileSystemUtils.h"
#include "core/memcheck.h"
/***************************************************************************
* class UBAddItem *
...
...
src/pdf-merger/CCITTFaxDecode.cpp
View file @
56eceb66
...
...
@@ -16,6 +16,8 @@
#include <QtGlobal>
#include "CCITTFaxDecode.h"
#include "core/memcheck.h"
using
namespace
merge_lib
;
bool
CCITTFaxDecode
::
encode
(
std
::
string
&
decoded
)
...
...
src/pdf-merger/DCTDecode.cpp
View file @
56eceb66
...
...
@@ -16,6 +16,8 @@
#include <QtGlobal>
#include "DCTDecode.h"
#include "core/memcheck.h"
using
namespace
merge_lib
;
bool
DCTDecode
::
encode
(
std
::
string
&
decoded
)
...
...
src/pdf-merger/JBIG2Decode.cpp
View file @
56eceb66
...
...
@@ -15,6 +15,7 @@
#include <QtGlobal>
#include "JBIG2Decode.h"
#include "core/memcheck.h"
using
namespace
merge_lib
;
...
...
src/web/UBOEmbedParser.cpp
View file @
56eceb66
...
...
@@ -24,6 +24,8 @@
#include "UBOEmbedParser.h"
#include "core/memcheck.h"
UBOEmbedParser
::
UBOEmbedParser
(
QObject
*
parent
,
const
char
*
name
)
{
Q_UNUSED
(
parent
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment