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
46b33afa
Commit
46b33afa
authored
May 07, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added page on save call
parent
f602efd3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
15 deletions
+23
-15
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+7
-3
UBSvgSubsetAdaptor.h
src/adaptors/UBSvgSubsetAdaptor.h
+1
-1
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+13
-9
UBTeacherGuideWidget.h
src/gui/UBTeacherGuideWidget.h
+1
-1
IDataStorage.h
src/interfaces/IDataStorage.h
+1
-1
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
46b33afa
...
...
@@ -333,6 +333,9 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
UBGraphicsStrokesGroup
*
strokesGroup
=
0
;
UBDrawingController
*
dc
=
UBDrawingController
::
drawingController
();
sTeacherGuideNode
=
""
;
while
(
!
mXmlReader
.
atEnd
())
{
mXmlReader
.
readNext
();
...
...
@@ -915,7 +918,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
void
UBSvgSubsetAdaptor
::
persistScene
(
UBDocumentProxy
*
proxy
,
UBGraphicsScene
*
pScene
,
const
int
pageIndex
)
{
UBSvgSubsetWriter
writer
(
proxy
,
pScene
,
pageIndex
);
writer
.
persistScene
();
writer
.
persistScene
(
pageIndex
);
}
...
...
@@ -963,8 +966,9 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::writeSvgElement()
mXmlWriter
.
writeEndElement
();
}
bool
UBSvgSubsetAdaptor
::
UBSvgSubsetWriter
::
persistScene
()
bool
UBSvgSubsetAdaptor
::
UBSvgSubsetWriter
::
persistScene
(
int
pageIndex
)
{
sTeacherGuideNode
=
""
;
if
(
mScene
->
isModified
())
{
QBuffer
buffer
;
...
...
@@ -1189,7 +1193,7 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
}
QMap
<
QString
,
IDataStorage
*>
elements
=
getAdditionalElementToStore
();
QVector
<
tIDataStorage
*>
dataStorageItems
=
elements
.
value
(
"teacherGuide"
)
->
save
();
QVector
<
tIDataStorage
*>
dataStorageItems
=
elements
.
value
(
"teacherGuide"
)
->
save
(
pageIndex
);
foreach
(
tIDataStorage
*
eachItem
,
dataStorageItems
){
if
(
eachItem
->
type
==
eElementType_START
){
mXmlWriter
.
writeStartElement
(
eachItem
->
name
);
...
...
src/adaptors/UBSvgSubsetAdaptor.h
View file @
46b33afa
...
...
@@ -164,7 +164,7 @@ class UBSvgSubsetAdaptor
UBSvgSubsetWriter
(
UBDocumentProxy
*
proxy
,
UBGraphicsScene
*
pScene
,
const
int
pageIndex
);
bool
persistScene
();
bool
persistScene
(
int
pageIndex
);
virtual
~
UBSvgSubsetWriter
(){}
...
...
src/gui/UBTeacherGuideWidget.cpp
View file @
46b33afa
...
...
@@ -189,10 +189,11 @@ void UBTeacherGuideEditionWidget::load(QString element)
QVector
<
tIDataStorage
*>
UBTeacherGuideEditionWidget
::
save
()
QVector
<
tIDataStorage
*>
UBTeacherGuideEditionWidget
::
save
(
int
pageIndex
)
{
QVector
<
tIDataStorage
*>
result
;
QMap
<
QString
,
QString
>
attributes
;
if
(
pageIndex
!=
UBApplication
::
boardController
->
currentPage
())
return
result
;
tIDataStorage
*
data
=
new
tIDataStorage
();
data
->
name
=
"teacherGuide"
;
data
->
type
=
eElementType_START
;
...
...
@@ -239,7 +240,7 @@ void UBTeacherGuideEditionWidget::onActiveSceneChanged()
int
currentPage
=
UBApplication
::
boardController
->
currentPage
();
if
(
currentPage
>
0
){
cleanData
();
qDebug
()
<<
UBSvgSubsetAdaptor
::
sTeacherGuideNode
;
qDebug
()
<<
"active scene changed current page "
<<
currentPage
<<
" "
<<
UBSvgSubsetAdaptor
::
sTeacherGuideNode
;
load
(
UBSvgSubsetAdaptor
::
sTeacherGuideNode
);
mpPageNumberLabel
->
setText
(
tr
(
"Page: %0"
).
arg
(
currentPage
));
UBDocumentProxy
*
documentProxy
=
UBApplication
::
boardController
->
activeDocument
();
...
...
@@ -936,14 +937,18 @@ void UBTeacherGuidePageZeroWidget::switchToMode(tUBTGZeroPageMode mode)
mpModePushButton
->
hide
();
mpSessionTitle
->
setReadOnly
(
false
);
mpSessionTitle
->
setStyleSheet
(
inputStyleSheet
);
mpSessionTitle
->
setTextColor
(
QColor
(
Qt
::
lightGray
));
QFont
titleFont
(
QApplication
::
font
().
family
(),
11
,
-
1
);
mpSessionTitle
->
document
()
->
setDefaultFont
(
titleFont
);
mpAuthors
->
setReadOnly
(
false
);
mpAuthors
->
setStyleSheet
(
inputStyleSheet
);
mpAuthors
->
setTextColor
(
QColor
(
Qt
::
lightGray
));
mpGoals
->
setReadOnly
(
false
);
mpGoals
->
setStyleSheet
(
inputStyleSheet
);
mpGoals
->
setTextColor
(
QColor
(
Qt
::
lightGray
));
mpKeywords
->
setReadOnly
(
false
);
mpKeywords
->
setStyleSheet
(
inputStyleSheet
);
mpKeywords
->
setTextColor
(
QColor
(
Qt
::
lightGray
));
mpSchoolLevelValueLabel
->
hide
();
mpSchoolLevelBox
->
show
();
mpSchoolBranchValueLabel
->
hide
();
...
...
@@ -957,21 +962,20 @@ void UBTeacherGuidePageZeroWidget::switchToMode(tUBTGZeroPageMode mode)
else
{
QString
inputStyleSheet
(
"QTextEdit { background: transparent; border: none;}"
);
mpModePushButton
->
show
();
mpSessionTitle
->
setReadOnly
(
true
);
updateSceneTitle
();
mpSessionTitle
->
showText
(
mpSessionTitle
->
text
());
mpSessionTitle
->
setStyleSheet
(
inputStyleSheet
);
mpSessionTitle
->
setTextColor
(
QColor
(
Qt
::
black
)
);
updateSceneTitle
(
);
QFont
titleFont
(
QApplication
::
font
().
family
(),
14
,
1
);
mpSessionTitle
->
document
()
->
setDefaultFont
(
titleFont
);
mpAuthors
->
setReadOnly
(
true
);
mpAuthors
->
setStyleSheet
(
inputStyleSheet
);
mpAuthors
->
setTextColor
(
QColor
(
Qt
::
black
));
mp
Goals
->
setReadOnly
(
true
);
mp
Authors
->
showText
(
mpAuthors
->
text
()
);
mpGoals
->
setStyleSheet
(
inputStyleSheet
);
mpGoals
->
setTextColor
(
QColor
(
Qt
::
black
));
mp
Keywords
->
setReadOnly
(
true
);
mp
Goals
->
showText
(
mpGoals
->
text
()
);
mpKeywords
->
setStyleSheet
(
inputStyleSheet
);
mpKeywords
->
setTextColor
(
QColor
(
Qt
::
black
));
mpKeywords
->
showText
(
mpKeywords
->
text
());
mpSchoolLevelValueLabel
->
setText
(
mpSchoolLevelBox
->
currentText
());
mpSchoolLevelValueLabel
->
show
();
mpSchoolLevelBox
->
hide
();
...
...
src/gui/UBTeacherGuideWidget.h
View file @
46b33afa
...
...
@@ -48,7 +48,7 @@ public:
QVector
<
tUBGEElementNode
*>
getData
();
void
load
(
QString
element
);
QVector
<
tIDataStorage
*>
save
();
QVector
<
tIDataStorage
*>
save
(
int
pageIndex
);
public
slots
:
void
onAddItemClicked
(
QTreeWidgetItem
*
widget
,
int
column
,
QDomElement
*
element
=
0
);
...
...
src/interfaces/IDataStorage.h
View file @
46b33afa
...
...
@@ -37,6 +37,6 @@ class IDataStorage
{
public
:
virtual
void
load
(
QString
element
)
=
0
;
virtual
QVector
<
tIDataStorage
*>
save
()
=
0
;
virtual
QVector
<
tIDataStorage
*>
save
(
int
pageIndex
)
=
0
;
};
#endif // IDATASTORAGE_H
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