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
821f08c8
Commit
821f08c8
authored
Jan 20, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
6a56f545
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
0 deletions
+24
-0
AndroidManifest.xml
android/AndroidManifest.xml
+2
-0
AppMessages.cc
src/QmlControls/AppMessages.cc
+2
-0
AppMessages.qml
src/QmlControls/AppMessages.qml
+1
-0
main.cc
src/main.cc
+19
-0
No files found.
android/AndroidManifest.xml
View file @
821f08c8
...
@@ -69,6 +69,8 @@
...
@@ -69,6 +69,8 @@
<uses-feature
android:name=
"android.hardware.location"
android:required=
"false"
/>
<uses-feature
android:name=
"android.hardware.location"
android:required=
"false"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.WRITE_INTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
Remove the comment if you do not require these default features. -->
...
...
src/QmlControls/AppMessages.cc
View file @
821f08c8
...
@@ -76,6 +76,8 @@ void AppLogModel::writeMessages(const QString dest_file)
...
@@ -76,6 +76,8 @@ void AppLogModel::writeMessages(const QString dest_file)
QTextStream
out
(
&
file
);
QTextStream
out
(
&
file
);
out
<<
writebuffer
;
out
<<
writebuffer
;
success
=
out
.
status
()
==
QTextStream
::
Ok
;
success
=
out
.
status
()
==
QTextStream
::
Ok
;
}
else
{
qWarning
()
<<
"AppLogModel::writeMessages write failed:"
<<
file
.
errorString
();
}
}
emit
debug_model
->
writeFinished
(
success
);
emit
debug_model
->
writeFinished
(
success
);
});
});
...
...
src/QmlControls/AppMessages.qml
View file @
821f08c8
...
@@ -133,6 +133,7 @@ QGCView {
...
@@ -133,6 +133,7 @@ QGCView {
id
:
writeDialog
id
:
writeDialog
folder
:
QGroundControl
.
settingsManager
.
appSettings
.
logSavePath
folder
:
QGroundControl
.
settingsManager
.
appSettings
.
logSavePath
nameFilters
:
[
qsTr
(
"
Log files (*.txt)
"
),
qsTr
(
"
All Files (*)
"
)]
nameFilters
:
[
qsTr
(
"
Log files (*.txt)
"
),
qsTr
(
"
All Files (*)
"
)]
fileExtension
:
qsTr
(
"
txt
"
)
selectExisting
:
false
selectExisting
:
false
title
:
qsTr
(
"
Select log save file
"
)
title
:
qsTr
(
"
Select log save file
"
)
qgcView
:
_qgcView
qgcView
:
_qgcView
...
...
src/main.cc
View file @
821f08c8
...
@@ -97,6 +97,21 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
...
@@ -97,6 +97,21 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
}
}
#endif
#endif
#ifdef __android__
#include <QtAndroid>
bool
checkAndroidWritePermission
()
{
QtAndroid
::
PermissionResult
r
=
QtAndroid
::
checkPermission
(
"android.permission.WRITE_EXTERNAL_STORAGE"
);
if
(
r
==
QtAndroid
::
PermissionResult
::
Denied
)
{
QtAndroid
::
requestPermissionsSync
(
QStringList
()
<<
"android.permission.WRITE_EXTERNAL_STORAGE"
);
r
=
QtAndroid
::
checkPermission
(
"android.permission.WRITE_EXTERNAL_STORAGE"
);
if
(
r
==
QtAndroid
::
PermissionResult
::
Denied
)
{
return
false
;
}
}
return
true
;
}
#endif
/**
/**
* @brief Starts the application
* @brief Starts the application
*
*
...
@@ -254,6 +269,10 @@ int main(int argc, char *argv[])
...
@@ -254,6 +269,10 @@ int main(int argc, char *argv[])
}
else
}
else
#endif
#endif
{
{
#ifdef __android__
checkAndroidWritePermission
();
#endif
if
(
!
app
->
_initForNormalAppBoot
())
{
if
(
!
app
->
_initForNormalAppBoot
())
{
return
-
1
;
return
-
1
;
}
}
...
...
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