Skip to content

Commit d8772e1

Browse files
committed
Fix dialog
1 parent 4dfe45a commit d8772e1

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

src/Interface/Application/Subnetworks.cc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void NetworkEditor::setupPortHolder(const std::vector<SharedPointer<PortDescript
163163

164164
for (const auto& port : ports)
165165
{
166-
auto portRepl = new SubnetOutputPortWidget(QString::fromStdString(port->get_portname()),
166+
auto portRepl = new SubnetOutputPortWidget(QString::fromStdString(port->get_portname()),
167167
to_color(PortColorLookup::toColor(port->get_typename()), 230), port->get_typename());
168168
layout->addWidget(portRepl);
169169

@@ -172,7 +172,7 @@ void NetworkEditor::setupPortHolder(const std::vector<SharedPointer<PortDescript
172172

173173
portRewiringMap_[port->id().toString()]->addSubnetCompanion(portRepl);
174174
}
175-
175+
176176
portsBridge->setLayout(layout);
177177

178178
auto proxy = new QGraphicsProxyWidget;
@@ -364,18 +364,21 @@ void NetworkEditor::makeSubnetwork()
364364

365365
bool ok;
366366
auto name = QInputDialog::getText(nullptr, "Make subnet", "Enter subnet name:", QLineEdit::Normal, "subnet", &ok);
367-
if (!ok || name.isEmpty())
367+
if (!ok)
368+
return;
369+
370+
if (name.isEmpty())
368371
{
369372
QMessageBox::information(this, "Make subnetwork", "Invalid name.");
370373
return;
371374
}
372-
375+
373376
if (currentSubnetNames_.contains(name))
374377
{
375378
QMessageBox::information(this, "Make subnetwork", "A subnet by that name already exists.");
376379
return;
377380
}
378-
381+
379382
if (underlyingModules.empty())
380383
{
381384
QMessageBox::information(this, "Make subnetwork", "Please select at least one module.");
@@ -414,9 +417,9 @@ class SubnetModuleFactory : public Modules::Factory::HardCodedModuleFactory
414417
{
415418
auto portToReplicate = ports.second;
416419
auto id = addSubnetToId(portToReplicate);
417-
418-
qDebug() << "port being replicated" << id.toString().c_str() <<
419-
portToReplicate->id().toString().c_str() <<
420+
421+
qDebug() << "port being replicated" << id.toString().c_str() <<
422+
portToReplicate->id().toString().c_str() <<
420423
portToReplicate->getUnderlyingModuleId().id_.c_str();
421424

422425
map_[id.toString()] = conn;
@@ -428,7 +431,7 @@ class SubnetModuleFactory : public Modules::Factory::HardCodedModuleFactory
428431
{
429432
auto portToReplicate = ports.first;
430433
auto id = addSubnetToId(portToReplicate);
431-
434+
432435
//qDebug() << "port being replicated" << id.toString().c_str() <<
433436
// portToReplicate->id().toString().c_str() <<
434437
// portToReplicate->getUnderlyingModuleId().id_.c_str();
@@ -453,7 +456,7 @@ class SubnetModuleFactory : public Modules::Factory::HardCodedModuleFactory
453456

454457
const PortRewiringMap& getMap() const
455458
{
456-
return map_;
459+
return map_;
457460
}
458461
private:
459462
mutable PortRewiringMap map_;

0 commit comments

Comments
 (0)