IPv6 and NetworkIPv6 dialogs load and save netmask as bit length

This commit is contained in:
Vadim Kurland
2008-05-20 03:37:23 +00:00
parent 64f2fe4478
commit 6f85e0c6c2
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -116,7 +116,8 @@ void IPv6Dialog::loadFWObject(FWObject *o)
try try
{ {
if ( Interface::isA( obj->getParent() ) ) if ( Interface::isA( obj->getParent() ) )
m_dialog->netmask->setText(s->getNetmaskPtr()->toString().c_str()); m_dialog->netmask->setText( QString("%1").arg(
s->getNetmaskPtr()->getLength()) );
} catch (FWException &ex) {} } catch (FWException &ex) {}
//apply->setEnabled( false ); //apply->setEnabled( false );
@@ -214,8 +215,7 @@ void IPv6Dialog::applyChanges()
{ {
try try
{ {
s->setNetmask( s->setNetmask(Inet6Addr(m_dialog->netmask->text().toShort()) );
Inet6Addr(m_dialog->netmask->text().toLatin1().constData()) );
} catch (FWException &ex) { } } catch (FWException &ex) { }
} else } else
s->setNetmask(Inet6Addr()); s->setNetmask(Inet6Addr());
+1 -1
View File
@@ -166,7 +166,7 @@ void NetworkDialogIPv6::applyChanges()
s->setAddress( s->setAddress(
Inet6Addr(m_dialog->address->text().toLatin1().constData()) ); Inet6Addr(m_dialog->address->text().toLatin1().constData()) );
s->setNetmask( s->setNetmask(
Inet6Addr(m_dialog->netmask->text().toLatin1().constData()) ); Inet6Addr(m_dialog->netmask->text().toShort()) );
} catch (FWException &ex) } catch (FWException &ex)
{ {
/* exception thrown if user types illegal m_dialog->address or /* exception thrown if user types illegal m_dialog->address or