1
0
Fork 0

Enable changing the ACN EPI 19 user assignable name

This commit is contained in:
Kevin Matz 2022-11-19 15:47:51 -05:00
parent d84dde0cb2
commit b7f045cd6b
3 changed files with 21 additions and 3 deletions

View File

@ -1,4 +1,5 @@
#include "adduniversedialog.h"
#include "lineeditdialog.h"
#include "multiverseview.h"
#include "multiversemodel.h"
#include "ui_multiverseview.h"
@ -38,6 +39,9 @@ MultiverseView::MultiverseView(QWidget *parent, QSacnNode *node)
connect(ui->multiverseView, &QTreeView::doubleClicked,
this, &MultiverseView::createEditor);
connect(ui->actionUACN, &QAction::triggered,
this, &MultiverseView::showUacnEditor);
connect(ui->actionInspect, &QAction::triggered,
this, [this]() {
auto selected = ui->multiverseView->currentIndex();
@ -207,3 +211,19 @@ void MultiverseView::createEditor(const QModelIndex &index)
subscribe->exec();
}
}
/**
* @brief MultiverseView::showUacnEditor
*/
void MultiverseView::showUacnEditor()
{
auto editor = new LineEditDialog(this, "Name", 63,
node->name().c_str(), node->fixedName().c_str());
editor->setWindowTitle("User Assigned Component Name");
connect(editor, &LineEditDialog::submit,
this, [&](QString name) {node->assignUserName(name.toStdString());});
editor->exec();
}

View File

@ -54,6 +54,7 @@ public slots:
void selectionChanged(const QModelIndex &current, const QModelIndex &previous);
void createContextMenu(const QPoint &pos);
void createEditor(const QModelIndex &index);
void showUacnEditor();
private:
Ui::MultiverseView *ui;

View File

@ -142,9 +142,6 @@
</property>
</action>
<action name="actionUACN">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>User Assigned Component Name</string>
</property>