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
4abdacd0
Commit
4abdacd0
authored
Feb 09, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
some modification on directory implementation
parents
08aa616f
ec10a0d3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
63 additions
and
29 deletions
+63
-29
UBImportAdaptor.cpp
src/adaptors/UBImportAdaptor.cpp
+1
-1
UBSvgSubsetAdaptor.h
src/adaptors/UBSvgSubsetAdaptor.h
+5
-10
UBSettings.cpp
src/core/UBSettings.cpp
+13
-18
UBGraphicsProxyWidget.cpp
src/domain/UBGraphicsProxyWidget.cpp
+10
-0
UBGraphicsProxyWidget.h
src/domain/UBGraphicsProxyWidget.h
+2
-0
UBGraphicsWidgetItem.cpp
src/domain/UBGraphicsWidgetItem.cpp
+24
-0
UBGraphicsWidgetItem.h
src/domain/UBGraphicsWidgetItem.h
+8
-0
No files found.
src/adaptors/UBImportAdaptor.cpp
View file @
4abdacd0
...
...
@@ -35,7 +35,7 @@ UBImportAdaptor::~UBImportAdaptor()
UBDocumentProxy
*
UBImportAdaptor
::
importFile
(
const
QFile
&
pFile
,
const
QString
&
pGroup
)
{
QString
documentName
=
QFileInfo
(
pFile
.
fileName
()).
b
aseName
();
QString
documentName
=
QFileInfo
(
pFile
.
fileName
()).
completeB
aseName
();
UBDocumentProxy
*
newDocument
=
UBPersistenceManager
::
persistenceManager
()
->
createDocument
(
pGroup
,
documentName
);
...
...
src/adaptors/UBSvgSubsetAdaptor.h
View file @
4abdacd0
...
...
@@ -171,20 +171,15 @@ class UBSvgSubsetAdaptor
int
pointsCount
=
crashedPoints
.
size
();
QString
svgPoints
;
static
const
int
maxBufferLengthPerPoint
=
30
;
int
maxBufferLength
=
maxBufferLengthPerPoint
*
pointsCount
;
char
*
buffer
=
new
char
[
maxBufferLength
];
int
length
=
0
;
QString
sBuf
;
for
(
int
j
=
0
;
j
<
pointsCount
;
j
++
)
{
const
QPointF
&
point
=
crashedPoints
.
at
(
j
);
int
n
=
sprintf
(
buffer
+
length
,
"%.2f,%.2f "
,
point
.
x
(),
point
.
y
());
length
+=
n
;
const
QPointF
&
point
=
crashedPoints
.
at
(
j
);
sBuf
.
sprintf
(
"%.2f,%.2f "
,
point
.
x
(),
point
.
y
());
svgPoints
.
insert
(
length
,
sBuf
);
length
+=
sBuf
.
length
();
}
svgPoints
=
QString
::
fromAscii
(
buffer
,
length
);
delete
buffer
;
return
svgPoints
;
}
...
...
src/core/UBSettings.cpp
View file @
4abdacd0
...
...
@@ -855,8 +855,8 @@ QString UBSettings::userFavoriteListFilePath()
static
QString
filePath
=
""
;
if
(
filePath
.
isEmpty
()){
QString
dirPath
=
userDataDirectory
()
+
"/libraryPalette"
;
filePath
=
dirPath
+
"/favorite.dat"
;
checkDirectory
(
dirPath
);
filePath
=
dirPath
+
"/favorite.dat"
;
}
return
filePath
;
}
...
...
@@ -865,7 +865,7 @@ QString UBSettings::userTrashDirPath()
{
static
QString
trashPath
=
""
;
if
(
trashPath
.
isEmpty
()){
QString
trashPath
=
userDataDirectory
()
+
"/libraryPalette/trash"
;
trashPath
=
userDataDirectory
()
+
"/libraryPalette/trash"
;
checkDirectory
(
trashPath
);
}
return
trashPath
;
...
...
@@ -878,12 +878,10 @@ QString UBSettings::applicationShapeLibraryDirectory()
QString
configPath
=
value
(
"Library/ShapeDirectory"
,
QVariant
(
defaultRelativePath
)).
toString
();
if
(
configPath
.
startsWith
(
"."
))
{
if
(
configPath
.
startsWith
(
"."
))
{
return
UBPlatformUtils
::
applicationResourcesDirectory
()
+
configPath
.
right
(
configPath
.
size
()
-
1
);
}
else
{
else
{
return
configPath
;
}
}
...
...
@@ -914,12 +912,10 @@ QString UBSettings::applicationImageLibraryDirectory()
QString
configPath
=
value
(
"Library/ImageDirectory"
,
QVariant
(
defaultRelativePath
)).
toString
();
if
(
configPath
.
startsWith
(
"."
))
{
if
(
configPath
.
startsWith
(
"."
))
{
return
UBPlatformUtils
::
applicationResourcesDirectory
()
+
configPath
.
right
(
configPath
.
size
()
-
1
);
}
else
{
else
{
return
configPath
;
}
}
...
...
@@ -959,12 +955,10 @@ QString UBSettings::applicationInteractivesDirectory()
QString
configPath
=
value
(
"Library/InteractivitiesDirectory"
,
QVariant
(
defaultRelativePath
)).
toString
();
if
(
configPath
.
startsWith
(
"."
))
{
if
(
configPath
.
startsWith
(
"."
))
{
return
UBPlatformUtils
::
applicationResourcesDirectory
()
+
configPath
.
right
(
configPath
.
size
()
-
1
);
}
else
{
else
{
return
configPath
;
}
}
...
...
@@ -975,12 +969,10 @@ QString UBSettings::applicationApplicationsLibraryDirectory()
QString
configPath
=
value
(
"Library/ApplicationsDirectory"
,
QVariant
(
defaultRelativePath
)).
toString
();
if
(
configPath
.
startsWith
(
"."
))
{
if
(
configPath
.
startsWith
(
"."
))
{
return
UBPlatformUtils
::
applicationResourcesDirectory
()
+
configPath
.
right
(
configPath
.
size
()
-
1
);
}
else
{
else
{
return
configPath
;
}
}
...
...
@@ -1132,6 +1124,9 @@ QString UBSettings::replaceWildcard(QString& path)
else
if
(
result
.
startsWith
(
"{Home}"
))
{
result
=
result
.
replace
(
"{Home}"
,
QDesktopServices
::
storageLocation
(
QDesktopServices
::
HomeLocation
));
}
else
if
(
result
.
startsWith
(
"{Desktop}"
))
{
result
=
result
.
replace
(
"{Desktop}"
,
QDesktopServices
::
storageLocation
(
QDesktopServices
::
DesktopLocation
));
}
if
(
result
.
contains
(
"{UserLoginName}"
)
&&
UBPlatformUtils
::
osUserLoginName
().
length
()
>
0
)
{
result
=
result
.
replace
(
"{UserLoginName}"
,
UBPlatformUtils
::
osUserLoginName
());
...
...
src/domain/UBGraphicsProxyWidget.cpp
View file @
4abdacd0
...
...
@@ -111,6 +111,16 @@ void UBGraphicsProxyWidget::wheelEvent(QGraphicsSceneWheelEvent *event)
}
}
void
UBGraphicsProxyWidget
::
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
Q_UNUSED
(
event
)
// NOOP
}
void
UBGraphicsProxyWidget
::
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
Q_UNUSED
(
event
)
// NOOP
}
void
UBGraphicsProxyWidget
::
setDelegate
(
UBGraphicsItemDelegate
*
pDelegate
)
{
...
...
src/domain/UBGraphicsProxyWidget.h
View file @
4abdacd0
...
...
@@ -51,6 +51,8 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
wheelEvent
(
QGraphicsSceneWheelEvent
*
event
);
virtual
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
QVariant
itemChange
(
GraphicsItemChange
change
,
const
QVariant
&
value
);
...
...
src/domain/UBGraphicsWidgetItem.cpp
View file @
4abdacd0
...
...
@@ -78,6 +78,16 @@ void UBGraphicsWidgetItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
UBGraphicsProxyWidget
::
mouseReleaseEvent
(
event
);
}
void
UBGraphicsWidgetItem
::
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
sendJSEnterEvent
();
UBGraphicsProxyWidget
::
hoverEnterEvent
(
event
);
}
void
UBGraphicsWidgetItem
::
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
)
{
sendJSLeaveEvent
();
UBGraphicsProxyWidget
::
hoverLeaveEvent
(
event
);
}
bool
UBGraphicsWidgetItem
::
eventFilter
(
QObject
*
obj
,
QEvent
*
event
)
{
...
...
@@ -247,6 +257,20 @@ void UBGraphicsWidgetItem::removeScript()
mWebKitWidget
->
page
()
->
mainFrame
()
->
evaluateJavaScript
(
"if(widget && widget.onremove) { widget.onremove();}"
);
}
}
void
UBGraphicsWidgetItem
::
sendJSEnterEvent
()
{
if
(
mWebKitWidget
&&
mWebKitWidget
->
page
()
&&
mWebKitWidget
->
page
()
->
mainFrame
())
{
mWebKitWidget
->
page
()
->
mainFrame
()
->
evaluateJavaScript
(
"if(widget && widget.onenter) { widget.onenter();}"
);
}
}
void
UBGraphicsWidgetItem
::
sendJSLeaveEvent
()
{
if
(
mWebKitWidget
&&
mWebKitWidget
->
page
()
&&
mWebKitWidget
->
page
()
->
mainFrame
())
{
mWebKitWidget
->
page
()
->
mainFrame
()
->
evaluateJavaScript
(
"if(widget && widget.onleave) { widget.onleave();}"
);
}
}
void
UBGraphicsWidgetItem
::
clearSource
()
{
...
...
src/domain/UBGraphicsWidgetItem.h
View file @
4abdacd0
...
...
@@ -66,6 +66,7 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
virtual
void
remove
();
void
removeScript
();
QString
downloadUrl
(
const
QString
&
fileUrl
,
const
QString
&
extention
);
QString
downloadWeb
(
const
QString
&
fileUrl
);
void
processDropEvent
(
QDropEvent
*
event
);
...
...
@@ -77,13 +78,20 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
virtual
void
clearSource
();
protected
:
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
bool
eventFilter
(
QObject
*
obj
,
QEvent
*
event
);
virtual
void
sendJSEnterEvent
();
virtual
void
sendJSLeaveEvent
();
UBAbstractWidget
*
mWebKitWidget
;
QMap
<
QString
,
QString
>
mPreferences
;
...
...
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