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
5ed4a41d
Commit
5ed4a41d
authored
Jul 31, 2018
by
Clément Fauconnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
native dialogs and replace if exists dialog on import document
parent
40a9bdc0
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
16 deletions
+14
-16
UBExportAdaptor.cpp
src/adaptors/UBExportAdaptor.cpp
+1
-9
UBImportDocument.cpp
src/adaptors/UBImportDocument.cpp
+1
-1
UBBoardController.cpp
src/board/UBBoardController.cpp
+10
-4
UBBoardController.h
src/board/UBBoardController.h
+1
-1
UBDocumentController.cpp
src/document/UBDocumentController.cpp
+1
-1
No files found.
src/adaptors/UBExportAdaptor.cpp
View file @
5ed4a41d
...
...
@@ -65,15 +65,7 @@ QString UBExportAdaptor::askForFileName(UBDocumentProxy* pDocument, const QStrin
QString
defaultPath
=
UBSettings
::
settings
()
->
lastExportFilePath
->
get
().
toString
()
+
"/"
+
defaultName
;
bool
useNativeDialog
=
true
;
#ifdef Q_OS_MAC
int
versionMac
=
QSysInfo
::
macVersion
();
if
(
versionMac
==
QSysInfo
::
MV_Unknown
||
versionMac
>=
QSysInfo
::
MV_MAVERICKS
){
// version 11 is MacOSX 10.9 Mavericks
useNativeDialog
=
false
;
}
#endif
QString
filename
=
QFileDialog
::
getSaveFileName
(
UBApplication
::
mainWindow
,
pDialogTitle
,
defaultPath
,
QString
(),
0
,
useNativeDialog
?
(
QFileDialog
::
Option
)
0
:
QFileDialog
::
DontUseNativeDialog
);
QString
filename
=
QFileDialog
::
getSaveFileName
(
UBApplication
::
mainWindow
,
pDialogTitle
,
defaultPath
,
QString
());
if
(
filename
.
size
()
==
0
)
{
...
...
src/adaptors/UBImportDocument.cpp
View file @
5ed4a41d
...
...
@@ -185,7 +185,7 @@ UBDocumentProxy* UBImportDocument::importFile(const QFile& pFile, const QString&
return
NULL
;
}
UBDocumentProxy
*
newDocument
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentFromDir
(
documentRootFolder
,
pGroup
,
""
);
UBDocumentProxy
*
newDocument
=
UBPersistenceManager
::
persistenceManager
()
->
createDocumentFromDir
(
documentRootFolder
,
pGroup
,
""
,
false
,
false
,
true
);
UBApplication
::
showMessage
(
tr
(
"Import successful."
));
return
newDocument
;
}
...
...
src/board/UBBoardController.cpp
View file @
5ed4a41d
...
...
@@ -1537,7 +1537,7 @@ void UBBoardController::setActiveDocumentScene(int pSceneIndex)
setActiveDocumentScene
(
selectedDocument
(),
pSceneIndex
);
}
void
UBBoardController
::
setActiveDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
const
int
pSceneIndex
,
bool
forceReload
)
void
UBBoardController
::
setActiveDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
const
int
pSceneIndex
,
bool
forceReload
,
bool
onImport
)
{
saveViewState
();
...
...
@@ -1554,9 +1554,15 @@ void UBBoardController::setActiveDocumentScene(UBDocumentProxy* pDocumentProxy,
if
(
targetScene
)
{
if
(
mActiveScene
&&
!
onImport
)
{
persistCurrentScene
();
freezeW3CWidgets
(
true
);
ClearUndoStack
();
}
else
{
UBApplication
::
undoStack
->
clear
();
}
mActiveScene
=
targetScene
;
mActiveSceneIndex
=
index
;
...
...
src/board/UBBoardController.h
View file @
5ed4a41d
...
...
@@ -179,7 +179,7 @@ class UBBoardController : public UBDocumentContainer
void
findUniquesItems
(
const
QUndoCommand
*
parent
,
QSet
<
QGraphicsItem
*>
&
itms
);
void
ClearUndoStack
();
void
setActiveDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
int
pSceneIndex
=
0
,
bool
forceReload
=
false
);
void
setActiveDocumentScene
(
UBDocumentProxy
*
pDocumentProxy
,
int
pSceneIndex
=
0
,
bool
forceReload
=
false
,
bool
onImport
=
false
);
void
setActiveDocumentScene
(
int
pSceneIndex
);
void
moveSceneToIndex
(
int
source
,
int
target
);
...
...
src/document/UBDocumentController.cpp
View file @
5ed4a41d
...
...
@@ -1686,7 +1686,7 @@ void UBDocumentController::selectDocument(UBDocumentProxy* proxy, bool setAsCurr
if
(
proxy
!=
mBoardController
->
selectedDocument
())
// only if wanted Document is different from document actually on Board, // ALTI/AOU - 20140217
{
//issue 1629 - NNE - 20131105 : When set a current document, change in the board controller
mBoardController
->
setActiveDocumentScene
(
proxy
,
0
,
false
);
mBoardController
->
setActiveDocumentScene
(
proxy
,
0
,
false
,
onImport
);
}
}
...
...
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