2021-01-22 09:54:22 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2023-11-18 07:12:18 -05:00
|
|
|
// Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
|
|
|
|
// written by Christian Daniel //
|
|
|
|
// Copyright (C) 2015-2019 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
|
|
|
|
// Copyright (C) 2021-2023 Jon Beniston, M7RCE <jon@beniston.com> //
|
2021-01-22 09:54:22 -05:00
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef INCLUDE_FEATURE_MAPSETTINGSDIALOG_H
|
|
|
|
#define INCLUDE_FEATURE_MAPSETTINGSDIALOG_H
|
|
|
|
|
2022-02-04 15:40:43 -05:00
|
|
|
#include <QSpinBox>
|
2022-02-09 11:41:40 -05:00
|
|
|
#include <QDoubleSpinBox>
|
2022-02-04 15:40:43 -05:00
|
|
|
#include <QMessageBox>
|
2023-02-14 09:46:08 -05:00
|
|
|
#include <QProgressDialog>
|
2022-02-04 15:40:43 -05:00
|
|
|
|
|
|
|
#include "gui/httpdownloadmanagergui.h"
|
2023-02-14 09:46:08 -05:00
|
|
|
#include "util/openaip.h"
|
|
|
|
#include "util/ourairportsdb.h"
|
2022-02-04 15:40:43 -05:00
|
|
|
|
2021-01-22 09:54:22 -05:00
|
|
|
#include "ui_mapsettingsdialog.h"
|
|
|
|
#include "mapsettings.h"
|
|
|
|
|
2022-02-04 15:40:43 -05:00
|
|
|
class MapColorGUI : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
|
|
|
|
MapColorGUI(QTableWidget *table, int row, int col, bool noColor, quint32 color);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void on_color_clicked();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QToolButton *m_colorButton;
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Have copies of settings, so we don't change unless main dialog is accepted
|
|
|
|
bool m_noColor;
|
|
|
|
quint32 m_color;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class MapItemSettingsGUI : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
|
|
|
|
MapItemSettingsGUI(QTableWidget *table, int row, MapSettings::MapItemSettings *settings);
|
|
|
|
|
|
|
|
MapColorGUI m_track2D;
|
|
|
|
MapColorGUI m_point3D;
|
|
|
|
MapColorGUI m_track3D;
|
|
|
|
QSpinBox *m_minZoom;
|
|
|
|
QSpinBox *m_minPixels;
|
2022-02-09 11:41:40 -05:00
|
|
|
QDoubleSpinBox *m_labelScale;
|
2022-02-04 15:40:43 -05:00
|
|
|
};
|
|
|
|
|
2021-01-22 09:54:22 -05:00
|
|
|
class MapSettingsDialog : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MapSettingsDialog(MapSettings *settings, QWidget* parent = 0);
|
|
|
|
~MapSettingsDialog();
|
|
|
|
|
2022-02-04 15:40:43 -05:00
|
|
|
enum Columns {
|
|
|
|
COL_ENABLED,
|
|
|
|
COL_2D_ICON,
|
|
|
|
COL_2D_LABEL,
|
|
|
|
COL_2D_MIN_ZOOM,
|
|
|
|
COL_2D_TRACK,
|
|
|
|
COL_3D_MODEL,
|
|
|
|
COL_3D_MIN_PIXELS,
|
|
|
|
COL_3D_LABEL,
|
|
|
|
COL_3D_POINT,
|
2022-02-09 11:41:40 -05:00
|
|
|
COL_3D_TRACK,
|
2023-02-14 09:46:08 -05:00
|
|
|
COL_3D_LABEL_SCALE,
|
|
|
|
COL_FILTER_NAME,
|
|
|
|
COL_FILTER_DISTANCE
|
2022-02-04 15:40:43 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool m_map2DSettingsChanged; // 2D map needs to be reloaded
|
|
|
|
bool m_map3DSettingsChanged; // 3D map needs to be reloaded
|
2021-11-23 11:44:07 -05:00
|
|
|
bool m_osmURLChanged;
|
2023-03-21 07:07:25 -04:00
|
|
|
QStringList m_settingsKeysChanged; // List of setting keys that have been changed
|
2022-02-04 15:40:43 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
MapSettings *m_settings;
|
|
|
|
QList<MapItemSettingsGUI *> m_mapItemSettingsGUIs;
|
|
|
|
HttpDownloadManagerGUI m_dlm;
|
|
|
|
int m_fileIdx;
|
|
|
|
QMessageBox m_downloadDialog;
|
2023-02-14 09:46:08 -05:00
|
|
|
QProgressDialog *m_progressDialog;
|
|
|
|
OpenAIP m_openAIP;
|
|
|
|
OurAirportsDB m_ourAirportsDB;
|
2022-02-04 15:40:43 -05:00
|
|
|
|
|
|
|
void unzip(const QString &filename);
|
2021-01-22 09:54:22 -05:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void accept();
|
2022-02-04 15:40:43 -05:00
|
|
|
void on_map2DEnabled_clicked(bool checked=false);
|
|
|
|
void on_map3DEnabled_clicked(bool checked=false);
|
|
|
|
void on_downloadModels_clicked();
|
2023-02-14 09:46:08 -05:00
|
|
|
void on_getAirportDB_clicked();
|
|
|
|
void on_getAirspacesDB_clicked();
|
2022-02-04 15:40:43 -05:00
|
|
|
void downloadComplete(const QString &filename, bool success, const QString &url, const QString &errorMessage);
|
2023-02-14 09:46:08 -05:00
|
|
|
void downloadingURL(const QString& url);
|
|
|
|
void downloadProgress(qint64 bytesRead, qint64 totalBytes);
|
|
|
|
void downloadError(const QString& error);
|
|
|
|
void downloadAirspaceFinished();
|
|
|
|
void downloadNavAidsFinished();
|
|
|
|
void downloadAirportInformationFinished();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void navAidsUpdated();
|
|
|
|
void airspacesUpdated();
|
|
|
|
void airportsUpdated();
|
2021-01-22 09:54:22 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::MapSettingsDialog* ui;
|
2022-02-04 15:40:43 -05:00
|
|
|
|
2021-01-22 09:54:22 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCLUDE_FEATURE_MAPSETTINGSDIALOG_H
|