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
468d3e54
Commit
468d3e54
authored
Jan 15, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2612 from DonLakeFlyer/StupidProofing
Stupid proof Linux serial port use
parents
0e3df28c
cb57b800
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
0 deletions
+47
-0
QGCApplication.cc
src/QGCApplication.cc
+47
-0
No files found.
src/QGCApplication.cc
View file @
468d3e54
...
...
@@ -114,6 +114,12 @@
#include "OpalLink.h"
#endif
#ifdef Q_OS_LINUX
#ifndef __mobile__
#include <unistd.h>
#include <sys/types.h>
#endif
#endif
QGCApplication
*
QGCApplication
::
_app
=
NULL
;
...
...
@@ -189,6 +195,47 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
setAttribute
(
Qt
::
AA_DontCreateNativeWidgetSiblings
);
#endif
#ifdef Q_OS_LINUX
#ifndef __mobile__
if
(
!
_runningUnitTests
)
{
if
(
getuid
()
==
0
)
{
QMessageBox
msgBox
;
msgBox
.
setInformativeText
(
"You are runnning QGroundControl as root. "
"You should not do this since it will cause other issues with QGroundControl. "
"QGroundControl will now exit. "
"If you are having serial port issues on Ubuntu, execute the following commands to fix most issues:
\n
"
"sudo usermod -a -G dialout $USER
\n
"
"sudo apt-get remove modemmanager"
);
msgBox
.
setStandardButtons
(
QMessageBox
::
Ok
);
msgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
msgBox
.
exec
();
_exit
(
0
);
}
// Determine if we have the correct permissions to access USB serial devices
QFile
permFile
(
"/etc/group"
);
if
(
permFile
.
open
(
QIODevice
::
ReadOnly
))
{
while
(
!
permFile
.
atEnd
())
{
QString
line
=
permFile
.
readLine
();
if
(
line
.
contains
(
"dialout"
)
&&
!
line
.
contains
(
getenv
(
"USER"
)))
{
QMessageBox
msgBox
;
msgBox
.
setInformativeText
(
"The current user does not have the correct permissions to access serial devices. "
"You should also remove modemmanager since it also interferes. "
"If you are using Ubuntu, execute the following commands to fix these issues:
\n
"
"sudo usermod -a -G dialout $USER
\n
"
"sudo apt-get remove modemmanager"
);
msgBox
.
setStandardButtons
(
QMessageBox
::
Ok
);
msgBox
.
setDefaultButton
(
QMessageBox
::
Ok
);
msgBox
.
exec
();
break
;
}
}
permFile
.
close
();
}
}
#endif
#endif
// Parse command line options
bool
fClearSettingsOptions
=
false
;
// Clear stored settings
...
...
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