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
fc693d73
Commit
fc693d73
authored
Jul 04, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
developed Sankore-208
parent
0a40c2f3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
144 additions
and
17 deletions
+144
-17
duplicateDisabled.svg
resources/images/duplicateDisabled.svg
+91
-0
sankore.qrc
resources/sankore.qrc
+1
-0
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+14
-1
UBDocumentController.h
src/document/UBDocumentController.h
+2
-0
UBDocumentThumbnailWidget.cpp
src/gui/UBDocumentThumbnailWidget.cpp
+2
-1
UBThumbnailWidget.cpp
src/gui/UBThumbnailWidget.cpp
+32
-15
UBThumbnailWidget.h
src/gui/UBThumbnailWidget.h
+2
-0
No files found.
resources/images/duplicateDisabled.svg
0 → 100644
View file @
fc693d73
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 13.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
<svg
xmlns:dc=
"http://purl.org/dc/elements/1.1/"
xmlns:cc=
"http://creativecommons.org/ns#"
xmlns:rdf=
"http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg=
"http://www.w3.org/2000/svg"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:sodipodi=
"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape=
"http://www.inkscape.org/namespaces/inkscape"
version=
"1.1"
id=
"Layer_1"
x=
"0px"
y=
"0px"
width=
"26px"
height=
"26px"
viewBox=
"0 0 26 26"
style=
"enable-background:new 0 0 26 26;"
xml:space=
"preserve"
inkscape:version=
"0.48.3.1 r9886"
sodipodi:docname=
"duplicateDisabled.svg"
><metadata
id=
"metadata21"
><rdf:RDF><cc:Work
rdf:about=
""
><dc:format>
image/svg+xml
</dc:format><dc:type
rdf:resource=
"http://purl.org/dc/dcmitype/StillImage"
/></cc:Work></rdf:RDF></metadata><defs
id=
"defs19"
/><sodipodi:namedview
pagecolor=
"#ffffff"
bordercolor=
"#666666"
borderopacity=
"1"
objecttolerance=
"10"
gridtolerance=
"10"
guidetolerance=
"10"
inkscape:pageopacity=
"0"
inkscape:pageshadow=
"2"
inkscape:window-width=
"1283"
inkscape:window-height=
"762"
id=
"namedview17"
showgrid=
"false"
inkscape:zoom=
"9.0769231"
inkscape:cx=
"13"
inkscape:cy=
"13"
inkscape:window-x=
"65"
inkscape:window-y=
"24"
inkscape:window-maximized=
"0"
inkscape:current-layer=
"Layer_1"
/>
<circle
style=
"fill:#CCCCCC;opacity:0.5"
cx=
"13"
cy=
"13"
r=
"13"
id=
"circle3"
/>
<circle
style=
"fill:#999999;opacity:0.5"
cx=
"13"
cy=
"13"
r=
"11"
id=
"circle5"
/>
<rect
x=
"5"
y=
"6"
style=
"fill:#F2F2F2;opacity:0.5"
width=
"12"
height=
"10"
id=
"rect7"
/>
<rect
x=
"8"
y=
"9"
style=
"fill:#999999;opacity:0.5"
width=
"12"
height=
"10"
id=
"rect9"
/>
<rect
x=
"7"
y=
"8"
style=
"fill:#999999;opacity:0.5"
width=
"8"
height=
"6"
id=
"rect11"
/>
<rect
x=
"9"
y=
"10"
style=
"fill:#FFFFFF;opacity:0.5"
width=
"12"
height=
"10"
id=
"rect13"
/>
<path
style=
"fill:#FFA600;opacity:0.5"
d=
"M10,7c0,0,2,0,4,0s3,1,3,3s0,3,0,3h3l-5,5l-5-5h3c0,0,0-1,0-2s0-2-1-2C10.5,9,10,7,10,7z"
id=
"path15"
/>
</svg>
\ No newline at end of file
resources/sankore.qrc
View file @
fc693d73
...
@@ -355,5 +355,6 @@
...
@@ -355,5 +355,6 @@
<file>images/teacherGuide/link.png</file>
<file>images/teacherGuide/link.png</file>
<file>images/teacherGuide/movie.png</file>
<file>images/teacherGuide/movie.png</file>
<file>images/teacherGuide/w3c.png</file>
<file>images/teacherGuide/w3c.png</file>
<file>images/duplicateDisabled.svg</file>
</qresource>
</qresource>
</RCC>
</RCC>
src/document/UBDocumentController.cpp
View file @
fc693d73
...
@@ -535,6 +535,20 @@ void UBDocumentController::openSelectedItem()
...
@@ -535,6 +535,20 @@ void UBDocumentController::openSelectedItem()
}
}
void
UBDocumentController
::
duplicateScenes
(
UBDocumentProxy
*
proxy
,
QList
<
int
>
scenesIndex
)
{
if
(
scenesIndex
.
count
()){
int
offset
=
0
;
foreach
(
int
eachSceneIndex
,
scenesIndex
){
UBPersistenceManager
::
persistenceManager
()
->
duplicateDocumentScene
(
proxy
,
eachSceneIndex
+
offset
);
mDocumentThumbs
.
insert
(
eachSceneIndex
+
offset
,
mDocumentThumbs
.
at
(
eachSceneIndex
+
offset
));
UBApplication
::
boardController
->
setActiveDocumentScene
(
proxy
,
eachSceneIndex
+
offset
+
1
);
offset
++
;
}
}
}
void
UBDocumentController
::
duplicateSelectedItem
()
void
UBDocumentController
::
duplicateSelectedItem
()
{
{
if
(
UBApplication
::
applicationController
->
displayMode
()
!=
UBApplicationController
::
Document
)
if
(
UBApplication
::
applicationController
->
displayMode
()
!=
UBApplicationController
::
Document
)
...
@@ -558,7 +572,6 @@ void UBDocumentController::duplicateSelectedItem()
...
@@ -558,7 +572,6 @@ void UBDocumentController::duplicateSelectedItem()
}
}
}
}
}
}
if
(
selectedSceneIndexes
.
count
()
>
0
)
if
(
selectedSceneIndexes
.
count
()
>
0
)
{
{
UBSceneThumbnailPixmap
*
thumb
=
dynamic_cast
<
UBSceneThumbnailPixmap
*>
(
selectedItems
.
at
(
0
));
UBSceneThumbnailPixmap
*
thumb
=
dynamic_cast
<
UBSceneThumbnailPixmap
*>
(
selectedItems
.
at
(
0
));
...
...
src/document/UBDocumentController.h
View file @
fc693d73
...
@@ -50,6 +50,8 @@ class UBDocumentController : public QObject
...
@@ -50,6 +50,8 @@ class UBDocumentController : public QObject
UBDocumentProxy
*
getCurrentDocument
()
{
return
mCurrentDocument
;
};
UBDocumentProxy
*
getCurrentDocument
()
{
return
mCurrentDocument
;
};
void
deletePages
(
QList
<
QGraphicsItem
*>
itemsToDelete
);
void
deletePages
(
QList
<
QGraphicsItem
*>
itemsToDelete
);
int
getSelectedItemIndex
();
int
getSelectedItemIndex
();
void
duplicateScenes
(
UBDocumentProxy
*
proxy
,
QList
<
int
>
scenesIndex
);
signals
:
signals
:
void
refreshThumbnails
();
void
refreshThumbnails
();
...
...
src/gui/UBDocumentThumbnailWidget.cpp
View file @
fc693d73
...
@@ -26,7 +26,8 @@ UBDocumentThumbnailWidget::UBDocumentThumbnailWidget(QWidget* parent)
...
@@ -26,7 +26,8 @@ UBDocumentThumbnailWidget::UBDocumentThumbnailWidget(QWidget* parent)
:
UBThumbnailWidget
(
parent
)
:
UBThumbnailWidget
(
parent
)
,
mDropCaretRectItem
(
0
)
,
mDropCaretRectItem
(
0
)
,
mClosestDropItem
(
0
)
,
mClosestDropItem
(
0
)
,
mDragEnabled
(
true
),
mScrollMagnitude
(
0
)
,
mDragEnabled
(
true
)
,
mScrollMagnitude
(
0
)
{
{
mScrollTimer
=
new
QTimer
(
this
);
mScrollTimer
=
new
QTimer
(
this
);
connect
(
mScrollTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
autoScroll
()));
connect
(
mScrollTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
autoScroll
()));
...
...
src/gui/UBThumbnailWidget.cpp
View file @
fc693d73
...
@@ -750,6 +750,7 @@ UBSceneThumbnailNavigPixmap::UBSceneThumbnailNavigPixmap(const QPixmap& pix, UBD
...
@@ -750,6 +750,7 @@ UBSceneThumbnailNavigPixmap::UBSceneThumbnailNavigPixmap(const QPixmap& pix, UBD
,
bCanDelete
(
false
)
,
bCanDelete
(
false
)
,
bCanMoveUp
(
false
)
,
bCanMoveUp
(
false
)
,
bCanMoveDown
(
false
)
,
bCanMoveDown
(
false
)
,
bCanDuplicate
(
false
)
{
{
if
(
0
<=
UBApplication
::
boardController
->
pageFromSceneIndex
(
pSceneIndex
)){
if
(
0
<=
UBApplication
::
boardController
->
pageFromSceneIndex
(
pSceneIndex
)){
setAcceptsHoverEvents
(
true
);
setAcceptsHoverEvents
(
true
);
...
@@ -788,14 +789,18 @@ void UBSceneThumbnailNavigPixmap::paint(QPainter *painter, const QStyleOptionGra
...
@@ -788,14 +789,18 @@ void UBSceneThumbnailNavigPixmap::paint(QPainter *painter, const QStyleOptionGra
painter
->
drawPixmap
(
0
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/close.svg"
));
painter
->
drawPixmap
(
0
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/close.svg"
));
else
else
painter
->
drawPixmap
(
0
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/closeDisabled.svg"
));
painter
->
drawPixmap
(
0
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/closeDisabled.svg"
));
if
(
bCanDuplicate
)
painter
->
drawPixmap
(
BUTTONSIZE
+
BUTTONSPACING
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/duplicate.svg"
));
else
painter
->
drawPixmap
(
BUTTONSIZE
+
BUTTONSPACING
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/duplicateDisabled.svg"
));
if
(
bCanMoveUp
)
if
(
bCanMoveUp
)
painter
->
drawPixmap
(
BUTTONSIZE
+
BUTTONSPACING
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/moveUp.svg"
));
painter
->
drawPixmap
(
2
*
(
BUTTONSIZE
+
BUTTONSPACING
)
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/moveUp.svg"
));
else
else
painter
->
drawPixmap
(
BUTTONSIZE
+
BUTTONSPACING
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/moveUpDisabled.svg"
));
painter
->
drawPixmap
(
2
*
(
BUTTONSIZE
+
BUTTONSPACING
)
,
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/moveUpDisabled.svg"
));
if
(
bCanMoveDown
)
if
(
bCanMoveDown
)
painter
->
drawPixmap
(
2
*
(
BUTTONSIZE
+
BUTTONSPACING
),
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/menu.svg"
));
painter
->
drawPixmap
(
3
*
(
BUTTONSIZE
+
BUTTONSPACING
),
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/menu.svg"
));
else
else
painter
->
drawPixmap
(
2
*
(
BUTTONSIZE
+
BUTTONSPACING
),
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/menuDisabled.svg"
));
painter
->
drawPixmap
(
3
*
(
BUTTONSIZE
+
BUTTONSPACING
),
0
,
BUTTONSIZE
,
BUTTONSIZE
,
QPixmap
(
":images/menuDisabled.svg"
));
}
}
}
}
...
@@ -805,17 +810,14 @@ void UBSceneThumbnailNavigPixmap::mousePressEvent(QGraphicsSceneMouseEvent *even
...
@@ -805,17 +810,14 @@ void UBSceneThumbnailNavigPixmap::mousePressEvent(QGraphicsSceneMouseEvent *even
// Here we check the position of the click and verify if it has to trig an action or not.
// 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
)
if
(
bCanDelete
&&
p
.
x
()
>=
0
&&
p
.
x
()
<=
BUTTONSIZE
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
{
deletePage
();
deletePage
();
}
if
(
bCanDuplicate
&&
p
.
x
()
>=
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
x
()
<=
2
*
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
if
(
bCanMoveUp
&&
p
.
x
()
>=
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
x
()
<=
2
*
BUTTONSIZE
+
BUTTONSPACING
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
duplicatePage
();
{
if
(
bCanMoveUp
&&
p
.
x
()
>=
2
*
(
BUTTONSIZE
+
BUTTONSPACING
)
&&
p
.
x
()
<=
3
*
BUTTONSIZE
+
2
*
BUTTONSPACING
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
moveUpPage
();
moveUpPage
();
}
if
(
bCanMoveDown
&&
p
.
x
()
>=
3
*
(
BUTTONSIZE
+
BUTTONSPACING
)
&&
p
.
x
()
<=
4
*
BUTTONSIZE
+
3
*
BUTTONSPACING
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
if
(
bCanMoveDown
&&
p
.
x
()
>=
2
*
(
BUTTONSIZE
+
BUTTONSPACING
)
&&
p
.
x
()
<=
2
*
(
BUTTONSIZE
+
BUTTONSPACING
)
+
BUTTONSIZE
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
BUTTONSIZE
)
{
moveDownPage
();
moveDownPage
();
}
event
->
accept
();
event
->
accept
();
}
}
...
@@ -824,6 +826,7 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState()
...
@@ -824,6 +826,7 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState()
bCanDelete
=
false
;
bCanDelete
=
false
;
bCanMoveUp
=
false
;
bCanMoveUp
=
false
;
bCanMoveDown
=
false
;
bCanMoveDown
=
false
;
bCanDuplicate
=
true
;
UBDocumentProxy
*
p
=
proxy
();
UBDocumentProxy
*
p
=
proxy
();
if
(
NULL
!=
p
&&
0
<=
UBApplication
::
boardController
->
pageFromSceneIndex
(
sceneIndex
()))
if
(
NULL
!=
p
&&
0
<=
UBApplication
::
boardController
->
pageFromSceneIndex
(
sceneIndex
()))
...
@@ -842,13 +845,19 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState()
...
@@ -842,13 +845,19 @@ void UBSceneThumbnailNavigPixmap::updateButtonsState()
}
}
}
}
}
}
if
(
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
&&
sceneIndex
()
<
1
)
if
(
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
&&
sceneIndex
()
<
=
1
)
bCanMoveUp
=
false
;
bCanMoveUp
=
false
;
if
(
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
&&
sceneIndex
()
==
0
){
bCanDelete
=
false
;
bCanDuplicate
=
false
;
bCanMoveUp
=
false
;
bCanMoveDown
=
false
;
}
if
(
bCanDelete
||
bCanMoveUp
||
bCanMoveDown
)
if
(
bCanDelete
||
bCanMoveUp
||
bCanMoveDown
)
{
bButtonsVisible
=
true
;
bButtonsVisible
=
true
;
}
}
}
void
UBSceneThumbnailNavigPixmap
::
deletePage
()
void
UBSceneThumbnailNavigPixmap
::
deletePage
()
...
@@ -859,6 +868,14 @@ void UBSceneThumbnailNavigPixmap::deletePage()
...
@@ -859,6 +868,14 @@ void UBSceneThumbnailNavigPixmap::deletePage()
UBApplication
::
documentController
->
deletePages
(
itemsToDelete
);
UBApplication
::
documentController
->
deletePages
(
itemsToDelete
);
}
}
void
UBSceneThumbnailNavigPixmap
::
duplicatePage
()
{
QList
<
int
>
itemsToDelete
;
itemsToDelete
<<
sceneIndex
();
UBApplication
::
documentController
->
duplicateScenes
(
proxy
(),
itemsToDelete
);
}
void
UBSceneThumbnailNavigPixmap
::
moveUpPage
()
void
UBSceneThumbnailNavigPixmap
::
moveUpPage
()
{
{
UBApplication
::
documentController
->
moveSceneToIndex
(
proxy
(),
sceneIndex
(),
sceneIndex
()
-
1
);
UBApplication
::
documentController
->
moveSceneToIndex
(
proxy
(),
sceneIndex
(),
sceneIndex
()
-
1
);
...
...
src/gui/UBThumbnailWidget.h
View file @
fc693d73
...
@@ -306,6 +306,7 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap
...
@@ -306,6 +306,7 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap
private
:
private
:
void
updateButtonsState
();
void
updateButtonsState
();
void
deletePage
();
void
deletePage
();
void
duplicatePage
();
void
moveUpPage
();
void
moveUpPage
();
void
moveDownPage
();
void
moveDownPage
();
...
@@ -313,6 +314,7 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap
...
@@ -313,6 +314,7 @@ class UBSceneThumbnailNavigPixmap : public UBSceneThumbnailPixmap
bool
bCanDelete
;
bool
bCanDelete
;
bool
bCanMoveUp
;
bool
bCanMoveUp
;
bool
bCanMoveDown
;
bool
bCanMoveDown
;
bool
bCanDuplicate
;
};
};
class
UBThumbnailVideo
:
public
UBThumbnailPixmap
class
UBThumbnailVideo
:
public
UBThumbnailPixmap
...
...
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