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
28d04e54
Commit
28d04e54
authored
Jan 18, 2012
by
Ivan Ilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sankore dnd copying widgets on placing w3cwidget on the scene cleaning needed
parent
fd9fc419
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
7 deletions
+59
-7
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+0
-1
UBWidgetUniboardAPI.cpp
src/api/UBWidgetUniboardAPI.cpp
+1
-1
UBBoardController.cpp
src/board/UBBoardController.cpp
+29
-5
UBBoardController.h
src/board/UBBoardController.h
+2
-0
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+22
-0
UBPersistenceManager.h
src/core/UBPersistenceManager.h
+1
-0
UBGraphicsWidgetItem.h
src/domain/UBGraphicsWidgetItem.h
+4
-0
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
28d04e54
...
...
@@ -2105,7 +2105,6 @@ void UBSvgSubsetAdaptor::UBSvgSubsetWriter::graphicsWidgetToSvg(UBGraphicsWidget
startFileUrl
=
widgetRootUrl
.
toString
()
+
"/"
+
item
->
widgetWebView
()
->
mainHtmlFileName
();
mXmlWriter
.
writeAttribute
(
"src"
,
startFileUrl
);
mXmlWriter
.
writeEndElement
();
//iFrame
//persists widget state
...
...
src/api/UBWidgetUniboardAPI.cpp
View file @
28d04e54
...
...
@@ -439,7 +439,7 @@ void UBWidgetUniboardAPI::enableDropOnWidget()
QString
UBWidgetUniboardAPI
::
downloadUrl
(
const
QString
&
objectUrl
,
const
QString
&
extention
)
{
QString
result
;
QUrl
widgetUrl
=
mGraphicsWidget
->
widgetWebView
()
->
widgetUrl
();
QUrl
widgetUrl
=
mGraphicsWidget
->
getOwnFolder
();
QString
destFileName
=
widgetUrl
.
toLocalFile
()
+
"/objects/"
+
QUuid
::
createUuid
().
toString
()
+
extention
;
if
(
UBFileSystemUtils
::
copyFile
(
objectUrl
,
destFileName
))
{
...
...
src/board/UBBoardController.cpp
View file @
28d04e54
...
...
@@ -871,9 +871,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
widgetUrl
=
expandWidgetToTempDir
(
pData
);
}
UBGraphicsWidgetItem
*
w3cWidgetItem
=
mActiveScene
->
addW3CWidget
(
widgetUrl
,
pPos
);
w3cWidgetItem
->
setSourceUrl
(
sourceUrl
);
UBGraphicsWidgetItem
*
w3cWidgetItem
=
addW3cWidget
(
widgetUrl
,
pPos
);
if
(
isBackground
)
{
...
...
@@ -1647,10 +1645,8 @@ void UBBoardController::updateBackgroundState()
{
newBackgroundStyle
=
"QWidget {background-color: #F1F1F1}"
;
}
}
void
UBBoardController
::
stylusToolChanged
(
int
tool
)
{
if
(
UBPlatformUtils
::
hasVirtualKeyboard
()
&&
mPaletteManager
->
mKeyboardPalette
)
...
...
@@ -1784,6 +1780,34 @@ UBGraphicsAudioItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool st
}
UBGraphicsWidgetItem
*
UBBoardController
::
addW3cWidget
(
const
QUrl
&
pUrl
,
const
QPointF
&
pos
)
{
UBGraphicsWidgetItem
*
w3cWidgetItem
=
0
;
QUuid
uuid
=
QUuid
::
createUuid
();
QUrl
newUrl
=
pUrl
;
newUrl
=
QUrl
::
fromLocalFile
(
UBPersistenceManager
::
persistenceManager
()
->
addGraphicsWidgteToDocument
(
mActiveDocument
,
pUrl
.
toLocalFile
(),
uuid
));
w3cWidgetItem
=
mActiveScene
->
addW3CWidget
(
pUrl
,
pos
);
if
(
w3cWidgetItem
)
{
w3cWidgetItem
->
setUuid
(
uuid
);
w3cWidgetItem
->
setOwnFolder
(
newUrl
);
w3cWidgetItem
->
setSourceUrl
(
pUrl
);
QString
struuid
=
UBStringUtils
::
toCanonicalUuid
(
uuid
);
QString
snapshotPath
=
mActiveDocument
->
persistencePath
()
+
"/"
+
UBPersistenceManager
::
widgetDirectory
+
"/"
+
struuid
+
".png"
;
UBGraphicsWidgetItem
*
tmpItem
=
dynamic_cast
<
UBGraphicsWidgetItem
*>
(
w3cWidgetItem
);
if
(
tmpItem
)
tmpItem
->
widgetWebView
()
->
takeSnapshot
().
save
(
snapshotPath
,
"PNG"
);
}
return
0
;
}
void
UBBoardController
::
cut
()
{
...
...
src/board/UBBoardController.h
View file @
28d04e54
...
...
@@ -200,6 +200,8 @@ class UBBoardController : public QObject
void
controlViewShown
();
UBGraphicsVideoItem
*
addVideo
(
const
QUrl
&
pUrl
,
bool
startPlay
,
const
QPointF
&
pos
);
UBGraphicsAudioItem
*
addAudio
(
const
QUrl
&
pUrl
,
bool
startPlay
,
const
QPointF
&
pos
);
UBGraphicsWidgetItem
*
addW3cWidget
(
const
QUrl
&
pUrl
,
const
QPointF
&
pos
);
void
cut
();
void
copy
();
void
paste
();
...
...
src/core/UBPersistenceManager.cpp
View file @
28d04e54
...
...
@@ -987,7 +987,29 @@ QString UBPersistenceManager::addPdfFileToDocument(UBDocumentProxy* pDocumentPro
return
fileName
;
}
QString
UBPersistenceManager
::
addGraphicsWidgteToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
)
{
QFileInfo
fi
(
path
);
if
(
!
fi
.
exists
()
||
!
pDocumentProxy
||
objectUuid
.
isNull
())
return
""
;
QString
widgetRootDir
=
path
;
QString
extension
=
QFileInfo
(
widgetRootDir
).
suffix
();
QString
widgetTargetDir
=
pDocumentProxy
->
persistencePath
()
+
"/"
+
widgetDirectory
+
"/"
+
objectUuid
.
toString
()
+
"."
+
extension
;
if
(
!
QFile
::
exists
(
widgetTargetDir
))
{
QDir
dir
;
dir
.
mkpath
(
widgetTargetDir
);
UBFileSystemUtils
::
copyDir
(
widgetRootDir
,
widgetTargetDir
);
}
if
(
!
QFile
::
exists
(
widgetTargetDir
))
widgetTargetDir
=
QString
();
return
widgetTargetDir
;
}
void
UBPersistenceManager
::
documentRepositoryChanged
(
const
QString
&
path
)
...
...
src/core/UBPersistenceManager.h
View file @
28d04e54
...
...
@@ -120,6 +120,7 @@ class UBPersistenceManager : public QObject
virtual
QString
addAudioFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
);
virtual
QString
addAudioFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QUrl
sourceUrl
,
QByteArray
pPayload
,
QUuid
objectUuid
);
virtual
QString
addPdfFileToDocument
(
UBDocumentProxy
*
pDocumentProxy
,
QString
path
,
QUuid
objectUuid
);
virtual
QString
addGraphicsWidgteToDocument
(
UBDocumentProxy
*
mDocumentProxy
,
QString
path
,
QUuid
objectUuid
);
bool
mayHaveVideo
(
UBDocumentProxy
*
pDocumentProxy
);
bool
mayHaveAudio
(
UBDocumentProxy
*
pDocumentProxy
);
...
...
src/domain/UBGraphicsWidgetItem.h
View file @
28d04e54
...
...
@@ -68,6 +68,9 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
void
removeScript
();
QString
downloadUrl
(
const
QString
&
fileUrl
,
const
QString
&
extention
);
virtual
void
setOwnFolder
(
const
QUrl
&
newFolder
)
{
ownFolder
=
newFolder
;}
virtual
QUrl
getOwnFolder
()
const
{
return
ownFolder
;}
virtual
void
clearSource
(){;}
...
...
@@ -91,6 +94,7 @@ class UBGraphicsWidgetItem : public UBGraphicsProxyWidget
QPointF
mLastMousePos
;
bool
mShouldMoveWidget
;
UBWidgetUniboardAPI
*
mUniboardAPI
;
QUrl
ownFolder
;
};
class
UBGraphicsAppleWidgetItem
:
public
UBGraphicsWidgetItem
...
...
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