mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-21 23:55:13 -05:00
commit
af8d63e94e
@ -60,7 +60,7 @@ if(NOT SERVER_MODE)
|
||||
)
|
||||
|
||||
set(TARGET_NAME demodadsb)
|
||||
set(TARGET_LIB Qt::Widgets Qt::Quick Qt::QuickWidgets Qt::Positioning Qt::TextToSpeech)
|
||||
set(TARGET_LIB Qt::Widgets Qt::Quick Qt::QuickWidgets Qt::Positioning Qt::Location Qt::TextToSpeech)
|
||||
set(TARGET_LIB_GUI "sdrgui")
|
||||
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
|
||||
else()
|
||||
|
@ -16,6 +16,7 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QFontDialog>
|
||||
#include <QGeoServiceProvider>
|
||||
#include <QDebug>
|
||||
|
||||
#include "adsbdemoddisplaydialog.h"
|
||||
@ -28,6 +29,15 @@ ADSBDemodDisplayDialog::ADSBDemodDisplayDialog(ADSBDemodSettings *settings, QWid
|
||||
m_fontSize(settings->m_tableFontSize)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QStringList mapProviders = QGeoServiceProvider::availableServiceProviders();
|
||||
if (!mapProviders.contains("osm")) {
|
||||
ui->mapProvider->removeItem(ui->mapProvider->findText("osm"));
|
||||
}
|
||||
if (!mapProviders.contains("mapboxgl")) {
|
||||
ui->mapProvider->removeItem(ui->mapProvider->findText("mapboxgl"));
|
||||
}
|
||||
|
||||
ui->timeout->setValue(settings->m_removeTimeout);
|
||||
ui->aircraftMinZoom->setValue(settings->m_aircraftMinZoom);
|
||||
ui->airportRange->setValue(settings->m_airportRange);
|
||||
@ -46,7 +56,10 @@ ADSBDemodDisplayDialog::ADSBDemodDisplayDialog(ADSBDemodSettings *settings, QWid
|
||||
}
|
||||
}
|
||||
ui->airspaceRange->setValue(settings->m_airspaceRange);
|
||||
ui->mapProvider->setCurrentText(settings->m_mapProvider);
|
||||
int idx = ui->mapProvider->findText(settings->m_mapProvider);
|
||||
if (idx != -1) {
|
||||
ui->mapProvider->setCurrentText(settings->m_mapProvider);
|
||||
}
|
||||
ui->mapType->setCurrentIndex((int)settings->m_mapType);
|
||||
ui->navAids->setChecked(settings->m_displayNavAids);
|
||||
ui->atcCallsigns->setChecked(settings->m_atcCallsigns);
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <QQmlProperty>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QGeoServiceProvider>
|
||||
|
||||
#include "ui_adsbdemodgui.h"
|
||||
#include "device/deviceapi.h"
|
||||
@ -4725,14 +4726,24 @@ void ADSBDemodGUI::applyMapSettings()
|
||||
zoom = 10.0;
|
||||
}
|
||||
|
||||
// Check requested map provider is available - if not, try the other
|
||||
QString mapProvider = m_settings.m_mapProvider;
|
||||
QStringList mapProviders = QGeoServiceProvider::availableServiceProviders();
|
||||
if ((mapProvider == "osm") && (!mapProviders.contains(mapProvider))) {
|
||||
mapProvider = "mapboxgl";
|
||||
}
|
||||
if ((mapProvider == "mapboxgl") && (!mapProviders.contains(mapProvider))) {
|
||||
mapProvider = "osm";
|
||||
}
|
||||
|
||||
// Create the map using the specified provider
|
||||
QQmlProperty::write(item, "smoothing", MainCore::instance()->getSettings().getMapSmoothing());
|
||||
QQmlProperty::write(item, "aircraftMinZoomLevel", m_settings.m_aircraftMinZoom);
|
||||
QQmlProperty::write(item, "mapProvider", m_settings.m_mapProvider);
|
||||
QQmlProperty::write(item, "mapProvider", mapProvider);
|
||||
QVariantMap parameters;
|
||||
QString mapType;
|
||||
|
||||
if (m_settings.m_mapProvider == "osm")
|
||||
if (mapProvider == "osm")
|
||||
{
|
||||
// Use our repo, so we can append API key and redefine transmit maps
|
||||
parameters["osm.mapping.providersrepository.address"] = QString("http://127.0.0.1:%1/").arg(m_osmPort);
|
||||
@ -4760,7 +4771,7 @@ void ADSBDemodGUI::applyMapSettings()
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (m_settings.m_mapProvider == "mapboxgl")
|
||||
else if (mapProvider == "mapboxgl")
|
||||
{
|
||||
switch (m_settings.m_mapType)
|
||||
{
|
||||
|
@ -38,21 +38,18 @@ bool CRightClickEnabler::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
auto mouseEvent = (QMouseEvent*) event;
|
||||
|
||||
if (mouseEvent->source() == Qt::MouseEventNotSynthesized) {
|
||||
m_mousePressed = true;
|
||||
} else {
|
||||
m_mousePressed = false; // Mouse event generated from touch event
|
||||
}
|
||||
|
||||
if (mouseEvent->button() == Qt::RightButton)
|
||||
{
|
||||
emit rightClick(mouseEvent->globalPos());
|
||||
mouseEvent->setAccepted(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mouseEvent->button() == Qt::LeftButton)
|
||||
{
|
||||
if (mouseEvent->source() == Qt::MouseEventNotSynthesized) {
|
||||
m_mousePressed = true;
|
||||
} else {
|
||||
m_mousePressed = false; // Mouse event generated from touch event
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (event->type() == QEvent::MouseButtonRelease)
|
||||
{
|
||||
@ -61,6 +58,7 @@ bool CRightClickEnabler::eventFilter(QObject *obj, QEvent *event)
|
||||
if (mouseEvent->button() == Qt::RightButton)
|
||||
{
|
||||
mouseEvent->setAccepted(true);
|
||||
m_mousePressed = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user