Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Valentin Platzgummer
qgroundcontrol
Commits
0be3b970
Commit
0be3b970
authored
Apr 19, 2017
by
Don Gagne
Committed by
GitHub
Apr 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5016 from DonLakeFlyer/MobileSave
Mobile file save: Show existing files to save to
parents
44682709
58cc2a47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
93 additions
and
50 deletions
+93
-50
QGCFileDialog.qml
src/QmlControls/QGCFileDialog.qml
+93
-50
No files found.
src/QmlControls/QGCFileDialog.qml
View file @
0be3b970
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Dialogs
1.2
import
QtQuick
.
Layouts
1.2
import
QGroundControl
1.0
import
QGroundControl
.
ScreenTools
1.0
...
...
@@ -21,12 +22,14 @@ Item {
property
bool
selectExisting
property
bool
selectFolder
property
bool
_openForLoad
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
bool
_openForLoad
:
true
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
bool
_mobile
:
ScreenTools
.
isMobile
function
openForLoad
()
{
_openForLoad
=
true
if
(
ScreenTools
.
isM
obile
&&
folder
.
length
!==
0
)
{
if
(
_m
obile
&&
folder
.
length
!==
0
)
{
qgcView
.
showDialog
(
mobileFileOpenDialog
,
title
,
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
)
}
else
{
fullFileDialog
.
open
()
...
...
@@ -35,7 +38,7 @@ Item {
function
openForSave
()
{
_openForLoad
=
false
if
(
ScreenTools
.
isM
obile
&&
folder
.
length
!==
0
)
{
if
(
_m
obile
&&
folder
.
length
!==
0
)
{
qgcView
.
showDialog
(
mobileFileSaveDialog
,
title
,
qgcView
.
showDialogDefaultWidth
,
StandardButton
.
Cancel
|
StandardButton
.
Ok
)
}
else
{
fullFileDialog
.
open
()
...
...
@@ -76,30 +79,36 @@ Item {
id
:
mobileFileOpenDialog
QGCViewDialog
{
Item
{
anchors.margins
:
_margins
anchors.fill
:
parent
QGCListView
{
id
:
listView
anchors.fill
:
parent
spacing
:
_margins
/
2
orientation
:
ListView
.
Vertical
model
:
controller
.
getFiles
(
folder
,
fileExtension
)
delegate
:
QGCButton
{
text
:
modelData
onClicked
:
{
hideDialog
()
_root
.
acceptedForLoad
(
controller
.
fullyQualifiedFilename
(
folder
,
modelData
,
fileExtension
))
QGCFlickable
{
anchors.fill
:
parent
contentHeight
:
fileOpenColumn
.
height
Column
{
id
:
fileOpenColumn
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
2
Repeater
{
id
:
fileList
;
model
:
controller
.
getFiles
(
folder
,
fileExtension
)
QGCButton
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
text
:
modelData
onClicked
:
{
hideDialog
()
_root
.
acceptedForLoad
(
controller
.
fullyQualifiedFilename
(
folder
,
modelData
,
fileExtension
))
}
}
}
}
QGCLabel
{
text
:
qsTr
(
"
No files
"
)
visible
:
listView
.
model
.
length
==
0
QGCLabel
{
text
:
qsTr
(
"
No files
"
)
visible
:
fileList
.
model
.
length
==
0
}
}
}
}
...
...
@@ -123,35 +132,69 @@ Item {
hideDialog
()
}
Column
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelHeight
QGCFlickable
{
anchors.fill
:
parent
contentHeight
:
fileSaveColumn
.
height
QGCLabel
{
text
:
qsTr
(
"
File name:
"
)
}
QGCTextField
{
id
:
filenameTextField
onTextChanged
:
replaceMessage
.
visible
=
false
}
QGCLabel
{
Column
{
id
:
fileSaveColumn
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
File names must end with .%1 file extension. If missing it will be added.
"
).
arg
(
fileExtension
)
}
spacing
:
ScreenTools
.
defaultFontPixelHeight
/
2
RowLayout
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
qsTr
(
"
New file name:
"
)
}
QGCTextField
{
id
:
filenameTextField
Layout.fillWidth
:
true
onTextChanged
:
replaceMessage
.
visible
=
false
}
}
QGCLabel
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
File names must end with .%1 file extension. If missing it will be added.
"
).
arg
(
fileExtension
)
}
QGCLabel
{
id
:
replaceMessage
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
The file %1 exists. Click Save again to replace it.
"
).
arg
(
filenameTextField
.
text
)
visible
:
false
color
:
qgcPal
.
warningText
}
SectionHeader
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
text
:
qsTr
(
"
Save to existing file:
"
)
}
Repeater
{
model
:
controller
.
getFiles
(
folder
,
fileExtension
)
QGCButton
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
text
:
modelData
onClicked
:
{
hideDialog
()
_root
.
acceptedForSave
(
controller
.
fullyQualifiedFilename
(
folder
,
modelData
,
fileExtension
))
}
}
}
QGCLabel
{
id
:
replaceMessage
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
wrapMode
:
Text
.
WordWrap
text
:
qsTr
(
"
The file %1 exists. Click Save again to replace it.
"
).
arg
(
filenameTextField
.
text
)
visible
:
false
color
:
qgcPal
.
warningText
}
}
}
...
...
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