Discussion:
Review Request: enable additional addresses even on DHCP
Ilia Kats
2011-04-20 22:44:30 UTC
Permalink
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101165/
-----------------------------------------------------------

Review request for Network Management.


Summary
-------

This is supported by NetworkManager, so let's add it to KDE. This patch also cleans up libs/ui/802_11_wirelesswidget.cpp (use enums instead of hardcoded values)


This addresses bug 249016.
http://bugs.kde.org/show_bug.cgi?id=249016


Diffs
-----

libs/ui/802_11_wirelesswidget.cpp cb103d2
libs/ui/ipv4widget.cpp 732a94e

Diff: http://git.reviewboard.kde.org/r/101165/diff


Testing
-------


Thanks,

Ilia

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-networkmanager/attachments/20110420/03dfd37e/attachment.htm
Ilia Kats
2011-04-20 23:35:03 UTC
Permalink
Post by Ilia Kats
This review has been submitted with commit ab05f9a030eab2f19af25ea7a535c56d14ce66e6 by Lamarque V. Souza.
Can't figure out how to update the diff, it keeps saying "revision xxx not found". Anyway, improved handling of switch from manual to DHCP: instead of just being greyed out, the address is pushed to additional addresses, the fields in the main ip widget are then cleared:

diff --git a/libs/ui/ipv4widget.cpp b/libs/ui/ipv4widget.cpp
index 1509084..2af67c4 100644
--- a/libs/ui/ipv4widget.cpp
+++ b/libs/ui/ipv4widget.cpp
@@ -311,10 +311,31 @@ void IpV4Widget::methodChanged(int currentIndex)
advancedSettingsPartEnabled = false;
}

