Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
Use IPv4AddrValidator for IPv4 protocol config UI
Browse files Browse the repository at this point in the history
  • Loading branch information
pstavirs committed Jul 17, 2023
1 parent 268fad0 commit 3bcd31a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
24 changes: 0 additions & 24 deletions common/ip4.ui
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ Length (x4)</string>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="leIpSrcAddr" >
<property name="inputMask" >
<string>009.009.009.009; </string>
</property>
<property name="text" >
<string>...</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
Expand Down Expand Up @@ -264,12 +258,6 @@ Length (x4)</string>
<property name="enabled" >
<bool>false</bool>
</property>
<property name="inputMask" >
<string>009.009.009.009; </string>
</property>
<property name="text" >
<string>...</string>
</property>
</widget>
</item>
<item row="2" column="0" >
Expand All @@ -281,12 +269,6 @@ Length (x4)</string>
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="leIpDstAddr" >
<property name="inputMask" >
<string>000.000.000.000; </string>
</property>
<property name="text" >
<string>...</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
Expand Down Expand Up @@ -331,12 +313,6 @@ Length (x4)</string>
<property name="enabled" >
<bool>false</bool>
</property>
<property name="inputMask" >
<string>009.009.009.009; </string>
</property>
<property name="text" >
<string>...</string>
</property>
</widget>
</item>
</layout>
Expand Down
5 changes: 5 additions & 0 deletions common/ip4config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>

#include "ip4config.h"
#include "ip4.h"
#include "ipv4addressvalidator.h"

#include <QHostAddress>

Expand All @@ -30,6 +31,10 @@ Ip4ConfigForm::Ip4ConfigForm(QWidget *parent)
leIpVersion->setValidator(new QIntValidator(0, 15, this));
leIpOptions->setValidator(new QRegExpValidator(QRegExp("[0-9a-fA-F]*"),
this));
leIpSrcAddr->setValidator(new IPv4AddressValidator(this));
leIpSrcAddrMask->setValidator(new IPv4AddressValidator(this));
leIpDstAddr->setValidator(new IPv4AddressValidator(this));
leIpDstAddrMask->setValidator(new IPv4AddressValidator(this));

connect(cmbIpSrcAddrMode, SIGNAL(currentIndexChanged(int)),
this, SLOT(on_cmbIpSrcAddrMode_currentIndexChanged(int)));
Expand Down

0 comments on commit 3bcd31a

Please sign in to comment.