Show group titles in widgets

This commit is contained in:
Alex Spataru 2022-06-23 20:25:10 -05:00
parent a92b09d427
commit 034ae1b7f1
2 changed files with 14 additions and 0 deletions

View File

@ -89,6 +89,8 @@ public:
bool read(const QJsonObject &object);
void setTitle(const QString &title) { m_title = title; }
private:
bool m_fft;
bool m_led;

View File

@ -850,7 +850,10 @@ QVector<JSON::Group> UI::Dashboard::getLEDWidgets()
Q_FOREACH (auto dataset, group.datasets())
{
if (dataset.led())
{
dataset.setTitle(dataset.title() + " (" + group.title() + ")");
widgets.append(dataset);
}
}
}
@ -877,7 +880,10 @@ QVector<JSON::Dataset> UI::Dashboard::getFFTWidgets()
Q_FOREACH (auto dataset, group.datasets())
{
if (dataset.fft())
{
dataset.setTitle(dataset.title() + " (" + group.title() + ")");
widgets.append(dataset);
}
}
}
@ -895,7 +901,10 @@ QVector<JSON::Dataset> UI::Dashboard::getPlotWidgets()
Q_FOREACH (auto dataset, group.datasets())
{
if (dataset.graph())
{
dataset.setTitle(dataset.title() + " (" + group.title() + ")");
widgets.append(dataset);
}
}
}
@ -930,7 +939,10 @@ QVector<JSON::Dataset> UI::Dashboard::getWidgetDatasets(const QString &handle)
Q_FOREACH (auto dataset, group.datasets())
{
if (dataset.widget() == handle)
{
dataset.setTitle(dataset.title() + " (" + group.title() + ")");
widgets.append(dataset);
}
}
}