mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-02 22:14:45 -04:00
Add support for plugin presets.
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
#include <QColorDialog>
|
||||
|
||||
#include "gui/pluginpresetsdialog.h"
|
||||
#include "gui/dialogpositioner.h"
|
||||
#include "feature/feature.h"
|
||||
#include "feature/featuregui.h"
|
||||
#include "maincore.h"
|
||||
|
||||
#include "basicfeaturesettingsdialog.h"
|
||||
#include "ui_basicfeaturesettingsdialog.h"
|
||||
|
||||
@@ -82,6 +88,28 @@ void BasicFeatureSettingsDialog::on_reverseAPIFeatureIndex_editingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void BasicFeatureSettingsDialog::on_presets_clicked()
|
||||
{
|
||||
FeatureGUI *featureGUI = qobject_cast<FeatureGUI *>(parent());
|
||||
if (!featureGUI)
|
||||
{
|
||||
qDebug() << "BasicFeatureSettingsDialog::on_presets_clicked: parent not a FeatureGUI";
|
||||
return;
|
||||
}
|
||||
Feature *feature = MainCore::instance()->getFeature(0, featureGUI->getIndex());
|
||||
const QString& id = feature->getURI();
|
||||
|
||||
PluginPresetsDialog dialog(id);
|
||||
dialog.setPresets(MainCore::instance()->getMutableSettings().getPluginPresets());
|
||||
dialog.setSerializableInterface(featureGUI);
|
||||
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 BasicFeatureSettingsDialog::accept()
|
||||
{
|
||||
m_hasChanged = true;
|
||||
|
||||
Reference in New Issue
Block a user