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
7b678ab7
Commit
7b678ab7
authored
Jul 19, 2019
by
Clément Fauconnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved behavior when replacing active document during import
parent
a690a114
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
UBPersistenceManager.cpp
src/core/UBPersistenceManager.cpp
+11
-11
No files found.
src/core/UBPersistenceManager.cpp
View file @
7b678ab7
...
...
@@ -188,15 +188,11 @@ void UBPersistenceManager::createDocumentProxiesStructure(const QFileInfoList &c
}
docProxy
->
setPageCount
(
sceneCount
(
docProxy
));
bool
addDoc
=
false
;
if
(
!
interactive
)
{
addDoc
=
true
;
}
else
if
(
processInteractiveReplacementDialog
(
docProxy
)
==
QDialog
::
Accepted
)
{
addDoc
=
true
;
}
if
(
addDoc
)
{
if
(
!
interactive
)
mDocumentTreeStructureModel
->
addDocument
(
docProxy
,
parentIndex
);
}
else
processInteractiveReplacementDialog
(
docProxy
);
}
}
}
...
...
@@ -231,7 +227,9 @@ QDialog::DialogCode UBPersistenceManager::processInteractiveReplacementDialog(UB
,
docList
,
/*UBApplication::documentController->mainWidget()*/
0
,
Qt
::
Widget
);
if
(
replaceDialog
->
exec
()
==
QDialog
::
Accepted
)
{
if
(
replaceDialog
->
exec
()
==
QDialog
::
Accepted
)
{
mDocumentTreeStructureModel
->
addDocument
(
pProxy
,
parentIndex
);
result
=
QDialog
::
Accepted
;
QString
resultName
=
replaceDialog
->
lineEditText
();
int
i
=
docList
.
indexOf
(
resultName
);
...
...
@@ -256,8 +254,10 @@ QDialog::DialogCode UBPersistenceManager::processInteractiveReplacementDialog(UB
replaceDialog
->
setParent
(
0
);
delete
replaceDialog
;
}
else
{
mDocumentTreeStructureModel
->
addDocument
(
pProxy
,
parentIndex
);
result
=
QDialog
::
Accepted
;
}
}
//TODO claudio the if is an hack
if
(
UBApplication
::
overrideCursor
())
...
...
@@ -452,11 +452,11 @@ UBDocumentProxy* UBPersistenceManager::createDocument(const QString& pGroupName
bool
addDoc
=
false
;
if
(
!
promptDialogIfExists
)
{
addDoc
=
true
;
mDocumentTreeStructureModel
->
addDocument
(
doc
);
}
else
if
(
processInteractiveReplacementDialog
(
doc
)
==
QDialog
::
Accepted
)
{
addDoc
=
true
;
}
if
(
addDoc
)
{
mDocumentTreeStructureModel
->
addDocument
(
doc
);
emit
proxyListChanged
();
}
else
{
deleteDocument
(
doc
);
...
...
@@ -524,12 +524,12 @@ UBDocumentProxy* UBPersistenceManager::createDocumentFromDir(const QString& pDoc
bool
addDoc
=
false
;
if
(
!
promptDialogIfExists
)
{
addDoc
=
true
;
mDocumentTreeStructureModel
->
addDocument
(
doc
);
}
else
if
(
processInteractiveReplacementDialog
(
doc
)
==
QDialog
::
Accepted
)
{
addDoc
=
true
;
}
if
(
addDoc
)
{
UBMetadataDcSubsetAdaptor
::
persist
(
doc
);
mDocumentTreeStructureModel
->
addDocument
(
doc
);
emit
proxyListChanged
();
emit
documentCreated
(
doc
);
}
else
{
...
...
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