Commit b1867b20 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4233 from wingtra/file_dialogs_z

Open file and directory dialogs in foreground
parents 76c634ed 498056eb
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "ExifParser.h" #include "ExifParser.h"
#include "QGCFileDialog.h" #include "QGCFileDialog.h"
#include "QGCLoggingCategory.h" #include "QGCLoggingCategory.h"
#include "MainWindow.h"
#include <math.h> #include <math.h>
#include <QtEndian> #include <QtEndian>
#include <QMessageBox> #include <QMessageBox>
...@@ -34,7 +35,7 @@ GeoTagController::~GeoTagController() ...@@ -34,7 +35,7 @@ GeoTagController::~GeoTagController()
void GeoTagController::pickLogFile(void) void GeoTagController::pickLogFile(void)
{ {
QString filename = QGCFileDialog::getOpenFileName(NULL, "Select log file load", QString(), "PX4 log file (*.px4log);;All Files (*.*)"); QString filename = QGCFileDialog::getOpenFileName(MainWindow::instance(), "Select log file load", QString(), "PX4 log file (*.px4log);;All Files (*.*)");
if (!filename.isEmpty()) { if (!filename.isEmpty()) {
_worker.setLogFile(filename); _worker.setLogFile(filename);
emit logFileChanged(filename); emit logFileChanged(filename);
...@@ -43,7 +44,7 @@ void GeoTagController::pickLogFile(void) ...@@ -43,7 +44,7 @@ void GeoTagController::pickLogFile(void)
void GeoTagController::pickImageDirectory(void) void GeoTagController::pickImageDirectory(void)
{ {
QString dir = QGCFileDialog::getExistingDirectory(NULL, "Select image directory"); QString dir = QGCFileDialog::getExistingDirectory(MainWindow::instance(), "Select image directory");
if (!dir.isEmpty()) { if (!dir.isEmpty()) {
_worker.setImageDirectory(dir); _worker.setImageDirectory(dir);
emit imageDirectoryChanged(dir); emit imageDirectoryChanged(dir);
...@@ -52,7 +53,7 @@ void GeoTagController::pickImageDirectory(void) ...@@ -52,7 +53,7 @@ void GeoTagController::pickImageDirectory(void)
void GeoTagController::pickSaveDirectory(void) void GeoTagController::pickSaveDirectory(void)
{ {
QString dir = QGCFileDialog::getExistingDirectory(NULL, "Select save directory"); QString dir = QGCFileDialog::getExistingDirectory(MainWindow::instance(), "Select save directory");
if (!dir.isEmpty()) { if (!dir.isEmpty()) {
_worker.setSaveDirectory(dir); _worker.setSaveDirectory(dir);
emit saveDirectoryChanged(dir); emit saveDirectoryChanged(dir);
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "JsonHelper.h" #include "JsonHelper.h"
#ifndef __mobile__ #ifndef __mobile__
#include "MainWindow.h"
#include "QGCFileDialog.h" #include "QGCFileDialog.h"
#endif #endif
...@@ -245,7 +246,7 @@ void GeoFenceController::loadFromFile(const QString& filename) ...@@ -245,7 +246,7 @@ void GeoFenceController::loadFromFile(const QString& filename)
void GeoFenceController::loadFromFilePicker(void) void GeoFenceController::loadFromFilePicker(void)
{ {
#ifndef __mobile__ #ifndef __mobile__
QString filename = QGCFileDialog::getOpenFileName(NULL, "Select GeoFence File to load", QString(), "Fence file (*.fence);;All Files (*.*)"); QString filename = QGCFileDialog::getOpenFileName(MainWindow::instance(), "Select GeoFence File to load", QString(), "Fence file (*.fence);;All Files (*.*)");
if (filename.isEmpty()) { if (filename.isEmpty()) {
return; return;
...@@ -308,7 +309,7 @@ void GeoFenceController::saveToFile(const QString& filename) ...@@ -308,7 +309,7 @@ void GeoFenceController::saveToFile(const QString& filename)
void GeoFenceController::saveToFilePicker(void) void GeoFenceController::saveToFilePicker(void)
{ {
#ifndef __mobile__ #ifndef __mobile__
QString filename = QGCFileDialog::getSaveFileName(NULL, "Select file to save GeoFence to", QString(), "Fence file (*.fence);;All Files (*.*)"); QString filename = QGCFileDialog::getSaveFileName(MainWindow::instance(), "Select file to save GeoFence to", QString(), "Fence file (*.fence);;All Files (*.*)");
if (filename.isEmpty()) { if (filename.isEmpty()) {
return; return;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "QGroundControlQmlGlobal.h" #include "QGroundControlQmlGlobal.h"
#ifndef __mobile__ #ifndef __mobile__
#include "MainWindow.h"
#include "QGCFileDialog.h" #include "QGCFileDialog.h"
#endif #endif
...@@ -469,7 +470,7 @@ void MissionController::loadFromFile(const QString& filename) ...@@ -469,7 +470,7 @@ void MissionController::loadFromFile(const QString& filename)
void MissionController::loadFromFilePicker(void) void MissionController::loadFromFilePicker(void)
{ {
#ifndef __mobile__ #ifndef __mobile__
QString filename = QGCFileDialog::getOpenFileName(NULL, "Select Mission File to load", QString(), "Mission file (*.mission);;All Files (*.*)"); QString filename = QGCFileDialog::getOpenFileName(MainWindow::instance(), "Select Mission File to load", QString(), "Mission file (*.mission);;All Files (*.*)");
if (filename.isEmpty()) { if (filename.isEmpty()) {
return; return;
...@@ -553,7 +554,7 @@ void MissionController::saveToFile(const QString& filename) ...@@ -553,7 +554,7 @@ void MissionController::saveToFile(const QString& filename)
void MissionController::saveToFilePicker(void) void MissionController::saveToFilePicker(void)
{ {
#ifndef __mobile__ #ifndef __mobile__
QString filename = QGCFileDialog::getSaveFileName(NULL, "Select file to save mission to", QString(), "Mission file (*.mission);;All Files (*.*)"); QString filename = QGCFileDialog::getSaveFileName(MainWindow::instance(), "Select file to save mission to", QString(), "Mission file (*.mission);;All Files (*.*)");
if (filename.isEmpty()) { if (filename.isEmpty()) {
return; return;
......
...@@ -113,7 +113,7 @@ void ParameterEditorController::saveToFile(const QString& filename) ...@@ -113,7 +113,7 @@ void ParameterEditorController::saveToFile(const QString& filename)
void ParameterEditorController::saveToFilePicker(void) void ParameterEditorController::saveToFilePicker(void)
{ {
#ifndef __mobile__ #ifndef __mobile__
QString fileName = QGCFileDialog::getSaveFileName(NULL, QString fileName = QGCFileDialog::getSaveFileName(MainWindow::instance(),
"Save Parameters", "Save Parameters",
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),
"Parameter Files (*.params)", "Parameter Files (*.params)",
...@@ -153,7 +153,7 @@ void ParameterEditorController::loadFromFile(const QString& filename) ...@@ -153,7 +153,7 @@ void ParameterEditorController::loadFromFile(const QString& filename)
void ParameterEditorController::loadFromFilePicker(void) void ParameterEditorController::loadFromFilePicker(void)
{ {
#ifndef __mobile__ #ifndef __mobile__
QString fileName = QGCFileDialog::getOpenFileName(NULL, QString fileName = QGCFileDialog::getOpenFileName(MainWindow::instance(),
"Load Parameters", "Load Parameters",
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation),
"Parameter Files (*.params);;All Files (*)"); "Parameter Files (*.params);;All Files (*)");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment