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
2ceefe73
Commit
2ceefe73
authored
Dec 15, 2011
by
Ivan Ilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created undoredo stack blocker
parent
e4c2afe6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
25 deletions
+67
-25
UBCFFSubsetAdaptor.cpp
src/adaptors/UBCFFSubsetAdaptor.cpp
+1
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+59
-25
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+7
-0
No files found.
src/adaptors/UBCFFSubsetAdaptor.cpp
View file @
2ceefe73
...
...
@@ -1002,6 +1002,7 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::repositionSvgItem(QGraphicsItem *ite
bool
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
createNewScene
()
{
mCurrentScene
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentSceneAt
(
mProxy
,
mProxy
->
pageCount
());
mCurrentScene
->
setURStackEnable
(
false
);
mCurrentSceneRect
=
mCurrentScene
->
normalizedSceneRect
();
mVBTransFactor
=
qMin
(
mCurrentSceneRect
.
width
()
/
mViewPort
.
width
(),
mCurrentSceneRect
.
height
()
/
mViewPort
.
height
());
...
...
src/domain/UBGraphicsScene.cpp
View file @
2ceefe73
...
...
@@ -93,8 +93,10 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
,
mCurrentStroke
(
0
)
,
mShouldUseOMP
(
true
)
,
mItemCount
(
0
)
,
enableUndoRedoStack
(
true
)
,
magniferControlViewWidget
(
0
)
,
magniferDisplayViewWidget
(
0
)
{
#ifdef __ppc__
...
...
@@ -139,6 +141,8 @@ UBGraphicsScene::UBGraphicsScene(UBDocumentProxy* parent)
}
connect
(
this
,
SIGNAL
(
selectionChanged
()),
this
,
SLOT
(
selectionChangedProcessing
()));
}
UBGraphicsScene
::~
UBGraphicsScene
()
...
...
@@ -371,10 +375,13 @@ bool UBGraphicsScene::inputDeviceRelease()
if
(
mRemovedItems
.
size
()
>
0
||
mAddedItems
.
size
()
>
0
)
{
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
udcmd
=
new
UBGraphicsItemUndoCommand
(
this
,
mRemovedItems
,
mAddedItems
);
//deleted by the undoStack
if
(
UBApplication
::
undoStack
)
UBApplication
::
undoStack
->
push
(
udcmd
);
}
mRemovedItems
.
clear
();
mAddedItems
.
clear
();
...
...
@@ -961,8 +968,11 @@ void UBGraphicsScene::clearItemsAndAnnotations()
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2 ?) to trigger repaint
update
(
sceneRect
());
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
removedItems
,
emptyList
);
UBApplication
::
undoStack
->
push
(
uc
);
}
setDocumentUpdated
();
}
...
...
@@ -995,8 +1005,12 @@ void UBGraphicsScene::clearItems()
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2 ?) to trigger repaint
update
(
sceneRect
());
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
removedItems
,
emptyList
);
UBApplication
::
undoStack
->
push
(
uc
);
}
setDocumentUpdated
();
}
...
...
@@ -1022,8 +1036,12 @@ void UBGraphicsScene::clearAnnotations()
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2 ?) to trigger repaint
update
(
sceneRect
());
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
removedItems
,
emptyList
);
UBApplication
::
undoStack
->
push
(
uc
);
}
setDocumentUpdated
();
}
...
...
@@ -1044,8 +1062,10 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, const Q
addItem
(
pixmapItem
);
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
0
,
pixmapItem
);
UBApplication
::
undoStack
->
push
(
uc
);
}
pixmapItem
->
scale
(
pScaleFactor
,
pScaleFactor
);
...
...
@@ -1070,8 +1090,10 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, const Q
void
UBGraphicsScene
::
textUndoCommandAdded
(
UBGraphicsTextItem
*
textItem
)
{
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsTextItemUndoCommand
*
uc
=
new
UBGraphicsTextItemUndoCommand
(
textItem
);
UBApplication
::
undoStack
->
push
(
uc
);
}
}
...
...
@@ -1090,8 +1112,10 @@ UBGraphicsVideoItem* UBGraphicsScene::addVideo(const QUrl& pVideoFileUrl, bool s
videoItem
->
show
();
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
0
,
videoItem
);
UBApplication
::
undoStack
->
push
(
uc
);
}
videoItem
->
mediaObject
()
->
play
();
...
...
@@ -1121,8 +1145,10 @@ UBGraphicsAudioItem* UBGraphicsScene::addAudio(const QUrl& pAudioFileUrl, bool s
audioItem
->
show
();
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
0
,
audioItem
);
UBApplication
::
undoStack
->
push
(
uc
);
}
audioItem
->
mediaObject
()
->
play
();
...
...
@@ -1197,8 +1223,10 @@ void UBGraphicsScene::addGraphicsWidget(UBGraphicsWidgetItem* graphicsWidget, co
// graphicsWidget->widgetWebView()->loadMainHtml();
graphicsWidget
->
setSelected
(
true
);
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
0
,
graphicsWidget
);
UBApplication
::
undoStack
->
push
(
uc
);
}
setDocumentUpdated
();
}
...
...
@@ -1253,8 +1281,10 @@ UBGraphicsSvgItem* UBGraphicsScene::addSvg(const QUrl& pSvgFileUrl, const QPoint
addItem
(
svgItem
);
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
0
,
svgItem
);
UBApplication
::
undoStack
->
push
(
uc
);
}
setDocumentUpdated
();
...
...
@@ -1314,8 +1344,10 @@ UBGraphicsTextItem* UBGraphicsScene::addTextWithFont(const QString& pString, con
textItem
->
show
();
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
0
,
textItem
);
UBApplication
::
undoStack
->
push
(
uc
);
}
connect
(
textItem
,
SIGNAL
(
textUndoCommandAdded
(
UBGraphicsTextItem
*
)),
this
,
SLOT
(
textUndoCommandAdded
(
UBGraphicsTextItem
*
)));
...
...
@@ -1337,8 +1369,10 @@ UBGraphicsTextItem *UBGraphicsScene::addTextHtml(const QString &pString, const Q
addItem
(
textItem
);
textItem
->
show
();
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
0
,
textItem
);
UBApplication
::
undoStack
->
push
(
uc
);
}
connect
(
textItem
,
SIGNAL
(
textUndoCommandAdded
(
UBGraphicsTextItem
*
)),
this
,
SLOT
(
textUndoCommandAdded
(
UBGraphicsTextItem
*
)));
...
...
src/domain/UBGraphicsScene.h
View file @
2ceefe73
...
...
@@ -55,6 +55,8 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
Q_OBJECT
public
:
// tmp stub for divide addings scene objects from undo mechanism implementation
void
setURStackEnable
(
bool
set
=
true
)
{
enableUndoRedoStack
=
set
;}
UBGraphicsScene
(
UBDocumentProxy
*
parent
);
virtual
~
UBGraphicsScene
();
...
...
@@ -363,8 +365,13 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
//int mMesure1Ms, mMesure2Ms;
bool
mHasCache
;
// tmp stub for divide addings scene objects from undo mechanism implementation
bool
enableUndoRedoStack
;
UBMagnifier
*
magniferControlViewWidget
;
UBMagnifier
*
magniferDisplayViewWidget
;
};
#endif
/* UBGRAPHICSSCENE_H_ */
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