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
3779f0e3
Commit
3779f0e3
authored
Aug 15, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test authentication as soon as the user adds/changes user name and/or password.
parent
7aecf62b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
6 deletions
+19
-6
AirMapManager.cc
src/Airmap/AirMapManager.cc
+12
-1
AirMapManager.h
src/Airmap/AirMapManager.h
+2
-0
AirMapSharedState.cc
src/Airmap/AirMapSharedState.cc
+1
-1
AirmapSettings.qml
src/Airmap/AirmapSettings.qml
+3
-3
AirspaceManager.h
src/AirspaceManagement/AirspaceManager.h
+1
-1
No files found.
src/Airmap/AirMapManager.cc
View file @
3779f0e3
...
@@ -63,6 +63,7 @@ AirMapManager::~AirMapManager()
...
@@ -63,6 +63,7 @@ AirMapManager::~AirMapManager()
void
void
AirMapManager
::
setToolbox
(
QGCToolbox
*
toolbox
)
AirMapManager
::
setToolbox
(
QGCToolbox
*
toolbox
)
{
{
_settingsTimer
.
setSingleShot
(
true
);
AirspaceManager
::
setToolbox
(
toolbox
);
AirspaceManager
::
setToolbox
(
toolbox
);
AirMapSettings
*
ap
=
toolbox
->
settingsManager
()
->
airMapSettings
();
AirMapSettings
*
ap
=
toolbox
->
settingsManager
()
->
airMapSettings
();
connect
(
ap
->
enableAirMap
(),
&
Fact
::
rawValueChanged
,
this
,
&
AirMapManager
::
_settingsChanged
);
connect
(
ap
->
enableAirMap
(),
&
Fact
::
rawValueChanged
,
this
,
&
AirMapManager
::
_settingsChanged
);
...
@@ -71,7 +72,8 @@ AirMapManager::setToolbox(QGCToolbox* toolbox)
...
@@ -71,7 +72,8 @@ AirMapManager::setToolbox(QGCToolbox* toolbox)
connect
(
ap
->
clientID
(),
&
Fact
::
rawValueChanged
,
this
,
&
AirMapManager
::
_settingsChanged
);
connect
(
ap
->
clientID
(),
&
Fact
::
rawValueChanged
,
this
,
&
AirMapManager
::
_settingsChanged
);
connect
(
ap
->
userName
(),
&
Fact
::
rawValueChanged
,
this
,
&
AirMapManager
::
_settingsChanged
);
connect
(
ap
->
userName
(),
&
Fact
::
rawValueChanged
,
this
,
&
AirMapManager
::
_settingsChanged
);
connect
(
ap
->
password
(),
&
Fact
::
rawValueChanged
,
this
,
&
AirMapManager
::
_settingsChanged
);
connect
(
ap
->
password
(),
&
Fact
::
rawValueChanged
,
this
,
&
AirMapManager
::
_settingsChanged
);
_settingsChanged
();
connect
(
&
_settingsTimer
,
&
QTimer
::
timeout
,
this
,
&
AirMapManager
::
_settingsTimeout
);
_settingsTimeout
();
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
@@ -100,6 +102,13 @@ AirMapManager::_authStatusChanged(AirspaceManager::AuthStatus status)
...
@@ -100,6 +102,13 @@ AirMapManager::_authStatusChanged(AirspaceManager::AuthStatus status)
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void
void
AirMapManager
::
_settingsChanged
()
AirMapManager
::
_settingsChanged
()
{
_settingsTimer
.
start
(
1000
);
}
//-----------------------------------------------------------------------------
void
AirMapManager
::
_settingsTimeout
()
{
{
qCDebug
(
AirMapManagerLog
)
<<
"AirMap settings changed"
;
qCDebug
(
AirMapManagerLog
)
<<
"AirMap settings changed"
;
_connectStatus
.
clear
();
_connectStatus
.
clear
();
...
@@ -156,6 +165,8 @@ AirMapManager::_settingsChanged()
...
@@ -156,6 +165,8 @@ AirMapManager::_settingsChanged()
emit
connectedChanged
();
emit
connectedChanged
();
_connectStatus
=
tr
(
"AirMap Enabled"
);
_connectStatus
=
tr
(
"AirMap Enabled"
);
emit
connectStatusChanged
();
emit
connectStatusChanged
();
//-- Now test authentication
_shared
.
login
();
}
else
{
}
else
{
qWarning
(
"Failed to create airmap::qt::Client instance"
);
qWarning
(
"Failed to create airmap::qt::Client instance"
);
QString
description
=
QString
::
fromStdString
(
result
.
error
().
description
()
?
result
.
error
().
description
().
get
()
:
""
);
QString
description
=
QString
::
fromStdString
(
result
.
error
().
description
()
?
result
.
error
().
description
().
get
()
:
""
);
...
...
src/Airmap/AirMapManager.h
View file @
3779f0e3
...
@@ -55,10 +55,12 @@ protected:
...
@@ -55,10 +55,12 @@ protected:
private
slots
:
private
slots
:
void
_error
(
const
QString
&
what
,
const
QString
&
airmapdMessage
,
const
QString
&
airmapdDetails
);
void
_error
(
const
QString
&
what
,
const
QString
&
airmapdMessage
,
const
QString
&
airmapdDetails
);
void
_settingsChanged
();
void
_settingsChanged
();
void
_settingsTimeout
();
void
_authStatusChanged
(
AirspaceManager
::
AuthStatus
status
);
void
_authStatusChanged
(
AirspaceManager
::
AuthStatus
status
);
private:
private:
QString
_connectStatus
;
QString
_connectStatus
;
QTimer
_settingsTimer
;
AirMapSharedState
_shared
;
AirMapSharedState
_shared
;
std
::
shared_ptr
<
airmap
::
qt
::
Logger
>
_logger
;
std
::
shared_ptr
<
airmap
::
qt
::
Logger
>
_logger
;
std
::
shared_ptr
<
airmap
::
qt
::
DispatchingLogger
>
_dispatchingLogger
;
std
::
shared_ptr
<
airmap
::
qt
::
DispatchingLogger
>
_dispatchingLogger
;
...
...
src/Airmap/AirMapSharedState.cc
View file @
3779f0e3
...
@@ -76,7 +76,7 @@ AirMapSharedState::login()
...
@@ -76,7 +76,7 @@ AirMapSharedState::login()
if
(
result
)
{
if
(
result
)
{
qCDebug
(
AirMapManagerLog
)
<<
"Successfully authenticated with AirMap: id="
<<
result
.
value
().
id
.
c_str
()
<<
", access="
qCDebug
(
AirMapManagerLog
)
<<
"Successfully authenticated with AirMap: id="
<<
result
.
value
().
id
.
c_str
()
<<
", access="
<<
result
.
value
().
access
.
c_str
();
<<
result
.
value
().
access
.
c_str
();
emit
authStatus
(
AirspaceManager
::
AuthStatus
::
Autheticated
);
emit
authStatus
(
AirspaceManager
::
AuthStatus
::
Authe
n
ticated
);
_loginToken
=
QString
::
fromStdString
(
result
.
value
().
id
);
_loginToken
=
QString
::
fromStdString
(
result
.
value
().
id
);
_processPendingRequests
();
_processPendingRequests
();
}
else
{
}
else
{
...
...
src/Airmap/AirmapSettings.qml
View file @
3779f0e3
...
@@ -209,10 +209,10 @@ QGCView {
...
@@ -209,10 +209,10 @@ QGCView {
return
qsTr
(
""
)
return
qsTr
(
""
)
case
AirspaceManager
.
Anonymous
:
case
AirspaceManager
.
Anonymous
:
return
qsTr
(
"
Anonymous
"
)
return
qsTr
(
"
Anonymous
"
)
case
AirspaceManager
.
Autheticated
:
case
AirspaceManager
.
Authe
n
ticated
:
return
qsTr
(
"
Autheticated
"
)
return
qsTr
(
"
Authe
n
ticated
"
)
default
:
default
:
return
qsTr
(
"
Authetication Error
"
)
return
qsTr
(
"
Authe
n
tication Error
"
)
}
}
}
}
Layout
.
rowSpan
:
2
Layout
.
rowSpan
:
2
...
...
src/AirspaceManagement/AirspaceManager.h
View file @
3779f0e3
...
@@ -60,7 +60,7 @@ public:
...
@@ -60,7 +60,7 @@ public:
enum
AuthStatus
{
enum
AuthStatus
{
Unknown
,
Unknown
,
Anonymous
,
Anonymous
,
Autheticated
,
Authe
n
ticated
,
Error
Error
};
};
...
...
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