Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
c7a9943c
Commit
c7a9943c
authored
May 15, 2017
by
Gus Grubba
Committed by
GitHub
May 15, 2017
Browse files
Merge pull request #5151 from dogmaphobic/offlineMaps
Fixes to offline maps import/export.
parents
d5592f49
e6618294
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/QGCQFileDialog.h
View file @
c7a9943c
...
...
@@ -74,7 +74,7 @@ public:
const
QString
&
caption
=
QString
(),
const
QString
&
dir
=
QString
(),
const
QString
&
filter
=
QString
(),
Options
options
=
0
);
Options
options
=
Options
()
);
//! Static helper that invokes a File Open dialog where the user can select one or more files to be opened.
/*!
...
...
@@ -91,7 +91,7 @@ public:
const
QString
&
caption
=
QString
(),
const
QString
&
dir
=
QString
(),
const
QString
&
filter
=
QString
(),
Options
options
=
0
);
Options
options
=
Options
()
);
//! Static helper that invokes a File Save dialog where the user can select a directory and enter a filename to be saved.
/*!
...
...
@@ -117,7 +117,7 @@ public:
const
QString
&
filter
=
QString
(),
const
QString
&
defaultSuffix
=
QString
(),
bool
strict
=
false
,
Options
options
=
0
);
Options
options
=
Options
()
);
private
slots
:
/// @brief The exec slot is private because we only want QGCQFileDialog users to use the static methods. Otherwise it will break
...
...
src/QtLocationPlugin/QMLControl/OfflineMap.qml
View file @
c7a9943c
...
...
@@ -936,7 +936,10 @@ QGCView {
text
:
qsTr
(
"
Import
"
)
width
:
_buttonSize
visible
:
!
ScreenTools
.
isMobile
onClicked
:
rootLoader
.
sourceComponent
=
importDialog
onClicked
:
{
QGroundControl
.
mapEngineManager
.
importAction
=
QGCMapEngineManager
.
ActionNone
rootLoader
.
sourceComponent
=
importDialog
}
}
QGCButton
{
text
:
qsTr
(
"
Export
"
)
...
...
@@ -1003,7 +1006,7 @@ QGCView {
onClicked
:
QGroundControl
.
mapEngineManager
.
selectNone
()
}
QGCButton
{
text
:
qsTr
(
"
Export
to Disk
"
)
text
:
qsTr
(
"
Export
"
)
width
:
_bigButtonSize
enabled
:
QGroundControl
.
mapEngineManager
.
selectedCount
>
0
onClicked
:
{
...
...
@@ -1013,14 +1016,6 @@ QGCView {
}
}
}
QGCButton
{
text
:
qsTr
(
"
Export to Device
"
)
width
:
_bigButtonSize
enabled
:
QGroundControl
.
mapEngineManager
.
selectedCount
>
0
onClicked
:
{
rootLoader
.
sourceComponent
=
exportToDevice
}
}
QGCButton
{
text
:
qsTr
(
"
Cancel
"
)
width
:
_bigButtonSize
...
...
@@ -1062,8 +1057,8 @@ QGCView {
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
BusyIndicator
{
visible
:
QGroundControl
.
mapEngineManager
?
QGroundControl
.
mapEngineManager
.
e
xporting
:
false
running
:
QGroundControl
.
mapEngineManager
?
QGroundControl
.
mapEngineManager
.
e
xporting
:
false
visible
:
QGroundControl
.
mapEngineManager
?
QGroundControl
.
mapEngineManager
.
importAction
===
QGCMapEngineManager
.
ActionE
xporting
:
false
running
:
QGroundControl
.
mapEngineManager
?
QGroundControl
.
mapEngineManager
.
importAction
===
QGCMapEngineManager
.
ActionE
xporting
:
false
width
:
exportCloseButton
.
height
height
:
exportCloseButton
.
height
anchors.horizontalCenter
:
parent
.
horizontalCenter
...
...
@@ -1166,7 +1161,7 @@ QGCView {
visible
:
QGroundControl
.
mapEngineManager
.
importAction
===
QGCMapEngineManager
.
ActionNone
anchors.horizontalCenter
:
parent
.
horizontalCenter
QGCButton
{
text
:
qsTr
(
"
Import
From Disk
"
)
text
:
qsTr
(
"
Import
"
)
width
:
_bigButtonSize
*
1.25
onClicked
:
{
if
(
!
QGroundControl
.
mapEngineManager
.
importSets
())
{
...
...
@@ -1175,13 +1170,6 @@ QGCView {
}
}
}
QGCButton
{
text
:
qsTr
(
"
Import From Device
"
)
width
:
_bigButtonSize
*
1.25
onClicked
:
{
rootLoader
.
sourceComponent
=
importFromDevice
}
}
QGCButton
{
text
:
qsTr
(
"
Cancel
"
)
width
:
_bigButtonSize
*
1.25
...
...
@@ -1196,94 +1184,4 @@ QGCView {
}
}
Component
{
id
:
importFromDevice
Rectangle
{
width
:
mainWindow
.
width
height
:
mainWindow
.
height
color
:
"
black
"
anchors.centerIn
:
parent
Rectangle
{
width
:
parent
.
width
*
0.45
height
:
importCol
.
height
*
1.5
radius
:
ScreenTools
.
defaultFontPixelWidth
color
:
qgcPal
.
windowShadeDark
border.color
:
qgcPal
.
text
anchors.centerIn
:
parent
Column
{
id
:
importCol
spacing
:
ScreenTools
.
defaultFontPixelHeight
width
:
parent
.
width
anchors.centerIn
:
parent
QGCLabel
{
text
:
qsTr
(
"
Map Tile Set Import From Device
"
);
font.family
:
ScreenTools
.
demiboldFontFamily
font.pointSize
:
ScreenTools
.
mediumFontPointSize
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
QGCLabel
{
text
:
qsTr
(
"
NOT YET IMPLEMENTED
"
);
font.family
:
ScreenTools
.
demiboldFontFamily
font.pointSize
:
ScreenTools
.
mediumFontPointSize
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
QGCButton
{
text
:
qsTr
(
"
Close
"
)
width
:
_bigButtonSize
*
1.25
anchors.horizontalCenter
:
parent
.
horizontalCenter
onClicked
:
{
showList
();
rootLoader
.
sourceComponent
=
null
}
}
}
}
}
}
Component
{
id
:
exportToDevice
Rectangle
{
width
:
mainWindow
.
width
height
:
mainWindow
.
height
color
:
"
black
"
anchors.centerIn
:
parent
Rectangle
{
width
:
parent
.
width
*
0.45
height
:
importCol
.
height
*
1.5
radius
:
ScreenTools
.
defaultFontPixelWidth
color
:
qgcPal
.
windowShadeDark
border.color
:
qgcPal
.
text
anchors.centerIn
:
parent
Column
{
id
:
importCol
spacing
:
ScreenTools
.
defaultFontPixelHeight
width
:
parent
.
width
anchors.centerIn
:
parent
QGCLabel
{
text
:
qsTr
(
"
Map Tile Set Export To Device
"
);
font.family
:
ScreenTools
.
demiboldFontFamily
font.pointSize
:
ScreenTools
.
mediumFontPointSize
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
QGCLabel
{
text
:
qsTr
(
"
NOT YET IMPLEMENTED
"
);
font.family
:
ScreenTools
.
demiboldFontFamily
font.pointSize
:
ScreenTools
.
mediumFontPointSize
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
QGCButton
{
text
:
qsTr
(
"
Close
"
)
width
:
_bigButtonSize
*
1.25
anchors.horizontalCenter
:
parent
.
horizontalCenter
onClicked
:
{
showList
();
rootLoader
.
sourceComponent
=
null
}
}
}
}
}
}
}
// QGCView
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
View file @
c7a9943c
...
...
@@ -421,8 +421,8 @@ QGCMapEngineManager::importSets(QString path) {
dir
=
QDir
(
QDir
::
homePath
()).
filePath
(
QString
(
"export_%1.db"
).
arg
(
QDateTime
::
currentDateTime
().
toTime_t
()));
#else
dir
=
QGCQFileDialog
::
getOpenFileName
(
MainWindow
::
instance
()
,
"
Ex
port Tile Set"
,
NULL
,
"
Im
port Tile Set"
,
QDir
::
homePath
(),
"Tile Sets (*.qgctiledb)"
);
#endif
...
...
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h
View file @
c7a9943c
...
...
@@ -58,7 +58,7 @@ public:
//-- Tile set export
Q_PROPERTY
(
int
selectedCount
READ
selectedCount
NOTIFY
selectedCountChanged
)
Q_PROPERTY
(
int
actionProgress
READ
actionProgress
NOTIFY
actionProgressChanged
)
Q_PROPERTY
(
ImportAction
importAction
READ
importAction
NOTIFY
importActionChanged
)
Q_PROPERTY
(
ImportAction
importAction
READ
importAction
WRITE
setImportAction
NOTIFY
importActionChanged
)
Q_PROPERTY
(
bool
importReplace
READ
importReplace
WRITE
setImportReplace
NOTIFY
importReplaceChanged
)
...
...
@@ -103,7 +103,7 @@ public:
void
setMaxMemCache
(
quint32
size
);
void
setMaxDiskCache
(
quint32
size
);
void
setImportReplace
(
bool
replace
)
{
_importReplace
=
replace
;
emit
importReplaceChanged
();
}
void
setImportAction
(
ImportAction
action
)
{
_importAction
=
action
;
emit
importActionChanged
();
}
void
setErrorMessage
(
const
QString
&
error
)
{
_errorMessage
=
error
;
emit
errorMessageChanged
();
}
// Override from QGCTool
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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