Device Emulation (contd.): Inform user that src/dst mac resolve requires a corresponding device

This commit is contained in:
Srivats P 2016-03-18 19:23:26 +05:30
parent 72bab2737f
commit c3fe9b0334
2 changed files with 25 additions and 3 deletions

View File

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>391</width>
<height>116</height>
<width>400</width>
<height>200</height>
</rect>
</property>
<property name="windowTitle" >
@ -178,7 +178,17 @@
</property>
</widget>
</item>
<item row="3" column="0" >
<item row="3" column="0" colspan="5" >
<widget class="QLabel" name="resolveInfo" >
<property name="text" >
<string>Please ensure that a corresponding device is configured on the port to enable source/destination mac address resolution. A corresponding device is one which has VLANs and source/gateway IP corresponding to this stream.</string>
</property>
<property name="wordWrap" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>

View File

@ -28,6 +28,12 @@ MacConfigForm::MacConfigForm(QWidget *parent)
QRegExp reMac("([0-9,a-f,A-F]{2,2}[:-]){5,5}[0-9,a-f,A-F]{2,2}");
setupUi(this);
resolveInfo->hide();
#if 0
// not working for some reason
resolveInfo->setPixmap(resolveInfo->style()->standardIcon(
QStyle::SP_MessageBoxInformation).pixmap(128));
#endif
leDstMac->setValidator(new QRegExpValidator(reMac, this));
leSrcMac->setValidator(new QRegExpValidator(reMac, this));
leDstMacCount->setValidator(new QIntValidator(1, MAX_MAC_ITER_COUNT, this));
@ -63,6 +69,9 @@ void MacConfigForm::on_cmbDstMacMode_currentIndexChanged(int index)
leDstMacStep->setEnabled(true);
break;
}
resolveInfo->setVisible(
cmbDstMacMode->currentIndex() == OstProto::Mac::e_mm_resolve
|| cmbSrcMacMode->currentIndex() == OstProto::Mac::e_mm_resolve);
}
void MacConfigForm::on_cmbSrcMacMode_currentIndexChanged(int index)
@ -84,6 +93,9 @@ void MacConfigForm::on_cmbSrcMacMode_currentIndexChanged(int index)
leSrcMacStep->setEnabled(true);
break;
}
resolveInfo->setVisible(
cmbDstMacMode->currentIndex() == OstProto::Mac::e_mm_resolve
|| cmbSrcMacMode->currentIndex() == OstProto::Mac::e_mm_resolve);
}
void MacConfigForm::loadWidget(AbstractProtocol *proto)