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
3182e092
Commit
3182e092
authored
Oct 26, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed trap flash issue
parent
1926d793
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
28 deletions
+38
-28
UBBoardController.cpp
src/board/UBBoardController.cpp
+30
-25
UBTrapFlashController.cpp
src/web/UBTrapFlashController.cpp
+8
-3
No files found.
src/board/UBBoardController.cpp
View file @
3182e092
...
@@ -544,7 +544,7 @@ void UBBoardController::duplicateScene()
...
@@ -544,7 +544,7 @@ void UBBoardController::duplicateScene()
}
}
UBGraphicsItem
*
UBBoardController
::
duplicateItem
(
UBItem
*
item
,
bool
bAsync
)
UBGraphicsItem
*
UBBoardController
::
duplicateItem
(
UBItem
*
item
,
bool
bAsync
)
{
{
if
(
!
item
)
if
(
!
item
)
return
NULL
;
return
NULL
;
...
@@ -580,9 +580,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -580,9 +580,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
if
(
NULL
!=
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
commonItem
))
if
(
NULL
!=
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
commonItem
))
itemMimeType
=
UBMimeType
::
Group
;
itemMimeType
=
UBMimeType
::
Group
;
else
else
itemMimeType
=
UBFileSystemUtils
::
mimeTypeFromString
(
contentTypeHeader
);
itemMimeType
=
UBFileSystemUtils
::
mimeTypeFromString
(
contentTypeHeader
);
switch
(
static_cast
<
int
>
(
itemMimeType
))
switch
(
static_cast
<
int
>
(
itemMimeType
))
{
{
case
UBMimeType
:
:
AppleWidget
:
case
UBMimeType
:
:
AppleWidget
:
...
@@ -604,7 +604,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -604,7 +604,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
sourceUrl
=
mitem
->
mediaFileUrl
();
sourceUrl
=
mitem
->
mediaFileUrl
();
if
(
bAsync
)
if
(
bAsync
)
{
{
downloadURL
(
sourceUrl
,
srcFile
,
itemPos
,
QSize
(
itemSize
.
width
(),
itemSize
.
height
()),
false
,
false
);
downloadURL
(
sourceUrl
,
srcFile
,
itemPos
,
QSize
(
itemSize
.
width
(),
itemSize
.
height
()),
false
,
false
);
return
NULL
;
// async operation
return
NULL
;
// async operation
}
}
}
}
...
@@ -636,7 +636,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -636,7 +636,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
{
{
UBGraphicsGroupContainerItem
*
groupItem
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
item
);
UBGraphicsGroupContainerItem
*
groupItem
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
item
);
UBGraphicsGroupContainerItem
*
duplicatedGroup
=
NULL
;
UBGraphicsGroupContainerItem
*
duplicatedGroup
=
NULL
;
QList
<
QGraphicsItem
*>
duplicatedItems
;
QList
<
QGraphicsItem
*>
duplicatedItems
;
QList
<
QGraphicsItem
*>
children
=
groupItem
->
childItems
();
QList
<
QGraphicsItem
*>
children
=
groupItem
->
childItems
();
foreach
(
QGraphicsItem
*
pIt
,
children
){
foreach
(
QGraphicsItem
*
pIt
,
children
){
...
@@ -665,7 +665,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -665,7 +665,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
{
{
QGraphicsItem
*
gitem
=
dynamic_cast
<
QGraphicsItem
*>
(
item
->
deepCopy
());
QGraphicsItem
*
gitem
=
dynamic_cast
<
QGraphicsItem
*>
(
item
->
deepCopy
());
if
(
gitem
)
if
(
gitem
)
{
{
mActiveScene
->
addItem
(
gitem
);
mActiveScene
->
addItem
(
gitem
);
gitem
->
setPos
(
itemPos
);
gitem
->
setPos
(
itemPos
);
mLastCreatedItem
=
gitem
;
mLastCreatedItem
=
gitem
;
...
@@ -673,8 +673,8 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -673,8 +673,8 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
}
}
retItem
=
dynamic_cast
<
UBGraphicsItem
*>
(
gitem
);
retItem
=
dynamic_cast
<
UBGraphicsItem
*>
(
gitem
);
}
break
;
}
break
;
}
}
if
(
retItem
)
if
(
retItem
)
return
retItem
;
return
retItem
;
...
@@ -959,7 +959,7 @@ void UBBoardController::groupButtonClicked()
...
@@ -959,7 +959,7 @@ void UBBoardController::groupButtonClicked()
}
}
if
(
groupAction
->
text
()
==
mActionGroupText
)
{
//The only way to get information from item, considering using smth else
if
(
groupAction
->
text
()
==
mActionGroupText
)
{
//The only way to get information from item, considering using smth else
UBGraphicsGroupContainerItem
*
groupItem
=
activeScene
()
->
createGroup
(
selItems
);
UBGraphicsGroupContainerItem
*
groupItem
=
activeScene
()
->
createGroup
(
selItems
);
groupItem
->
setSelected
(
true
);
groupItem
->
setSelected
(
true
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
...
@@ -984,7 +984,7 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
...
@@ -984,7 +984,7 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
QString
sUrl
=
url
.
toString
();
QString
sUrl
=
url
.
toString
();
QGraphicsItem
*
oldBackgroundObject
=
NULL
;
QGraphicsItem
*
oldBackgroundObject
=
NULL
;
if
(
isBackground
)
if
(
isBackground
)
oldBackgroundObject
=
mActiveScene
->
backgroundObject
();
oldBackgroundObject
=
mActiveScene
->
backgroundObject
();
if
(
sUrl
.
startsWith
(
"uniboardTool://"
))
if
(
sUrl
.
startsWith
(
"uniboardTool://"
))
...
@@ -1029,12 +1029,17 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
...
@@ -1029,12 +1029,17 @@ void UBBoardController::downloadURL(const QUrl& url, QString contentSourceUrl, c
}
}
else
else
{
{
QString
urlString
=
url
.
toString
();
int
parametersStringPosition
=
urlString
.
indexOf
(
"?"
);
if
(
parametersStringPosition
!=
-
1
)
urlString
=
urlString
.
left
(
parametersStringPosition
);
// When we fall there, it means that we are dropping something from the web to the board
// When we fall there, it means that we are dropping something from the web to the board
sDownloadFileDesc
desc
;
sDownloadFileDesc
desc
;
desc
.
modal
=
true
;
desc
.
modal
=
true
;
desc
.
srcUrl
=
url
.
toString
()
;
desc
.
srcUrl
=
url
String
;
desc
.
currentSize
=
0
;
desc
.
currentSize
=
0
;
desc
.
name
=
QFileInfo
(
url
.
toString
()
).
fileName
();
desc
.
name
=
QFileInfo
(
url
String
).
fileName
();
desc
.
totalSize
=
0
;
// The total size will be retrieved during the download
desc
.
totalSize
=
0
;
// The total size will be retrieved during the download
desc
.
pos
=
pPos
;
desc
.
pos
=
pPos
;
desc
.
size
=
pSize
;
desc
.
size
=
pSize
;
...
@@ -1065,7 +1070,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1065,7 +1070,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
// why we will check if an ; exists and take the first part (the standard allows this kind of mimetype)
// why we will check if an ; exists and take the first part (the standard allows this kind of mimetype)
if
(
mimeType
.
isEmpty
())
if
(
mimeType
.
isEmpty
())
mimeType
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
sourceUrl
.
toString
());
mimeType
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
sourceUrl
.
toString
());
int
position
=
mimeType
.
indexOf
(
";"
);
int
position
=
mimeType
.
indexOf
(
";"
);
if
(
position
!=
-
1
)
if
(
position
!=
-
1
)
mimeType
=
mimeType
.
left
(
position
);
mimeType
=
mimeType
.
left
(
position
);
...
@@ -1080,7 +1085,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1080,7 +1085,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
mActiveScene
->
deselectAllItems
();
mActiveScene
->
deselectAllItems
();
if
(
!
sourceUrl
.
toString
().
startsWith
(
"file://"
)
&&
!
sourceUrl
.
toString
().
startsWith
(
"uniboardTool://"
))
if
(
!
sourceUrl
.
toString
().
startsWith
(
"file://"
)
&&
!
sourceUrl
.
toString
().
startsWith
(
"uniboardTool://"
))
showMessage
(
tr
(
"Download finished"
));
showMessage
(
tr
(
"Download finished"
));
...
@@ -1194,7 +1199,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1194,7 +1199,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
if
(
pData
.
length
()
>
0
)
if
(
pData
.
length
()
>
0
)
{
{
QString
destFile
;
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
sourceUrl
.
toString
(),
sourceUrl
.
toString
(),
UBPersistenceManager
::
videoDirectory
,
UBPersistenceManager
::
videoDirectory
,
uuid
,
uuid
,
...
@@ -1219,7 +1224,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1219,7 +1224,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
if
(
mediaVideoItem
){
if
(
mediaVideoItem
){
if
(
contentUrl
.
isEmpty
())
if
(
contentUrl
.
isEmpty
())
mediaVideoItem
->
setSourceUrl
(
sourceUrl
);
mediaVideoItem
->
setSourceUrl
(
sourceUrl
);
else
else
mediaVideoItem
->
setSourceUrl
(
contentUrl
);
mediaVideoItem
->
setSourceUrl
(
contentUrl
);
mediaVideoItem
->
setUuid
(
uuid
);
mediaVideoItem
->
setUuid
(
uuid
);
connect
(
this
,
SIGNAL
(
activeSceneChanged
()),
mediaVideoItem
,
SLOT
(
activeSceneChanged
()));
connect
(
this
,
SIGNAL
(
activeSceneChanged
()),
mediaVideoItem
,
SLOT
(
activeSceneChanged
()));
...
@@ -1239,7 +1244,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1239,7 +1244,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
if
(
pData
.
length
()
>
0
)
if
(
pData
.
length
()
>
0
)
{
{
QString
destFile
;
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
sourceUrl
.
toString
(),
sourceUrl
.
toString
(),
UBPersistenceManager
::
audioDirectory
,
UBPersistenceManager
::
audioDirectory
,
uuid
,
uuid
,
...
@@ -1263,7 +1268,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
...
@@ -1263,7 +1268,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QUrl
if
(
audioMediaItem
){
if
(
audioMediaItem
){
if
(
contentUrl
.
isEmpty
())
if
(
contentUrl
.
isEmpty
())
audioMediaItem
->
setSourceUrl
(
sourceUrl
);
audioMediaItem
->
setSourceUrl
(
sourceUrl
);
else
else
audioMediaItem
->
setSourceUrl
(
contentUrl
);
audioMediaItem
->
setSourceUrl
(
contentUrl
);
audioMediaItem
->
setUuid
(
uuid
);
audioMediaItem
->
setUuid
(
uuid
);
connect
(
this
,
SIGNAL
(
activeSceneChanged
()),
audioMediaItem
,
SLOT
(
activeSceneChanged
()));
connect
(
this
,
SIGNAL
(
activeSceneChanged
()),
audioMediaItem
,
SLOT
(
activeSceneChanged
()));
...
@@ -1497,7 +1502,7 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy,
...
@@ -1497,7 +1502,7 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy,
mActiveScene
=
targetScene
;
mActiveScene
=
targetScene
;
mActiveSceneIndex
=
index
;
mActiveSceneIndex
=
index
;
setDocument
(
pDocumentProxy
,
forceReload
);
setDocument
(
pDocumentProxy
,
forceReload
);
updateSystemScaleFactor
();
updateSystemScaleFactor
();
mControlView
->
setScene
(
mActiveScene
);
mControlView
->
setScene
(
mActiveScene
);
...
@@ -2070,7 +2075,7 @@ UBGraphicsMediaItem* UBBoardController::addVideo(const QUrl& pSourceUrl, bool st
...
@@ -2070,7 +2075,7 @@ UBGraphicsMediaItem* UBBoardController::addVideo(const QUrl& pSourceUrl, bool st
if
(
!
bUseSource
)
if
(
!
bUseSource
)
{
{
QString
destFile
;
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
pSourceUrl
.
toLocalFile
(),
pSourceUrl
.
toLocalFile
(),
UBPersistenceManager
::
videoDirectory
,
UBPersistenceManager
::
videoDirectory
,
uuid
,
uuid
,
...
@@ -2105,7 +2110,7 @@ UBGraphicsMediaItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool st
...
@@ -2105,7 +2110,7 @@ UBGraphicsMediaItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool st
if
(
!
bUseSource
)
if
(
!
bUseSource
)
{
{
QString
destFile
;
QString
destFile
;
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
bool
b
=
UBPersistenceManager
::
persistenceManager
()
->
addFileToDocument
(
selectedDocument
(),
pSourceUrl
.
toLocalFile
(),
pSourceUrl
.
toLocalFile
(),
UBPersistenceManager
::
audioDirectory
,
UBPersistenceManager
::
audioDirectory
,
uuid
,
uuid
,
...
@@ -2273,10 +2278,10 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
...
@@ -2273,10 +2278,10 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
{
{
foreach
(
UBItem
*
item
,
mimeData
->
items
())
foreach
(
UBItem
*
item
,
mimeData
->
items
())
{
{
QGraphicsItem
*
pItem
=
dynamic_cast
<
QGraphicsItem
*>
(
item
);
QGraphicsItem
*
pItem
=
dynamic_cast
<
QGraphicsItem
*>
(
item
);
if
(
NULL
!=
pItem
){
if
(
NULL
!=
pItem
){
duplicateItem
(
item
);
duplicateItem
(
item
);
}
}
}
}
return
;
return
;
...
...
src/web/UBTrapFlashController.cpp
View file @
3182e092
...
@@ -204,7 +204,7 @@ void UBTrapFlashController::createWidget()
...
@@ -204,7 +204,7 @@ void UBTrapFlashController::createWidget()
}
}
QString
freezedWidgetPath
=
UBPlatformUtils
::
applicationResourcesDirectory
()
+
"/etc/freezedWidgetWrapper.html"
;
QString
freezedWidgetPath
=
UBPlatformUtils
::
applicationResourcesDirectory
()
+
"/etc/freezedWidgetWrapper.html"
;
mTrapFlashUi
->
webView
->
load
(
QUrl
::
fromLocalFile
(
freezedWidgetPath
));
mTrapFlashUi
->
webView
->
load
(
QUrl
::
fromLocalFile
(
freezedWidgetPath
));
mTrapFlashDialog
->
hide
();
mTrapFlashDialog
->
hide
();
}
}
...
@@ -370,6 +370,7 @@ QString UBTrapFlashController::generateFullPageHtml(const QString& pDirPath, boo
...
@@ -370,6 +370,7 @@ QString UBTrapFlashController::generateFullPageHtml(const QString& pDirPath, boo
QString
UBTrapFlashController
::
generateHtml
(
const
UBWebKitUtils
::
HtmlObject
&
pObject
,
QString
UBTrapFlashController
::
generateHtml
(
const
UBWebKitUtils
::
HtmlObject
&
pObject
,
const
QString
&
pDirPath
,
bool
pGenerateFile
)
const
QString
&
pDirPath
,
bool
pGenerateFile
)
{
{
qDebug
()
<<
pObject
.
source
;
QUrl
objectUrl
(
pObject
.
source
);
QUrl
objectUrl
(
pObject
.
source
);
QString
objectFullUrl
=
pObject
.
source
;
QString
objectFullUrl
=
pObject
.
source
;
if
(
!
objectUrl
.
isValid
())
if
(
!
objectUrl
.
isValid
())
...
@@ -471,9 +472,13 @@ QString UBTrapFlashController::generateHtml(const UBWebKitUtils::HtmlObject& pOb
...
@@ -471,9 +472,13 @@ QString UBTrapFlashController::generateHtml(const UBWebKitUtils::HtmlObject& pOb
QString
UBTrapFlashController
::
widgetNameForObject
(
UBWebKitUtils
::
HtmlObject
pObject
)
QString
UBTrapFlashController
::
widgetNameForObject
(
UBWebKitUtils
::
HtmlObject
pObject
)
{
{
int
lastSlashIndex
=
pObject
.
source
.
lastIndexOf
(
"/"
);
QString
url
=
pObject
.
source
;
int
parametersIndex
=
url
.
indexOf
(
"?"
);
if
(
parametersIndex
!=
-
1
)
url
=
url
.
left
(
parametersIndex
);
int
lastSlashIndex
=
url
.
lastIndexOf
(
"/"
);
QString
result
=
pObject
.
source
.
right
(
pObject
.
source
.
length
()
-
lastSlashIndex
);
QString
result
=
url
.
right
(
url
.
length
()
-
lastSlashIndex
);
result
=
UBFileSystemUtils
::
cleanName
(
result
);
result
=
UBFileSystemUtils
::
cleanName
(
result
);
return
result
;
return
result
;
...
...
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