Skip to content

Commit 8f493a9

Browse files
authored
Merge pull request #77 from leochan2009/master
Extend the current IF Module to be able to create user specified mrmlnode based on meta information
2 parents 5c36b6e + ab300fd commit 8f493a9

35 files changed

Lines changed: 1480 additions & 1201 deletions

GUI/qSlicerIGTLConnectorPropertyWidget.cxx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ void qSlicerIGTLConnectorPropertyWidgetPrivate::init()
5151
q, SLOT(updateIGTLConnectorNode()));
5252
QObject::connect(&this->ConnectorTypeButtonGroup, SIGNAL(buttonClicked(int)),
5353
q, SLOT(updateIGTLConnectorNode()));
54+
QObject::connect(this->UseProtocolV2CheckBox, SIGNAL(toggled(bool)),
55+
q, SLOT(updateIGTLConnectorNode()));
5456

5557
this->ConnectorNotDefinedRadioButton->setVisible(false);
5658
this->ConnectorTypeButtonGroup.addButton(this->ConnectorNotDefinedRadioButton, vtkMRMLIGTLConnectorNode::TYPE_NOT_DEFINED);
@@ -119,6 +121,12 @@ void setTypeEnabled(qSlicerIGTLConnectorPropertyWidgetPrivate * d, bool enabled)
119121
d->ConnectorClientRadioButton->setEnabled(enabled);
120122
}
121123

124+
//------------------------------------------------------------------------------
125+
void setUseProtocolV2Enabled(qSlicerIGTLConnectorPropertyWidgetPrivate * d, bool enabled)
126+
{
127+
d->UseProtocolV2CheckBox->setEnabled(enabled);
128+
}
129+
122130
//------------------------------------------------------------------------------
123131
void setStateEnabled(qSlicerIGTLConnectorPropertyWidgetPrivate * d, bool enabled)
124132
{
@@ -156,6 +164,7 @@ void qSlicerIGTLConnectorPropertyWidget::onMRMLNodeModified()
156164
d->ConnectorNotDefinedRadioButton->setChecked(type == vtkMRMLIGTLConnectorNode::TYPE_NOT_DEFINED);
157165
d->ConnectorServerRadioButton->setChecked(type == vtkMRMLIGTLConnectorNode::TYPE_SERVER);
158166
d->ConnectorClientRadioButton->setChecked(type == vtkMRMLIGTLConnectorNode::TYPE_CLIENT);
167+
d->UseProtocolV2CheckBox->setChecked(d->IGTLConnectorNode->GetUseProtocolV2());
159168

160169
setStateEnabled(d, type != vtkMRMLIGTLConnectorNode::TYPE_NOT_DEFINED);
161170

@@ -164,13 +173,15 @@ void qSlicerIGTLConnectorPropertyWidget::onMRMLNodeModified()
164173
{
165174
setNameEnabled(d, true);
166175
setTypeEnabled(d, true);
176+
setUseProtocolV2Enabled(d, true);
167177
setHostnameEnabled(d, type == vtkMRMLIGTLConnectorNode::TYPE_CLIENT);
168178
setPortEnabled(d, type != vtkMRMLIGTLConnectorNode::TYPE_NOT_DEFINED);
169179
}
170180
else
171181
{
172182
setNameEnabled(d, false);
173183
setTypeEnabled(d, false);
184+
setUseProtocolV2Enabled(d, false);
174185
setHostnameEnabled(d, false);
175186
setPortEnabled(d, false);
176187
}
@@ -209,7 +220,7 @@ void qSlicerIGTLConnectorPropertyWidget::updateIGTLConnectorNode()
209220
vtkMRMLIGTLConnectorNode::PERSISTENT_ON :
210221
vtkMRMLIGTLConnectorNode::PERSISTENT_OFF);
211222
d->IGTLConnectorNode->SetLogErrorIfServerConnectionFailed(d->LogConnectionErrorCheckBox->isChecked());
212-
223+
d->IGTLConnectorNode->SetUseProtocolV2(d->UseProtocolV2CheckBox->isChecked());
213224
d->IGTLConnectorNode->DisableModifiedEventOff();
214225
d->IGTLConnectorNode->InvokePendingModifiedEvent();
215226
}

0 commit comments

Comments
 (0)