|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <QGCFileDialogController.h>
Inheritance diagram for QGCFileDialogController:
Collaboration diagram for QGCFileDialogController:Signals | |
| void | fileImported (const QString &filePath) |
| void | importFailed (const QString &errorMessage) |
Public Member Functions | |
| QGCFileDialogController (QObject *parent=nullptr) | |
| ~QGCFileDialogController () | |
| Q_INVOKABLE void | importFromNativePicker () |
Static Public Member Functions | |
| static Q_INVOKABLE QStringList | getFiles (const QString &directoryPath, const QStringList &nameFilters) |
| Return all file in the specified path which match the specified extension. | |
| static Q_INVOKABLE QString | fullyQualifiedFilename (const QString &directoryPath, const QString &filename, const QStringList &nameFilters=QStringList()) |
| static Q_INVOKABLE bool | fileExists (const QString &filename) |
| Check for file existence of specified fully qualified file name. | |
| static Q_INVOKABLE void | deleteFile (const QString &filename) |
| Deletes the file specified by the fully qualified file name. | |
| static Q_INVOKABLE QString | urlToLocalFile (QUrl url) |
| static Q_INVOKABLE QString | fullFolderPathToShortMobilePath (const QString &fullFolderPath) |
Unit test file dialog shim | |
Native file dialogs cannot be driven from automated tests. Tests arm the shim with the result the next dialog should produce; QGCFileDialog.qml checks testHookArmed() in openForLoad()/openForSave() and, when armed, emits acceptedForLoad/acceptedForSave (or rejected) directly instead of opening the native dialog. Outside of unit test builds the hook is never armed and the QML check is a no-op. | |
| static Q_INVOKABLE bool | testHookArmed () |
| Returns true if a test result has been armed for the next dialog open. | |
| static Q_INVOKABLE QString | takeTestNextFile () |
| Returns the armed file path (empty for reject) and disarms the hook. | |
Definition at line 7 of file QGCFileDialogController.h.
|
explicit |
Definition at line 55 of file QGCFileDialogController.cc.
| QGCFileDialogController::~QGCFileDialogController | ( | ) |
Definition at line 61 of file QGCFileDialogController.cc.
|
static |
Deletes the file specified by the fully qualified file name.
Definition at line 123 of file QGCFileDialogController.cc.
|
static |
Check for file existence of specified fully qualified file name.
Definition at line 82 of file QGCFileDialogController.cc.
|
signal |
Emitted when the selected file has been successfully imported to the Missions directory.
| filePath | Fully-qualified path of the imported file in the Missions directory. |
|
static |
Important: Should only be used in mobile builds where default save location cannot be changed. Returns the standard QGC location portion of a fully qualified folder path. Example: "/Users/Don/Document/QGroundControl/Missions" returns "QGroundControl/Missions"
Definition at line 128 of file QGCFileDialogController.cc.
References SettingsManager::appSettings(), and SettingsManager::instance().
|
static |
Returns the fully qualified file name from the specified parts. If filename has no file extension the first file extension is nameFilters is added to the filename.
Definition at line 87 of file QGCFileDialogController.cc.
|
static |
Return all file in the specified path which match the specified extension.
Definition at line 66 of file QGCFileDialogController.cc.
|
signal |
Emitted when the import operation fails.
| errorMessage | Human-readable description of the error. |
Referenced by importFromNativePicker().
| void QGCFileDialogController::importFromNativePicker | ( | ) |
Opens Android's native file picker (ACTION_OPEN_DOCUMENT). On non-Android platforms this is a no-op.
Definition at line 166 of file QGCFileDialogController.cc.
References SettingsManager::appSettings(), importFailed(), SettingsManager::instance(), AppSettings::missionSavePath(), and AndroidInterface::openFileImportDialog().
|
static |
Returns the armed file path (empty for reject) and disarms the hook.
Definition at line 49 of file QGCFileDialogController.cc.
|
static |
Returns true if a test result has been armed for the next dialog open.
Definition at line 44 of file QGCFileDialogController.cc.
|
static |
Definition at line 142 of file QGCFileDialogController.cc.