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
4e772301
Commit
4e772301
authored
Jan 10, 2016
by
Don Gagne
Browse files
Onboard Files is PX4 only
parent
2c1e6a37
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ui/QGCUASFileView.cc
View file @
4e772301
...
...
@@ -24,31 +24,37 @@
#include
"QGCUASFileView.h"
#include
"FileManager.h"
#include
"QGCFileDialog.h"
#include
"UAS.h"
#include
<QFileDialog>
#include
<QDir>
#include
<QDebug>
QGCUASFileView
::
QGCUASFileView
(
QWidget
*
parent
,
FileManager
*
manager
)
:
QWidget
(
parent
)
,
_manager
(
m
anager
)
,
_currentCommand
(
commandNone
)
QGCUASFileView
::
QGCUASFileView
(
QWidget
*
parent
,
Vehicle
*
vehicle
)
:
QWidget
(
parent
)
,
_manager
(
vehicle
->
uas
()
->
getFileM
anager
()
)
,
_currentCommand
(
commandNone
)
{
_ui
.
setupUi
(
this
);
_ui
.
progressBar
->
reset
();
// Connect UI signals
connect
(
_ui
.
listFilesButton
,
&
QPushButton
::
clicked
,
this
,
&
QGCUASFileView
::
_refreshTree
);
connect
(
_ui
.
downloadButton
,
&
QPushButton
::
clicked
,
this
,
&
QGCUASFileView
::
_downloadFile
);
connect
(
_ui
.
uploadButton
,
&
QPushButton
::
clicked
,
this
,
&
QGCUASFileView
::
_uploadFile
);
connect
(
_ui
.
treeWidget
,
&
QTreeWidget
::
currentItemChanged
,
this
,
&
QGCUASFileView
::
_currentItemChanged
);
// Connect signals from FileManager
connect
(
_manager
,
&
FileManager
::
commandProgress
,
this
,
&
QGCUASFileView
::
_commandProgress
);
connect
(
_manager
,
&
FileManager
::
commandComplete
,
this
,
&
QGCUASFileView
::
_commandComplete
);
connect
(
_manager
,
&
FileManager
::
commandError
,
this
,
&
QGCUASFileView
::
_commandError
);
connect
(
_manager
,
&
FileManager
::
listEntry
,
this
,
&
QGCUASFileView
::
_listEntryReceived
);
if
(
vehicle
->
px4Firmware
())
{
_ui
.
progressBar
->
reset
();
// Connect UI signals
connect
(
_ui
.
listFilesButton
,
&
QPushButton
::
clicked
,
this
,
&
QGCUASFileView
::
_refreshTree
);
connect
(
_ui
.
downloadButton
,
&
QPushButton
::
clicked
,
this
,
&
QGCUASFileView
::
_downloadFile
);
connect
(
_ui
.
uploadButton
,
&
QPushButton
::
clicked
,
this
,
&
QGCUASFileView
::
_uploadFile
);
connect
(
_ui
.
treeWidget
,
&
QTreeWidget
::
currentItemChanged
,
this
,
&
QGCUASFileView
::
_currentItemChanged
);
// Connect signals from FileManager
connect
(
_manager
,
&
FileManager
::
commandProgress
,
this
,
&
QGCUASFileView
::
_commandProgress
);
connect
(
_manager
,
&
FileManager
::
commandComplete
,
this
,
&
QGCUASFileView
::
_commandComplete
);
connect
(
_manager
,
&
FileManager
::
commandError
,
this
,
&
QGCUASFileView
::
_commandError
);
connect
(
_manager
,
&
FileManager
::
listEntry
,
this
,
&
QGCUASFileView
::
_listEntryReceived
);
}
else
{
_setAllButtonsEnabled
(
false
);
_ui
.
statusText
->
setText
(
QStringLiteral
(
"Onboard Files not supported by this Vehicle"
));
}
}
/// @brief Downloads the file currently selected in the tree view
...
...
src/ui/QGCUASFileView.h
View file @
4e772301
...
...
@@ -27,6 +27,7 @@
#include
<QWidget>
#include
<QTreeWidgetItem>
#include
"Vehicle.h"
#include
"uas/FileManager.h"
#include
"ui_QGCUASFileView.h"
...
...
@@ -35,7 +36,7 @@ class QGCUASFileView : public QWidget
Q_OBJECT
public:
explicit
QGCUASFileView
(
QWidget
*
parent
,
FileManager
*
manager
);
explicit
QGCUASFileView
(
QWidget
*
parent
,
Vehicle
*
vehicle
);
protected:
FileManager
*
_manager
;
...
...
src/ui/QGCUASFileViewMulti.cc
View file @
4e772301
...
...
@@ -41,7 +41,7 @@ void QGCUASFileViewMulti::_vehicleAdded(Vehicle* vehicle)
UAS
*
uas
=
vehicle
->
uas
();
if
(
!
lists
.
contains
(
uas
))
{
QGCUASFileView
*
list
=
new
QGCUASFileView
(
ui
->
stackedWidget
,
uas
->
getFileManager
()
);
QGCUASFileView
*
list
=
new
QGCUASFileView
(
ui
->
stackedWidget
,
vehicle
);
lists
.
insert
(
uas
,
list
);
ui
->
stackedWidget
->
addWidget
(
list
);
}
...
...
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