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
fca4b6c9
Commit
fca4b6c9
authored
Sep 28, 2018
by
Clément Fauconnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvements on the document mode behavior
parent
681acce8
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
105 deletions
+106
-105
UBDocumentContainer.h
src/document/UBDocumentContainer.h
+9
-1
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+86
-101
UBDocumentController.h
src/document/UBDocumentController.h
+9
-2
UBDocumentProxy.cpp
src/document/UBDocumentProxy.cpp
+1
-0
UBDocumentNavigator.cpp
src/gui/UBDocumentNavigator.cpp
+1
-1
No files found.
src/document/UBDocumentContainer.h
View file @
fca4b6c9
...
@@ -46,7 +46,15 @@ class UBDocumentContainer : public QObject
...
@@ -46,7 +46,15 @@ class UBDocumentContainer : public QObject
UBDocumentProxy
*
selectedDocument
(){
return
mCurrentDocument
;}
UBDocumentProxy
*
selectedDocument
(){
return
mCurrentDocument
;}
int
pageCount
(){
return
mCurrentDocument
->
pageCount
();}
int
pageCount
(){
return
mCurrentDocument
->
pageCount
();}
const
QPixmap
*
pageAt
(
int
index
){
return
mDocumentThumbs
[
index
];}
const
QPixmap
*
pageAt
(
int
index
)
{
if
(
index
<
mDocumentThumbs
.
size
())
return
mDocumentThumbs
[
index
];
else
{
return
NULL
;
}
}
static
int
pageFromSceneIndex
(
int
sceneIndex
);
static
int
pageFromSceneIndex
(
int
sceneIndex
);
static
int
sceneIndexFromPage
(
int
sceneIndex
);
static
int
sceneIndexFromPage
(
int
sceneIndex
);
...
...
src/document/UBDocumentController.cpp
View file @
fca4b6c9
This diff is collapsed.
Click to expand it.
src/document/UBDocumentController.h
View file @
fca4b6c9
...
@@ -111,7 +111,14 @@ public:
...
@@ -111,7 +111,14 @@ public:
void
removeChild
(
int
index
);
void
removeChild
(
int
index
);
UBDocumentProxy
*
proxyData
()
const
{
return
mProxy
;}
UBDocumentProxy
*
proxyData
()
const
{
return
mProxy
;}
bool
isRoot
()
{
return
!
mParent
;}
bool
isRoot
()
{
return
!
mParent
;}
bool
isTopLevel
()
{
return
mParent
&&
!
mParent
->
mParent
;}
bool
isTopLevel
()
{
if
(
mParent
)
{
return
!
mParent
->
mParent
;
}
else
return
false
;
}
UBDocumentTreeNode
*
clone
();
UBDocumentTreeNode
*
clone
();
QString
dirPathInHierarchy
();
QString
dirPathInHierarchy
();
...
@@ -216,7 +223,7 @@ public:
...
@@ -216,7 +223,7 @@ public:
QPersistentModelIndex
myDocumentsIndex
()
const
{
return
mMyDocuments
;}
QPersistentModelIndex
myDocumentsIndex
()
const
{
return
mMyDocuments
;}
QPersistentModelIndex
trashIndex
()
const
{
return
mTrash
;}
QPersistentModelIndex
trashIndex
()
const
{
return
mTrash
;}
QPersistentModelIndex
untitledDocumentsIndex
()
const
{
return
m
Untitled
Documents
;}
QPersistentModelIndex
untitledDocumentsIndex
()
const
{
return
m
My
Documents
;}
UBDocumentTreeNode
*
nodeFromIndex
(
const
QModelIndex
&
pIndex
)
const
;
UBDocumentTreeNode
*
nodeFromIndex
(
const
QModelIndex
&
pIndex
)
const
;
static
bool
nodeLessThan
(
const
UBDocumentTreeNode
*
firstIndex
,
const
UBDocumentTreeNode
*
secondIndex
);
static
bool
nodeLessThan
(
const
UBDocumentTreeNode
*
firstIndex
,
const
UBDocumentTreeNode
*
secondIndex
);
void
setHighLighted
(
const
QModelIndex
&
newHighLighted
)
{
mHighLighted
=
newHighLighted
;}
void
setHighLighted
(
const
QModelIndex
&
newHighLighted
)
{
mHighLighted
=
newHighLighted
;}
...
...
src/document/UBDocumentProxy.cpp
View file @
fca4b6c9
...
@@ -42,6 +42,7 @@
...
@@ -42,6 +42,7 @@
UBDocumentProxy
::
UBDocumentProxy
()
UBDocumentProxy
::
UBDocumentProxy
()
:
mPageCount
(
0
)
:
mPageCount
(
0
)
,
mPageDpi
(
0
)
,
mPageDpi
(
0
)
,
mPersistencePath
(
""
)
{
{
init
();
init
();
}
}
...
...
src/gui/UBDocumentNavigator.cpp
View file @
fca4b6c9
...
@@ -127,7 +127,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
...
@@ -127,7 +127,7 @@ void UBDocumentNavigator::generateThumbnails(UBDocumentContainer* source)
{
{
//claudio This is a very bad hack and shows a architectural problem
//claudio This is a very bad hack and shows a architectural problem
// source->selectedDocument()->pageCount() != source->pageCount()
// source->selectedDocument()->pageCount() != source->pageCount()
if
(
i
>=
source
->
pageCount
()
||
source
->
pageAt
(
i
)
->
isNull
(
))
if
(
i
>=
source
->
pageCount
()
||
!
source
->
pageAt
(
i
))
source
->
insertThumbPage
(
i
);
source
->
insertThumbPage
(
i
);
const
QPixmap
*
pix
=
source
->
pageAt
(
i
);
const
QPixmap
*
pix
=
source
->
pageAt
(
i
);
...
...
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