- if (!addressPartEnabled && !advancedSettingsPartEnabled) {
+ if (!addressPartEnabled && advancedSettingsPartEnabled)
+ {
+ QList<Solid::Control::IPv4Address> addresses = d->ui.advancedSettings->additionalAddresses();
+ QNetworkAddressEntry entry;
+ // we need to set up IP before prefix/netmask manipulation
+ entry.setIp(QHostAddress(d->ui.address->text()));
+ entry.setNetmask(QHostAddress(d->ui.netMask->text()));
+
+ QHostAddress gateway(d->ui.gateway->text());
+ if (entry.ip() != QHostAddress::Null)
+ {
+ Solid::Control::IPv4Address addr(entry.ip().toIPv4Address(),
+ entry.prefixLength(), gateway.toIPv4Address());
+ addresses.prepend(addr);
+ }
+ d->ui.advancedSettings->setAdditionalAddresses(addresses);
+ }
+ if (!addressPartEnabled)
+ {
d->ui.address->clear();
d->ui.netMask->clear();
d->ui.gateway->clear();
+ }
+ if (!advancedSettingsPartEnabled)
+ {
d->ui.advancedSettings->setAdditionalAddresses(QList<Solid::Control::IPv4Address>());
}


- Ilia


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101165/#review2782
-----------------------------------------------------------
Post by Ilia Kats
-----------------------------------------------------------
http://git.reviewboard.kde.org/r/101165/
-----------------------------------------------------------
(Updated April 20, 2011, 10:44 p.m.)
Review request for Network Management.
Summary
-------
This is supported by NetworkManager, so let's add it to KDE. This patch also cleans up libs/ui/802_11_wirelesswidget.cpp (use enums instead of hardcoded values)
This addresses bug 249016.
http://bugs.kde.org/show_bug.cgi?id=249016
Diffs
-----
libs/ui/802_11_wirelesswidget.cpp cb103d2
libs/ui/ipv4widget.cpp 732a94e
Diff: http://git.reviewboard.kde.org/r/101165/diff
Testing
-------
Thanks,
Ilia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-networkmanager/attachments/20110420/0c2e6a9f/attachment.html
Lamarque Vieira Souza
2011-04-20 23:50:40 UTC
Permalink
Post by Ilia Kats
Post by Ilia Kats
This review has been submitted with commit
ab05f9a030eab2f19af25ea7a535c56d14ce66e6 by Lamarque V. Souza.
Can't figure out how to update the diff, it keeps saying "revision xxx not
found". Anyway, improved handling of switch from manual to DHCP: instead
of just being greyed out, the address is pushed to additional addresses,
Well, I guess it is because I already submitted the patch :-) I think I
am going to fast in commiting patches hehehe. I have just commited the change
Post by Ilia Kats
diff --git a/libs/ui/ipv4widget.cpp b/libs/ui/ipv4widget.cpp
index 1509084..2af67c4 100644
--- a/libs/ui/ipv4widget.cpp
+++ b/libs/ui/ipv4widget.cpp
@@ -311,10 +311,31 @@ void IpV4Widget::methodChanged(int currentIndex)
advancedSettingsPartEnabled = false;
}
- if (!addressPartEnabled && !advancedSettingsPartEnabled) {
+ if (!addressPartEnabled && advancedSettingsPartEnabled)
+ {
+ QList<Solid::Control::IPv4Address> addresses =
d->ui.advancedSettings->additionalAddresses(); +
QNetworkAddressEntry entry;
+ // we need to set up IP before prefix/netmask manipulation
+ entry.setIp(QHostAddress(d->ui.address->text()));
+ entry.setNetmask(QHostAddress(d->ui.netMask->text()));
+
+ QHostAddress gateway(d->ui.gateway->text());
+ if (entry.ip() != QHostAddress::Null)
+ {
+ Solid::Control::IPv4Address addr(entry.ip().toIPv4Address(),
+ entry.prefixLength(),
gateway.toIPv4Address()); + addresses.prepend(addr);
+ }
+ d->ui.advancedSettings->setAdditionalAddresses(addresses);
+ }
+ if (!addressPartEnabled)
+ {
d->ui.address->clear();
d->ui.netMask->clear();
d->ui.gateway->clear();
+ }
+ if (!advancedSettingsPartEnabled)
+ {
d->ui.advancedSettings->setAdditionalAddresses(QList<Solid::Control::IPv4A
ddress>()); }
- Ilia
-----------------------------------------------------------
http://git.reviewboard.kde.org/r/101165/#review2782
-----------------------------------------------------------
Post by Ilia Kats
-----------------------------------------------------------
http://git.reviewboard.kde.org/r/101165/
-----------------------------------------------------------
(Updated April 20, 2011, 10:44 p.m.)
Review request for Network Management.
Summary
-------
This is supported by NetworkManager, so let's add it to KDE. This patch
also cleans up libs/ui/802_11_wirelesswidget.cpp (use enums instead of
hardcoded values)
This addresses bug 249016.
http://bugs.kde.org/show_bug.cgi?id=249016
Diffs
-----
libs/ui/802_11_wirelesswidget.cpp cb103d2
libs/ui/ipv4widget.cpp 732a94e
Diff: http://git.reviewboard.kde.org/r/101165/diff
Testing
-------
Thanks,
Ilia
--
Lamarque V. Souza
http://www.geographicguide.com/brazil.htm
Linux User #57137 - http://counter.li.org/
http://planetkde.org/pt-br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-networkmanager/attachments/20110420/28c29da2/attachment-0001.htm
Commit Hook
2011-04-20 23:16:20 UTC
Permalink
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101165/#review2782
-----------------------------------------------------------


This review has been submitted with commit ab05f9a030eab2f19af25ea7a535c56d14ce66e6 by Lamarque V. Souza.

- Commit
Post by Ilia Kats
-----------------------------------------------------------
http://git.reviewboard.kde.org/r/101165/
-----------------------------------------------------------
(Updated April 20, 2011, 10:44 p.m.)
Review request for Network Management.
Summary
-------
This is supported by NetworkManager, so let's add it to KDE. This patch also cleans up libs/ui/802_11_wirelesswidget.cpp (use enums instead of hardcoded values)
This addresses bug 249016.
http://bugs.kde.org/show_bug.cgi?id=249016
Diffs
-----
libs/ui/802_11_wirelesswidget.cpp cb103d2
libs/ui/ipv4widget.cpp 732a94e
Diff: http://git.reviewboard.kde.org/r/101165/diff
Testing
-------
Thanks,
Ilia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-networkmanager/attachments/20110420/1e564df3/attachment.htm
Commit Hook
2011-04-20 23:16:18 UTC
Permalink
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101165/#review2781
-----------------------------------------------------------


This review has been submitted with commit 4a9703177ff67d5c531551a9dca467dce2621818 by Lamarque V. Souza.

- Commit
Post by Ilia Kats
-----------------------------------------------------------
http://git.reviewboard.kde.org/r/101165/
-----------------------------------------------------------
(Updated April 20, 2011, 10:44 p.m.)
Review request for Network Management.
Summary
-------
This is supported by NetworkManager, so let's add it to KDE. This patch also cleans up libs/ui/802_11_wirelesswidget.cpp (use enums instead of hardcoded values)
This addresses bug 249016.
http://bugs.kde.org/show_bug.cgi?id=249016
Diffs
-----
libs/ui/802_11_wirelesswidget.cpp cb103d2
libs/ui/ipv4widget.cpp 732a94e
Diff: http://git.reviewboard.kde.org/r/101165/diff
Testing
-------
Thanks,
Ilia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-networkmanager/attachments/20110420/95927d68/attachment.htm
Lamarque Vieira Souza
2011-05-01 09:51:41 UTC
Permalink
Post by Ilia Kats
Post by Commit Hook
This review has been submitted with commit 4a9703177ff67d5c531551a9dca467dce2621818 by Lamarque V. Souza.
This patch was already submitted. Please close this review request.


- Lamarque Vieira


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/101165/#review2781
-----------------------------------------------------------
Post by Ilia Kats
-----------------------------------------------------------
http://git.reviewboard.kde.org/r/101165/
-----------------------------------------------------------
(Updated April 20, 2011, 10:44 p.m.)
Review request for Network Management.
Summary
-------
This is supported by NetworkManager, so let's add it to KDE. This patch also cleans up libs/ui/802_11_wirelesswidget.cpp (use enums instead of hardcoded values)
This addresses bug 249016.
http://bugs.kde.org/show_bug.cgi?id=249016
Diffs
-----
libs/ui/802_11_wirelesswidget.cpp cb103d2
libs/ui/ipv4widget.cpp 732a94e
Diff: http://git.reviewboard.kde.org/r/101165/diff
Testing
-------
Thanks,
Ilia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-networkmanager/attachments/20110501/6d3d3fe1/attachment.htm
Loading...