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
2e0bf003
Commit
2e0bf003
authored
Feb 06, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
a5a728d4
5761ddb0
Changes
33
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
302 additions
and
190 deletions
+302
-190
style.qss
resources/style.qss
+2
-1
UBExportFullPDF.cpp
src/adaptors/UBExportFullPDF.cpp
+26
-71
UBExportFullPDF.h
src/adaptors/UBExportFullPDF.h
+3
-4
UBExportPDF.cpp
src/adaptors/UBExportPDF.cpp
+0
-1
UBMetadataDcSubsetAdaptor.cpp
src/adaptors/UBMetadataDcSubsetAdaptor.cpp
+2
-1
UBSettings.cpp
src/core/UBSettings.cpp
+1
-0
UBSettings.h
src/core/UBSettings.h
+1
-0
UBWidgetList.cpp
src/customWidgets/UBWidgetList.cpp
+9
-0
UBWidgetList.h
src/customWidgets/UBWidgetList.h
+4
-0
UBDesktopAnnotationController.cpp
src/desktop/UBDesktopAnnotationController.cpp
+1
-1
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+2
-3
UBDocumentProxy.cpp
src/document/UBDocumentProxy.cpp
+9
-0
UBDocumentProxy.h
src/document/UBDocumentProxy.h
+1
-0
UBGraphicsTextItemDelegate.cpp
src/domain/UBGraphicsTextItemDelegate.cpp
+6
-4
UBDockPalette.cpp
src/gui/UBDockPalette.cpp
+1
-1
UBDocumentNavigator.cpp
src/gui/UBDocumentNavigator.cpp
+3
-6
UBLibPathViewer.cpp
src/gui/UBLibPathViewer.cpp
+1
-1
UBLibraryWidget.cpp
src/gui/UBLibraryWidget.cpp
+1
-4
UBResources.cpp
src/gui/UBResources.cpp
+1
-2
UBResources.h
src/gui/UBResources.h
+0
-1
UBTBDocumentEditWidget.cpp
src/gui/UBTBDocumentEditWidget.cpp
+4
-5
UBTBDocumentEditWidget.h
src/gui/UBTBDocumentEditWidget.h
+1
-1
UBTBDocumentPreviewWidget.cpp
src/gui/UBTBDocumentPreviewWidget.cpp
+119
-15
UBTBDocumentPreviewWidget.h
src/gui/UBTBDocumentPreviewWidget.h
+27
-2
UBTBPageEditWidget.cpp
src/gui/UBTBPageEditWidget.cpp
+1
-1
UBTeacherBarDataMgr.cpp
src/gui/UBTeacherBarDataMgr.cpp
+8
-2
UBTeacherBarDataMgr.h
src/gui/UBTeacherBarDataMgr.h
+9
-0
UBTeacherBarPreviewWidget.cpp
src/gui/UBTeacherBarPreviewWidget.cpp
+31
-12
UBTeacherBarPreviewWidget.h
src/gui/UBTeacherBarPreviewWidget.h
+6
-1
UBTeacherBarWidget.cpp
src/gui/UBTeacherBarWidget.cpp
+6
-0
UBTeacherBarWidget.h
src/gui/UBTeacherBarWidget.h
+1
-0
UBThumbnailWidget.cpp
src/gui/UBThumbnailWidget.cpp
+15
-48
UBThumbnailWidget.h
src/gui/UBThumbnailWidget.h
+0
-2
No files found.
resources/style.qss
View file @
2e0bf003
...
...
@@ -27,7 +27,8 @@ QWidget#UBMediaVideoContainer
border: 2px solid #999999;
}
QWidget#UBTeacherBarPreviewWidget
QWidget#UBTBPreviewWidget
{
background: #FFFFFF;
border-radius: 10px;
...
...
src/adaptors/UBExportFullPDF.cpp
View file @
2e0bf003
...
...
@@ -46,7 +46,10 @@ using namespace merge_lib;
UBExportFullPDF
::
UBExportFullPDF
(
QObject
*
parent
)
:
UBExportAdaptor
(
parent
)
{
// NOOP
//need to calculate screen resolution
QDesktopWidget
*
desktop
=
UBApplication
::
desktop
();
int
dpiCommon
=
(
desktop
->
physicalDpiX
()
+
desktop
->
physicalDpiY
())
/
2
;
mScaleFactor
=
72.0
f
/
dpiCommon
;
}
...
...
@@ -56,7 +59,7 @@ UBExportFullPDF::~UBExportFullPDF()
}
void
UBExportFullPDF
::
saveOverlayPdf
(
UBDocumentProxy
*
pDocumentProxy
,
QString
filename
)
void
UBExportFullPDF
::
saveOverlayPdf
(
UBDocumentProxy
*
pDocumentProxy
,
const
QString
&
filename
)
{
if
(
!
pDocumentProxy
||
filename
.
length
()
==
0
||
pDocumentProxy
->
pageCount
()
==
0
)
return
;
...
...
@@ -70,9 +73,6 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString fi
pdfPrinter
.
setOutputFileName
(
filename
);
pdfPrinter
.
setFullPage
(
true
);
const
qreal
margin
=
UBSettings
::
settings
()
->
pdfMargin
->
get
().
toDouble
()
*
pdfPrinter
.
resolution
()
/
25.4
;
mMargin
=
margin
;
QPainter
*
pdfPainter
=
0
;
for
(
int
pageIndex
=
0
;
pageIndex
<
pDocumentProxy
->
pageCount
();
pageIndex
++
)
...
...
@@ -87,54 +87,20 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString fi
scene
->
setRenderingQuality
(
UBItem
::
RenderingQualityHigh
);
scene
->
setRenderingContext
(
UBGraphicsScene
::
PdfExport
);
UBGraphicsPDFItem
*
pdfItem
=
qgraphicsitem_cast
<
UBGraphicsPDFItem
*>
(
scene
->
backgroundObject
());
if
(
pdfItem
)
{
QSizeF
sceneItemsBound
=
scene
->
itemsBoundingRect
().
size
();
qreal
ratio
=
(
qreal
)
pdfPrinter
.
resolution
()
/
72.0
;
QSizeF
scaled
=
sceneItemsBound
*
ratio
;
pdfPrinter
.
setPaperSize
(
scaled
,
QPrinter
::
DevicePixel
);
QSize
pageSize
=
scene
->
nominalSize
();
if
(
pageIndex
!=
0
)
pdfPrinter
.
newPage
();
if
(
!
pdfPainter
)
pdfPainter
=
new
QPainter
(
&
pdfPrinter
);
//render to PDF
scene
->
render
(
pdfPainter
,
QRectF
(
0
,
0
,
sceneItemsBound
.
width
()
*
ratio
,
sceneItemsBound
.
height
()
*
ratio
),
scene
->
itemsBoundingRect
());
mHasPDFBackgrounds
=
true
;
}
else
{
if
(
UBSettings
::
settings
()
->
pdfPageFormat
->
get
().
toString
()
==
"Letter"
)
pdfPrinter
.
setPageSize
(
QPrinter
::
Letter
);
else
pdfPrinter
.
setPageSize
(
QPrinter
::
A4
);
UBGraphicsPDFItem
*
pdfItem
=
qgraphicsitem_cast
<
UBGraphicsPDFItem
*>
(
scene
->
backgroundObject
());
QSize
docSize
=
pDocumentProxy
->
defaultDocumentSize
();
if
(
docSize
.
width
()
>
docSize
.
height
())
{
pdfPrinter
.
setOrientation
(
QPrinter
::
Landscape
);
}
if
(
pdfItem
)
mHasPDFBackgrounds
=
true
;
if
(
pageIndex
!=
0
)
pdfPrinter
.
newPage
();
pdfPrinter
.
setPaperSize
(
QSizeF
(
pageSize
.
width
()
*
mScaleFactor
,
pageSize
.
height
()
*
mScaleFactor
),
QPrinter
::
Point
);
mDefaultPageRect
=
pdfPrinter
.
paperRect
();
QRectF
paperRect
=
mDefaultPageRect
.
adjusted
(
margin
,
margin
,
-
margin
,
-
margin
);
QRectF
normalized
=
scene
->
normalizedSceneRect
(
paperRect
.
width
()
/
paperRect
.
height
());
if
(
!
pdfPainter
)
pdfPainter
=
new
QPainter
(
&
pdfPrinter
);
if
(
!
pdfPainter
)
pdfPainter
=
new
QPainter
(
&
pdfPrinter
);
if
(
pageIndex
!=
0
)
pdfPrinter
.
newPage
();
//render to PDF
scene
->
render
(
pdfPainter
,
paperRect
,
normalized
);
}
scene
->
render
(
pdfPainter
);
//restore screen rendering quality
scene
->
setRenderingContext
(
UBGraphicsScene
::
Screen
);
...
...
@@ -144,8 +110,7 @@ void UBExportFullPDF::saveOverlayPdf(UBDocumentProxy* pDocumentProxy, QString fi
scene
->
setBackground
(
isDark
,
isCrossed
);
}
if
(
pdfPainter
)
delete
pdfPainter
;
if
(
pdfPainter
)
delete
pdfPainter
;
}
...
...
@@ -171,12 +136,10 @@ void UBExportFullPDF::persist(UBDocumentProxy* pDocumentProxy)
}
void
UBExportFullPDF
::
persistsDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
filename
)
void
UBExportFullPDF
::
persistsDocument
(
UBDocumentProxy
*
pDocumentProxy
,
const
QString
&
filename
)
{
QFile
file
(
filename
);
if
(
file
.
exists
())
file
.
remove
();
if
(
file
.
exists
())
file
.
remove
();
QString
overlayName
=
filename
;
overlayName
.
replace
(
".pdf"
,
"_overlay.pdf"
);
...
...
@@ -209,6 +172,8 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, QString
UBGraphicsScene
*
scene
=
UBPersistenceManager
::
persistenceManager
()
->
loadDocumentScene
(
pDocumentProxy
,
pageIndex
);
UBGraphicsPDFItem
*
pdfItem
=
qgraphicsitem_cast
<
UBGraphicsPDFItem
*>
(
scene
->
backgroundObject
());
QSize
pageSize
=
scene
->
nominalSize
();
if
(
pdfItem
)
{
QString
pdfName
=
UBPersistenceManager
::
objectDirectory
+
"/"
+
pdfItem
->
fileUuid
().
toString
()
+
".pdf"
;
...
...
@@ -216,24 +181,18 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, QString
QPointF
boudingRectBottomLeft
=
scene
->
itemsBoundingRect
().
bottomLeft
();
QPointF
pdfItemBottomLeft
=
pdfItem
->
sceneBoundingRect
().
bottomLeft
();
QPointF
offset
=
pdfItemBottomLeft
-
boudingRectBottomLeft
;
qDebug
()
<<
"scene->itemsBoundingRect()"
<<
scene
->
itemsBoundingRect
();
qDebug
()
<<
"pdfItem->boundingRect()"
<<
pdfItem
->
boundingRect
();
qDebug
()
<<
"pdfItem->sceneBoundingRect()"
<<
pdfItem
->
sceneBoundingRect
();
qDebug
()
<<
offset
;
TransformationDescription
baseTrans
(
offset
.
x
(),
offset
.
y
()
*
-
1
,
1
,
0
);
//TransformationDescription baseTrans(0, 0, 1, 0);
TransformationDescription
overlayTrans
(
0
,
0
,
1
,
0
);
MergePageDescription
pageDescription
(
scene
->
itemsBoundingRect
().
width
()
,
scene
->
itemsBoundingRect
().
height
()
,
MergePageDescription
pageDescription
(
pageSize
.
width
()
*
mScaleFactor
,
pageSize
.
height
()
*
mScaleFactor
,
pdfItem
->
pageNumber
(),
QFile
::
encodeName
(
backgroundPath
).
constData
(),
baseTrans
,
TransformationDescription
()
,
pageIndex
+
1
,
overlayTrans
,
TransformationDescription
()
,
false
,
false
);
mergeInfo
.
push_back
(
pageDescription
);
...
...
@@ -242,12 +201,8 @@ void UBExportFullPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, QString
}
else
{
QRectF
paperRect
=
mDefaultPageRect
.
adjusted
(
mMargin
,
mMargin
,
-
mMargin
,
-
mMargin
);
QRectF
normalized
=
scene
->
normalizedSceneRect
(
paperRect
.
width
()
/
paperRect
.
height
());
MergePageDescription
pageDescription
(
normalized
.
width
(),
normalized
.
height
(),
MergePageDescription
pageDescription
(
pageSize
.
width
()
*
mScaleFactor
,
pageSize
.
height
()
*
mScaleFactor
,
0
,
""
,
TransformationDescription
(),
...
...
src/adaptors/UBExportFullPDF.h
View file @
2e0bf003
...
...
@@ -33,14 +33,13 @@ class UBExportFullPDF : public UBExportAdaptor
virtual
QString
exportExtention
();
virtual
void
persist
(
UBDocumentProxy
*
pDocument
);
virtual
void
persistsDocument
(
UBDocumentProxy
*
pDocument
,
QString
filename
);
virtual
void
persistsDocument
(
UBDocumentProxy
*
pDocument
,
const
QString
&
filename
);
protected
:
void
saveOverlayPdf
(
UBDocumentProxy
*
pDocumentProxy
,
QString
filename
);
void
saveOverlayPdf
(
UBDocumentProxy
*
pDocumentProxy
,
const
QString
&
filename
);
private
:
QRect
mDefaultPageRect
;
int
mMargin
;
float
mScaleFactor
;
bool
mHasPDFBackgrounds
;
};
...
...
src/adaptors/UBExportPDF.cpp
View file @
2e0bf003
...
...
@@ -101,7 +101,6 @@ void UBExportPDF::persistsDocument(UBDocumentProxy* pDocumentProxy, const QStrin
//setting page size to appropriate value
pdfPrinter
.
setPaperSize
(
QSizeF
(
pageSize
.
width
()
*
scaleFactor
,
pageSize
.
height
()
*
scaleFactor
),
QPrinter
::
Point
);
pdfPrinter
.
setOrientation
((
pageSize
.
width
()
>
pageSize
.
height
())
?
QPrinter
::
Landscape
:
QPrinter
::
Portrait
);
if
(
painterNeedsBegin
)
painterNeedsBegin
=
!
pdfPainter
.
begin
(
&
pdfPrinter
);
//render to PDF
scene
->
render
(
&
pdfPainter
);
...
...
src/adaptors/UBMetadataDcSubsetAdaptor.cpp
View file @
2e0bf003
...
...
@@ -276,7 +276,6 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
qWarning
()
<<
"Document size not found, using default view size"
<<
docSize
;
metadata
.
insert
(
UBSettings
::
documentSize
,
QVariant
(
docSize
));
}
if
(
!
updatedAtFound
)
...
...
@@ -284,6 +283,8 @@ QMap<QString, QVariant> UBMetadataDcSubsetAdaptor::load(QString pPath)
metadata
.
insert
(
UBSettings
::
documentUpdatedAt
,
date
+
"T00:00:00Z"
);
}
metadata
.
insert
(
UBSettings
::
documentDate
,
QVariant
(
date
));
return
metadata
;
}
src/core/UBSettings.cpp
View file @
2e0bf003
...
...
@@ -43,6 +43,7 @@ QString UBSettings::sessionKeywords = QString("sessionKeywords");
QString
UBSettings
::
sessionLevel
=
QString
(
"sessionLevel"
);
QString
UBSettings
::
sessionTopic
=
QString
(
"sessionTopic"
);
QString
UBSettings
::
sessionAuthors
=
QString
(
"sessionAuthors"
);
QString
UBSettings
::
documentDate
=
QString
(
"date"
);
QString
UBSettings
::
trashedDocumentGroupNamePrefix
=
QString
(
"_Trash:"
);
...
...
src/core/UBSettings.h
View file @
2e0bf003
...
...
@@ -160,6 +160,7 @@ class UBSettings : public QObject
static
QString
sessionLevel
;
static
QString
sessionTopic
;
static
QString
sessionAuthors
;
static
QString
documentDate
;
static
QString
trashedDocumentGroupNamePrefix
;
...
...
src/customWidgets/UBWidgetList.cpp
View file @
2e0bf003
...
...
@@ -10,6 +10,8 @@ UBWidgetList::UBWidgetList(QWidget* parent, eWidgetListOrientation orientation,
,
mMargin
(
5
)
,
mListElementsSpacing
(
10
)
,
mpEmptyLabel
(
NULL
)
,
mCanRemove
(
true
)
,
mpCurrentWidget
(
NULL
)
{
setObjectName
(
name
);
mOrientation
=
orientation
;
...
...
@@ -130,6 +132,13 @@ void UBWidgetList::resizeEvent(QResizeEvent *ev)
updateSizes
();
}
void
UBWidgetList
::
mousePressEvent
(
QMouseEvent
*
ev
)
{
if
(
mCanRemove
){
}
}
void
UBWidgetList
::
updateSizes
()
{
// Resize all the widgets
...
...
src/customWidgets/UBWidgetList.h
View file @
2e0bf003
...
...
@@ -41,7 +41,10 @@ public:
int
listElementsSpacing
()
{
return
mListElementsSpacing
;
}
protected
:
bool
mCanRemove
;
void
resizeEvent
(
QResizeEvent
*
ev
);
void
mousePressEvent
(
QMouseEvent
*
ev
);
private
:
int
scaleWidgets
(
QSize
pSize
);
...
...
@@ -55,6 +58,7 @@ private:
int
mListElementsSpacing
;
QMap
<
QWidget
*
,
QSize
>
mWidgetInfo
;
QLabel
*
mpEmptyLabel
;
QWidget
*
mpCurrentWidget
;
};
#endif // UBWIDGETLIST_H
src/desktop/UBDesktopAnnotationController.cpp
View file @
2e0bf003
...
...
@@ -81,7 +81,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent)
mTransparentDrawingView
->
setMouseTracking
(
true
);
mTransparentDrawingView
->
setAcceptDrops
(
fals
e
);
mTransparentDrawingView
->
setAcceptDrops
(
tru
e
);
QString
backgroundStyle
=
"QWidget {background-color: rgba(127, 127, 127, 0)}"
;
mTransparentDrawingView
->
setStyleSheet
(
backgroundStyle
);
...
...
src/document/UBDocumentController.cpp
View file @
2e0bf003
...
...
@@ -1150,11 +1150,10 @@ void UBDocumentController::moveSceneToIndex(UBDocumentProxy* proxy, int source,
UBMetadataDcSubsetAdaptor
::
persist
(
proxy
);
refreshDocumentThumbnailsView
();
// NOTE [Didier]: I think that selecting the thumbnail is not the role of the documentController
mDocumentUI
->
thumbnailWidget
->
selectItemAt
(
target
);
// Notify the move to anyone interested in knowing it
emit
movedToIndex
(
target
);
UBApplication
::
boardController
->
setActiveDocumentScene
(
proxy
,
target
);
}
...
...
src/document/UBDocumentProxy.cpp
View file @
2e0bf003
...
...
@@ -295,6 +295,15 @@ QString UBDocumentProxy::sessionAuthors()
return
QString
();
}
QString
UBDocumentProxy
::
documentDate
()
{
if
(
mMetaDatas
.
contains
(
UBSettings
::
documentDate
)){
return
metaData
(
UBSettings
::
documentDate
).
toString
();
}
else
{
return
QString
();
}
}
bool
UBDocumentProxy
::
isModified
()
const
{
return
mIsModified
;
...
...
src/document/UBDocumentProxy.h
View file @
2e0bf003
...
...
@@ -59,6 +59,7 @@ class UBDocumentProxy : public QObject
QString
sessionTopic
();
void
setSessionAuthor
(
const
QString
&
authors
);
QString
sessionAuthors
();
QString
documentDate
();
QSize
defaultDocumentSize
()
const
;
...
...
src/domain/UBGraphicsTextItemDelegate.cpp
View file @
2e0bf003
...
...
@@ -305,10 +305,11 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta)
bool
bEndofTheSameBlock
;
int
iBlockLen
;
int
iPointSize
;
int
i
new
PointSize
;
int
i
Next
PointSize
;
int
iCursorPos
=
startPos
;
// we search continuous blocks of the text with the same PointSize and allpy new settings for them.
cursor
.
setPosition
(
startPos
,
QTextCursor
::
MoveAnchor
);
while
(
iCursorPos
<
endPos
)
{
bEndofTheSameBlock
=
false
;
...
...
@@ -326,17 +327,18 @@ void UBGraphicsTextItemDelegate::ChangeTextSize(int delta)
iBlockLen
++
;
cursor
.
setPosition
(
iCursorPos
+
iBlockLen
+
1
,
QTextCursor
::
KeepAnchor
);
i
new
PointSize
=
cursor
.
charFormat
().
font
().
pointSize
();
i
Next
PointSize
=
cursor
.
charFormat
().
font
().
pointSize
();
cursor
.
setPosition
(
iCursorPos
+
iBlockLen
,
QTextCursor
::
KeepAnchor
);
if
((
iPointSize
!=
i
new
PointSize
)
||
(
iCursorPos
+
iBlockLen
>=
endPos
))
if
((
iPointSize
!=
i
Next
PointSize
)
||
(
iCursorPos
+
iBlockLen
>=
endPos
))
bEndofTheSameBlock
=
true
;
}
while
(
!
bEndofTheSameBlock
);
//setting new parameners
curFont
.
setPointSize
(
iPointSize
+
delta
);
int
iNewPointSize
=
iPointSize
+
delta
;
curFont
.
setPointSize
(
(
iNewPointSize
>
0
)
?
iNewPointSize
:
1
);
textFormat
.
setFont
(
curFont
);
cursor
.
mergeCharFormat
(
textFormat
);
...
...
src/gui/UBDockPalette.cpp
View file @
2e0bf003
...
...
@@ -697,7 +697,7 @@ void UBDockPalette::moveTabs()
void
UBDockPalette
::
resizeTabs
()
{
int
numTabs
=
mTabWidgets
.
size
();
mTabPalette
->
res
ize
(
2
*
border
(),
(
numTabs
*
TABSIZE
)
+
qMax
(
numTabs
-
1
,
0
)
*
tabSpacing
());
mTabPalette
->
setFixedS
ize
(
2
*
border
(),
(
numTabs
*
TABSIZE
)
+
qMax
(
numTabs
-
1
,
0
)
*
tabSpacing
());
}
QRect
UBDockPalette
::
getTabPaletteRect
()
{
...
...
src/gui/UBDocumentNavigator.cpp
View file @
2e0bf003
...
...
@@ -391,17 +391,13 @@ void UBDocumentNavigator::mousePressEvent(QMouseEvent *event)
mCrntItem
=
pCrntItem
;
}
// HACK: for an unknown reason, the mousePressEvent of the item is not
// called when a click occurs on it. So I created this method in
// order to handle the click.
mCrntItem
->
notifyClick
(
mapToScene
(
event
->
pos
()));
// Then display the related page
emit
changeCurrentPage
();
refreshScene
();
}
bNavig
=
false
;
}
QGraphicsView
::
mousePressEvent
(
event
);
}
/**
...
...
@@ -448,6 +444,7 @@ void UBDocumentNavigator::onMovedToIndex(int index)
UBSceneThumbnailNavigPixmap
*
pItem
=
dynamic_cast
<
UBSceneThumbnailNavigPixmap
*>
(
mThumbnails
.
at
(
index
));
if
(
NULL
!=
pItem
)
{
if
(
mCrntItem
)
mCrntItem
->
setSelected
(
false
);
//deselecting previous one
mCrntItem
=
pItem
;
mCrntItem
->
setSelected
(
true
);
centerOn
(
mCrntItem
);
...
...
src/gui/UBLibPathViewer.cpp
View file @
2e0bf003
...
...
@@ -284,7 +284,7 @@ void UBLibPathViewer::showBack()
if
(
NULL
!=
pLastElem
)
{
mpBackElem
->
setPath
(
pLastElem
->
element
()
->
path
());
mpBackElem
->
setType
(
eUBLibElementType_Folder
);
mpBackElem
->
setType
(
pLastElem
->
element
()
->
type
()
);
mpBackElem
->
setName
(
pLastElem
->
element
()
->
name
());
}
...
...
src/gui/UBLibraryWidget.cpp
View file @
2e0bf003
...
...
@@ -361,15 +361,12 @@ void UBLibraryWidget::dropEvent(QDropEvent *event)
QString
filePath
;
QString
crntPath
=
urlList
.
at
(
i
).
toString
();
#ifdef Q_WS_MACX
filePath
=
QUrl
(
urlList
.
at
(
i
)).
toString
();
#else
if
(
crntPath
.
startsWith
(
"file:"
)
||
crntPath
.
startsWith
(
"/"
)){
filePath
=
QUrl
(
crntPath
).
toLocalFile
();
}
else
{
filePath
=
crntPath
;
}
#endif
mLibraryController
->
importItemOnLibrary
(
filePath
);
bDropAccepted
=
true
;
}
...
...
src/gui/UBResources.cpp
View file @
2e0bf003
...
...
@@ -51,7 +51,6 @@ void UBResources::init()
// Cursors
penCursor
=
QCursor
(
Qt
::
CrossCursor
);
eraserCursor
=
QCursor
(
QPixmap
(
":/images/cursors/eraser.png"
),
21
,
21
);
magnifierCursor
=
QCursor
(
QPixmap
(
":/images/cursors/magnifier.png"
),
9
,
9
);
markerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/marker.png"
),
3
,
30
);
pointerCursor
=
QCursor
(
QPixmap
(
":/images/cursors/laser.png"
),
2
,
1
);
handCursor
=
QCursor
(
Qt
::
OpenHandCursor
);
...
...
src/gui/UBResources.h
View file @
2e0bf003
...
...
@@ -37,7 +37,6 @@ class UBResources : public QObject
QCursor
penCursor
;
QCursor
eraserCursor
;
QCursor
magnifierCursor
;
QCursor
markerCursor
;
QCursor
pointerCursor
;
QCursor
handCursor
;
...
...
src/gui/UBTBDocumentEditWidget.cpp
View file @
2e0bf003
...
...
@@ -62,8 +62,8 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
mpKeywords
->
setObjectName
(
"DockPaletteWidgetLineEdit"
);
mpLevel
=
new
QComboBox
(
this
);
mpLevel
->
setObjectName
(
"DockPaletteWidgetComboBox"
);
mpTopic
=
new
Q
ComboBox
(
this
);
mpTopic
->
setObjectName
(
"DockPaletteWidget
ComboBox
"
);
mpTopic
=
new
Q
LineEdit
(
this
);
mpTopic
->
setObjectName
(
"DockPaletteWidget
LineEdit
"
);
mpAuthor
=
new
QLineEdit
(
this
);
mpAuthor
->
setObjectName
(
"DockPaletteWidgetLineEdit"
);
mpKeywordLabel
=
new
QLabel
(
tr
(
"Keywords:"
),
this
);
...
...
@@ -120,7 +120,7 @@ UBTBDocumentEditWidget::UBTBDocumentEditWidget(UBTeacherBarDataMgr* pDataMgr, QW
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
(
currentIndex
Changed
(
QString
)),
this
,
SLOT
(
onTopicChanged
(
QString
)));
connect
(
mpTopic
,
SIGNAL
(
text
Changed
(
QString
)),
this
,
SLOT
(
onTopicChanged
(
QString
)));
connect
(
mpAuthor
,
SIGNAL
(
textChanged
(
QString
)),
this
,
SLOT
(
onAuthorChanged
(
QString
)));
}
...
...
@@ -179,7 +179,7 @@ void UBTBDocumentEditWidget::updateFields()
mpTarget
->
setPlainText
(
mpDataMgr
->
sessionTarget
());
mpKeywords
->
setText
(
mpDataMgr
->
keywords
());
// TODO: retrieve the level
// TODO retrieve the topic
mpTopic
->
setText
(
mpDataMgr
->
topic
());
mpAuthor
->
setText
(
mpDataMgr
->
authors
());
}
...
...
@@ -192,7 +192,6 @@ void UBTBDocumentEditWidget::clearFields()
void
UBTBDocumentEditWidget
::
onKeywordChanged
(
const
QString
&
kw
)
{
mpDataMgr
->
setKeywords
(
kw
);
qDebug
()
<<
">>> KEYWORD CHANGED: "
<<
kw
;
emit
valueChanged
();
}
...
...
src/gui/UBTBDocumentEditWidget.h
View file @
2e0bf003
...
...
@@ -60,7 +60,7 @@ private:
QComboBox
*
mpLicenseCombox
;
QLineEdit
*
mpKeywords
;
QComboBox
*
mpLevel
;
Q
ComboBox
*
mpTopic
;
Q
LineEdit
*
mpTopic
;
QLineEdit
*
mpAuthor
;
QLabel
*
mpKeywordLabel
;
QLabel
*
mpLevelLabel
;
...
...
src/gui/UBTBDocumentPreviewWidget.cpp
View file @
2e0bf003
...
...
@@ -4,27 +4,119 @@
UBTBDocumentPreviewWidget
::
UBTBDocumentPreviewWidget
(
UBTeacherBarDataMgr
*
pDataMgr
,
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpPageViewButton
(
NULL
)
,
mpEditButton
(
NULL
)
,
mpSessionLabel
(
NULL
)
,
mpSessionTitle
(
NULL
)
,
mpAuthorLabel
(
NULL
)
,
mpAuthors
(
NULL
)
,
mpCreationDate
(
NULL
)
,
mpTargetLabel
(
NULL
)
,
mpTarget
(
NULL
)
,
mpMetadataLabel
(
NULL
)
,
mpKeywordLabel
(
NULL
)
,
mpKeyword
(
NULL
)
,
mpLevelLabel
(
NULL
)
,
mpLevel
(
NULL
)
,
mpTopicLabel
(
NULL
)
,
mpTopic
(
NULL
)
,
mpLicense
(
NULL
)
,
mpContainer
(
NULL
)
{
setObjectName
(
name
);
mpDataMgr
=
pDataMgr
;
setLayout
(
&
mLayout
);
mLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
);
mpPageViewButton
=
new
QPushButton
(
tr
(
"Page View"
),
this
);
mpPageViewButton
->
setObjectName
(
"DockPaletteWidgetButton"
);
mPageLayout
.
addStretch
(
1
);
mPageLayout
.
addWidget
(
mpPageViewButton
,
0
);
mPageLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mPageLayout
);
mpContainer
=
new
QWidget
(
this
);
mpContainer
->
setLayout
(
&
mContainerLayout
);
mpContainer
->
setObjectName
(
"UBTBPreviewWidget"
);
// Session Title
mpSessionLabel
=
new
QLabel
(
tr
(
"Session"
),
mpContainer
);
mpSessionLabel
->
setAlignment
(
Qt
::
AlignRight
);
mpSessionLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mContainerLayout
.
addWidget
(
mpSessionLabel
,
0
);
mpSessionTitle
=
new
QLabel
(
mpContainer
);
mpSessionTitle
->
setWordWrap
(
true
);
mpSessionTitle
->
setAlignment
(
Qt
::
AlignRight
);
mpSessionTitle
->
setObjectName
(
"UBTeacherBarPreviewTitle"
);
mContainerLayout
.
addWidget
(
mpSessionTitle
,
0
);
mContainerLayout
.
addWidget
(
&
mTitleSeparator
,
0
);
// Author(s)
mpAuthorLabel
=
new
QLabel
(
tr
(
"Author(s)"
),
mpContainer
);
mpAuthorLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mContainerLayout
.
addWidget
(
mpAuthorLabel
,
0
);
mpAuthors
=
new
QLabel
(
mpContainer
);
mpAuthors
->
setWordWrap
(
true
);
mpAuthors
->
setStyleSheet
(
"padding-left:5px;"
);
mContainerLayout
.
addWidget
(
mpAuthors
,
0
);
mContainerLayout
.
addWidget
(
&
mAuthorSeparator
,
0
);
// Dates
mpCreationDate
=
new
QLabel
(
tr
(
"Created on: "
),
mpContainer
);
mpCreationDate
->
setStyleSheet
(
"padding-left:5px;"
);
mContainerLayout
.
addWidget
(
mpCreationDate
);
mContainerLayout
.
addWidget
(
&
mDateSeparator
,
0
);
// Target
mpTargetLabel
=
new
QLabel
(
tr
(
"Target"
),
mpContainer
);
mpTargetLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mContainerLayout
.
addWidget
(
mpTargetLabel
,
0
);
mpTarget
=
new
QTextEdit
(
mpContainer
);
mpTarget
->
setReadOnly
(
true
);
mContainerLayout
.
addWidget
(
mpTarget
,
1
);
mContainerLayout
.
addWidget
(
&
mTargetSeparator
,
0
);
// Metadata
mpMetadataLabel
=
new
QLabel
(
tr
(
"Metadata"
),
mpContainer
);
mpMetadataLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mContainerLayout
.
addWidget
(
mpMetadataLabel
,
0
);
// Keyword
mpKeywordLabel
=
new
QLabel
(
tr
(
"<b>Keywords:</b>"
),
mpContainer
);
mpKeywordLabel
->
setStyleSheet
(
"padding-left:5px;"
);
mpKeyword
=
new
QLabel
(
mpContainer
);
mpKeyword
->
setWordWrap
(
true
);
mKeywordLayout
.
addWidget
(
mpKeywordLabel
,
0
);
mKeywordLayout
.
addWidget
(
mpKeyword
,
1
);
mContainerLayout
.
addLayout
(
&
mKeywordLayout
,
0
);
// Level
mpLevelLabel
=
new
QLabel
(
tr
(
"<b>Level:</b>"
),
mpContainer
);
mpLevelLabel
->
setStyleSheet
(
"padding-left:5px;"
);
mpLevel
=
new
QLabel
(
mpContainer
);
mpLevel
->
setWordWrap
(
true
);
mLevelLayout
.
addWidget
(
mpLevelLabel
,
0
);
mLevelLayout
.
addWidget
(
mpLevel
,
1
);
mContainerLayout
.
addLayout
(
&
mLevelLayout
,
0
);
// TODO : Add the elements here
// Topic
mpTopicLabel
=
new
QLabel
(
tr
(
"<b>Topic:</b>"
),
mpContainer
);
mpTopicLabel
->
setStyleSheet
(
"padding-left:5px;"
);
mpTopic
=
new
QLabel
(
mpContainer
);
mpTopic
->
setWordWrap
(
true
);
mTopicLayout
.
addWidget
(
mpTopicLabel
,
0
);
mTopicLayout
.
addWidget
(
mpTopic
,
1
);
mContainerLayout
.
addLayout
(
&
mTopicLayout
,
0
);
mContainerLayout
.
addWidget
(
&
mMetadataSeparator
,
0
);
// License
mpLicense
=
new
UBTBLicenseWidget
(
mpContainer
);
mContainerLayout
.
addWidget
(
mpLicense
,
0
);
mLayout
.
addWidget
(
mpContainer
,
1
);
mpPageViewButton
=
new
QPushButton
(
tr
(
"Page View"
),
this
);
mpPageViewButton
->
setObjectName
(
"DockPaletteWidgetButton"
);
mpEditButton
=
new
QPushButton
(
tr
(
"Edit"
),
this
);
mpEditButton
->
setObjectName
(
"DockPaletteWidgetButton"
);
mPreviewLayout
.
addStretch
(
1
);
mPreviewLayout
.
addWidget
(
mpEditButton
,
0
);
mPreviewLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mPreviewLayout
);
mButtonsLayout
.
addWidget
(
mpPageViewButton
,
0
);
mButtonsLayout
.
addWidget
(
mpEditButton
,
0
);
mButtonsLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mButtonsLayout
,
0
);
connect
(
mpPageViewButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onPageView
()));
connect
(
mpEditButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onEdit
()));
...
...
@@ -32,8 +124,7 @@ UBTBDocumentPreviewWidget::UBTBDocumentPreviewWidget(UBTeacherBarDataMgr *pDataM
UBTBDocumentPreviewWidget
::~
UBTBDocumentPreviewWidget
()
{
DELETEPTR
(
mpPageViewButton
);
DELETEPTR
(
mpEditButton
);
}
void
UBTBDocumentPreviewWidget
::
onEdit
()
...
...
@@ -48,10 +139,23 @@ void UBTBDocumentPreviewWidget::onPageView()
void
UBTBDocumentPreviewWidget
::
updateFields
()
{
mpSessionTitle
->
setText
(
mpDataMgr
->
sessionTitle
());
mpAuthors
->
setText
(
mpDataMgr
->
authors
());
mpCreationDate
->
setText
(
tr
(
"<b>Creation Date:</b> %0"
).
arg
(
mpDataMgr
->
creationDate
()));
mpTarget
->
setText
(
mpDataMgr
->
sessionTarget
());
mpLicense
->
setLicense
(
mpDataMgr
->
sessionLicence
());
mpKeyword
->
setText
(
mpDataMgr
->
keywords
());
mpLevel
->
setText
(
mpDataMgr
->
level
());
mpTopic
->
setText
(
mpDataMgr
->
topic
());
}
void
UBTBDocumentPreviewWidget
::
clearFields
()
{
mpSessionTitle
->
setText
(
""
);
mpAuthors
->
setText
(
""
);
mpCreationDate
->
setText
(
""
);
mpTarget
->
setText
(
""
);
mpKeyword
->
setText
(
""
);
mpLevel
->
setText
(
""
);
mpTopic
->
setText
(
""
);
}
src/gui/UBTBDocumentPreviewWidget.h
View file @
2e0bf003
...
...
@@ -24,10 +24,35 @@ private slots:
private
:
QVBoxLayout
mLayout
;
QHBoxLayout
mPageLayout
;
QHBoxLayout
mPreviewLayout
;
QHBoxLayout
mButtonsLayout
;
QWidget
*
mpContainer
;
QVBoxLayout
mContainerLayout
;
QPushButton
*
mpPageViewButton
;
QPushButton
*
mpEditButton
;
QLabel
*
mpSessionLabel
;
QLabel
*
mpSessionTitle
;
UBTBSeparator
mTitleSeparator
;
QLabel
*
mpAuthorLabel
;
QLabel
*
mpAuthors
;
UBTBSeparator
mAuthorSeparator
;
QLabel
*
mpCreationDate
;
UBTBSeparator
mDateSeparator
;
QLabel
*
mpTargetLabel
;
QTextEdit
*
mpTarget
;
UBTBSeparator
mTargetSeparator
;
QLabel
*
mpMetadataLabel
;
QHBoxLayout
mKeywordLayout
;
QLabel
*
mpKeywordLabel
;
QLabel
*
mpKeyword
;
QHBoxLayout
mLevelLayout
;
QLabel
*
mpLevelLabel
;
QLabel
*
mpLevel
;
QHBoxLayout
mTopicLayout
;
QLabel
*
mpTopicLabel
;
QLabel
*
mpTopic
;
UBTBSeparator
mMetadataSeparator
;
UBTBLicenseWidget
*
mpLicense
;
UBTeacherBarDataMgr
*
mpDataMgr
;
};
...
...
src/gui/UBTBPageEditWidget.cpp
View file @
2e0bf003
...
...
@@ -320,7 +320,7 @@ QString UBUrlWidget::url()
QString
str
;
if
(
NULL
!=
mpUrl
){
str
=
mpUrl
->
text
()
+
";"
+
mpTitle
->
text
();
str
=
mpUrl
->
text
()
;
//
+ ";" + mpTitle->text();
}
return
str
;
...
...
src/gui/UBTeacherBarDataMgr.cpp
View file @
2e0bf003
#include <QDate>
#include "UBTeacherBarDataMgr.h"
#include "core/UBApplication.h"
...
...
@@ -59,7 +61,6 @@ void UBTeacherBarDataMgr::saveContent()
documentProxy
->
setSessionTitle
(
mSessionTitle
);
documentProxy
->
setSessionTarget
(
mSessionTarget
);
documentProxy
->
setSessionLicence
(
QString
(
"%0"
).
arg
(
mSessionLicence
));
qDebug
()
<<
"Saving keywords: "
<<
mKeywords
;
documentProxy
->
setSessionKeywords
(
mKeywords
);
documentProxy
->
setSessionLevel
(
mLevel
);
documentProxy
->
setSessionTopic
(
mTopic
);
...
...
@@ -82,10 +83,15 @@ void UBTeacherBarDataMgr::loadContent(bool docChanged)
mSessionTarget
=
documentProxy
->
sessionTarget
();
mSessionLicence
=
(
eLicense
)
documentProxy
->
sessionLicence
().
toInt
();
mKeywords
=
documentProxy
->
sessionKeywords
();
qDebug
()
<<
"Keywords loaded: "
<<
mKeywords
<<
" ("
<<
documentProxy
->
sessionKeywords
()
<<
")"
;
mLevel
=
documentProxy
->
sessionLevel
();
mTopic
=
documentProxy
->
sessionTopic
();
mAuthors
=
documentProxy
->
sessionAuthors
();
if
(
""
!=
documentProxy
->
documentDate
()){
mCreationDate
=
documentProxy
->
documentDate
();
}
else
{
mCreationDate
=
QDate
::
currentDate
().
toString
(
"yyyy-MM-dd"
);
}
}
// Page Title
...
...
src/gui/UBTeacherBarDataMgr.h
View file @
2e0bf003
...
...
@@ -115,6 +115,13 @@ public:
void
setAuthors
(
const
QString
&
authors
){
mAuthors
=
authors
;}
QString
authors
(){
return
mAuthors
;}
// Creation Date
void
setCreationDate
(
const
QString
&
date
){
mCreationDate
=
date
;}
QString
creationDate
(){
return
mCreationDate
;}
// Last Modification
void
setLastModificationDate
(
const
QString
&
date
){
mLastModif
=
date
;}
QString
lastModificationDate
(){
return
mLastModif
;}
// Others
void
clearLists
();
...
...
@@ -131,6 +138,8 @@ private:
QString
mLevel
;
QString
mTopic
;
QString
mAuthors
;
QString
mCreationDate
;
QString
mLastModif
;
QVector
<
sAction
>
mActionList
;
QVector
<
sLink
>
mUrlList
;
...
...
src/gui/UBTeacherBarPreviewWidget.cpp
View file @
2e0bf003
...
...
@@ -134,6 +134,7 @@ void UBActionPreview::setContent(const QString &content)
UBTBPreviewContainer
::
UBTBPreviewContainer
(
QWidget
*
parent
,
const
char
*
name
)
:
UBWidgetList
(
parent
)
{
setObjectName
(
name
);
mCanRemove
=
false
;
}
UBTBPreviewContainer
::~
UBTBPreviewContainer
()
...
...
@@ -144,6 +145,7 @@ UBTBPreviewContainer::~UBTBPreviewContainer()
// ------------------------------------------------------------------------------------
UBTeacherBarPreviewWidget
::
UBTeacherBarPreviewWidget
(
UBTeacherBarDataMgr
*
pDataMgr
,
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpEditButton
(
NULL
)
,
mpDocumentButton
(
NULL
)
,
mpSessionTitle
(
NULL
)
,
mpTitle
(
NULL
)
,
mpTitleLabel
(
NULL
)
...
...
@@ -155,20 +157,27 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM
setObjectName
(
name
);
mpDataMgr
=
pDataMgr
;
setLayout
(
&
mLayout
);
mLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
// Build the Preview widget
mpContainer
=
new
QWidget
(
this
);
mpContainer
->
setObjectName
(
"UBTBPreviewWidget"
);
mpContainer
->
setLayout
(
&
mContainerLayout
);
mLayout
.
addWidget
(
mpContainer
,
1
);
// Session Title
mpTitleContainer
=
new
QWidget
(
this
);
mpTitleContainer
=
new
QWidget
(
mpContainer
);
mpTitleContainer
->
setLayout
(
&
mTitleLayout
);
mpSessionTitle
=
new
QLabel
(
this
);
mpSessionTitle
=
new
QLabel
(
mpContainer
);
mpSessionTitle
->
setText
(
tr
(
"Session: "
));
mpSessionTitle
->
setWordWrap
(
true
);
mpSessionTitle
->
setAlignment
(
Qt
::
AlignRight
);
mpSessionTitle
->
setObjectName
(
"UBTBPreviewSessionTitle"
);
mLayout
.
addWidget
(
mpSessionTitle
);
m
Container
Layout
.
addWidget
(
mpSessionTitle
);
// Title
mpTitleContainer
->
setLayout
(
&
mTitleLayout
);
...
...
@@ -187,27 +196,32 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM
mpPageNbrLabel
->
setObjectName
(
"UBTBPreviewSessionTitle"
);
mTitleLayout
.
addWidget
(
mpPageNbrLabel
);
mTitleLayout
.
addWidget
(
&
mTitleSeparator
);
mLayout
.
addWidget
(
mpTitleContainer
);
m
Container
Layout
.
addWidget
(
mpTitleContainer
);
// Content
mpContentContainer
=
new
UBTBPreviewContainer
(
this
);
mLayout
.
addWidget
(
mpContentContainer
,
1
);
mpContentContainer
=
new
UBTBPreviewContainer
(
mpContainer
);
m
Container
Layout
.
addWidget
(
mpContentContainer
,
1
);
// License
mLayout
.
addWidget
(
&
mLicenseSeparator
);
mpLicenseLabel
=
new
UBTBLicenseWidget
(
this
);
mLayout
.
addWidget
(
mpLicenseLabel
);
m
Container
Layout
.
addWidget
(
&
mLicenseSeparator
);
mpLicenseLabel
=
new
UBTBLicenseWidget
(
mpContainer
);
m
Container
Layout
.
addWidget
(
mpLicenseLabel
);
// Edit button
mpEditButton
=
new
QPushButton
(
tr
(
"Edit infos"
),
this
);
// Document Button
mpDocumentButton
=
new
QPushButton
(
tr
(
"Document View"
),
this
);
mpDocumentButton
->
setObjectName
(
"DockPaletteWidgetButton"
);
// Edit Button
mpEditButton
=
new
QPushButton
(
tr
(
"Edit"
),
this
);
mpEditButton
->
setObjectName
(
"DockPaletteWidgetButton"
);
mEditLayout
.
add
Stretch
(
1
);
mEditLayout
.
add
Widget
(
mpDocumentButton
,
0
);
mEditLayout
.
addWidget
(
mpEditButton
,
0
);
mEditLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mEditLayout
,
0
);
connect
(
mpEditButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onEdit
()));
connect
(
mpDocumentButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onDocumentClicked
()));
connect
(
UBApplication
::
boardController
,
SIGNAL
(
activeSceneChanged
()),
this
,
SLOT
(
onActiveSceneChanged
()));
}
...
...
@@ -225,6 +239,11 @@ void UBTeacherBarPreviewWidget::onEdit()
emit
showEditMode
();
}
void
UBTeacherBarPreviewWidget
::
onDocumentClicked
()
{
emit
showDocumentPreview
();
}
void
UBTeacherBarPreviewWidget
::
updateFields
()
{
// Session Title
...
...
src/gui/UBTeacherBarPreviewWidget.h
View file @
2e0bf003
...
...
@@ -62,6 +62,7 @@ public:
signals
:
void
showEditMode
();
void
showDocumentPreview
();
protected
:
void
showEvent
(
QShowEvent
*
ev
);
...
...
@@ -69,6 +70,7 @@ protected:
private
slots
:
void
onEdit
();
void
onActiveSceneChanged
();
void
onDocumentClicked
();
private
:
void
generateActions
();
...
...
@@ -77,8 +79,12 @@ private:
void
generateComments
();
QVBoxLayout
mLayout
;
QVBoxLayout
mContainerLayout
;
QHBoxLayout
mEditLayout
;
QPushButton
*
mpEditButton
;
QPushButton
*
mpDocumentButton
;
QWidget
*
mpContainer
;
// Titles
QVBoxLayout
mTitleLayout
;
...
...
@@ -95,7 +101,6 @@ private:
// License
UBTBSeparator
mLicenseSeparator
;
// TODO : replace the QLabel of the license by a widget done for that!
UBTBLicenseWidget
*
mpLicenseLabel
;
...
...
src/gui/UBTeacherBarWidget.cpp
View file @
2e0bf003
...
...
@@ -57,6 +57,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
connect
(
UBApplication
::
boardController
,
SIGNAL
(
activeDocumentChanged
()),
this
,
SLOT
(
onActiveDocumentChanged
()));
connect
(
mpPreview
,
SIGNAL
(
showEditMode
()),
this
,
SLOT
(
onShowEditMode
()));
connect
(
mpPreview
,
SIGNAL
(
showDocumentPreview
()),
this
,
SLOT
(
onShowDocumentPreview
()));
connect
(
mpDocPreviewWidget
,
SIGNAL
(
changeTBState
(
eTeacherBarState
)),
this
,
SLOT
(
onTBStateChanged
(
eTeacherBarState
)));
connect
(
mpDocEditWidget
,
SIGNAL
(
changeTBState
(
eTeacherBarState
)),
this
,
SLOT
(
onTBStateChanged
(
eTeacherBarState
)));
connect
(
mpPageEditWidget
,
SIGNAL
(
changeTBState
(
eTeacherBarState
)),
this
,
SLOT
(
onTBStateChanged
(
eTeacherBarState
)));
...
...
@@ -150,6 +151,11 @@ void UBTeacherBarWidget::onShowEditMode()
onTBStateChanged
(
eTeacherBarState_PageEdit
);
}
void
UBTeacherBarWidget
::
onShowDocumentPreview
()
{
onTBStateChanged
(
eTeacherBarState_DocumentPreview
);
}
void
UBTeacherBarWidget
::
onTBStateChanged
(
eTeacherBarState
state
)
{
switch
(
state
){
...
...
src/gui/UBTeacherBarWidget.h
View file @
2e0bf003
...
...
@@ -48,6 +48,7 @@ private slots:
void
onShowEditMode
();
void
onTBStateChanged
(
eTeacherBarState
state
);
void
onActiveDocumentChanged
();
void
onShowDocumentPreview
();
private
:
bool
isEmpty
();
...
...
src/gui/UBThumbnailWidget.cpp
View file @
2e0bf003
...
...
@@ -740,25 +740,21 @@ void UBSceneThumbnailNavigPixmap::paint(QPainter *painter, const QStyleOptionGra
void
UBSceneThumbnailNavigPixmap
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
// INFO: This implementation should work but this method is not called on a mousePressEvent, why?
// PLEASE DO NOT REMOVE THIS METHOD! We should reactivate this code when we will fix
// the mousePressEvent-not-called issue!
// QPointF p = event->pos();
// // Here we check the position of the click and verify if it has to trig an action or not.
// if(bCanDelete && p.x() >= 0 && p.x() <= BUTTONSIZE && p.y() >= 0 && p.y() <= BUTTONSIZE)
// {
// deletePage();
// }
// if(bCanMoveUp && p.x() >= BUTTONSIZE + BUTTONSPACING && p.x() <= 2*BUTTONSIZE + BUTTONSPACING && p.y() >= 0 && p.y() <= BUTTONSIZE)
// {
// moveUpPage();
// }
// if(bCanMoveDown && p.x() >= 2*(BUTTONSIZE + BUTTONSPACING) && p.x() <= 2*(BUTTONSIZE + BUTTONSPACING) + BUTTONSIZE && p.y() >= 0 && p.y() <= BUTTONSIZE)
// {
// moveDownPage();
// }
QPointF
p
=
event
->
pos
();
// Here we check the position of the click and verify if it has to trig an action or not.
if
(
bCanDelete
&&
p
.
x
()
>=
0
&&
p
.
x
()
<=
BUTTONSIZE
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
{
deletePage
();
}
if
(
bCanMoveUp
&&
p
.
x
()
>=
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
x
()
<=
2
*
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
{
moveUpPage
();
}
if
(
bCanMoveDown
&&
p
.
x
()
>=
2
*
(
BUTTONSIZE
+
BUTTONSPACING
)
&&
p
.
x
()
<=
2
*
(
BUTTONSIZE
+
BUTTONSPACING
)
+
BUTTONSIZE
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
{
moveDownPage
();
}
event
->
accept
();
}
...
...
@@ -809,32 +805,3 @@ void UBSceneThumbnailNavigPixmap::moveDownPage()
{
UBApplication
::
documentController
->
moveSceneToIndex
(
proxy
(),
sceneIndex
(),
sceneIndex
()
+
1
);
}
void
UBSceneThumbnailNavigPixmap
::
notifyClick
(
QPointF
clickedScenePos
)
{
QPointF
p
=
clickedPos
(
clickedScenePos
);
// Here we check the position of the click and verify if it has to trig an action or not.
if
(
bCanDelete
&&
p
.
x
()
>=
0
&&
p
.
x
()
<=
BUTTONSIZE
/
2
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
/
2
)
{
deletePage
();
}
if
(
bCanMoveUp
&&
p
.
x
()
>=
(
BUTTONSIZE
+
BUTTONSPACING
)
/
2
&&
p
.
x
()
<=
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
/
2
)
{
moveUpPage
();
}
if
(
bCanMoveDown
&&
p
.
x
()
>=
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
x
()
<=
BUTTONSIZE
+
BUTTONSPACING
+
BUTTONSIZE
/
2
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
/
2
)
{
moveDownPage
();
}
}
QPointF
UBSceneThumbnailNavigPixmap
::
clickedPos
(
QPointF
clickedScenePos
)
{
QPointF
p
;
p
.
setX
(
clickedScenePos
.
x
()
-
scenePos
().
x
());
p
.
setY
(
clickedScenePos
.
y
()
-
scenePos
().
y
());
return
p
;
}
src/gui/UBThumbnailWidget.h
View file @
2e0bf003
...
...
@@ -292,7 +292,6 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap
public
:
UBSceneThumbnailNavigPixmap
(
const
QPixmap
&
pix
,
UBDocumentProxy
*
proxy
,
int
pSceneIndex
);
~
UBSceneThumbnailNavigPixmap
();
void
notifyClick
(
QPointF
clickedScenePos
);
protected
:
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
...
...
@@ -305,7 +304,6 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap
void
deletePage
();
void
moveUpPage
();
void
moveDownPage
();
QPointF
clickedPos
(
QPointF
clickedScenePos
);
bool
bButtonsVisible
;
bool
bCanDelete
;
...
...
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