QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGCFileDialogController Class Reference

#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)
 

Detailed Description

Definition at line 7 of file QGCFileDialogController.h.

Constructor & Destructor Documentation

◆ QGCFileDialogController()

QGCFileDialogController::QGCFileDialogController ( QObject *  parent = nullptr)
explicit

Definition at line 15 of file QGCFileDialogController.cc.

◆ ~QGCFileDialogController()

QGCFileDialogController::~QGCFileDialogController ( )

Definition at line 21 of file QGCFileDialogController.cc.

Member Function Documentation

◆ deleteFile()

void QGCFileDialogController::deleteFile ( const QString &  filename)
static

Deletes the file specified by the fully qualified file name.

Definition at line 83 of file QGCFileDialogController.cc.

◆ fileExists()

bool QGCFileDialogController::fileExists ( const QString &  filename)
static

Check for file existence of specified fully qualified file name.

Definition at line 42 of file QGCFileDialogController.cc.

◆ fileImported

void QGCFileDialogController::fileImported ( const QString &  filePath)
signal

Emitted when the selected file has been successfully imported to the Missions directory.

Parameters
filePathFully-qualified path of the imported file in the Missions directory.

◆ fullFolderPathToShortMobilePath()

QString QGCFileDialogController::fullFolderPathToShortMobilePath ( const QString &  fullFolderPath)
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 88 of file QGCFileDialogController.cc.

References SettingsManager::appSettings(), and SettingsManager::instance().

◆ fullyQualifiedFilename()

QString QGCFileDialogController::fullyQualifiedFilename ( const QString &  directoryPath,
const QString &  filename,
const QStringList &  nameFilters = QStringList() 
)
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 47 of file QGCFileDialogController.cc.

◆ getFiles()

QStringList QGCFileDialogController::getFiles ( const QString &  directoryPath,
const QStringList &  nameFilters 
)
static

Return all file in the specified path which match the specified extension.

Definition at line 26 of file QGCFileDialogController.cc.

◆ importFailed

void QGCFileDialogController::importFailed ( const QString &  errorMessage)
signal

Emitted when the import operation fails.

Parameters
errorMessageHuman-readable description of the error.

Referenced by importFromNativePicker().

◆ 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 126 of file QGCFileDialogController.cc.

References SettingsManager::appSettings(), importFailed(), SettingsManager::instance(), AppSettings::missionSavePath(), and AndroidInterface::openFileImportDialog().

◆ urlToLocalFile()

QString QGCFileDialogController::urlToLocalFile ( QUrl  url)
static

Definition at line 102 of file QGCFileDialogController.cc.


The documentation for this class was generated from the following files: