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
90144b76
Commit
90144b76
authored
Nov 19, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Undo for duplicated items works for groups.
parent
3b1e4715
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
11 deletions
+6
-11
UBBoardController.cpp
src/board/UBBoardController.cpp
+6
-3
UBGraphicsItemUndoCommand.cpp
src/domain/UBGraphicsItemUndoCommand.cpp
+0
-8
No files found.
src/board/UBBoardController.cpp
View file @
90144b76
...
@@ -648,6 +648,8 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -648,6 +648,8 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
QList
<
QGraphicsItem
*>
duplicatedItems
;
QList
<
QGraphicsItem
*>
duplicatedItems
;
QList
<
QGraphicsItem
*>
children
=
groupItem
->
childItems
();
QList
<
QGraphicsItem
*>
children
=
groupItem
->
childItems
();
mActiveScene
->
setURStackEnable
(
false
);
foreach
(
QGraphicsItem
*
pIt
,
children
){
foreach
(
QGraphicsItem
*
pIt
,
children
){
UBItem
*
pItem
=
dynamic_cast
<
UBItem
*>
(
pIt
);
UBItem
*
pItem
=
dynamic_cast
<
UBItem
*>
(
pIt
);
if
(
pItem
){
// we diong sync duplication of all childs.
if
(
pItem
){
// we diong sync duplication of all childs.
...
@@ -668,6 +670,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -668,6 +670,7 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
mActiveScene
->
addItem
(
itemToAdd
);
mActiveScene
->
addItem
(
itemToAdd
);
itemToAdd
->
setSelected
(
true
);
itemToAdd
->
setSelected
(
true
);
}
}
mActiveScene
->
setURStackEnable
(
true
);
}
break
;
}
break
;
case
UBMimeType
:
:
UNKNOWN
:
case
UBMimeType
:
:
UNKNOWN
:
...
@@ -687,9 +690,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
...
@@ -687,9 +690,9 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item, bool bAsync)
if
(
retItem
)
if
(
retItem
)
{
{
QGraphicsItem
*
graphicsRetItem
=
dynamic_cast
<
QGraphicsItem
*>
(
retItem
);
QGraphicsItem
*
graphicsRetItem
=
dynamic_cast
<
QGraphicsItem
*>
(
retItem
);
if
(
graphicsRetItem
&&
mActiveScene
->
isURStackIsEnabled
())
{
//should be deleted after scene own undo stack implemented
if
(
mActiveScene
->
isURStackIsEnabled
())
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
mActiveScene
,
0
,
graphicsRetItem
);
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
mActiveScene
,
0
,
graphicsRetItem
);
UBApplication
::
undoStack
->
push
(
uc
);
UBApplication
::
undoStack
->
push
(
uc
);
}
}
return
retItem
;
return
retItem
;
}
}
...
...
src/domain/UBGraphicsItemUndoCommand.cpp
View file @
90144b76
...
@@ -92,14 +92,6 @@ void UBGraphicsItemUndoCommand::undo()
...
@@ -92,14 +92,6 @@ void UBGraphicsItemUndoCommand::undo()
{
{
QGraphicsItem
*
item
=
itAdded
.
next
();
QGraphicsItem
*
item
=
itAdded
.
next
();
//if removing group
if
(
item
->
type
()
==
UBGraphicsGroupContainerItem
::
Type
)
{
UBGraphicsGroupContainerItem
*
curGroup
=
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
item
);
if
(
curGroup
)
{
curGroup
->
destroy
();
}
}
UBApplication
::
boardController
->
freezeW3CWidget
(
item
,
true
);
UBApplication
::
boardController
->
freezeW3CWidget
(
item
,
true
);
item
->
setSelected
(
false
);
item
->
setSelected
(
false
);
mScene
->
removeItem
(
item
);
mScene
->
removeItem
(
item
);
...
...
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