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
b87a39b9
Commit
b87a39b9
authored
Nov 30, 2011
by
Ivan Ilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extended iwb editable prop new file version available
parent
cb8cfcf8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
20 deletions
+47
-20
UBCFFSubsetAdaptor.cpp
src/adaptors/UBCFFSubsetAdaptor.cpp
+24
-2
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+21
-13
UBSettings.cpp
src/core/UBSettings.cpp
+1
-1
UBGraphicsTextItemDelegate.cpp
src/domain/UBGraphicsTextItemDelegate.cpp
+1
-4
No files found.
src/adaptors/UBCFFSubsetAdaptor.cpp
View file @
b87a39b9
...
...
@@ -28,6 +28,7 @@
#include "domain/UBGraphicsAudioItem.h"
#include "domain/UBGraphicsWidgetItem.h"
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsTextItemDelegate.h"
#include "domain/UBW3CWidget.h"
#include "frameworks/UBFileSystemUtils.h"
...
...
@@ -95,6 +96,7 @@ static QString aRef = "ref";
static
QString
aHref
=
"href"
;
static
QString
aBackground
=
"background"
;
static
QString
aLocked
=
"locked"
;
static
QString
aEditable
=
"editable"
;
//attributes part names
static
QString
apRotate
=
"rotate"
;
...
...
@@ -647,6 +649,12 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgTextarea(const QDomElement &
hastransform
=
true
;
}
//by default all the textAreas are not editable
UBGraphicsTextItemDelegate
*
curDelegate
=
dynamic_cast
<
UBGraphicsTextItemDelegate
*>
(
svgItem
->
Delegate
());
if
(
curDelegate
)
{
curDelegate
->
setEditable
(
false
);
}
repositionSvgItem
(
svgItem
,
width
,
height
,
x
,
y
,
hastransform
,
transform
);
hashSceneItem
(
element
,
svgItem
);
...
...
@@ -914,18 +922,32 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseIwbElement(QDomElement &element
return
false
;
}
bool
locked
=
false
,
isBackground
=
false
;
bool
locked
=
false
;
bool
isBackground
=
false
;
bool
isEditableItem
=
false
;
bool
isEditable
=
false
;
//Text items to convert to UBGraphicsTextItem only
QString
IDRef
=
element
.
attribute
(
aRef
);
if
(
!
IDRef
.
isNull
())
{
isBackground
=
element
.
hasAttribute
(
aBackground
)
?
strToBool
(
element
.
attribute
(
aBackground
))
:
false
;
locked
=
element
.
hasAttribute
(
aBackground
)
?
strToBool
(
element
.
attribute
(
aBackground
))
:
false
;
isEditableItem
=
element
.
hasAttribute
(
aEditable
);
if
(
isEditableItem
)
isEditable
=
strToBool
(
element
.
attribute
(
aEditable
));
UBGraphicsItem
*
referedItem
(
0
);
QHash
<
QString
,
UBGraphicsItem
*>::
iterator
iReferedItem
;
iReferedItem
=
persistedItems
.
find
(
IDRef
);
if
(
iReferedItem
!=
persistedItems
.
end
())
{
UBGraphicsItem
*
referedItem
=
*
iReferedItem
;
referedItem
=
*
iReferedItem
;
referedItem
->
Delegate
()
->
lock
(
locked
);
}
if
(
isEditableItem
)
{
UBGraphicsTextItemDelegate
*
textDelegate
=
dynamic_cast
<
UBGraphicsTextItemDelegate
*>
(
referedItem
->
Delegate
());
if
(
textDelegate
)
{
textDelegate
->
setEditable
(
isEditable
);
}
}
}
return
true
;
...
...
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
b87a39b9
...
...
@@ -309,7 +309,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
UBGraphicsWidgetItem
*
currentWidget
=
0
;
int
mFileVersion
=
40100
;
// default to 4.1.0
mFileVersion
=
40100
;
// default to 4.1.0
UBGraphicsStroke
*
annotationGroup
=
0
;
...
...
@@ -878,7 +878,8 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
buffer
.
open
(
QBuffer
::
WriteOnly
);
mXmlWriter
.
setDevice
(
&
buffer
);
QTime
timer
=
QTime
::
currentTime
();
//Unused variable
//QTime timer = QTime::currentTime();
mXmlWriter
.
setAutoFormatting
(
true
);
...
...
@@ -1383,8 +1384,6 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromPol
}
UBGraphicsPolygonItem
*
UBSvgSubsetAdaptor
::
UBSvgSubsetReader
::
polygonItemFromLineSvg
(
const
QColor
&
pDefaultColor
)
{
QStringRef
svgX1
=
mXmlReader
.
attributes
().
value
(
"x1"
);
...
...
@@ -1491,12 +1490,8 @@ UBGraphicsPolygonItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::polygonItemFromLin
}
return
polygonItem
;
}
QList
<
UBGraphicsPolygonItem
*>
UBSvgSubsetAdaptor
::
UBSvgSubsetReader
::
polygonItemsFromPolylineSvg
(
const
QColor
&
pDefaultColor
)
{
QStringRef
strokeWidth
=
mXmlReader
.
attributes
().
value
(
"stroke-width"
);
...
...
@@ -1966,6 +1961,14 @@ void UBSvgSubsetAdaptor::UBSvgSubsetReader::graphicsItemFromSvg(QGraphicsItem* g
gItem
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
QVariant
(
isLocked
));
}
QStringRef
ubEditable
=
mXmlReader
.
attributes
().
value
(
mNamespaceUri
,
"editable"
);
if
(
!
ubEditable
.
isNull
())
{
bool
isEditable
=
(
ubEditable
.
toString
()
==
xmlTrue
||
ubEditable
.
toString
()
==
"1"
);
gItem
->
setData
(
UBGraphicsItemData
::
ItemEditable
,
QVariant
(
isEditable
));
}
//deprecated as of 4.4.a.12
QStringRef
ubLayer
=
mXmlReader
.
attributes
().
value
(
mNamespaceUri
,
"layer"
);
if
(
!
ubLayer
.
isNull
())
...
...
@@ -2020,9 +2023,18 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::graphicsItemToSvg(QGraphicsItem* ite
if
(
!
locked
.
isNull
()
&&
locked
.
toBool
())
mXmlWriter
.
writeAttribute
(
UBSettings
::
uniboardDocumentNamespaceUri
,
"locked"
,
xmlTrue
);
QVariant
editable
=
item
->
data
(
UBGraphicsItemData
::
ItemEditable
);
if
(
!
editable
.
isNull
())
{
if
(
editable
.
toBool
())
mXmlWriter
.
writeAttribute
(
UBSettings
::
uniboardDocumentNamespaceUri
,
"editable"
,
xmlTrue
);
else
mXmlWriter
.
writeAttribute
(
UBSettings
::
uniboardDocumentNamespaceUri
,
"editable"
,
xmlFalse
);
}
}
void
UBSvgSubsetAdaptor
::
UBSvgSubsetWriter
::
graphicsAppleWidgetToSvg
(
UBGraphicsAppleWidgetItem
*
item
)
{
graphicsWidgetToSvg
(
item
);
...
...
@@ -2290,13 +2302,9 @@ UBGraphicsTextItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::textItemFromSvg()
if
(
mXmlReader
.
isStartElement
())
{
//for new documents from version 4.5.0
if
(
true
)
{
if
(
mFileVersion
>=
40500
)
{
if
(
mXmlReader
.
name
()
==
"itemTextContent"
)
{
QString
text
=
mXmlReader
.
readElementText
();
// QtLogger::start("/home/ilia/Documents/tmp/10/log.log");
// QtLogger::appendl(text);
// QtLogger::finish();
// textItem->setPlainText("");
textItem
->
setHtml
(
text
);
break
;
}
...
...
src/core/UBSettings.cpp
View file @
b87a39b9
...
...
@@ -47,7 +47,7 @@ QString UBSettings::uniboardApplicationNamespaceUri = "http://uniboard.mnemis.co
const
int
UBSettings
::
sDefaultFontPixelSize
=
36
;
const
char
*
UBSettings
::
sDefaultFontFamily
=
"Arial"
;
QString
UBSettings
::
currentFileVersion
=
"4.
4
.0"
;
QString
UBSettings
::
currentFileVersion
=
"4.
5
.0"
;
QColor
UBSettings
::
crossDarkBackground
=
QColor
(
44
,
44
,
44
,
200
);
QColor
UBSettings
::
crossLightBackground
=
QColor
(
165
,
225
,
255
);
...
...
src/domain/UBGraphicsTextItemDelegate.cpp
View file @
b87a39b9
...
...
@@ -50,6 +50,7 @@ UBGraphicsTextItemDelegate::UBGraphicsTextItemDelegate(UBGraphicsTextItem* pDele
delegated
()
->
adjustSize
();
delegated
()
->
contentsChanged
();
// QTextCursor defcursor(createDefaultCursor());
// defcursor.movePosition(QTextCursor::Start);
// delegated()->setTextCursor(defcursor);
...
...
@@ -229,11 +230,7 @@ void UBGraphicsTextItemDelegate::pickColor()
QTextCursor
curCursor
=
delegated
()
->
textCursor
();
QTextCharFormat
format
;
format
.
setForeground
(
QBrush
(
selectedColor
));
// format.setBackground(Qt::yellow);
curCursor
.
mergeCharFormat
(
format
);
QTextBlockFormat
blFormat
;
blFormat
.
setAlignment
(
Qt
::
AlignCenter
);
curCursor
.
setBlockFormat
(
blFormat
);
delegated
()
->
setTextCursor
(
curCursor
);
UBGraphicsTextItem
::
lastUsedTextColor
=
selectedColor
;
...
...
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