1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-04 06:54:39 -04:00

Add support for plugin presets.

This commit is contained in:
Jon Beniston
2023-08-24 15:51:50 +01:00
parent 028a44ce48
commit 2a24f72590
28 changed files with 1397 additions and 41 deletions
+27
View File
@@ -1,6 +1,11 @@
#include <QColorDialog>
#include "dsp/channelmarker.h"
#include "gui/pluginpresetsdialog.h"
#include "gui/dialogpositioner.h"
#include "channel/channelapi.h"
#include "channel/channelgui.h"
#include "maincore.h"
#include "basicchannelsettingsdialog.h"
#include "ui_basicchannelsettingsdialog.h"
@@ -154,6 +159,28 @@ void BasicChannelSettingsDialog::on_titleReset_clicked()
ui->title->setText(m_defaultTitle);
}
void BasicChannelSettingsDialog::on_presets_clicked()
{
ChannelGUI *channelGUI = qobject_cast<ChannelGUI *>(parent());
if (!channelGUI)
{
qDebug() << "BasicChannelSettingsDialog::on_presets_clicked: parent not a ChannelGUI";
return;
}
ChannelAPI *channel = MainCore::instance()->getChannel(channelGUI->getDeviceSetIndex(), channelGUI->getIndex());
const QString& id = channel->getURI();
PluginPresetsDialog dialog(id);
dialog.setPresets(MainCore::instance()->getMutableSettings().getPluginPresets());
dialog.setSerializableInterface(channelGUI);
dialog.populateTree();
new DialogPositioner(&dialog, true);
dialog.exec();
if (dialog.wasPresetLoaded()) {
QDialog::reject(); // Settings may have changed, so GUI will be inconsistent. Just close it
}
}
void BasicChannelSettingsDialog::accept()
{
m_channelMarker->blockSignals(true);