allow only one inspector per universe
This commit is contained in:
parent
3da5529b39
commit
0fb5db0574
|
@ -213,8 +213,15 @@ void MultiverseView::createEditor(const QModelIndex &index)
|
|||
if (data.metaType().id() == qMetaTypeId<QSacnUniverse*>())
|
||||
{
|
||||
auto univ = data.value<QSacnUniverse*>();
|
||||
auto universeView = new UniverseView(this, univ);
|
||||
universeView->show();
|
||||
foreach (const auto & inspector, mInspectors)
|
||||
if (inspector->universe() == univ)
|
||||
return;
|
||||
auto view = new UniverseView(this, univ);
|
||||
mInspectors.insert(view);
|
||||
connect(view, &QObject::destroyed, this, [this, view](){mInspectors.remove(view);});
|
||||
view->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
view->show();
|
||||
return;
|
||||
}
|
||||
|
||||
// Discovery universes:
|
||||
|
@ -227,6 +234,7 @@ void MultiverseView::createEditor(const QModelIndex &index)
|
|||
connect(subscribe, &AddUniverseDialog::additionRequested,
|
||||
node, &QSacnNode::subscribe);
|
||||
subscribe->exec();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "multiversemodel.h"
|
||||
#include "qsacnnode.h"
|
||||
#include "universeview.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
@ -61,4 +62,5 @@ private:
|
|||
QSacnNode * node;
|
||||
MultiverseModel * model;
|
||||
QSortFilterProxyModel *sortProxy;
|
||||
QSet<UniverseView*> mInspectors;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue