2021-09-06 15:09:08 -04:00
|
|
|
#include "adduniversedialog.h"
|
2022-11-19 15:47:51 -05:00
|
|
|
#include "lineeditdialog.h"
|
2022-12-03 23:28:24 -05:00
|
|
|
#include "multiversewindow.h"
|
2021-09-06 12:54:28 -04:00
|
|
|
#include "multiversemodel.h"
|
2022-12-03 23:28:24 -05:00
|
|
|
#include "ui_multiversewindow.h"
|
2022-12-03 20:36:02 -05:00
|
|
|
#include "universewindow.h"
|
2022-11-24 11:35:04 -05:00
|
|
|
#include <QActionGroup>
|
2022-12-05 11:26:37 -05:00
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QStringBuilder>
|
2021-09-06 12:54:28 -04:00
|
|
|
|
|
|
|
/**
|
2022-12-03 23:28:24 -05:00
|
|
|
* @brief MultiverseWindow::MultiverseWindow
|
2021-09-06 12:54:28 -04:00
|
|
|
* @param parent
|
|
|
|
*/
|
2022-12-03 23:28:24 -05:00
|
|
|
MultiverseWindow::MultiverseWindow(QWidget *parent, QSacnNode *node)
|
2021-09-06 12:54:28 -04:00
|
|
|
: QMainWindow(parent)
|
2022-12-03 23:28:24 -05:00
|
|
|
, ui(new Ui::MultiverseWindow)
|
2021-09-06 22:01:12 -04:00
|
|
|
, node(node)
|
2021-09-08 09:40:27 -04:00
|
|
|
, model(new MultiverseModel(this, node))
|
|
|
|
, sortProxy(new QSortFilterProxyModel(this))
|
2021-09-06 12:54:28 -04:00
|
|
|
{
|
2022-12-04 20:53:46 -05:00
|
|
|
// build the UI
|
2021-09-06 12:54:28 -04:00
|
|
|
ui->setupUi(this);
|
2022-12-04 20:53:46 -05:00
|
|
|
ui->menubar->setNativeMenuBar(false);
|
|
|
|
auto mergeMode = new QActionGroup(this);
|
|
|
|
mergeMode->addAction(ui->actionMergeModeHTP);
|
|
|
|
mergeMode->addAction(ui->actionMergeModeLTP);
|
|
|
|
|
|
|
|
// initial states
|
2021-09-06 15:09:08 -04:00
|
|
|
ui->actionTerminate->setEnabled(false);
|
|
|
|
ui->actionUnsubscribe->setEnabled(false);
|
2021-09-06 22:01:12 -04:00
|
|
|
ui->actionInspect->setEnabled(false);
|
2022-11-26 12:41:46 -05:00
|
|
|
ui->actionIPv4->setChecked(node->isEnabledIPv4());
|
|
|
|
ui->actionIPv6->setChecked(node->isEnabledIPv6());
|
2022-11-19 16:43:41 -05:00
|
|
|
ui->actionDiscovery->setChecked(node->discoveryEnabled());
|
2021-09-06 12:54:28 -04:00
|
|
|
|
2022-12-04 20:53:46 -05:00
|
|
|
// setup the model
|
2021-09-08 09:40:27 -04:00
|
|
|
sortProxy->setSourceModel(model);
|
|
|
|
ui->multiverseView->setModel(sortProxy);
|
|
|
|
ui->multiverseView->setSortingEnabled(true);
|
|
|
|
ui->multiverseView->sortByColumn(MultiverseModel::Column::Universe,
|
|
|
|
Qt::SortOrder::AscendingOrder);
|
2021-09-06 22:01:12 -04:00
|
|
|
ui->multiverseView->setContextMenuPolicy(Qt::CustomContextMenu);
|
2021-09-07 09:59:01 -04:00
|
|
|
ui->multiverseView->expandAll();
|
|
|
|
for (int i = 0; i < ui->multiverseView->model()->rowCount(); i++)
|
|
|
|
ui->multiverseView->setFirstColumnSpanned(i, QModelIndex(), true);
|
|
|
|
|
2022-12-04 20:53:46 -05:00
|
|
|
// model connections
|
2022-12-03 23:28:24 -05:00
|
|
|
connect(ui->multiverseView->selectionModel(), &QItemSelectionModel::currentChanged,
|
|
|
|
this, &MultiverseWindow::selectionChanged);
|
2021-09-06 22:01:12 -04:00
|
|
|
connect(ui->multiverseView, &QTreeView::customContextMenuRequested,
|
2022-12-04 11:53:48 -05:00
|
|
|
this, &MultiverseWindow::openContextMenu);
|
2021-09-06 22:01:12 -04:00
|
|
|
connect(ui->multiverseView, &QTreeView::doubleClicked,
|
2022-12-04 11:53:48 -05:00
|
|
|
this, &MultiverseWindow::openUniverseEditor);
|
2021-09-06 22:01:12 -04:00
|
|
|
|
2022-12-04 20:53:46 -05:00
|
|
|
// action connections
|
2022-11-19 15:47:51 -05:00
|
|
|
connect(ui->actionUACN, &QAction::triggered,
|
2022-12-04 11:53:48 -05:00
|
|
|
this, &MultiverseWindow::openUacnEditor);
|
2022-11-26 12:41:46 -05:00
|
|
|
connect(ui->actionIPv4, &QAction::toggled,
|
|
|
|
node, &QSacnNode::setIPv4);
|
|
|
|
connect(ui->actionIPv6, &QAction::toggled,
|
|
|
|
node, &QSacnNode::setIPv6);
|
2022-12-04 20:53:46 -05:00
|
|
|
connect(ui->actionDiscovery, &QAction::toggled,
|
|
|
|
node, [&, node](bool checked) {
|
|
|
|
checked ? node->discoveryStart() : node->discoveryStop();
|
|
|
|
});
|
2021-09-06 15:09:08 -04:00
|
|
|
connect(ui->actionCreate, &QAction::triggered,
|
|
|
|
this, [this, node]() {
|
2022-12-04 11:53:12 -05:00
|
|
|
auto dialog = new AddUniverseDialog(this, 1);
|
2022-12-04 11:56:12 -05:00
|
|
|
connect(dialog, &AddUniverseDialog::submit,
|
2021-09-06 15:09:08 -04:00
|
|
|
node, &QSacnNode::create);
|
2022-12-04 11:53:12 -05:00
|
|
|
dialog->setWindowTitle(tr("Create"));
|
2022-12-04 11:30:49 -05:00
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
dialog->open();
|
2021-09-06 15:09:08 -04:00
|
|
|
});
|
2021-09-06 22:01:12 -04:00
|
|
|
connect(ui->actionTerminate, &QAction::triggered,
|
2021-09-07 09:59:01 -04:00
|
|
|
this, [&, node]() {
|
2021-09-08 09:40:27 -04:00
|
|
|
auto index = ui->multiverseView->currentIndex();
|
|
|
|
auto data = index.data(Qt::EditRole);
|
2021-09-06 22:01:12 -04:00
|
|
|
if (data.metaType().id() == qMetaTypeId<QSacnUniverse*>())
|
|
|
|
{
|
|
|
|
auto univ = data.value<QSacnUniverse*>();
|
|
|
|
if (univ->isEditable())
|
|
|
|
node->terminate(univ->number());
|
|
|
|
}
|
|
|
|
});
|
2021-09-06 15:09:08 -04:00
|
|
|
connect(ui->actionSubscribe, &QAction::triggered,
|
|
|
|
this, [this, node]() {
|
2022-12-03 11:02:40 -05:00
|
|
|
auto val = QVariant(1);
|
2021-09-08 09:40:27 -04:00
|
|
|
auto index = ui->multiverseView->currentIndex();
|
2022-12-03 11:02:40 -05:00
|
|
|
if (index.isValid())
|
|
|
|
{
|
|
|
|
auto actual = sortProxy->mapToSource(index);
|
|
|
|
auto item = static_cast<MultiverseItem*>(actual.internalPointer());
|
|
|
|
val = item->data(MultiverseModel::Column::Universe, Qt::DisplayRole);
|
|
|
|
}
|
2022-12-04 11:53:12 -05:00
|
|
|
auto dialog = new AddUniverseDialog(this, val.toInt());
|
2022-12-04 11:56:12 -05:00
|
|
|
connect(dialog, &AddUniverseDialog::submit,
|
2021-09-06 15:09:08 -04:00
|
|
|
node, &QSacnNode::subscribe);
|
2022-12-04 11:53:12 -05:00
|
|
|
dialog->setWindowTitle(tr("Subscribe"));
|
2022-12-04 11:30:49 -05:00
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
dialog->open();
|
2021-09-06 15:09:08 -04:00
|
|
|
});
|
2021-09-06 22:01:12 -04:00
|
|
|
connect(ui->actionUnsubscribe, &QAction::triggered,
|
2021-09-07 09:59:01 -04:00
|
|
|
this, [&, node]() {
|
2021-09-08 09:40:27 -04:00
|
|
|
auto index = ui->multiverseView->currentIndex();
|
|
|
|
auto data = index.data(Qt::EditRole);
|
2021-09-06 22:01:12 -04:00
|
|
|
if (data.metaType().id() == qMetaTypeId<QSacnUniverse*>())
|
|
|
|
{
|
|
|
|
auto univ = data.value<QSacnUniverse*>();
|
|
|
|
if (!univ->isEditable())
|
|
|
|
node->unsubscribe(univ->number());
|
|
|
|
}
|
|
|
|
});
|
2022-12-04 20:53:46 -05:00
|
|
|
connect(ui->actionInspect, &QAction::triggered,
|
|
|
|
this, [this]() {
|
|
|
|
auto selected = ui->multiverseView->currentIndex();
|
|
|
|
openUniverseEditor(selected);
|
2022-11-19 12:33:49 -05:00
|
|
|
});
|
2022-12-10 13:20:39 -05:00
|
|
|
connect(ui->actionUniverseHoldLastLook, &QAction::toggled,
|
|
|
|
this, [this](bool state) {
|
|
|
|
auto selected = ui->multiverseView->currentIndex();
|
|
|
|
auto data = selected.data(Qt::EditRole);
|
|
|
|
auto univ = data.value<QSacnUniverse*>();
|
|
|
|
univ->setHoldLastLook(state);
|
|
|
|
});
|
2022-12-11 14:55:05 -05:00
|
|
|
connect(ui->actionMergeModeHTP, &QAction::toggled,
|
|
|
|
this, [this](bool state) {
|
|
|
|
auto selected = ui->multiverseView->currentIndex();
|
|
|
|
auto data = selected.data(Qt::EditRole);
|
|
|
|
auto univ = data.value<QSacnUniverse*>();
|
|
|
|
if (state)
|
2022-12-12 13:39:10 -05:00
|
|
|
univ->setMergeMode(sACN::UniverseArbitrator::MERGE_HTP);
|
2022-12-11 14:55:05 -05:00
|
|
|
else
|
2022-12-12 13:39:10 -05:00
|
|
|
univ->setMergeMode(sACN::UniverseArbitrator::MERGE_LTP);
|
2022-12-11 14:55:05 -05:00
|
|
|
});
|
2022-12-05 11:26:37 -05:00
|
|
|
connect(ui->actionAbout, &QAction::triggered,
|
|
|
|
this, [this](){
|
|
|
|
QString title = tr("About") % " " % qAppName();
|
|
|
|
QString text = QApplication::organizationName() % "\n"
|
|
|
|
% "https://" % QApplication::organizationDomain() % "\n\n"
|
|
|
|
% QApplication::applicationName() % " is a demonstration of the capabilities "
|
|
|
|
% "of the sACN implimentation in the OpenLCP protocol library using the "
|
|
|
|
% "QsACN platform driver." % "\n\n"
|
|
|
|
% "© 2020-2022 Kevin Matz" % "\n\n"
|
|
|
|
% "Permission is hereby granted, free of charge, to any person obtaining a copy"
|
|
|
|
% "of this software and associated documentation files (the \"Software\"), "
|
|
|
|
% "to deal in the Software without restriction, including without limitation "
|
|
|
|
% "the rights to use, copy, modify, merge, publish, distribute, sublicense, "
|
|
|
|
% "and/or sell copies of the Software, and to permit persons to whom the "
|
|
|
|
% "Software is furnished to do so, subject to the following conditions:" % "\n\n"
|
|
|
|
% "The above copyright notice and this permission notice shall be included in "
|
|
|
|
% "all copies or substantial portions of the Software." % "\n\n"
|
|
|
|
% "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR "
|
|
|
|
% "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, "
|
|
|
|
% "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE "
|
|
|
|
% "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER "
|
|
|
|
% "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING "
|
|
|
|
% "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER "
|
|
|
|
% "DEALINGS IN THE SOFTWARE.";
|
|
|
|
QMessageBox::about(this, title, text);
|
|
|
|
});
|
|
|
|
connect(ui->actionAbout_Qt, &QAction::triggered,
|
|
|
|
this, [this](){QMessageBox::aboutQt(this);});
|
2021-09-06 12:54:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-12-03 23:28:24 -05:00
|
|
|
* @brief MultiverseWindow::~MultiverseWindow
|
2021-09-06 12:54:28 -04:00
|
|
|
*/
|
2022-12-03 23:28:24 -05:00
|
|
|
MultiverseWindow::~MultiverseWindow()
|
2021-09-06 12:54:28 -04:00
|
|
|
{
|
2022-12-06 00:12:18 -05:00
|
|
|
qDeleteAll(mInspectors);
|
2021-09-08 09:40:27 -04:00
|
|
|
delete ui;
|
2021-09-06 12:54:28 -04:00
|
|
|
}
|
2021-09-06 15:08:16 -04:00
|
|
|
|
|
|
|
|
2022-12-06 00:12:18 -05:00
|
|
|
void MultiverseWindow::closeEvent(QCloseEvent *)
|
|
|
|
{
|
|
|
|
// close all universe windows
|
|
|
|
foreach (const auto & inspector, mInspectors)
|
|
|
|
inspector->close();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-09-06 15:08:16 -04:00
|
|
|
/**
|
2022-12-03 23:28:24 -05:00
|
|
|
* @brief MultiverseWindow::selectionChanged
|
2021-09-06 15:08:16 -04:00
|
|
|
* @param selected
|
|
|
|
* @param deselected
|
|
|
|
*/
|
2022-12-03 23:28:24 -05:00
|
|
|
void MultiverseWindow::selectionChanged(const QModelIndex ¤t,
|
|
|
|
const QModelIndex &previous)
|
2021-09-06 15:08:16 -04:00
|
|
|
{
|
|
|
|
Q_UNUSED(previous)
|
|
|
|
|
|
|
|
ui->actionTerminate->setEnabled(false);
|
|
|
|
ui->actionUnsubscribe->setEnabled(false);
|
2021-09-06 22:01:12 -04:00
|
|
|
ui->actionInspect->setEnabled(false);
|
2022-12-10 13:20:39 -05:00
|
|
|
ui->actionUniverseHoldLastLook->setEnabled(false);
|
2022-12-11 14:55:05 -05:00
|
|
|
ui->menuMerge_Mode->setEnabled(false);
|
2021-09-06 15:08:16 -04:00
|
|
|
|
2021-09-08 09:40:27 -04:00
|
|
|
auto data = current.data(Qt::EditRole);
|
|
|
|
|
|
|
|
// Data universes:
|
2021-09-06 15:08:16 -04:00
|
|
|
if (data.metaType().id() == qMetaTypeId<QSacnUniverse*>())
|
|
|
|
{
|
|
|
|
auto univ = data.value<QSacnUniverse*>();
|
2022-12-10 13:20:39 -05:00
|
|
|
ui->actionInspect->setEnabled(true);
|
|
|
|
ui->actionUniverseHoldLastLook->setChecked(univ->getHoldLastLook());
|
2022-12-11 14:55:05 -05:00
|
|
|
switch (univ->getMergeMode()){
|
2022-12-12 13:39:10 -05:00
|
|
|
case sACN::UniverseArbitrator::MERGE_HTP:
|
2022-12-11 14:55:05 -05:00
|
|
|
ui->actionMergeModeHTP->setChecked(true);
|
|
|
|
break;
|
2022-12-12 13:39:10 -05:00
|
|
|
case sACN::UniverseArbitrator::MERGE_LTP:
|
2022-12-11 14:55:05 -05:00
|
|
|
ui->actionMergeModeLTP->setChecked(true);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2021-09-06 15:08:16 -04:00
|
|
|
if (univ->isEditable())
|
|
|
|
ui->actionTerminate->setEnabled(true);
|
|
|
|
else
|
2022-12-10 13:20:39 -05:00
|
|
|
{
|
2021-09-06 15:08:16 -04:00
|
|
|
ui->actionUnsubscribe->setEnabled(true);
|
2022-12-10 13:20:39 -05:00
|
|
|
if (univ->hasSources())
|
2022-12-11 14:55:05 -05:00
|
|
|
{
|
|
|
|
ui->actionUniverseHoldLastLook->setEnabled(true);
|
|
|
|
ui->menuMerge_Mode->setEnabled(true);
|
|
|
|
}
|
2022-12-10 13:20:39 -05:00
|
|
|
}
|
2021-09-06 15:08:16 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2021-09-06 22:01:12 -04:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-12-04 11:53:48 -05:00
|
|
|
* @brief MultiverseWindow::openContextMenu
|
2021-09-06 22:01:12 -04:00
|
|
|
* @param pos
|
|
|
|
*/
|
2022-12-04 11:53:48 -05:00
|
|
|
void MultiverseWindow::openContextMenu(const QPoint &pos)
|
2021-09-06 22:01:12 -04:00
|
|
|
{
|
2022-12-04 11:30:49 -05:00
|
|
|
auto menu = new QMenu(ui->multiverseView);
|
|
|
|
menu->setAttribute(Qt::WA_DeleteOnClose, true);
|
2021-09-06 22:01:12 -04:00
|
|
|
|
2021-09-08 09:40:27 -04:00
|
|
|
auto globalpos = ui->multiverseView->mapToGlobal(pos);
|
2022-12-04 20:44:36 -05:00
|
|
|
auto data = ui->multiverseView->indexAt(pos).data(Qt::EditRole);
|
2021-09-06 22:01:12 -04:00
|
|
|
|
|
|
|
if (data.metaType().id() == qMetaTypeId<QSacnUniverse*>())
|
2022-12-04 20:44:36 -05:00
|
|
|
{ // Data universes:
|
2022-12-04 11:30:49 -05:00
|
|
|
menu->addAction(ui->actionInspect);
|
|
|
|
menu->addSeparator();
|
2021-09-06 22:01:12 -04:00
|
|
|
auto univ = data.value<QSacnUniverse*>();
|
|
|
|
if (univ->isEditable())
|
2022-12-04 11:30:49 -05:00
|
|
|
menu->addAction(ui->actionTerminate);
|
2021-09-06 22:01:12 -04:00
|
|
|
else
|
2022-12-04 11:30:49 -05:00
|
|
|
menu->addAction(ui->actionUnsubscribe);
|
|
|
|
menu->popup(globalpos);
|
2021-09-06 22:01:12 -04:00
|
|
|
}
|
2022-12-04 20:44:36 -05:00
|
|
|
else if (data.metaType().id() ==
|
2021-09-08 09:40:27 -04:00
|
|
|
qMetaTypeId<sACN::EXTENDED::DISCOVERY::discoveredUniverse*>())
|
2022-12-04 20:44:36 -05:00
|
|
|
{ // Discovery universes:
|
2022-12-04 11:30:49 -05:00
|
|
|
menu->addAction(ui->actionSubscribe);
|
|
|
|
menu->popup(globalpos);
|
2021-09-06 22:01:12 -04:00
|
|
|
}
|
2022-12-04 20:44:36 -05:00
|
|
|
else
|
|
|
|
// unknow metaType
|
|
|
|
menu->deleteLater();
|
2021-09-06 22:01:12 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-12-04 11:53:48 -05:00
|
|
|
* @brief MultiverseWindow::openUniverseEditor
|
2021-09-06 22:01:12 -04:00
|
|
|
* @param index
|
|
|
|
*/
|
2022-12-04 11:53:48 -05:00
|
|
|
void MultiverseWindow::openUniverseEditor(const QModelIndex &index)
|
2021-09-06 22:01:12 -04:00
|
|
|
{
|
2021-09-08 09:40:27 -04:00
|
|
|
auto data = index.data(Qt::EditRole);
|
2021-09-06 22:01:12 -04:00
|
|
|
|
2021-09-08 09:40:27 -04:00
|
|
|
// Data universes:
|
2021-09-06 22:01:12 -04:00
|
|
|
if (data.metaType().id() == qMetaTypeId<QSacnUniverse*>())
|
|
|
|
{
|
|
|
|
auto univ = data.value<QSacnUniverse*>();
|
2022-12-03 11:04:00 -05:00
|
|
|
foreach (const auto & inspector, mInspectors)
|
2023-04-16 11:51:11 -04:00
|
|
|
if (inspector->universe() == univ->get())
|
2022-12-03 11:09:44 -05:00
|
|
|
return inspector->show();
|
2023-04-16 11:51:11 -04:00
|
|
|
auto view = new UniverseWindow(nullptr, univ->get());
|
2022-12-03 11:04:00 -05:00
|
|
|
mInspectors.insert(view);
|
|
|
|
connect(view, &QObject::destroyed, this, [this, view](){mInspectors.remove(view);});
|
2022-12-03 11:04:17 -05:00
|
|
|
connect(univ, &QObject::destroyed, view, &QMainWindow::close);
|
2023-04-16 11:51:11 -04:00
|
|
|
view->setWindowTitle(QString("%1 '%2' : "+tr("Universe")+" %3").arg(
|
|
|
|
univ->isEditable() ? tr("Editing") : tr("Viewing"),
|
|
|
|
univ->sourceName(),
|
|
|
|
QString::number(univ->number())));
|
2022-12-03 11:04:00 -05:00
|
|
|
view->setAttribute(Qt::WA_DeleteOnClose, true);
|
|
|
|
view->show();
|
|
|
|
return;
|
2021-09-06 22:01:12 -04:00
|
|
|
}
|
|
|
|
|
2021-09-08 09:40:27 -04:00
|
|
|
// Discovery universes:
|
2021-09-06 22:01:12 -04:00
|
|
|
if (data.metaType().id() ==
|
|
|
|
qMetaTypeId<sACN::EXTENDED::DISCOVERY::discoveredUniverse*>())
|
|
|
|
{
|
|
|
|
auto disc = data.value<sACN::EXTENDED::DISCOVERY::discoveredUniverse*>();
|
2022-12-04 11:53:12 -05:00
|
|
|
auto dialog = new AddUniverseDialog(this, disc->universe);
|
2022-12-04 11:56:12 -05:00
|
|
|
connect(dialog, &AddUniverseDialog::submit,
|
2021-09-06 22:01:12 -04:00
|
|
|
node, &QSacnNode::subscribe);
|
2022-12-04 11:53:12 -05:00
|
|
|
dialog->setWindowTitle(tr("Create"));
|
2022-12-04 11:30:49 -05:00
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
dialog->open();
|
2022-12-03 11:04:00 -05:00
|
|
|
return;
|
2021-09-06 22:01:12 -04:00
|
|
|
}
|
|
|
|
}
|
2022-11-19 15:47:51 -05:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-12-04 11:53:48 -05:00
|
|
|
* @brief MultiverseWindow::openUacnEditor
|
2022-11-19 15:47:51 -05:00
|
|
|
*/
|
2022-12-04 11:53:48 -05:00
|
|
|
void MultiverseWindow::openUacnEditor()
|
2022-11-19 15:47:51 -05:00
|
|
|
{
|
|
|
|
auto editor = new LineEditDialog(this, "Name", 63,
|
2022-11-19 15:56:59 -05:00
|
|
|
node->userName().c_str(), node->fixedName().c_str());
|
2022-11-19 15:47:51 -05:00
|
|
|
connect(editor, &LineEditDialog::submit,
|
2022-12-04 12:05:58 -05:00
|
|
|
this, [&](const QString name) {node->assignUserName(name.toStdString());});
|
2022-12-04 11:30:49 -05:00
|
|
|
editor->setWindowTitle("User Assigned Component Name");
|
|
|
|
editor->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
editor->open();
|
2022-11-19 15:47:51 -05:00
|
|
|
}
|