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
b255afd2
Commit
b255afd2
authored
Sep 14, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'aleksei_kanash_dev' into develop
parents
90d08215
a1e9772c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
12 deletions
+41
-12
UBBoardController.cpp
src/board/UBBoardController.cpp
+24
-8
UBBoardController.h
src/board/UBBoardController.h
+2
-1
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+3
-2
UBItem.h
src/domain/UBItem.h
+2
-0
UBToolWidget.cpp
src/gui/UBToolWidget.cpp
+10
-1
No files found.
src/board/UBBoardController.cpp
View file @
b255afd2
...
...
@@ -533,10 +533,12 @@ void UBBoardController::duplicateScene()
duplicateScene
(
mActiveSceneIndex
);
}
void
UBBoardController
::
duplicateItem
(
UBItem
*
item
)
UBGraphicsItem
*
UBBoardController
::
duplicateItem
(
UBItem
*
item
)
{
if
(
!
item
)
return
;
return
NULL
;
UBGraphicsItem
*
retItem
=
NULL
;
mLastCreatedItem
=
NULL
;
...
...
@@ -610,6 +612,7 @@ void UBBoardController::duplicateItem(UBItem *item)
case
UBMimeType
:
:
Group
:
{
UBGraphicsGroupContainerItem
*
groupItem
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
item
);
UBGraphicsGroupContainerItem
*
duplicatedGroup
=
NULL
;
if
(
groupItem
){
QTransform
groupTransform
=
groupItem
->
transform
();
groupItem
->
resetTransform
();
...
...
@@ -628,13 +631,13 @@ void UBBoardController::duplicateItem(UBItem *item)
if
(
!
selItems
.
empty
()){
// I don't like this solution but for now this is the only way I found.
// Normally, at this state, only the duplicated group should be selected
UBGraphicsGroupContainerItem
*
duplicatedGroup
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
selItems
.
at
(
0
));
duplicatedGroup
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
selItems
.
at
(
0
));
if
(
NULL
!=
duplicatedGroup
){
duplicatedGroup
->
setTransform
(
groupTransform
);
}
}
}
ret
urn
;
ret
Item
=
dynamic_cast
<
UBGraphicsItem
*>
(
duplicatedGroup
)
;
break
;
}
...
...
@@ -648,10 +651,13 @@ void UBBoardController::duplicateItem(UBItem *item)
mLastCreatedItem
=
gitem
;
gitem
->
setSelected
(
true
);
}
ret
urn
;
ret
Item
=
dynamic_cast
<
UBGraphicsItem
*>
(
gitem
)
;
}
break
;
}
if
(
retItem
)
return
retItem
;
UBItem
*
createdItem
=
downloadFinished
(
true
,
sourceUrl
,
contentTypeHeader
,
pData
,
itemPos
,
QSize
(
itemSize
.
width
(),
itemSize
.
height
()),
false
);
if
(
createdItem
)
{
...
...
@@ -663,7 +669,10 @@ void UBBoardController::duplicateItem(UBItem *item)
createdGitem
->
setPos
(
itemPos
);
mLastCreatedItem
=
dynamic_cast
<
QGraphicsItem
*>
(
createdItem
);
mLastCreatedItem
->
setSelected
(
true
);
retItem
=
dynamic_cast
<
UBGraphicsItem
*>
(
createdItem
);
}
return
retItem
;
}
void
UBBoardController
::
deleteScene
(
int
nIndex
)
...
...
@@ -2080,7 +2089,7 @@ UBGraphicsWidgetItem *UBBoardController::addW3cWidget(const QUrl &pUrl, const QP
QString
snapshotPath
=
selectedDocument
()
->
persistencePath
()
+
"/"
+
UBPersistenceManager
::
widgetDirectory
+
"/"
+
struuid
+
".png"
;
w3cWidgetItem
->
setSnapshotPath
(
QUrl
::
fromLocalFile
(
snapshotPath
));
UBGraphicsWidgetItem
*
tmpItem
=
dynamic_cast
<
UBGraphicsWidgetItem
*>
(
w3cWidgetItem
);
if
(
tmpItem
)
if
(
tmpItem
&&
tmpItem
->
scene
()
)
tmpItem
->
takeSnapshot
().
save
(
snapshotPath
,
"PNG"
);
}
...
...
@@ -2293,17 +2302,24 @@ void UBBoardController::togglePodcast(bool checked)
UBPodcastController
::
instance
()
->
toggleRecordingPalette
(
checked
);
}
void
UBBoardController
::
moveGraphicsWidgetToControlView
(
UBGraphicsWidgetItem
*
graphicsWidget
)
{
graphicsWidget
->
remove
();
UBToolWidget
*
toolWidget
=
new
UBToolWidget
(
graphicsWidget
);
mActiveScene
->
setURStackEnable
(
false
);
UBGraphicsItem
*
toolW3C
=
duplicateItem
(
dynamic_cast
<
UBItem
*>
(
graphicsWidget
));
UBGraphicsWidgetItem
*
copyedGraphicsWidget
=
NULL
;
if
(
UBGraphicsWidgetItem
::
Type
==
toolW3C
->
type
())
copyedGraphicsWidget
=
static_cast
<
UBGraphicsWidgetItem
*>
(
toolW3C
);
UBToolWidget
*
toolWidget
=
new
UBToolWidget
(
copyedGraphicsWidget
);
mActiveScene
->
addItem
(
toolWidget
);
qreal
ssf
=
1
/
UBApplication
::
boardController
->
systemScaleFactor
();
toolWidget
->
setScale
(
ssf
);
toolWidget
->
setPos
(
graphicsWidget
->
scenePos
());
mActiveScene
->
setURStackEnable
(
true
);
}
...
...
src/board/UBBoardController.h
View file @
b255afd2
...
...
@@ -40,6 +40,7 @@ class UBGraphicsAudioItem;
class
UBGraphicsWidgetItem
;
class
UBBoardPaletteManager
;
class
UBItem
;
class
UBGraphicsItem
;
class
UBBoardController
:
public
UBDocumentContainer
...
...
@@ -158,7 +159,7 @@ class UBBoardController : public UBDocumentContainer
void
moveSceneToIndex
(
int
source
,
int
target
);
void
duplicateScene
(
int
index
);
void
duplicateItem
(
UBItem
*
item
);
UBGraphicsItem
*
duplicateItem
(
UBItem
*
item
);
void
deleteScene
(
int
index
);
bool
cacheIsVisible
()
{
return
mCacheWidgetIsEnabled
;}
...
...
src/domain/UBGraphicsScene.h
View file @
b255afd2
...
...
@@ -109,8 +109,9 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
};
// tmp stub for divide addings scene objects from undo mechanism implementation
bool
isURStackIsEnabled
(){
return
mUndoRedoStackEnabled
;}
void
enableUndoRedoStack
(){
mUndoRedoStackEnabled
=
true
;}
void
enableUndoRedoStack
(){
mUndoRedoStackEnabled
=
true
;}
void
setURStackEnable
(
bool
enable
){
mUndoRedoStackEnabled
=
enable
;}
bool
isURStackIsEnabled
(){
return
mUndoRedoStackEnabled
;}
UBGraphicsScene
(
UBDocumentProxy
*
parent
,
bool
enableUndoRedoStack
=
true
);
virtual
~
UBGraphicsScene
();
...
...
src/domain/UBItem.h
View file @
b255afd2
...
...
@@ -99,6 +99,8 @@ protected:
public
:
virtual
int
type
()
const
=
0
;
inline
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;
}
static
void
assignZValue
(
QGraphicsItem
*
,
qreal
value
);
...
...
src/gui/UBToolWidget.cpp
View file @
b255afd2
...
...
@@ -75,6 +75,15 @@ void UBToolWidget::initialize()
if
(
!
sUnpinPixmap
)
sUnpinPixmap
=
new
QPixmap
(
":/images/unpin.svg"
);
UBGraphicsScene
*
wscene
=
dynamic_cast
<
UBGraphicsScene
*>
(
mGraphicsWidgetItem
->
scene
());
if
(
wscene
)
{
wscene
->
removeItemFromDeletion
(
mGraphicsWidgetItem
);
wscene
->
removeItem
(
mGraphicsWidgetItem
);
}
mGraphicsWidgetItem
->
setParent
(
this
);
QGraphicsLinearLayout
*
graphicsLayout
=
new
QGraphicsLinearLayout
(
Qt
::
Vertical
,
this
);
...
...
@@ -83,7 +92,7 @@ void UBToolWidget::initialize()
graphicsLayout
->
setContentsMargins
(
mContentMargin
,
mContentMargin
,
mContentMargin
,
mContentMargin
);
setPreferredSize
(
mGraphicsWidgetItem
->
preferredWidth
()
+
mContentMargin
*
2
,
mGraphicsWidgetItem
->
preferredHeight
()
+
mContentMargin
*
2
);
mGraphicsWebView
=
new
QGraphicsWebView
();
mGraphicsWebView
=
new
QGraphicsWebView
(
this
);
connect
(
mGraphicsWebView
->
page
()
->
mainFrame
(),
SIGNAL
(
javaScriptWindowObjectCleared
()),
this
,
SLOT
(
javaScriptWindowObjectCleared
()));
mGraphicsWebView
->
load
(
mGraphicsWidgetItem
->
mainHtml
());
graphicsLayout
->
addItem
(
mGraphicsWebView
);
...
...
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