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
11129a97
Commit
11129a97
authored
Sep 21, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue with toque teacher bar
parent
04561f96
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
23 additions
and
78 deletions
+23
-78
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+0
-30
UBThumbnailAdaptor.cpp
src/adaptors/UBThumbnailAdaptor.cpp
+12
-1
UBBoardController.cpp
src/board/UBBoardController.cpp
+6
-7
UBBoardController.h
src/board/UBBoardController.h
+1
-2
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+1
-10
UBPersistenceManager.h
src/core/UBPersistenceManager.h
+0
-3
UBDocumentContainer.cpp
src/document/UBDocumentContainer.cpp
+0
-2
UBDocumentContainer.h
src/document/UBDocumentContainer.h
+2
-2
UBDocumentNavigator.cpp
src/gui/UBDocumentNavigator.cpp
+1
-21
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
11129a97
...
...
@@ -941,18 +941,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
readGroupRoot
();
}
// else if (mXmlReader.name() == "teacherBar" || mXmlReader.name() == "teacherGuide"){
// sTeacherGuideNode.clear();
// sTeacherGuideNode += "<teacherGuide version=\"" + mXmlReader.attributes().value("version").toString() + "\">";
// sTeacherGuideNode += "\n";
// }
// else if (mXmlReader.name() == "media" || mXmlReader.name() == "link" || mXmlReader.name() == "title" || mXmlReader.name() == "comment" || mXmlReader.name() == "action")
// {
// sTeacherGuideNode += "<" + mXmlReader.name().toString() + " ";
// foreach(QXmlStreamAttribute attribute, mXmlReader.attributes())
// sTeacherGuideNode += attribute.name().toString() + "=\"" + attribute.value().toString() + "\" ";
// sTeacherGuideNode += " />\n";
// }
else
{
// NOOP
...
...
@@ -976,17 +964,6 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
mGroupDarkBackgroundColor
=
QColor
();
mGroupLightBackgroundColor
=
QColor
();
}
// else if (mXmlReader.name() == "teacherBar" || mXmlReader.name() == "teacherGuide"){
// sTeacherGuideNode += "</teacherGuide>";
// qDebug() << sTeacherGuideNode;
// QMap<QString,IDataStorage*> elements = getAdditionalElementToStore();
// IDataStorage* storageClass = elements.value("teacherGuide");
// if(storageClass){
// storageClass->load(sTeacherGuideNode);
// }
// }
}
}
...
...
@@ -1147,17 +1124,10 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene(int pageIndex)
QDomElement
groupRoot
=
groupDomDocument
.
createElement
(
tGroups
);
groupDomDocument
.
appendChild
(
groupRoot
);
static
int
i
=
0
;
qDebug
()
<<
"persist call no is "
<<
++
i
;
QBuffer
buffer
;
buffer
.
open
(
QBuffer
::
WriteOnly
);
mXmlWriter
.
setDevice
(
&
buffer
);
//Unused variable
//QTime timer = QTime::currentTime();
mXmlWriter
.
setAutoFormatting
(
true
);
mXmlWriter
.
writeStartDocument
();
...
...
src/adaptors/UBThumbnailAdaptor.cpp
View file @
11129a97
...
...
@@ -23,7 +23,12 @@
#include "core/UBApplication.h"
#include "core/UBSettings.h"
#include "gui/UBDockTeacherGuideWidget.h"
#include "gui/UBTeacherGuideWidget.h"
#include "board/UBBoardController.h"
#include "board/UBBoardPaletteManager.h"
#include "document/UBDocumentProxy.h"
...
...
@@ -120,7 +125,7 @@ void UBThumbnailAdaptor::persistScene(UBDocumentProxy* proxy, UBGraphicsScene* p
QFile
thumbFile
(
fileName
);
if
(
pScene
->
isModified
()
||
overrideModified
||
!
thumbFile
.
exists
())
if
(
pScene
->
isModified
()
||
overrideModified
||
!
thumbFile
.
exists
()
||
UBApplication
::
boardController
->
paletteManager
()
->
teacherGuideDockWidget
()
->
teacherGuideWidget
()
->
isModified
()
)
{
qreal
nominalWidth
=
pScene
->
nominalSize
().
width
();
qreal
nominalHeight
=
pScene
->
nominalSize
().
height
();
...
...
@@ -152,6 +157,12 @@ void UBThumbnailAdaptor::persistScene(UBDocumentProxy* proxy, UBGraphicsScene* p
pScene
->
render
(
&
painter
,
imageRect
,
sceneRect
,
Qt
::
KeepAspectRatio
);
if
(
UBApplication
::
boardController
->
paletteManager
()
->
teacherGuideDockWidget
()
->
teacherGuideWidget
()
->
isModified
()){
QPixmap
toque
(
":images/toque.png"
);
painter
.
setOpacity
(
0.6
);
painter
.
drawPixmap
(
QPoint
(
width
-
toque
.
width
(),
0
),
toque
);
}
pScene
->
setRenderingContext
(
UBGraphicsScene
::
Screen
);
pScene
->
setRenderingQuality
(
UBItem
::
RenderingQualityNormal
);
...
...
src/board/UBBoardController.cpp
View file @
11129a97
...
...
@@ -95,6 +95,7 @@ UBBoardController::UBBoardController(UBMainWindow* mainWindow)
,
mCleanupDone
(
false
)
,
mCacheWidgetIsEnabled
(
false
)
,
mDeletingSceneIndex
(
-
1
)
,
mMovingSceneIndex
(
-
1
)
,
mActionGroupText
(
tr
(
"Group"
))
,
mActionUngroupText
(
tr
(
"Ungroup"
))
{
...
...
@@ -1450,9 +1451,6 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy,
{
freezeW3CWidgets
(
true
);
if
(
sceneChange
)
emit
activeSceneWillChange
();
persistCurrentScene
();
ClearUndoStack
();
...
...
@@ -1500,14 +1498,17 @@ void UBBoardController::moveSceneToIndex(int source, int target)
{
if
(
selectedDocument
())
{
persistCurrentScene
();
UBDocumentContainer
::
movePageToIndex
(
source
,
target
);
selectedDocument
()
->
setMetaData
(
UBSettings
::
documentUpdatedAt
,
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
()));
UBMetadataDcSubsetAdaptor
::
persist
(
selectedDocument
());
mMovingSceneIndex
=
source
;
setActiveDocumentScene
(
target
);
mMovingSceneIndex
=
-
1
;
}
}
...
...
@@ -1807,11 +1808,9 @@ void UBBoardController::persistCurrentScene()
{
if
(
UBPersistenceManager
::
persistenceManager
()
&&
selectedDocument
()
&&
mActiveScene
&&
mActiveSceneIndex
!=
mDeletingSceneIndex
&&
(
mActiveSceneIndex
>=
0
)
&&
(
mActiveSceneIndex
>=
0
)
&&
mActiveSceneIndex
!=
mMovingSceneIndex
&&
(
mActiveScene
->
isModified
()
||
(
UBApplication
::
boardController
->
paletteManager
()
->
teacherGuideDockWidget
()
&&
UBApplication
::
boardController
->
paletteManager
()
->
teacherGuideDockWidget
()
->
teacherGuideWidget
()
->
isModified
())))
{
emit
activeSceneWillBePersisted
();
UBPersistenceManager
::
persistenceManager
()
->
persistDocumentScene
(
selectedDocument
(),
mActiveScene
,
mActiveSceneIndex
);
updatePage
(
mActiveSceneIndex
);
}
...
...
src/board/UBBoardController.h
View file @
11129a97
...
...
@@ -229,8 +229,6 @@ class UBBoardController : public UBDocumentContainer
signals
:
void
newPageAdded
();
void
activeSceneWillBePersisted
();
void
activeSceneWillChange
();
void
activeSceneChanged
();
void
zoomChanged
(
qreal
pZoomFactor
);
void
systemScaleFactorChanged
(
qreal
pSystemScaleFactor
);
...
...
@@ -286,6 +284,7 @@ class UBBoardController : public UBDocumentContainer
bool
mCacheWidgetIsEnabled
;
QGraphicsItem
*
mLastCreatedItem
;
int
mDeletingSceneIndex
;
int
mMovingSceneIndex
;
QString
mActionGroupText
;
QString
mActionUngroupText
;
...
...
src/core/UBPersistenceManager.cpp
View file @
11129a97
...
...
@@ -463,11 +463,6 @@ void UBPersistenceManager::deleteDocumentScenes(UBDocumentProxy* proxy, const QL
}
}
foreach
(
int
index
,
compactedIndexes
)
{
emit
documentSceneDeleted
(
proxy
,
index
);
}
}
...
...
@@ -576,8 +571,6 @@ void UBPersistenceManager::moveSceneToIndex(UBDocumentProxy* proxy, int source,
thumb
.
rename
(
proxy
->
persistencePath
()
+
UBFileSystemUtils
::
digitFileFormat
(
"/page%1.thumbnail.jpg"
,
target
));
mSceneCache
.
moveScene
(
proxy
,
source
,
target
);
emit
documentSceneMoved
(
proxy
,
target
);
}
...
...
@@ -612,7 +605,7 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
UBBoardPaletteManager
*
paletteManager
=
UBApplication
::
boardController
->
paletteManager
();
bool
teacherGuideModified
=
false
;
if
(
paletteManager
->
teacherGuideDockWidget
())
if
(
UBApplication
::
app
()
->
boardController
->
currentPage
()
==
pSceneIndex
&&
paletteManager
->
teacherGuideDockWidget
())
teacherGuideModified
=
paletteManager
->
teacherGuideDockWidget
()
->
teacherGuideWidget
()
->
isModified
();
if
(
pDocumentProxy
->
isModified
()
||
teacherGuideModified
)
...
...
@@ -628,8 +621,6 @@ void UBPersistenceManager::persistDocumentScene(UBDocumentProxy* pDocumentProxy,
}
mSceneCache
.
insert
(
pDocumentProxy
,
pSceneIndex
,
pScene
);
emit
documentCommitted
(
pDocumentProxy
);
}
...
...
src/core/UBPersistenceManager.h
View file @
11129a97
...
...
@@ -117,13 +117,10 @@ class UBPersistenceManager : public QObject
void
documentCreated
(
UBDocumentProxy
*
pDocumentProxy
);
void
documentMetadataChanged
(
UBDocumentProxy
*
pDocumentProxy
);
void
documentCommitted
(
UBDocumentProxy
*
pDocumentProxy
);
void
documentWillBeDeleted
(
UBDocumentProxy
*
pDocumentProxy
);
void
documentSceneCreated
(
UBDocumentProxy
*
pDocumentProxy
,
int
pIndex
);
void
documentSceneMoved
(
UBDocumentProxy
*
pDocumentProxy
,
int
pIndex
);
void
documentSceneWillBeDeleted
(
UBDocumentProxy
*
pDocumentProxy
,
int
pIndex
);
void
documentSceneDeleted
(
UBDocumentProxy
*
pDocumentProxy
,
int
pDeletedIndex
);
private
:
...
...
src/document/UBDocumentContainer.cpp
View file @
11129a97
...
...
@@ -94,7 +94,6 @@ void UBDocumentContainer::updatePage(int index)
void
UBDocumentContainer
::
deleteThumbPage
(
int
index
)
{
mDocumentThumbs
.
removeAt
(
index
);
emit
documentPageDeleted
(
index
);
}
void
UBDocumentContainer
::
updateThumbPage
(
int
index
)
...
...
@@ -106,7 +105,6 @@ void UBDocumentContainer::updateThumbPage(int index)
void
UBDocumentContainer
::
insertThumbPage
(
int
index
)
{
mDocumentThumbs
.
insert
(
index
,
UBThumbnailAdaptor
::
get
(
mCurrentDocument
,
index
));
emit
documentPageAdded
(
index
);
}
void
UBDocumentContainer
::
reloadThumbnails
()
...
...
src/document/UBDocumentContainer.h
View file @
11129a97
...
...
@@ -58,8 +58,8 @@ class UBDocumentContainer : public QObject
signals
:
void
documentSet
(
UBDocumentProxy
*
document
);
void
documentPageAdded
(
int
index
);
void
documentPageDeleted
(
int
index
);
//
void documentPageAdded(int index);
//
void documentPageDeleted(int index);
void
documentPageUpdated
(
int
index
);
void
documentThumbnailsUpdated
(
UBDocumentContainer
*
source
);
};
...
...
src/gui/UBDocumentNavigator.cpp
View file @
11129a97
...
...
@@ -89,27 +89,9 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
{
const
QPixmap
*
pix
=
source
->
pageAt
(
i
);
QPixmap
result
(
pix
->
width
(),
pix
->
height
());
int
pageIndex
=
UBDocumentContainer
::
pageFromSceneIndex
(
i
);
QPainter
composePainter
;
composePainter
.
begin
(
&
result
);
composePainter
.
drawPixmap
(
QPoint
(
0
,
0
),
*
pix
);
if
(
pageIndex
==
UBApplication
::
boardController
->
currentPage
()
&&
((
pageIndex
==
0
&&
UBSettings
::
settings
()
->
teacherGuidePageZeroActivated
->
get
().
toBool
())
||
(
pageIndex
&&
UBSettings
::
settings
()
->
teacherGuideLessonPagesActivated
->
get
().
toBool
()))
)
{
if
(
UBApplication
::
boardController
->
paletteManager
()
->
teacherGuideDockWidget
()
->
teacherGuideWidget
()
->
isModified
()){
QPixmap
toque
(
":images/toque.png"
);
composePainter
.
setOpacity
(
0.6
);
composePainter
.
drawPixmap
(
QPoint
(
pix
->
width
()
-
toque
.
width
(),
0
),
toque
);
}
}
composePainter
.
end
();
UBSceneThumbnailNavigPixmap
*
pixmapItem
=
new
UBSceneThumbnailNavigPixmap
(
result
,
source
->
selectedDocument
(),
i
);
UBSceneThumbnailNavigPixmap
*
pixmapItem
=
new
UBSceneThumbnailNavigPixmap
(
*
pix
,
source
->
selectedDocument
(),
i
);
QString
label
=
pageIndex
==
0
?
tr
(
"Title page"
)
:
tr
(
"Page %0"
).
arg
(
pageIndex
);
UBThumbnailTextItem
*
labelItem
=
new
UBThumbnailTextItem
(
label
);
...
...
@@ -128,7 +110,6 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
void
UBDocumentNavigator
::
onScrollToSelectedPage
(
int
index
)
{
qDebug
()
<<
"Selection in widget: "
<<
index
;
int
c
=
0
;
foreach
(
UBImgTextThumbnailElement
el
,
mThumbsWithLabels
)
{
...
...
@@ -286,7 +267,6 @@ void UBDocumentNavigator::mousePressEvent(QMouseEvent *event)
break
;
}
}
qDebug
()
<<
"Selected Scene: "
<<
index
;
UBApplication
::
boardController
->
setActiveDocumentScene
(
index
);
}
QGraphicsView
::
mousePressEvent
(
event
);
...
...
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