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
c33a1057
Commit
c33a1057
authored
Aug 18, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document mode: title page selection
parent
b8f006d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
UBDocumentContainer.cpp
src/document/UBDocumentContainer.cpp
+7
-1
UBDocumentContainer.h
src/document/UBDocumentContainer.h
+1
-1
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+6
-5
UBThumbnailWidget.cpp
src/gui/UBThumbnailWidget.cpp
+11
-6
No files found.
src/document/UBDocumentContainer.cpp
View file @
c33a1057
...
...
@@ -52,12 +52,18 @@ void UBDocumentContainer::duplicatePages(QList<int>& pageIndexes)
emit
documentThumbnailsUpdated
(
this
);
}
void
UBDocumentContainer
::
movePageToIndex
(
int
source
,
int
target
)
bool
UBDocumentContainer
::
movePageToIndex
(
int
source
,
int
target
)
{
if
(
source
==
0
)
{
// Title page - cant be moved
return
false
;
}
UBPersistenceManager
::
persistenceManager
()
->
moveSceneToIndex
(
mCurrentDocument
,
source
,
target
);
deleteThumbPage
(
source
);
insertThumbPage
(
target
);
emit
documentThumbnailsUpdated
(
this
);
return
true
;
}
void
UBDocumentContainer
::
deletePages
(
QList
<
int
>&
pageIndexes
)
...
...
src/document/UBDocumentContainer.h
View file @
c33a1057
...
...
@@ -37,7 +37,7 @@ class UBDocumentContainer : public QObject
static
int
sceneIndexFromPage
(
int
sceneIndex
);
void
duplicatePages
(
QList
<
int
>&
pageIndexes
);
void
movePageToIndex
(
int
source
,
int
target
);
bool
movePageToIndex
(
int
source
,
int
target
);
void
deletePages
(
QList
<
int
>&
pageIndexes
);
void
addPage
(
int
index
);
void
updatePage
(
int
index
);
...
...
src/document/UBDocumentController.cpp
View file @
c33a1057
...
...
@@ -1032,12 +1032,13 @@ bool UBDocumentController::addFileToDocument(UBDocumentProxy* document)
void
UBDocumentController
::
moveSceneToIndex
(
UBDocumentProxy
*
proxy
,
int
source
,
int
target
)
{
UBDocumentContainer
::
movePageToIndex
(
source
,
target
);
proxy
->
setMetaData
(
UBSettings
::
documentUpdatedAt
,
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
()));
UBMetadataDcSubsetAdaptor
::
persist
(
proxy
);
if
(
UBDocumentContainer
::
movePageToIndex
(
source
,
target
))
{
proxy
->
setMetaData
(
UBSettings
::
documentUpdatedAt
,
UBStringUtils
::
toUtcIsoDateTime
(
QDateTime
::
currentDateTime
()));
UBMetadataDcSubsetAdaptor
::
persist
(
proxy
);
mDocumentUI
->
thumbnailWidget
->
hightlightItem
(
target
);
mDocumentUI
->
thumbnailWidget
->
hightlightItem
(
target
);
}
}
...
...
src/gui/UBThumbnailWidget.cpp
View file @
c33a1057
...
...
@@ -210,13 +210,18 @@ void UBThumbnailWidget::mousePressEvent(QMouseEvent *event)
mMousePressPos
=
event
->
pos
();
UBSceneThumbnailPixmap
*
sceneItem
=
dynamic_cast
<
UBSceneThumbnailPixmap
*>
(
itemAt
(
mMousePressPos
));
if
(
sceneItem
){
int
pageIndex
=
UBDocumentContainer
::
pageFromSceneIndex
(
sceneItem
->
sceneIndex
());
if
(
pageIndex
==
0
){
event
->
ignore
();
return
;
}
if
(
sceneItem
==
NULL
)
{
event
->
ignore
();
return
;
}
//if(sceneItem){
// int pageIndex = UBDocumentContainer::pageFromSceneIndex(sceneItem->sceneIndex());
// if(pageIndex == 0){
// event->ignore();
// return;
// }
//}
mMousePressScenePos
=
mapToScene
(
mMousePressPos
);
QGraphicsItem
*
underlyingItem
=
itemAt
(
mMousePressPos
);
...
...
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