diff --git a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.cpp b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.cpp index e2c409655..c4d53c658 100644 --- a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.cpp +++ b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmodgui.cpp @@ -19,6 +19,7 @@ #include "device/deviceuiset.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/hbfilterchainconverter.h" #include "maincore.h" @@ -234,6 +235,7 @@ void BeamSteeringCWModGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelmimo/doa2/doa2gui.cpp b/plugins/channelmimo/doa2/doa2gui.cpp index 2067aa29f..59862ce74 100644 --- a/plugins/channelmimo/doa2/doa2gui.cpp +++ b/plugins/channelmimo/doa2/doa2gui.cpp @@ -19,6 +19,8 @@ #include "device/deviceuiset.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/hbfilterchainconverter.h" #include "dsp/scopevis.h" #include "dsp/spectrumvis.h" @@ -158,6 +160,7 @@ DOA2GUI::DOA2GUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, MIMOChannel *ch ui->halfWLLabel->setText(QString("%1/2").arg(QChar(0xBB, 0x03))); ui->azUnits->setText(QString("%1").arg(QChar(0260))); + DialPopup::addPopupsToChildDials(this); } DOA2GUI::~DOA2GUI() @@ -300,6 +303,7 @@ void DOA2GUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelmimo/interferometer/interferometergui.cpp b/plugins/channelmimo/interferometer/interferometergui.cpp index 6f135d448..0be02a717 100644 --- a/plugins/channelmimo/interferometer/interferometergui.cpp +++ b/plugins/channelmimo/interferometer/interferometergui.cpp @@ -19,6 +19,7 @@ #include "device/deviceuiset.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/hbfilterchainconverter.h" #include "dsp/scopevis.h" #include "dsp/spectrumvis.h" @@ -269,6 +270,7 @@ void InterferometerGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/chanalyzer/chanalyzergui.cpp b/plugins/channelrx/chanalyzer/chanalyzergui.cpp index 2169fe1b6..a379b40a2 100644 --- a/plugins/channelrx/chanalyzer/chanalyzergui.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzergui.cpp @@ -25,6 +25,8 @@ #include "gui/glspectrum.h" #include "gui/glscope.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "plugin/pluginapi.h" #include "util/simpleserializer.h" #include "util/db.h" @@ -481,6 +483,7 @@ void ChannelAnalyzerGUI::onMenuDialogCalled(const QPoint& p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -582,6 +585,7 @@ ChannelAnalyzerGUI::ChannelAnalyzerGUI(PluginAPI* pluginAPI, DeviceUISet *device displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } ChannelAnalyzerGUI::~ChannelAnalyzerGUI() diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.cpp b/plugins/channelrx/demodadsb/adsbdemodgui.cpp index 385878a98..0ac33c607 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodgui.cpp @@ -51,6 +51,9 @@ #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" #include "gui/clickablelabel.h" +#include "gui/tabletapandhold.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "mainwindow.h" @@ -3371,7 +3374,7 @@ void ADSBDemodGUI::findOnChannelMap(Aircraft *aircraft) void ADSBDemodGUI::adsbData_customContextMenuRequested(QPoint pos) { - QTableWidgetItem *item = ui->adsbData->itemAt(pos); + QTableWidgetItem *item = ui->adsbData->itemAt(pos); if (item) { int row = item->row(); @@ -3806,6 +3809,7 @@ void ADSBDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -4752,6 +4756,8 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb m_osmPort = 0; // Pick a free port m_templateServer = new ADSBOSMTemplateServer("q2RVNAe3eFKCH4XsrE3r", m_osmPort); + ui->map->setAttribute(Qt::WA_AcceptTouchEvents, true); + ui->map->rootContext()->setContextProperty("aircraftModel", &m_aircraftModel); ui->map->rootContext()->setContextProperty("airportModel", &m_airportModel); ui->map->rootContext()->setContextProperty("airspaceModel", &m_airspaceModel); @@ -4819,6 +4825,8 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb // Context menu ui->adsbData->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->adsbData, SIGNAL(customContextMenuRequested(QPoint)), SLOT(adsbData_customContextMenuRequested(QPoint))); + TableTapAndHold *tableTapAndHold = new TableTapAndHold(ui->adsbData); + connect(tableTapAndHold, &TableTapAndHold::tapAndHold, this, &ADSBDemodGUI::adsbData_customContextMenuRequested); ui->photoHeader->setVisible(false); ui->photoFlag->setVisible(false); @@ -4903,6 +4911,7 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb connect(&m_redrawMapTimer, &QTimer::timeout, this, &ADSBDemodGUI::redrawMap); m_redrawMapTimer.setSingleShot(true); ui->map->installEventFilter(this); + DialPopup::addPopupsToChildDials(this); } ADSBDemodGUI::~ADSBDemodGUI() @@ -5552,6 +5561,7 @@ void ADSBDemodGUI::showEvent(QShowEvent *event) // MapQuickItems can be in wrong position when window is first displayed m_redrawMapTimer.start(500); } + ChannelGUI::showEvent(event); } bool ADSBDemodGUI::eventFilter(QObject *obj, QEvent *event) @@ -5570,7 +5580,7 @@ bool ADSBDemodGUI::eventFilter(QObject *obj, QEvent *event) } } } - return false; + return ChannelGUI::eventFilter(obj, event); } void ADSBDemodGUI::applyImportSettings() diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.h b/plugins/channelrx/demodadsb/adsbdemodgui.h index 6c79cf271..4822bc052 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.h +++ b/plugins/channelrx/demodadsb/adsbdemodgui.h @@ -1060,8 +1060,8 @@ private slots: void downloadAirspaceFinished(); void downloadNavAidsFinished(); void photoClicked(); - virtual void showEvent(QShowEvent *event); - virtual bool eventFilter(QObject *obj, QEvent *event); + virtual void showEvent(QShowEvent *event) override; + virtual bool eventFilter(QObject *obj, QEvent *event) override; void import(); void handleImportReply(QNetworkReply* reply); void preferenceChanged(int elementType); diff --git a/plugins/channelrx/demodais/aisdemodgui.cpp b/plugins/channelrx/demodais/aisdemodgui.cpp index b365a9bb7..1614b19dc 100644 --- a/plugins/channelrx/demodais/aisdemodgui.cpp +++ b/plugins/channelrx/demodais/aisdemodgui.cpp @@ -42,9 +42,12 @@ #include "util/db.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/glscopesettings.h" #include "gui/crightclickenabler.h" +#include "gui/tabletapandhold.h" #include "channel/channelwebapiutils.h" #include "maincore.h" #include "feature/featurewebapiutils.h" @@ -395,6 +398,7 @@ void AISDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, true); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -521,12 +525,15 @@ AISDemodGUI::AISDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban connect(ui->messages->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(messages_sectionResized(int, int, int))); ui->messages->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->messages, SIGNAL(customContextMenuRequested(QPoint)), SLOT(customContextMenuRequested(QPoint))); + TableTapAndHold *tableTapAndHold = new TableTapAndHold(ui->messages); + connect(tableTapAndHold, &TableTapAndHold::tapAndHold, this, &AISDemodGUI::customContextMenuRequested); ui->scopeContainer->setVisible(false); displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } void AISDemodGUI::customContextMenuRequested(QPoint pos) diff --git a/plugins/channelrx/demodam/amdemodgui.cpp b/plugins/channelrx/demodam/amdemodgui.cpp index fcc729bbc..0033062a0 100644 --- a/plugins/channelrx/demodam/amdemodgui.cpp +++ b/plugins/channelrx/demodam/amdemodgui.cpp @@ -32,6 +32,7 @@ #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_amdemodgui.h" @@ -217,6 +218,7 @@ void AMDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/demodapt/aptdemodgui.cpp b/plugins/channelrx/demodapt/aptdemodgui.cpp index 277d3851e..4b198d958 100644 --- a/plugins/channelrx/demodapt/aptdemodgui.cpp +++ b/plugins/channelrx/demodapt/aptdemodgui.cpp @@ -43,6 +43,8 @@ #include "util/units.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "gui/crightclickenabler.h" #include "gui/graphicsviewzoom.h" @@ -570,6 +572,7 @@ void APTDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -669,12 +672,14 @@ APTDemodGUI::APTDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban m_scene->addItem(m_tempText); ui->image->setScene(m_scene); ui->image->show(); + ui->image->setDragMode(QGraphicsView::ScrollHandDrag); m_scene->installEventFilter(this); displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } APTDemodGUI::~APTDemodGUI() diff --git a/plugins/channelrx/demodatv/atvdemodgui.cpp b/plugins/channelrx/demodatv/atvdemodgui.cpp index 11f363966..aaef12a9f 100644 --- a/plugins/channelrx/demodatv/atvdemodgui.cpp +++ b/plugins/channelrx/demodatv/atvdemodgui.cpp @@ -25,6 +25,8 @@ #include "dsp/scopevis.h" #include "dsp/glscopesettings.h" #include "gui/basicchannelsettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "ui_atvdemodgui.h" #include "plugin/pluginapi.h" #include "util/simpleserializer.h" @@ -220,6 +222,7 @@ void ATVDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -329,6 +332,7 @@ ATVDemodGUI::ATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Base ui->fmDeviationLabel->setText(delta); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } ATVDemodGUI::~ATVDemodGUI() diff --git a/plugins/channelrx/demodbfm/bfmdemodgui.cpp b/plugins/channelrx/demodbfm/bfmdemodgui.cpp index daacf41dc..8bf302c8e 100644 --- a/plugins/channelrx/demodbfm/bfmdemodgui.cpp +++ b/plugins/channelrx/demodbfm/bfmdemodgui.cpp @@ -38,6 +38,7 @@ #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "bfmdemodreport.h" @@ -339,6 +340,7 @@ void BFMDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -436,6 +438,11 @@ BFMDemodGUI::BFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban ui->g14MappedFrequencies->setEnabled(false); ui->g14AltFrequencies->setEnabled(false); +#ifdef ANDROID + // Currently a bit too wide for most Android screens + ui->rdsContainer->setVisible(false); +#endif + rdsUpdateFixedFields(); rdsUpdate(true); displaySettings(); diff --git a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp index 8111ac825..5251ac42e 100644 --- a/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp +++ b/plugins/channelrx/demodchirpchat/chirpchatdemodgui.cpp @@ -28,6 +28,8 @@ #include "gui/glspectrumgui.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "plugin/pluginapi.h" #include "util/simpleserializer.h" #include "util/db.h" @@ -352,6 +354,7 @@ void ChirpChatDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -438,6 +441,7 @@ ChirpChatDemodGUI::ChirpChatDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI makeUIConnections(); resetLoRaStatus(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } ChirpChatDemodGUI::~ChirpChatDemodGUI() diff --git a/plugins/channelrx/demoddab/dabdemodgui.cpp b/plugins/channelrx/demoddab/dabdemodgui.cpp index 4aa91d933..f3b39b312 100644 --- a/plugins/channelrx/demoddab/dabdemodgui.cpp +++ b/plugins/channelrx/demoddab/dabdemodgui.cpp @@ -36,6 +36,7 @@ #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" +#include "gui/dialogpositioner.h" #include "channel/channelwebapiutils.h" #include "maincore.h" @@ -415,6 +416,7 @@ void DABDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/demoddatv/datvdemodgui.cpp b/plugins/channelrx/demoddatv/datvdemodgui.cpp index aeb54c4a3..5dc5e23de 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.cpp +++ b/plugins/channelrx/demoddatv/datvdemodgui.cpp @@ -31,6 +31,8 @@ #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "mainwindow.h" #include "ui_datvdemodgui.h" @@ -183,6 +185,7 @@ void DATVDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -310,6 +313,7 @@ DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Ba ui->udpIndicator->setStyleSheet("QLabel { background-color: gray; border-radius: 8px; }"); resetToDefaults(); // does applySettings() makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } DATVDemodGUI::~DATVDemodGUI() diff --git a/plugins/channelrx/demoddsd/dsddemodgui.cpp b/plugins/channelrx/demoddsd/dsddemodgui.cpp index 5316023e8..e82c22aeb 100644 --- a/plugins/channelrx/demoddsd/dsddemodgui.cpp +++ b/plugins/channelrx/demoddsd/dsddemodgui.cpp @@ -30,6 +30,7 @@ #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "maincore.h" @@ -307,6 +308,7 @@ void DSDDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp index 55d2faae7..55b272f6a 100644 --- a/plugins/channelrx/demodfreedv/freedvdemodgui.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemodgui.cpp @@ -27,6 +27,8 @@ #include "gui/glspectrum.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "plugin/pluginapi.h" #include "util/simpleserializer.h" #include "util/db.h" @@ -215,6 +217,7 @@ void FreeDVDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -326,6 +329,7 @@ FreeDVDemodGUI::FreeDVDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B displaySettings(); makeUIConnections(); applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true) + DialPopup::addPopupsToChildDials(this); } FreeDVDemodGUI::~FreeDVDemodGUI() diff --git a/plugins/channelrx/demodm17/m17demodgui.cpp b/plugins/channelrx/demodm17/m17demodgui.cpp index 50aae0dd2..4dbe74726 100644 --- a/plugins/channelrx/demodm17/m17demodgui.cpp +++ b/plugins/channelrx/demodm17/m17demodgui.cpp @@ -37,6 +37,8 @@ #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "maincore.h" @@ -363,6 +365,7 @@ void M17DemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -510,6 +513,7 @@ M17DemodGUI::M17DemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban displaySettings(); makeUIConnections(); applySettings(QList(), true); + DialPopup::addPopupsToChildDials(this); } M17DemodGUI::~M17DemodGUI() diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index 69f176ea8..c1bd35749 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -11,6 +11,8 @@ #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dcscodes.h" #include "dsp/dspcommands.h" @@ -315,6 +317,7 @@ void NFMDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -439,6 +442,7 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } NFMDemodGUI::~NFMDemodGUI() diff --git a/plugins/channelrx/demodpacket/packetdemodgui.cpp b/plugins/channelrx/demodpacket/packetdemodgui.cpp index 5faa2384e..23b162d52 100644 --- a/plugins/channelrx/demodpacket/packetdemodgui.cpp +++ b/plugins/channelrx/demodpacket/packetdemodgui.cpp @@ -44,6 +44,7 @@ #include "gui/devicestreamselectiondialog.h" #include "dsp/dspengine.h" #include "gui/crightclickenabler.h" +#include "gui/dialogpositioner.h" #include "channel/channelwebapiutils.h" #include "maincore.h" @@ -397,6 +398,7 @@ void PacketDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/demodpager/pagerdemodgui.cpp b/plugins/channelrx/demodpager/pagerdemodgui.cpp index 0e56bd151..296c275f7 100644 --- a/plugins/channelrx/demodpager/pagerdemodgui.cpp +++ b/plugins/channelrx/demodpager/pagerdemodgui.cpp @@ -42,6 +42,7 @@ #include "dsp/dspengine.h" #include "dsp/glscopesettings.h" #include "gui/crightclickenabler.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "pagerdemod.h" @@ -444,6 +445,7 @@ void PagerDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp b/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp index 3ad505ba6..4a3034b22 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp +++ b/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp @@ -41,9 +41,12 @@ #include "gui/datetimedelegate.h" #include "gui/decimaldelegate.h" #include "gui/timedelegate.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/glscopesettings.h" #include "gui/crightclickenabler.h" +#include "gui/tabletapandhold.h" #include "channel/channelwebapiutils.h" #include "maincore.h" #include "feature/featurewebapiutils.h" @@ -501,6 +504,7 @@ void RadiosondeDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -627,6 +631,8 @@ RadiosondeDemodGUI::RadiosondeDemodGUI(PluginAPI* pluginAPI, DeviceUISet *device connect(ui->frames->horizontalHeader(), SIGNAL(sectionResized(int, int, int)), SLOT(frames_sectionResized(int, int, int))); ui->frames->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->frames, SIGNAL(customContextMenuRequested(QPoint)), SLOT(customContextMenuRequested(QPoint))); + TableTapAndHold *tableTapAndHold = new TableTapAndHold(ui->frames); + connect(tableTapAndHold, &TableTapAndHold::tapAndHold, this, &RadiosondeDemodGUI::customContextMenuRequested); ui->frames->setItemDelegateForColumn(FRAME_COL_DATE, new DateTimeDelegate("yyyy/MM/dd")); ui->frames->setItemDelegateForColumn(FRAME_COL_TIME, new TimeDelegate()); @@ -643,6 +649,7 @@ RadiosondeDemodGUI::RadiosondeDemodGUI(PluginAPI* pluginAPI, DeviceUISet *device displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } void RadiosondeDemodGUI::customContextMenuRequested(QPoint pos) diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index 02cfe584a..ebb01253e 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -16,6 +16,8 @@ #include "util/db.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ssbdemod.h" @@ -281,6 +283,7 @@ void SSBDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -398,6 +401,7 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban makeUIConnections(); applyBandwidths(m_settings.m_filterBank[m_settings.m_filterIndex].m_spanLog2, true); // does applySettings(true) + DialPopup::addPopupsToChildDials(this); } SSBDemodGUI::~SSBDemodGUI() diff --git a/plugins/channelrx/demodvor/vordemodgui.cpp b/plugins/channelrx/demodvor/vordemodgui.cpp index cacb5c12b..cdbfa25e0 100644 --- a/plugins/channelrx/demodvor/vordemodgui.cpp +++ b/plugins/channelrx/demodvor/vordemodgui.cpp @@ -33,6 +33,8 @@ #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "channel/channelwebapiutils.h" #include "maincore.h" @@ -251,6 +253,7 @@ void VORDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -333,6 +336,7 @@ VORDemodGUI::VORDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } VORDemodGUI::~VORDemodGUI() diff --git a/plugins/channelrx/demodvormc/vordemodmcgui.cpp b/plugins/channelrx/demodvormc/vordemodmcgui.cpp index 871ffa896..05827e2a1 100644 --- a/plugins/channelrx/demodvormc/vordemodmcgui.cpp +++ b/plugins/channelrx/demodvormc/vordemodmcgui.cpp @@ -43,6 +43,8 @@ #include "dsp/dspengine.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "channel/channelwebapiutils.h" #include "maincore.h" @@ -1130,6 +1132,7 @@ void VORDemodMCGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -1282,6 +1285,7 @@ VORDemodMCGUI::VORDemodMCGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } VORDemodMCGUI::~VORDemodMCGUI() diff --git a/plugins/channelrx/demodwfm/wfmdemodgui.cpp b/plugins/channelrx/demodwfm/wfmdemodgui.cpp index 28b7f0583..65bcd2059 100644 --- a/plugins/channelrx/demodwfm/wfmdemodgui.cpp +++ b/plugins/channelrx/demodwfm/wfmdemodgui.cpp @@ -15,6 +15,7 @@ #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" +#include "gui/dialogpositioner.h" #include "gui/audioselectdialog.h" #include "maincore.h" @@ -178,6 +179,7 @@ void WFMDemodGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/filesink/filesinkgui.cpp b/plugins/channelrx/filesink/filesinkgui.cpp index 5bb96aaca..10282b006 100644 --- a/plugins/channelrx/filesink/filesinkgui.cpp +++ b/plugins/channelrx/filesink/filesinkgui.cpp @@ -24,6 +24,8 @@ #include "device/deviceapi.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/hbfilterchainconverter.h" #include "dsp/dspcommands.h" #include "mainwindow.h" @@ -231,6 +233,7 @@ FileSinkGUI::FileSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } FileSinkGUI::~FileSinkGUI() @@ -378,6 +381,7 @@ void FileSinkGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -519,8 +523,8 @@ void FileSinkGUI::on_showFileDialog_clicked(bool checked) tr("SDR I/Q Files (*.sdriq *.wav)") ); - fileDialog.setOptions(QFileDialog::DontUseNativeDialog); fileDialog.setFileMode(QFileDialog::AnyFile); + fileDialog.setAcceptMode(QFileDialog::AcceptSave); QStringList fileNames; if (fileDialog.exec()) diff --git a/plugins/channelrx/freqtracker/freqtrackergui.cpp b/plugins/channelrx/freqtracker/freqtrackergui.cpp index d76cc758d..bbef439b6 100644 --- a/plugins/channelrx/freqtracker/freqtrackergui.cpp +++ b/plugins/channelrx/freqtracker/freqtrackergui.cpp @@ -33,6 +33,8 @@ #include "dsp/dspengine.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "freqtracker.h" @@ -279,6 +281,7 @@ void FreqTrackerGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -373,6 +376,7 @@ FreqTrackerGUI::FreqTrackerGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } FreqTrackerGUI::~FreqTrackerGUI() diff --git a/plugins/channelrx/localsink/localsinkgui.cpp b/plugins/channelrx/localsink/localsinkgui.cpp index ff4fa5bec..ba92f80db 100644 --- a/plugins/channelrx/localsink/localsinkgui.cpp +++ b/plugins/channelrx/localsink/localsinkgui.cpp @@ -20,6 +20,7 @@ #include "device/deviceuiset.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialogpositioner.h" #include "dsp/hbfilterchainconverter.h" #include "dsp/dspcommands.h" @@ -348,6 +349,7 @@ void LocalSinkGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/noisefigure/noisefiguregui.cpp b/plugins/channelrx/noisefigure/noisefiguregui.cpp index 96274d3fb..62161c1a4 100644 --- a/plugins/channelrx/noisefigure/noisefiguregui.cpp +++ b/plugins/channelrx/noisefigure/noisefiguregui.cpp @@ -34,6 +34,7 @@ #include "gui/devicestreamselectiondialog.h" #include "gui/crightclickenabler.h" #include "gui/decimaldelegate.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "noisefigure.h" @@ -560,6 +561,7 @@ void NoiseFigureGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/radioastronomy/radioastronomygui.cpp b/plugins/channelrx/radioastronomy/radioastronomygui.cpp index 708821929..5fc26a296 100644 --- a/plugins/channelrx/radioastronomy/radioastronomygui.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomygui.cpp @@ -51,6 +51,7 @@ #include "gui/crightclickenabler.h" #include "gui/timedelegate.h" #include "gui/decimaldelegate.h" +#include "gui/dialogpositioner.h" #include "channel/channelwebapiutils.h" #include "maincore.h" #include "feature/featurewebapiutils.h" @@ -1929,6 +1930,7 @@ void RadioAstronomyGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/radioclock/radioclockgui.cpp b/plugins/channelrx/radioclock/radioclockgui.cpp index 3c5304022..b6f14c252 100644 --- a/plugins/channelrx/radioclock/radioclockgui.cpp +++ b/plugins/channelrx/radioclock/radioclockgui.cpp @@ -32,6 +32,8 @@ #include "util/db.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/glscopesettings.h" #include "gui/crightclickenabler.h" @@ -235,6 +237,7 @@ void RadioClockGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -328,6 +331,7 @@ RadioClockGUI::RadioClockGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } RadioClockGUI::~RadioClockGUI() diff --git a/plugins/channelrx/remotesink/remotesinkgui.cpp b/plugins/channelrx/remotesink/remotesinkgui.cpp index c506cf976..ebf39f766 100644 --- a/plugins/channelrx/remotesink/remotesinkgui.cpp +++ b/plugins/channelrx/remotesink/remotesinkgui.cpp @@ -20,6 +20,8 @@ #include "device/deviceuiset.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/hbfilterchainconverter.h" #include "dsp/dspcommands.h" #include "mainwindow.h" @@ -131,6 +133,7 @@ RemoteSinkGUI::RemoteSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } RemoteSinkGUI::~RemoteSinkGUI() @@ -247,6 +250,7 @@ void RemoteSinkGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/remotetcpsink/remotetcpsinkgui.cpp b/plugins/channelrx/remotetcpsink/remotetcpsinkgui.cpp index a752105af..5e2657716 100644 --- a/plugins/channelrx/remotetcpsink/remotetcpsinkgui.cpp +++ b/plugins/channelrx/remotetcpsink/remotetcpsinkgui.cpp @@ -21,6 +21,8 @@ #include "device/deviceuiset.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/hbfilterchainconverter.h" #include "dsp/dspcommands.h" #include "mainwindow.h" @@ -199,6 +201,7 @@ RemoteTCPSinkGUI::RemoteTCPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISe displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } RemoteTCPSinkGUI::~RemoteTCPSinkGUI() @@ -307,6 +310,7 @@ void RemoteTCPSinkGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/sigmffilesink/sigmffilesinkgui.cpp b/plugins/channelrx/sigmffilesink/sigmffilesinkgui.cpp index 727105d4b..71b080a82 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesinkgui.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesinkgui.cpp @@ -23,6 +23,8 @@ #include "device/deviceapi.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/hbfilterchainconverter.h" #include "dsp/dspcommands.h" #include "mainwindow.h" @@ -217,6 +219,7 @@ SigMFFileSinkGUI::SigMFFileSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISe displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } SigMFFileSinkGUI::~SigMFFileSinkGUI() @@ -370,6 +373,7 @@ void SigMFFileSinkGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channelrx/udpsink/udpsinkgui.cpp b/plugins/channelrx/udpsink/udpsinkgui.cpp index 5bdb1b2e1..c84969bbf 100644 --- a/plugins/channelrx/udpsink/udpsinkgui.cpp +++ b/plugins/channelrx/udpsink/udpsinkgui.cpp @@ -25,6 +25,8 @@ #include "util/db.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "ui_udpsinkgui.h" #include "maincore.h" @@ -214,6 +216,7 @@ UDPSinkGUI::UDPSinkGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS makeUIConnections(); applySettingsImmediate(true); applySettings(true); + DialPopup::addPopupsToChildDials(this); } UDPSinkGUI::~UDPSinkGUI() @@ -623,6 +626,7 @@ void UDPSinkGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channeltx/filesource/filesourcegui.cpp b/plugins/channeltx/filesource/filesourcegui.cpp index 1b6123a8e..05113a9c9 100644 --- a/plugins/channeltx/filesource/filesourcegui.cpp +++ b/plugins/channeltx/filesource/filesourcegui.cpp @@ -25,6 +25,7 @@ #include "dsp/dspcommands.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialogpositioner.h" #include "util/db.h" #include "mainwindow.h" @@ -386,6 +387,7 @@ void FileSourceGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channeltx/localsource/localsourcegui.cpp b/plugins/channeltx/localsource/localsourcegui.cpp index 247fb3685..5a37d9d68 100644 --- a/plugins/channeltx/localsource/localsourcegui.cpp +++ b/plugins/channeltx/localsource/localsourcegui.cpp @@ -20,6 +20,7 @@ #include "device/deviceuiset.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialogpositioner.h" #include "dsp/hbfilterchainconverter.h" #include "dsp/dspcommands.h" #include "mainwindow.h" @@ -253,6 +254,7 @@ void LocalSourceGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp index 7ed6abc60..821c72d5b 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_modgui.cpp @@ -36,6 +36,8 @@ #include "gui/crightclickenabler.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_ieee_802_15_4_modgui.h" @@ -343,6 +345,7 @@ void IEEE_802_15_4_ModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -471,6 +474,7 @@ IEEE_802_15_4_ModGUI::IEEE_802_15_4_ModGUI(PluginAPI* pluginAPI, DeviceUISet *de displaySettings(); makeUIConnections(); applySettings(); + DialPopup::addPopupsToChildDials(this); } IEEE_802_15_4_ModGUI::~IEEE_802_15_4_ModGUI() diff --git a/plugins/channeltx/modais/aismodgui.cpp b/plugins/channeltx/modais/aismodgui.cpp index 371b8e5db..acc78af59 100644 --- a/plugins/channeltx/modais/aismodgui.cpp +++ b/plugins/channeltx/modais/aismodgui.cpp @@ -35,6 +35,8 @@ #include "gui/crightclickenabler.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_aismodgui.h" @@ -366,6 +368,7 @@ void AISModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -497,6 +500,7 @@ AISModGUI::AISModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam displaySettings(); makeUIConnections(); applySettings(); + DialPopup::addPopupsToChildDials(this); } AISModGUI::~AISModGUI() diff --git a/plugins/channeltx/modam/ammodgui.cpp b/plugins/channeltx/modam/ammodgui.cpp index 7b387a71e..8fbe760fb 100644 --- a/plugins/channeltx/modam/ammodgui.cpp +++ b/plugins/channeltx/modam/ammodgui.cpp @@ -33,6 +33,8 @@ #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_ammodgui.h" @@ -306,6 +308,7 @@ void AMModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -406,6 +409,7 @@ AMModGUI::AMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampl displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } AMModGUI::~AMModGUI() diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp index a5113c1d5..e2d96388f 100644 --- a/plugins/channeltx/modatv/atvmodgui.cpp +++ b/plugins/channeltx/modatv/atvmodgui.cpp @@ -32,6 +32,8 @@ #include "util/db.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_atvmodgui.h" @@ -119,6 +121,7 @@ ATVModGUI::ATVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } ATVModGUI::~ATVModGUI() @@ -711,6 +714,7 @@ void ATVModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channeltx/modchirpchat/chirpchatmodgui.cpp b/plugins/channeltx/modchirpchat/chirpchatmodgui.cpp index 3d70d6235..b746a8d51 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmodgui.cpp +++ b/plugins/channeltx/modchirpchat/chirpchatmodgui.cpp @@ -30,6 +30,8 @@ #include "gui/crightclickenabler.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_chirpchatmodgui.h" @@ -386,6 +388,7 @@ void ChirpChatModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -465,6 +468,7 @@ ChirpChatModGUI::ChirpChatModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, displaySettings(); makeUIConnections(); applySettings(); + DialPopup::addPopupsToChildDials(this); } ChirpChatModGUI::~ChirpChatModGUI() diff --git a/plugins/channeltx/moddatv/datvmodgui.cpp b/plugins/channeltx/moddatv/datvmodgui.cpp index 8a84c88de..21e3ed87d 100644 --- a/plugins/channeltx/moddatv/datvmodgui.cpp +++ b/plugins/channeltx/moddatv/datvmodgui.cpp @@ -33,6 +33,7 @@ #include "util/db.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_datvmodgui.h" @@ -514,6 +515,7 @@ void DATVModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channeltx/modfreedv/freedvmodgui.cpp b/plugins/channeltx/modfreedv/freedvmodgui.cpp index d1fcca227..c28a17d4f 100644 --- a/plugins/channeltx/modfreedv/freedvmodgui.cpp +++ b/plugins/channeltx/modfreedv/freedvmodgui.cpp @@ -35,6 +35,8 @@ #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_freedvmodgui.h" @@ -318,6 +320,7 @@ void FreeDVModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -415,6 +418,7 @@ FreeDVModGUI::FreeDVModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb displaySettings(); makeUIConnections(); applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true) + DialPopup::addPopupsToChildDials(this); } FreeDVModGUI::~FreeDVModGUI() diff --git a/plugins/channeltx/modm17/m17modgui.cpp b/plugins/channeltx/modm17/m17modgui.cpp index fa04175f3..2724eaca7 100644 --- a/plugins/channeltx/modm17/m17modgui.cpp +++ b/plugins/channeltx/modm17/m17modgui.cpp @@ -33,6 +33,8 @@ #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_m17modgui.h" @@ -415,6 +417,7 @@ void M17ModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -524,6 +527,7 @@ M17ModGUI::M17ModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam displaySettings(); makeUIConnections(); applySettings(QList{"channelMarker", "rollupState"}); + DialPopup::addPopupsToChildDials(this); } M17ModGUI::~M17ModGUI() diff --git a/plugins/channeltx/modnfm/nfmmodgui.cpp b/plugins/channeltx/modnfm/nfmmodgui.cpp index 6d526aebd..87d6017f9 100644 --- a/plugins/channeltx/modnfm/nfmmodgui.cpp +++ b/plugins/channeltx/modnfm/nfmmodgui.cpp @@ -33,6 +33,8 @@ #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_nfmmodgui.h" @@ -396,6 +398,7 @@ void NFMModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -512,6 +515,7 @@ NFMModGUI::NFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam displaySettings(); makeUIConnections(); applySettings(); + DialPopup::addPopupsToChildDials(this); } NFMModGUI::~NFMModGUI() diff --git a/plugins/channeltx/modpacket/packetmodgui.cpp b/plugins/channeltx/modpacket/packetmodgui.cpp index bf13a8b7a..34ccd8d93 100644 --- a/plugins/channeltx/modpacket/packetmodgui.cpp +++ b/plugins/channeltx/modpacket/packetmodgui.cpp @@ -34,6 +34,8 @@ #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" #include "gui/fmpreemphasisdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_packetmodgui.h" @@ -403,6 +405,7 @@ void PacketModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -510,6 +513,7 @@ PacketModGUI::PacketModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb displaySettings(); makeUIConnections(); applySettings(); + DialPopup::addPopupsToChildDials(this); } PacketModGUI::~PacketModGUI() diff --git a/plugins/channeltx/modssb/ssbmodgui.cpp b/plugins/channeltx/modssb/ssbmodgui.cpp index 2be75db9c..f1db7b1c3 100644 --- a/plugins/channeltx/modssb/ssbmodgui.cpp +++ b/plugins/channeltx/modssb/ssbmodgui.cpp @@ -36,6 +36,8 @@ #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" SSBModGUI* SSBModGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx) @@ -382,6 +384,7 @@ void SSBModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -497,6 +500,7 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam displaySettings(); makeUIConnections(); applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true) + DialPopup::addPopupsToChildDials(this); } SSBModGUI::~SSBModGUI() diff --git a/plugins/channeltx/modwfm/wfmmodgui.cpp b/plugins/channeltx/modwfm/wfmmodgui.cpp index f007b14a8..2541f8c22 100644 --- a/plugins/channeltx/modwfm/wfmmodgui.cpp +++ b/plugins/channeltx/modwfm/wfmmodgui.cpp @@ -33,6 +33,8 @@ #include "gui/audioselectdialog.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_wfmmodgui.h" @@ -312,6 +314,7 @@ void WFMModGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); @@ -422,6 +425,7 @@ WFMModGUI::WFMModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } WFMModGUI::~WFMModGUI() diff --git a/plugins/channeltx/remotesource/remotesourcegui.cpp b/plugins/channeltx/remotesource/remotesourcegui.cpp index 334e2a201..27a2f8922 100644 --- a/plugins/channeltx/remotesource/remotesourcegui.cpp +++ b/plugins/channeltx/remotesource/remotesourcegui.cpp @@ -23,6 +23,7 @@ #include "dsp/dspcommands.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialogpositioner.h" #include "mainwindow.h" #include "remotesource.h" @@ -326,6 +327,7 @@ void RemoteSourceGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/channeltx/udpsource/udpsourcegui.cpp b/plugins/channeltx/udpsource/udpsourcegui.cpp index 7e06158f8..6cd94f137 100644 --- a/plugins/channeltx/udpsource/udpsourcegui.cpp +++ b/plugins/channeltx/udpsource/udpsourcegui.cpp @@ -25,6 +25,8 @@ #include "util/db.h" #include "gui/basicchannelsettingsdialog.h" #include "gui/devicestreamselectiondialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "plugin/pluginapi.h" #include "maincore.h" @@ -171,6 +173,7 @@ UDPSourceGUI::UDPSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb displaySettings(); makeUIConnections(); applySettings(true); + DialPopup::addPopupsToChildDials(this); } UDPSourceGUI::~UDPSourceGUI() @@ -505,6 +508,7 @@ void UDPSourceGUI::onMenuDialogCalled(const QPoint &p) } dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_rgbColor = m_channelMarker.getColor().rgb(); diff --git a/plugins/feature/afc/afcgui.cpp b/plugins/feature/afc/afcgui.cpp index 8fa3bd289..c3c078d7d 100644 --- a/plugins/feature/afc/afcgui.cpp +++ b/plugins/feature/afc/afcgui.cpp @@ -21,6 +21,8 @@ #include "device/deviceset.h" #include "channel/channelapi.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "ui_afcgui.h" @@ -171,6 +173,7 @@ AFCGUI::AFCGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur displaySettings(); applySettings(true); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } AFCGUI::~AFCGUI() @@ -287,6 +290,7 @@ void AFCGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/ais/aisgui.cpp b/plugins/feature/ais/aisgui.cpp index ceacad050..e9c0dab47 100644 --- a/plugins/feature/ais/aisgui.cpp +++ b/plugins/feature/ais/aisgui.cpp @@ -27,6 +27,8 @@ #include "feature/featureuiset.h" #include "feature/featurewebapiutils.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/tabletapandhold.h" +#include "gui/dialogpositioner.h" #include "mainwindow.h" #include "device/deviceuiset.h" @@ -226,6 +228,8 @@ AISGUI::AISGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur // Context menu ui->vessels->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->vessels, SIGNAL(customContextMenuRequested(QPoint)), SLOT(vessels_customContextMenuRequested(QPoint))); + TableTapAndHold *tableTapAndHold = new TableTapAndHold(ui->vessels); + connect(tableTapAndHold, &TableTapAndHold::tapAndHold, this, &AISGUI::vessels_customContextMenuRequested); m_settings.setRollupState(&m_rollupState); @@ -291,6 +295,7 @@ void AISGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/ambe/ambegui.cpp b/plugins/feature/ambe/ambegui.cpp index 91eede6ce..70e6bb911 100644 --- a/plugins/feature/ambe/ambegui.cpp +++ b/plugins/feature/ambe/ambegui.cpp @@ -18,6 +18,7 @@ #include "feature/featureuiset.h" #include "gui/basicfeaturesettingsdialog.h" #include "gui/crightclickenabler.h" +#include "gui/dialogpositioner.h" #include "ui_ambegui.h" #include "ambegui.h" @@ -125,6 +126,7 @@ void AMBEGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/antennatools/antennatoolsgui.cpp b/plugins/feature/antennatools/antennatoolsgui.cpp index 743830f60..124ee06da 100644 --- a/plugins/feature/antennatools/antennatoolsgui.cpp +++ b/plugins/feature/antennatools/antennatoolsgui.cpp @@ -22,6 +22,7 @@ #include "feature/featureuiset.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "channel/channelwebapiutils.h" #include "mainwindow.h" #include "maincore.h" @@ -223,6 +224,7 @@ void AntennaToolsGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/aprs/aprsgui.cpp b/plugins/feature/aprs/aprsgui.cpp index 5d54a02a8..2073404be 100644 --- a/plugins/feature/aprs/aprsgui.cpp +++ b/plugins/feature/aprs/aprsgui.cpp @@ -33,6 +33,7 @@ #include "feature/featureuiset.h" #include "feature/featurewebapiutils.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "mainwindow.h" #include "maincore.h" #include "device/deviceuiset.h" @@ -698,6 +699,7 @@ void APRSGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/demodanalyzer/demodanalyzergui.cpp b/plugins/feature/demodanalyzer/demodanalyzergui.cpp index bc0605615..e5f4008ee 100644 --- a/plugins/feature/demodanalyzer/demodanalyzergui.cpp +++ b/plugins/feature/demodanalyzer/demodanalyzergui.cpp @@ -23,6 +23,8 @@ #include "gui/basicfeaturesettingsdialog.h" #include "gui/glspectrum.h" #include "gui/glscope.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "device/deviceset.h" #include "util/db.h" #include "maincore.h" @@ -188,6 +190,7 @@ DemodAnalyzerGUI::DemodAnalyzerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUI displaySettings(); applySettings(true); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } DemodAnalyzerGUI::~DemodAnalyzerGUI() @@ -276,6 +279,7 @@ void DemodAnalyzerGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/gs232controller/gs232controllergui.cpp b/plugins/feature/gs232controller/gs232controllergui.cpp index 3b6e5d418..86ffe3268 100644 --- a/plugins/feature/gs232controller/gs232controllergui.cpp +++ b/plugins/feature/gs232controller/gs232controllergui.cpp @@ -24,6 +24,7 @@ #include "feature/featureuiset.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "mainwindow.h" #include "device/deviceuiset.h" @@ -322,6 +323,7 @@ void GS232ControllerGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp b/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp index e94d200ec..e46658a43 100644 --- a/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp +++ b/plugins/feature/jogdialcontroller/jogdialcontrollergui.cpp @@ -20,6 +20,7 @@ #include "feature/featureuiset.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "device/deviceset.h" #include "util/db.h" #include "maincore.h" @@ -258,6 +259,7 @@ void JogdialControllerGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/limerfe/limerfegui.cpp b/plugins/feature/limerfe/limerfegui.cpp index dd3f6b6cb..19c24e5ff 100644 --- a/plugins/feature/limerfe/limerfegui.cpp +++ b/plugins/feature/limerfe/limerfegui.cpp @@ -18,6 +18,7 @@ #include "feature/featureuiset.h" #include "gui/basicfeaturesettingsdialog.h" #include "gui/crightclickenabler.h" +#include "gui/dialogpositioner.h" #include "util/db.h" #include "dsp/dspengine.h" #include "dsp/dspdevicesourceengine.h" @@ -98,6 +99,7 @@ void LimeRFEGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/pertester/pertestergui.cpp b/plugins/feature/pertester/pertestergui.cpp index 4c7e6a0b9..027e46854 100644 --- a/plugins/feature/pertester/pertestergui.cpp +++ b/plugins/feature/pertester/pertestergui.cpp @@ -22,6 +22,7 @@ #include "feature/featureuiset.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "mainwindow.h" #include "device/deviceuiset.h" @@ -212,6 +213,7 @@ void PERTesterGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/radiosonde/radiosondegui.cpp b/plugins/feature/radiosonde/radiosondegui.cpp index 0ca45bcc2..e13ff4e9c 100644 --- a/plugins/feature/radiosonde/radiosondegui.cpp +++ b/plugins/feature/radiosonde/radiosondegui.cpp @@ -27,6 +27,8 @@ #include "gui/basicfeaturesettingsdialog.h" #include "gui/datetimedelegate.h" #include "gui/decimaldelegate.h" +#include "gui/tabletapandhold.h" +#include "gui/dialogpositioner.h" #include "mainwindow.h" #include "device/deviceuiset.h" @@ -175,6 +177,8 @@ RadiosondeGUI::RadiosondeGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, F // Context menu ui->radiosondes->setContextMenuPolicy(Qt::CustomContextMenu); connect(ui->radiosondes, SIGNAL(customContextMenuRequested(QPoint)), SLOT(radiosondes_customContextMenuRequested(QPoint))); + TableTapAndHold *tableTapAndHold = new TableTapAndHold(ui->radiosondes); + connect(tableTapAndHold, &TableTapAndHold::tapAndHold, this, &RadiosondeGUI::customContextMenuRequested); ui->radiosondes->setItemDelegateForColumn(RADIOSONDE_COL_LATITUDE, new DecimalDelegate(5)); ui->radiosondes->setItemDelegateForColumn(RADIOSONDE_COL_LONGITUDE, new DecimalDelegate(5)); @@ -254,6 +258,7 @@ void RadiosondeGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/remotecontrol/remotecontrolgui.cpp b/plugins/feature/remotecontrol/remotecontrolgui.cpp index 5abd45d59..2593a3890 100644 --- a/plugins/feature/remotecontrol/remotecontrolgui.cpp +++ b/plugins/feature/remotecontrol/remotecontrolgui.cpp @@ -20,6 +20,7 @@ #include "gui/basicfeaturesettingsdialog.h" #include "gui/flowlayout.h" #include "gui/scidoublespinbox.h" +#include "gui/dialogpositioner.h" #include "ui_remotecontrolgui.h" #include "remotecontrol.h" @@ -202,6 +203,7 @@ void RemoteControlGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/rigctlserver/rigctlservergui.cpp b/plugins/feature/rigctlserver/rigctlservergui.cpp index bd448b7d3..e8a4a31ab 100644 --- a/plugins/feature/rigctlserver/rigctlservergui.cpp +++ b/plugins/feature/rigctlserver/rigctlservergui.cpp @@ -20,6 +20,7 @@ #include "feature/featureuiset.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "device/deviceset.h" #include "maincore.h" @@ -298,6 +299,7 @@ void RigCtlServerGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/satellitetracker/satellitetrackergui.cpp b/plugins/feature/satellitetracker/satellitetrackergui.cpp index 2e9b33a38..ab2446d04 100644 --- a/plugins/feature/satellitetracker/satellitetrackergui.cpp +++ b/plugins/feature/satellitetracker/satellitetrackergui.cpp @@ -32,6 +32,7 @@ #include "feature/featureuiset.h" #include "feature/featurewebapiutils.h" #include "gui/basicfeaturesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "mainwindow.h" #include "device/deviceuiset.h" #include "util/units.h" @@ -397,6 +398,7 @@ void SatelliteTrackerGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); @@ -512,7 +514,7 @@ void SatelliteTrackerGUI::on_useMyPosition_clicked(bool checked) void SatelliteTrackerGUI::on_displaySettings_clicked() { SatelliteTrackerSettingsDialog dialog(&m_settings); - + new DialogPositioner(&dialog, true); if (dialog.exec() == QDialog::Accepted) { m_settingsKeys.append("deviceSettings"); @@ -575,7 +577,7 @@ void SatelliteTrackerGUI::on_updateSatData_clicked() void SatelliteTrackerGUI::on_selectSats_clicked() { SatelliteSelectionDialog dialog(&m_settings, m_satellites); - + new DialogPositioner(&dialog, true); if (dialog.exec() == QDialog::Accepted) { updateSelectedSats(); @@ -587,7 +589,7 @@ void SatelliteTrackerGUI::on_selectSats_clicked() void SatelliteTrackerGUI::on_radioControl_clicked() { SatelliteRadioControlDialog dialog(&m_settings, m_satellites); - + new DialogPositioner(&dialog, true); if (dialog.exec() == QDialog::Accepted) { m_settingsKeys.append("deviceSettings"); diff --git a/plugins/feature/simpleptt/simplepttgui.cpp b/plugins/feature/simpleptt/simplepttgui.cpp index 3de0d8cca..725e7764e 100644 --- a/plugins/feature/simpleptt/simplepttgui.cpp +++ b/plugins/feature/simpleptt/simplepttgui.cpp @@ -21,6 +21,8 @@ #include "gui/basicfeaturesettingsdialog.h" #include "gui/crightclickenabler.h" #include "gui/audioselectdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "device/deviceset.h" #include "util/db.h" @@ -190,6 +192,7 @@ SimplePTTGUI::SimplePTTGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Fea displaySettings(); applySettings(true); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } SimplePTTGUI::~SimplePTTGUI() @@ -321,6 +324,7 @@ void SimplePTTGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); diff --git a/plugins/feature/startracker/startrackergui.cpp b/plugins/feature/startracker/startrackergui.cpp index ec24e6920..0663a0865 100644 --- a/plugins/feature/startracker/startrackergui.cpp +++ b/plugins/feature/startracker/startrackergui.cpp @@ -38,6 +38,7 @@ #include "gui/basicfeaturesettingsdialog.h" #include "gui/dmsspinbox.h" #include "gui/graphicsviewzoom.h" +#include "gui/dialogpositioner.h" #include "mainwindow.h" #include "device/deviceuiset.h" #include "util/units.h" @@ -491,6 +492,7 @@ void StarTrackerGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); @@ -1122,6 +1124,8 @@ void StarTrackerGUI::createGalacticLineOfSightScene() ui->image->setScene(scene); ui->image->show(); + + ui->image->setDragMode(QGraphicsView::ScrollHandDrag); } void StarTrackerGUI::plotGalacticLineOfSight() diff --git a/plugins/feature/vorlocalizer/vorlocalizergui.cpp b/plugins/feature/vorlocalizer/vorlocalizergui.cpp index f83ec408f..604e7e7e3 100644 --- a/plugins/feature/vorlocalizer/vorlocalizergui.cpp +++ b/plugins/feature/vorlocalizer/vorlocalizergui.cpp @@ -41,6 +41,8 @@ #include "util/units.h" #include "gui/basicfeaturesettingsdialog.h" #include "gui/crightclickenabler.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "maincore.h" #include "vorlocalizer.h" @@ -833,6 +835,7 @@ void VORLocalizerGUI::onMenuDialogCalled(const QPoint &p) dialog.setDefaultTitle(m_displayedName); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_title = dialog.getTitle(); @@ -970,6 +973,8 @@ VORLocalizerGUI::VORLocalizerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe rollupContents->arrangeRollups(); connect(rollupContents, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool))); + ui->map->setAttribute(Qt::WA_AcceptTouchEvents, true); + ui->map->rootContext()->setContextProperty("vorModel", &m_vorModel); ui->map->setSource(QUrl(QStringLiteral("qrc:/demodvor/map/map.qml"))); @@ -1042,6 +1047,7 @@ VORLocalizerGUI::VORLocalizerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISe connect(MainCore::instance(), &MainCore::deviceChanged, this, &VORLocalizerGUI::channelsRefresh); // List already opened channels channelsRefresh(); + DialPopup::addPopupsToChildDials(this); } VORLocalizerGUI::~VORLocalizerGUI() @@ -1269,8 +1275,7 @@ bool VORLocalizerGUI::eventFilter(QObject *obj, QEvent *event) } } } - - return false; + return FeatureGUI::eventFilter(obj, event); } void VORLocalizerGUI::makeUIConnections() diff --git a/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp b/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp index 83310101f..1847c303f 100644 --- a/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp +++ b/plugins/samplemimo/bladerf2mimo/bladerf2mimogui.cpp @@ -30,6 +30,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspdevicemimoengine.h" #include "dsp/dspcommands.h" @@ -878,6 +879,7 @@ void BladeRF2MIMOGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp b/plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp index fa1756887..b6b32806f 100644 --- a/plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp +++ b/plugins/samplemimo/limesdrmimo/limesdrmimogui.cpp @@ -29,6 +29,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspdevicemimoengine.h" #include "dsp/dspcommands.h" @@ -103,6 +105,7 @@ LimeSDRMIMOGUI::LimeSDRMIMOGUI(DeviceUISet *deviceUISet, QWidget* parent) : sendSettings(); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } LimeSDRMIMOGUI::~LimeSDRMIMOGUI() @@ -1244,6 +1247,7 @@ void LimeSDRMIMOGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplemimo/metismiso/metismisogui.cpp b/plugins/samplemimo/metismiso/metismisogui.cpp index 66faee965..b3603245d 100644 --- a/plugins/samplemimo/metismiso/metismisogui.cpp +++ b/plugins/samplemimo/metismiso/metismisogui.cpp @@ -28,6 +28,8 @@ #include "device/deviceuiset.h" #include "gui/colormapper.h" #include "gui/glspectrum.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "gui/basicdevicesettingsdialog.h" #include "dsp/dspengine.h" #include "dsp/dspdevicemimoengine.h" @@ -75,6 +77,7 @@ MetisMISOGui::MetisMISOGui(DeviceUISet *deviceUISet, QWidget* parent) : connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } MetisMISOGui::~MetisMISOGui() @@ -611,6 +614,7 @@ void MetisMISOGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp b/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp index 8d3f28c70..6ea13e612 100644 --- a/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp +++ b/plugins/samplemimo/plutosdrmimo/plutosdrmimogui.cpp @@ -28,6 +28,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspdevicemimoengine.h" #include "dsp/dspcommands.h" @@ -106,6 +108,7 @@ PlutoSDRMIMOGUI::PlutoSDRMIMOGUI(DeviceUISet *deviceUISet, QWidget* parent) : m_sampleMIMO->setMessageQueueToGUI(&m_inputMessageQueue); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } PlutoSDRMIMOGUI::~PlutoSDRMIMOGUI() @@ -988,6 +991,7 @@ void PlutoSDRMIMOGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplemimo/testmi/testmigui.cpp b/plugins/samplemimo/testmi/testmigui.cpp index 9a566b3e7..7d87010a3 100644 --- a/plugins/samplemimo/testmi/testmigui.cpp +++ b/plugins/samplemimo/testmi/testmigui.cpp @@ -29,6 +29,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspdevicemimoengine.h" #include "dsp/dspcommands.h" @@ -88,6 +90,7 @@ TestMIGui::TestMIGui(DeviceUISet *deviceUISet, QWidget* parent) : connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } TestMIGui::~TestMIGui() @@ -559,6 +562,7 @@ void TestMIGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplemimo/testmosync/testmosyncgui.cpp b/plugins/samplemimo/testmosync/testmosyncgui.cpp index 1f32e8496..f7514ec2d 100644 --- a/plugins/samplemimo/testmosync/testmosyncgui.cpp +++ b/plugins/samplemimo/testmosync/testmosyncgui.cpp @@ -25,6 +25,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "dsp/spectrumvis.h" @@ -315,6 +316,7 @@ void TestMOSyncGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp b/plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp index e6816037c..d04a80b2a 100644 --- a/plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp +++ b/plugins/samplemimo/xtrxmimo/xtrxmimogui.cpp @@ -27,6 +27,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspdevicemimoengine.h" #include "dsp/dspcommands.h" @@ -100,6 +102,7 @@ XTRXMIMOGUI::XTRXMIMOGUI(DeviceUISet *deviceUISet, QWidget* parent) : sendSettings(); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } XTRXMIMOGUI::~XTRXMIMOGUI() @@ -1083,6 +1086,7 @@ void XTRXMIMOGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/audiooutput/audiooutputgui.cpp b/plugins/samplesink/audiooutput/audiooutputgui.cpp index 63614ed77..c4a7c3c3f 100644 --- a/plugins/samplesink/audiooutput/audiooutputgui.cpp +++ b/plugins/samplesink/audiooutput/audiooutputgui.cpp @@ -23,6 +23,8 @@ #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" #include "gui/audioselectdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "audiooutputgui.h" @@ -60,6 +62,7 @@ AudioOutputGui::AudioOutputGui(DeviceUISet *deviceUISet, QWidget* parent) : m_audioOutput->setMessageQueueToGUI(&m_inputMessageQueue); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } AudioOutputGui::~AudioOutputGui() @@ -246,6 +249,7 @@ void AudioOutputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/bladerf1output/bladerf1outputgui.cpp b/plugins/samplesink/bladerf1output/bladerf1outputgui.cpp index 0549c766a..127930ed6 100644 --- a/plugins/samplesink/bladerf1output/bladerf1outputgui.cpp +++ b/plugins/samplesink/bladerf1output/bladerf1outputgui.cpp @@ -24,6 +24,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -478,6 +479,7 @@ void Bladerf1OutputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/bladerf2output/bladerf2outputgui.cpp b/plugins/samplesink/bladerf2output/bladerf2outputgui.cpp index 78fe63cdf..001de36e5 100644 --- a/plugins/samplesink/bladerf2output/bladerf2outputgui.cpp +++ b/plugins/samplesink/bladerf2output/bladerf2outputgui.cpp @@ -24,6 +24,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -462,6 +463,7 @@ void BladeRF2OutputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/fileoutput/fileoutputgui.cpp b/plugins/samplesink/fileoutput/fileoutputgui.cpp index fc2cd7825..32f62471e 100644 --- a/plugins/samplesink/fileoutput/fileoutputgui.cpp +++ b/plugins/samplesink/fileoutput/fileoutputgui.cpp @@ -28,6 +28,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" @@ -351,6 +352,7 @@ void FileOutputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp b/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp index dac003a81..198fed161 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutputgui.cpp @@ -23,6 +23,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -481,6 +482,7 @@ void HackRFOutputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/limesdroutput/limesdroutputgui.cpp b/plugins/samplesink/limesdroutput/limesdroutputgui.cpp index 60e9c98a2..36c0c7732 100644 --- a/plugins/samplesink/limesdroutput/limesdroutputgui.cpp +++ b/plugins/samplesink/limesdroutput/limesdroutputgui.cpp @@ -22,6 +22,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -697,6 +698,7 @@ void LimeSDROutputGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/localoutput/localoutputgui.cpp b/plugins/samplesink/localoutput/localoutputgui.cpp index 489d5b6a7..e2148b1bf 100644 --- a/plugins/samplesink/localoutput/localoutputgui.cpp +++ b/plugins/samplesink/localoutput/localoutputgui.cpp @@ -33,6 +33,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "mainwindow.h" @@ -298,6 +299,7 @@ void LocalOutputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp b/plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp index c8bdb0998..6ceb08adb 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp +++ b/plugins/samplesink/plutosdroutput/plutosdroutputgui.cpp @@ -23,6 +23,8 @@ #include "dsp/dspcommands.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "device/deviceapi.h" #include "device/deviceuiset.h" #include "plutosdr/deviceplutosdr.h" @@ -81,6 +83,7 @@ PlutoSDROutputGUI::PlutoSDROutputGUI(DeviceUISet *deviceUISet, QWidget* parent) m_statusTimer.start(500); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); + DialPopup::addPopupsToChildDials(this); } PlutoSDROutputGUI::~PlutoSDROutputGUI() @@ -525,6 +528,7 @@ void PlutoSDROutputGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/remoteoutput/remoteoutputgui.cpp b/plugins/samplesink/remoteoutput/remoteoutputgui.cpp index 30b7342e1..42709dc72 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputgui.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutputgui.cpp @@ -29,6 +29,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" @@ -91,6 +93,7 @@ RemoteOutputSinkGui::RemoteOutputSinkGui(DeviceUISet *deviceUISet, QWidget* pare displaySettings(); sendSettings(); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } RemoteOutputSinkGui::~RemoteOutputSinkGui() @@ -559,6 +562,7 @@ void RemoteOutputSinkGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/soapysdroutput/soapysdroutputgui.cpp b/plugins/samplesink/soapysdroutput/soapysdroutputgui.cpp index 1c9d08547..f5dbde3a3 100644 --- a/plugins/samplesink/soapysdroutput/soapysdroutputgui.cpp +++ b/plugins/samplesink/soapysdroutput/soapysdroutputgui.cpp @@ -27,6 +27,7 @@ #include "ui_soapysdroutputgui.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "soapygui/discreterangegui.h" #include "soapygui/intervalrangegui.h" #include "soapygui/stringrangegui.h" @@ -894,6 +895,7 @@ void SoapySDROutputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/testsink/testsinkgui.cpp b/plugins/samplesink/testsink/testsinkgui.cpp index d86ddbd45..3d9175106 100644 --- a/plugins/samplesink/testsink/testsinkgui.cpp +++ b/plugins/samplesink/testsink/testsinkgui.cpp @@ -26,6 +26,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/spectrumvis.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" @@ -291,6 +292,7 @@ void TestSinkGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/usrpoutput/usrpoutputgui.cpp b/plugins/samplesink/usrpoutput/usrpoutputgui.cpp index 266ae7bcb..9602f176a 100644 --- a/plugins/samplesink/usrpoutput/usrpoutputgui.cpp +++ b/plugins/samplesink/usrpoutput/usrpoutputgui.cpp @@ -23,6 +23,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -590,6 +591,7 @@ void USRPOutputGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp b/plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp index dcb5ef372..505552b74 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp +++ b/plugins/samplesink/xtrxoutput/xtrxoutputgui.cpp @@ -24,6 +24,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -586,6 +587,7 @@ void XTRXOutputGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/airspy/airspygui.cpp b/plugins/samplesource/airspy/airspygui.cpp index 67c76b8d2..06e208fd5 100644 --- a/plugins/samplesource/airspy/airspygui.cpp +++ b/plugins/samplesource/airspy/airspygui.cpp @@ -30,6 +30,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" @@ -479,6 +480,7 @@ void AirspyGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/airspyhf/airspyhfgui.cpp b/plugins/samplesource/airspyhf/airspyhfgui.cpp index 6720e543a..b182fafde 100644 --- a/plugins/samplesource/airspyhf/airspyhfgui.cpp +++ b/plugins/samplesource/airspyhf/airspyhfgui.cpp @@ -28,6 +28,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "airspyhfgui.h" @@ -503,6 +504,7 @@ void AirspyHFGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/audioinput/audioinputgui.cpp b/plugins/samplesource/audioinput/audioinputgui.cpp index 97787d728..d2a47ebad 100644 --- a/plugins/samplesource/audioinput/audioinputgui.cpp +++ b/plugins/samplesource/audioinput/audioinputgui.cpp @@ -23,6 +23,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "audioinputgui.h" @@ -55,6 +57,7 @@ AudioInputGui::AudioInputGui(DeviceUISet *deviceUISet, QWidget* parent) : connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue); + DialPopup::addPopupsToChildDials(this); } AudioInputGui::~AudioInputGui() @@ -320,6 +323,7 @@ void AudioInputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/bladerf1input/bladerf1inputgui.cpp b/plugins/samplesource/bladerf1input/bladerf1inputgui.cpp index 3939c544b..80b39aa27 100644 --- a/plugins/samplesource/bladerf1input/bladerf1inputgui.cpp +++ b/plugins/samplesource/bladerf1input/bladerf1inputgui.cpp @@ -25,6 +25,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -560,6 +561,7 @@ void Bladerf1InputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/bladerf2input/bladerf2inputgui.cpp b/plugins/samplesource/bladerf2input/bladerf2inputgui.cpp index a12ebeb97..d7eb74bf5 100644 --- a/plugins/samplesource/bladerf2input/bladerf2inputgui.cpp +++ b/plugins/samplesource/bladerf2input/bladerf2inputgui.cpp @@ -25,6 +25,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -556,6 +557,7 @@ void BladeRF2InputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/fcdpro/fcdprogui.cpp b/plugins/samplesource/fcdpro/fcdprogui.cpp index b8528f5f1..e7c28791c 100644 --- a/plugins/samplesource/fcdpro/fcdprogui.cpp +++ b/plugins/samplesource/fcdpro/fcdprogui.cpp @@ -22,6 +22,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "fcdprogui.h" @@ -601,6 +602,7 @@ void FCDProGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/fcdproplus/fcdproplusgui.cpp b/plugins/samplesource/fcdproplus/fcdproplusgui.cpp index 4c2583510..c876f0a2d 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusgui.cpp +++ b/plugins/samplesource/fcdproplus/fcdproplusgui.cpp @@ -23,6 +23,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "fcdproplusgui.h" @@ -403,6 +404,7 @@ void FCDProPlusGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/hackrfinput/hackrfinputgui.cpp b/plugins/samplesource/hackrfinput/hackrfinputgui.cpp index 1f2d15c20..4cc192c55 100644 --- a/plugins/samplesource/hackrfinput/hackrfinputgui.cpp +++ b/plugins/samplesource/hackrfinput/hackrfinputgui.cpp @@ -26,6 +26,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -543,6 +544,7 @@ void HackRFInputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/kiwisdr/kiwisdrgui.cpp b/plugins/samplesource/kiwisdr/kiwisdrgui.cpp index 4c8ba4e57..4154e80cb 100644 --- a/plugins/samplesource/kiwisdr/kiwisdrgui.cpp +++ b/plugins/samplesource/kiwisdr/kiwisdrgui.cpp @@ -29,6 +29,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "util/db.h" @@ -330,6 +331,7 @@ void KiwiSDRGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/limesdrinput/limesdrinputgui.cpp b/plugins/samplesource/limesdrinput/limesdrinputgui.cpp index c08137c58..53126197a 100644 --- a/plugins/samplesource/limesdrinput/limesdrinputgui.cpp +++ b/plugins/samplesource/limesdrinput/limesdrinputgui.cpp @@ -27,6 +27,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -102,6 +104,7 @@ LimeSDRInputGUI::LimeSDRInputGUI(DeviceUISet *deviceUISet, QWidget* parent) : m_limeSDRInput->setMessageQueueToGUI(&m_inputMessageQueue); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); + DialPopup::addPopupsToChildDials(this); } LimeSDRInputGUI::~LimeSDRInputGUI() @@ -806,6 +809,7 @@ void LimeSDRInputGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/localinput/localinputgui.cpp b/plugins/samplesource/localinput/localinputgui.cpp index 955d4620e..eb9092be6 100644 --- a/plugins/samplesource/localinput/localinputgui.cpp +++ b/plugins/samplesource/localinput/localinputgui.cpp @@ -34,6 +34,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "mainwindow.h" @@ -328,6 +329,7 @@ void LocalInputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/perseus/perseusgui.cpp b/plugins/samplesource/perseus/perseusgui.cpp index fffb5e238..87dd79225 100644 --- a/plugins/samplesource/perseus/perseusgui.cpp +++ b/plugins/samplesource/perseus/perseusgui.cpp @@ -26,6 +26,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "perseusgui.h" @@ -418,6 +419,7 @@ void PerseusGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/plutosdrinput/plutosdrinputgui.cpp b/plugins/samplesource/plutosdrinput/plutosdrinputgui.cpp index 01bb6456c..5d170593d 100644 --- a/plugins/samplesource/plutosdrinput/plutosdrinputgui.cpp +++ b/plugins/samplesource/plutosdrinput/plutosdrinputgui.cpp @@ -24,6 +24,8 @@ #include "dsp/dspcommands.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "device/deviceapi.h" #include "device/deviceuiset.h" #include "plutosdr/deviceplutosdr.h" @@ -83,6 +85,7 @@ PlutoSDRInputGui::PlutoSDRInputGui(DeviceUISet *deviceUISet, QWidget* parent) : connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue); + DialPopup::addPopupsToChildDials(this); } PlutoSDRInputGui::~PlutoSDRInputGui() @@ -604,6 +607,7 @@ void PlutoSDRInputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/remoteinput/remoteinputgui.cpp b/plugins/samplesource/remoteinput/remoteinputgui.cpp index 71ba66c35..c9d809682 100644 --- a/plugins/samplesource/remoteinput/remoteinputgui.cpp +++ b/plugins/samplesource/remoteinput/remoteinputgui.cpp @@ -30,6 +30,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "dsp/hbfilterchainconverter.h" @@ -699,6 +700,7 @@ void RemoteInputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/remotetcpinput/remotetcpinputgui.cpp b/plugins/samplesource/remotetcpinput/remotetcpinputgui.cpp index 396efadc5..8d28d6762 100644 --- a/plugins/samplesource/remotetcpinput/remotetcpinputgui.cpp +++ b/plugins/samplesource/remotetcpinput/remotetcpinputgui.cpp @@ -25,6 +25,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "dsp/hbfilterchainconverter.h" @@ -87,6 +89,7 @@ RemoteTCPInputGui::RemoteTCPInputGui(DeviceUISet *deviceUISet, QWidget* parent) m_forceSettings = true; sendSettings(); makeUIConnections(); + DialPopup::addPopupsToChildDials(this); } RemoteTCPInputGui::~RemoteTCPInputGui() @@ -778,6 +781,7 @@ void RemoteTCPInputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/rtlsdr/rtlsdrgui.cpp b/plugins/samplesource/rtlsdr/rtlsdrgui.cpp index 8cceb9800..7141df793 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrgui.cpp +++ b/plugins/samplesource/rtlsdr/rtlsdrgui.cpp @@ -28,6 +28,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" @@ -557,6 +558,7 @@ void RTLSDRGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/sdrplay/sdrplaygui.cpp b/plugins/samplesource/sdrplay/sdrplaygui.cpp index 9759e2e74..1c7e31b43 100644 --- a/plugins/samplesource/sdrplay/sdrplaygui.cpp +++ b/plugins/samplesource/sdrplay/sdrplaygui.cpp @@ -28,6 +28,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" @@ -84,6 +86,7 @@ SDRPlayGui::SDRPlayGui(DeviceUISet *deviceUISet, QWidget* parent) : connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue); + DialPopup::addPopupsToChildDials(this); } SDRPlayGui::~SDRPlayGui() @@ -480,6 +483,7 @@ void SDRPlayGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/sdrplayv3/sdrplayv3gui.cpp b/plugins/samplesource/sdrplayv3/sdrplayv3gui.cpp index 23ad2d11c..f4f4beb56 100644 --- a/plugins/samplesource/sdrplayv3/sdrplayv3gui.cpp +++ b/plugins/samplesource/sdrplayv3/sdrplayv3gui.cpp @@ -29,6 +29,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" @@ -120,6 +122,7 @@ SDRPlayV3Gui::SDRPlayV3Gui(DeviceUISet *deviceUISet, QWidget* parent) : connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_sdrPlayV3Input->setMessageQueueToGUI(&m_inputMessageQueue); + DialPopup::addPopupsToChildDials(this); } SDRPlayV3Gui::~SDRPlayV3Gui() @@ -562,6 +565,7 @@ void SDRPlayV3Gui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/sigmffileinput/sigmffileinputgui.cpp b/plugins/samplesource/sigmffileinput/sigmffileinputgui.cpp index 1a446452d..a7d58a399 100644 --- a/plugins/samplesource/sigmffileinput/sigmffileinputgui.cpp +++ b/plugins/samplesource/sigmffileinput/sigmffileinputgui.cpp @@ -28,6 +28,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "dsp/filerecordinterface.h" @@ -694,6 +695,7 @@ void SigMFFileInputGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/soapysdrinput/soapysdrinputgui.cpp b/plugins/samplesource/soapysdrinput/soapysdrinputgui.cpp index 5ccb2beb0..596897b2f 100644 --- a/plugins/samplesource/soapysdrinput/soapysdrinputgui.cpp +++ b/plugins/samplesource/soapysdrinput/soapysdrinputgui.cpp @@ -27,6 +27,7 @@ #include "util/simpleserializer.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "soapygui/discreterangegui.h" #include "soapygui/intervalrangegui.h" #include "soapygui/stringrangegui.h" @@ -936,6 +937,7 @@ void SoapySDRInputGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/testsource/testsourcegui.cpp b/plugins/samplesource/testsource/testsourcegui.cpp index 408e60715..5bce1010d 100644 --- a/plugins/samplesource/testsource/testsourcegui.cpp +++ b/plugins/samplesource/testsource/testsourcegui.cpp @@ -28,6 +28,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "util/db.h" @@ -76,6 +78,7 @@ TestSourceGui::TestSourceGui(DeviceUISet *deviceUISet, QWidget* parent) : m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); + DialPopup::addPopupsToChildDials(this); } TestSourceGui::~TestSourceGui() @@ -531,6 +534,7 @@ void TestSourceGui::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/usrpinput/usrpinputgui.cpp b/plugins/samplesource/usrpinput/usrpinputgui.cpp index 089228fdc..5fce0fb91 100644 --- a/plugins/samplesource/usrpinput/usrpinputgui.cpp +++ b/plugins/samplesource/usrpinput/usrpinputgui.cpp @@ -28,6 +28,7 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -650,6 +651,7 @@ void USRPInputGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/plugins/samplesource/xtrxinput/xtrxinputgui.cpp b/plugins/samplesource/xtrxinput/xtrxinputgui.cpp index f5fe67520..a517f608b 100644 --- a/plugins/samplesource/xtrxinput/xtrxinputgui.cpp +++ b/plugins/samplesource/xtrxinput/xtrxinputgui.cpp @@ -28,6 +28,8 @@ #include "gui/colormapper.h" #include "gui/glspectrum.h" #include "gui/basicdevicesettingsdialog.h" +#include "gui/dialpopup.h" +#include "gui/dialogpositioner.h" #include "dsp/dspengine.h" #include "dsp/dspcommands.h" #include "device/deviceapi.h" @@ -82,6 +84,7 @@ XTRXInputGUI::XTRXInputGUI(DeviceUISet *deviceUISet, QWidget* parent) : makeUIConnections(); connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); + DialPopup::addPopupsToChildDials(this); } XTRXInputGUI::~XTRXInputGUI() @@ -673,6 +676,7 @@ void XTRXInputGUI::openDeviceSettingsDialog(const QPoint& p) dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex); dialog.move(p); + new DialogPositioner(&dialog, false); dialog.exec(); m_settings.m_useReverseAPI = dialog.useReverseAPI(); diff --git a/sdrgui/gui/audiodialog.cpp b/sdrgui/gui/audiodialog.cpp index b379aead3..e94b5312f 100644 --- a/sdrgui/gui/audiodialog.cpp +++ b/sdrgui/gui/audiodialog.cpp @@ -24,6 +24,7 @@ #include "audio/audiodevicemanager.h" #include "audiodialog.h" +#include "gui/dialpopup.h" #include "ui_audiodialog.h" AudioDialogX::AudioDialogX(AudioDeviceManager* audioDeviceManager, QWidget* parent) : @@ -95,6 +96,7 @@ AudioDialogX::AudioDialogX(AudioDeviceManager* audioDeviceManager, QWidget* pare m_inIndex = -1; ui->tabWidget->setCurrentIndex(0); + DialPopup::addPopupsToChildDials(this); } AudioDialogX::~AudioDialogX() diff --git a/sdrgui/gui/dialogpositioner.cpp b/sdrgui/gui/dialogpositioner.cpp new file mode 100644 index 000000000..143cc41f8 --- /dev/null +++ b/sdrgui/gui/dialogpositioner.cpp @@ -0,0 +1,131 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Jon Beniston, M7RCE // +// // +// 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 . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include + +#include "dialogpositioner.h" + +DialogPositioner::DialogPositioner(QWidget *dialog, bool center) : + QObject(dialog), + m_dialog(dialog), + m_center(center) +{ + connect(dialog->screen(), &QScreen::orientationChanged, this, &DialogPositioner::orientationChanged); + dialog->screen()->setOrientationUpdateMask(Qt::PortraitOrientation + | Qt::LandscapeOrientation + | Qt::InvertedPortraitOrientation + | Qt::InvertedLandscapeOrientation); + if (m_center) { + DialogPositioner::centerDialog(m_dialog); + } else { + DialogPositioner::positionDialog(m_dialog); + } + dialog->installEventFilter(this); +} + +void DialogPositioner::orientationChanged(Qt::ScreenOrientation orientation) +{ + (void) orientation; + + // Need a delay before geometry() reflects new orientation + // https://bugreports.qt.io/browse/QTBUG-109127 + QTimer::singleShot(200, [this]() { + if (m_center) { + DialogPositioner::centerDialog(m_dialog); + } else { + DialogPositioner::positionDialog(m_dialog); + } + }); +} + +void DialogPositioner::centerDialog(QWidget *dialog) +{ + // Restrict size of dialog to size of desktop + DialogPositioner::sizeToDesktop(dialog); + + // Position in center of screen + QRect desktop = dialog->screen()->availableGeometry(); + QSize size = dialog->size(); + QPoint pos; + pos.setX((desktop.width() - size.width()) / 2); + pos.setY((desktop.height() - size.height()) / 2); + dialog->move(pos); +} + +void DialogPositioner::positionDialog(QWidget *dialog) +{ + // Restrict size of dialog to size of desktop + DialogPositioner::sizeToDesktop(dialog); + + // Position so fully on screen + QRect desktop = dialog->screen()->availableGeometry(); + QSize size = dialog->size(); + QPoint pos = dialog->pos(); + + bool move = false; + if (pos.x() + size.width() > desktop.width()) + { + pos.setX(desktop.width() - size.width()); + move = true; + } + if (pos.y() + size.height() > desktop.height()) + { + pos.setY(desktop.height() - size.height()); + move = true; + } + if (move) { + dialog->move(pos); + } +} + +void DialogPositioner::sizeToDesktop(QWidget *widget) +{ + QRect desktop = widget->screen()->availableGeometry(); + QSize size = widget->size(); + + bool resize = false; + if (size.width() > desktop.width()) + { + size.setWidth(desktop.width()); + resize = true; + } + if (size.height() > desktop.height()) + { + size.setHeight(desktop.height()); + resize = true; + } + if (resize) { + widget->resize(size); + } +} + +bool DialogPositioner::eventFilter(QObject *obj, QEvent *event) +{ + if (event->type() == QEvent::Show) + { + if (m_center) { + DialogPositioner::centerDialog(m_dialog); + } else { + DialogPositioner::positionDialog(m_dialog); + } + } + return QObject::eventFilter(obj, event); +} diff --git a/sdrgui/gui/dialogpositioner.h b/sdrgui/gui/dialogpositioner.h new file mode 100644 index 000000000..a5a0d3170 --- /dev/null +++ b/sdrgui/gui/dialogpositioner.h @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Jon Beniston, M7RCE // +// // +// 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 . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef SDRGUI_GUI_DIALOGPOSITIONER_H +#define SDRGUI_GUI_DIALOGPOSITIONER_H + +#include +#include "export.h" + +// DialogPositioner monitors screen orientation and repositions dialog +class SDRGUI_API DialogPositioner : public QObject { + + Q_OBJECT + +public: + DialogPositioner(QWidget *dialog, bool center=false); + + // Center dialog on screen + static void centerDialog(QWidget *dialog); + + // Make sure dialog is on screen + static void positionDialog(QWidget *dialog); + + // Restrict size of widget to size of desktop (but not smaller than minimumSize) + static void sizeToDesktop(QWidget *widget); + +private slots: + void orientationChanged(Qt::ScreenOrientation orientation); + +protected: + bool eventFilter(QObject *watched, QEvent *event) override; + +private: + QWidget *m_dialog; + bool m_center; + +}; + +#endif diff --git a/sdrgui/gui/dialpopup.cpp b/sdrgui/gui/dialpopup.cpp new file mode 100644 index 000000000..82436ab37 --- /dev/null +++ b/sdrgui/gui/dialpopup.cpp @@ -0,0 +1,114 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Jon Beniston, M7RCE // +// // +// 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 . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include + +#include "gui/crightclickenabler.h" +#include "gui/dialogpositioner.h" +#include "dialpopup.h" + +DialPopup::DialPopup(QDial *parent) : + QDialog(parent), + m_dial(parent), + m_originalValue(m_dial->value()) +{ + m_value = new QSlider(Qt::Horizontal); + m_valueText = new QLabel(QString::number(m_dial->value())); + m_label = new QLabel(m_dial->toolTip()); + QVBoxLayout *v = new QVBoxLayout(this); + QHBoxLayout *h = new QHBoxLayout(); + h->addWidget(m_label); + h->addWidget(m_value); + h->addWidget(m_valueText); + v->addLayout(h); + h = new QHBoxLayout(); + m_cancelButton = new QPushButton("Cancel"); + m_okButton = new QPushButton("OK"); + h->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding)); + h->addWidget(m_cancelButton); + h->addWidget(m_okButton); + v->addLayout(h); + + connect(m_value, &QSlider::valueChanged, this, &DialPopup::on_value_valueChanged); + + connect(m_cancelButton, &QPushButton::clicked, this, &QDialog::reject); + connect(m_okButton, &QPushButton::clicked, this, &QDialog::accept); + + // Add right click / tap and hold on parent to open dialog + CRightClickEnabler *rclick = new CRightClickEnabler(m_dial); + connect(rclick, &CRightClickEnabler::rightClick, this, &DialPopup::display); + + m_positioner = new DialogPositioner(this); +} + +void DialPopup::reject() +{ + m_dial->setValue(m_originalValue); + QDialog::reject(); +} + +void DialPopup::accept() +{ + m_dial->setValue(m_value->value()); + QDialog::accept(); +} + +void DialPopup::display(const QPoint& p) +{ + if (m_dial->isEnabled()) + { + m_value->setMaximum(m_dial->maximum()); + m_value->setMinimum(m_dial->minimum()); + m_value->setPageStep(m_dial->pageStep()); + m_value->setSingleStep(m_dial->singleStep()); + m_value->setValue(m_dial->value()); + m_originalValue = m_dial->value(); + move(p); + show(); + } +} + +void DialPopup::on_value_valueChanged(int value) +{ + m_valueText->setText(QString::number(value)); + m_dial->setValue(value); +} + +void DialPopup::addPopupsToChildDials(QWidget *parent) +{ + // Get list of child dials that already have a popup + QList popups = parent->findChildren(); + QList dialsWithPopups; + for (auto popup : popups) { + dialsWithPopups.append(popup->dial()); + } + + // Add dial popups to all child dials without one + QList dials = parent->findChildren(); + for (auto dial : dials) + { + if (!dialsWithPopups.contains(dial)) { + new DialPopup(dial); + } + } +} diff --git a/sdrgui/gui/dialpopup.h b/sdrgui/gui/dialpopup.h new file mode 100644 index 000000000..d52443a0b --- /dev/null +++ b/sdrgui/gui/dialpopup.h @@ -0,0 +1,62 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Jon Beniston, M7RCE // +// // +// 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 . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDE_GUI_DIALPOPUP_H +#define INCLUDE_GUI_DIALPOPUP_H + +#include + +#include "export.h" + +class QDial; +class QSlider; +class QLabel; +class QPushButton; +class DialogPositioner; + +// A popup dialog for QDials that uses a slider instead, which is easier to use +// on a touch screen. Actived with tap and hold or right mouse click +class SDRGUI_API DialPopup : public QDialog { + Q_OBJECT + +public: + explicit DialPopup(QDial *parent = nullptr); + QDial *dial() const { return m_dial; } + + // Add popups to all child QDials in a widget + static void addPopupsToChildDials(QWidget *parent); + +public slots: + virtual void accept() override; + virtual void reject() override; + void on_value_valueChanged(int value); + void display(const QPoint& p); + +private: + + QDial *m_dial; + QSlider *m_value; + QLabel *m_valueText; + QLabel *m_label; + QPushButton *m_okButton; + QPushButton *m_cancelButton; + int m_originalValue; + DialogPositioner *m_positioner; + +}; + +#endif // INCLUDE_GUI_DIALPOPUP_H diff --git a/sdrgui/gui/spectrumcalibrationpointsdialog.cpp b/sdrgui/gui/spectrumcalibrationpointsdialog.cpp index 17f20fda4..84b6a0464 100644 --- a/sdrgui/gui/spectrumcalibrationpointsdialog.cpp +++ b/sdrgui/gui/spectrumcalibrationpointsdialog.cpp @@ -23,6 +23,7 @@ #include "util/db.h" #include "util/csv.h" #include "dsp/spectrummarkers.h" +#include "gui/dialpopup.h" #include "spectrumcalibrationpointsdialog.h" @@ -60,6 +61,7 @@ SpectrumCalibrationPointsDialog::SpectrumCalibrationPointsDialog( ui->calibrationGlobalCorr->setValue(m_globalCorrection * 100.0); ui->corrOrSet->setText("Cor"); displayCalibrationPoint(); + DialPopup::addPopupsToChildDials(this); } SpectrumCalibrationPointsDialog::~SpectrumCalibrationPointsDialog() diff --git a/sdrgui/gui/spectrummarkersdialog.cpp b/sdrgui/gui/spectrummarkersdialog.cpp index dd0f2c324..25a765fcd 100644 --- a/sdrgui/gui/spectrummarkersdialog.cpp +++ b/sdrgui/gui/spectrummarkersdialog.cpp @@ -20,6 +20,7 @@ #include #include +#include "gui/dialpopup.h" #include "util/db.h" #include "util/csv.h" #include "spectrummarkersdialog.h" @@ -69,6 +70,7 @@ SpectrumMarkersDialog::SpectrumMarkersDialog( displayHistogramMarker(); displayWaterfallMarker(); displayAnnotationMarker(); + DialPopup::addPopupsToChildDials(this); } SpectrumMarkersDialog::~SpectrumMarkersDialog() diff --git a/sdrgui/gui/tabletapandhold.cpp b/sdrgui/gui/tabletapandhold.cpp new file mode 100644 index 000000000..9527126cc --- /dev/null +++ b/sdrgui/gui/tabletapandhold.cpp @@ -0,0 +1,56 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Jon Beniston, M7RCE // +// // +// 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 . // +/////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include + +#include "tabletapandhold.h" + +TableTapAndHold::TableTapAndHold(QTableWidget *table) : + QObject(table), + m_table(table) +{ + m_table->installEventFilter(this); + m_table->grabGesture(Qt::TapAndHoldGesture); +}; + +bool TableTapAndHold::eventFilter(QObject *obj, QEvent *event) +{ + if (event->type() == QEvent::Gesture) + { + QGestureEvent *gestureEvent = static_cast(event); + if (QTapAndHoldGesture *tapAndHoldGesture = static_cast(gestureEvent->gesture(Qt::TapAndHoldGesture))) + { + // Map from global position to item position + QPoint point = m_table->mapFromGlobal(tapAndHoldGesture->position().toPoint()); + QHeaderView *hHeader = m_table->horizontalHeader(); + QHeaderView *vHeader = m_table->verticalHeader(); + if (hHeader) { + point.setY(point.y() - hHeader->height()); + } + if (vHeader) { + point.setX(point.x() - vHeader->width()); + } + emit tapAndHold(point); + return true; + } + } + return QObject::eventFilter(obj, event); +} diff --git a/sdrgui/gui/tabletapandhold.h b/sdrgui/gui/tabletapandhold.h new file mode 100644 index 000000000..392d1ad9a --- /dev/null +++ b/sdrgui/gui/tabletapandhold.h @@ -0,0 +1,43 @@ +/////////////////////////////////////////////////////////////////////////////////// +// Copyright (C) 2022 Jon Beniston, M7RCE // +// // +// 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 . // +/////////////////////////////////////////////////////////////////////////////////// + +#ifndef SDRGUI_GUI_TABLETAPANDHOLD_H +#define SDRGUI_GUI_TABLETAPANDHOLD_H + +#include "export.h" + +class QTableWidget; + +// Emits a signal when tap and hold gesture occurs on a table +// Position passed with tapAndHold signal is adjusted by table header size, +// so can be used to call QTableWidget::itemAt(itemPos) +class SDRGUI_API TableTapAndHold : public QObject { + Q_OBJECT +public: + TableTapAndHold(QTableWidget *table); + +signals: + void tapAndHold(const QPoint& itemPos); + +protected: + bool eventFilter(QObject *obj, QEvent *event) override; + +private: + QTableWidget* m_table; +}; + +#endif /* SDRGUI_GUI_TABLETAPANDHOLD_H */