Re: [PATCH] Say we are unable to configure the network interface (#467960)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





David Cantrell wrote:
In stage 2 when you get the 'Enable network interface' dialog, if
you select an interface that is not able to connect to a network,
we just wait and then take the user back to the Enable network
interface dialog.  Before going back to the dialog, tell the user
we were unable to configure the selected interface.
---
 iw/netconfig_dialog.py  |   24 +++++++++++++++++-------
 textw/netconfig_text.py |    2 ++
 2 files changed, 19 insertions(+), 7 deletions(-)


Looks good to me,

Regards,

Hans

diff --git a/iw/netconfig_dialog.py b/iw/netconfig_dialog.py
index 5eac64d..6a8bdc7 100644
--- a/iw/netconfig_dialog.py
+++ b/iw/netconfig_dialog.py
@@ -188,10 +188,23 @@ class NetworkConfigurator:
         d.run()
         d.destroy()
+ def _handleNetworkError(self, field):
+        d = gtk.MessageDialog(None, 0, gtk.MESSAGE_ERROR,
+                              gtk.BUTTONS_OK,
+                              _("An error occurred trying to bring up the "
+                                "%s network interface.") % (field,))
+        d.set_title(_("Error Configuring Network"))
+        d.set_position(gtk.WIN_POS_CENTER)
+        gui.addFrame(d)
+        d.run()
+        d.destroy()
+
     def _cancel(self, *args):
         self.rc = gtk.RESPONSE_CANCEL
def _ok(self, *args):
+        self.rc = gtk.RESPONSE_OK
+        haveNet = False
         combo = self.xml.get_widget("interfaceCombo")
         active = combo.get_active_iter()
         val = combo.get_model().get_value(active, 1)
@@ -205,9 +218,8 @@ class NetworkConfigurator:
             w = gui.WaitWindow(_("Dynamic IP"),
                                _("Sending request for IP information "
                                  "for %s...") % (netdev.get('DEVICE'),))
-            self.network.bringUp()
+            haveNet = self.network.bringUp()
             w.pop()
-            self.rc = gtk.RESPONSE_OK
         else:
             netdev.set(('BOOTPROTO', 'static'))
             ipv4addr = self.xml.get_widget("ipv4Address").get_text()
@@ -271,7 +283,7 @@ class NetworkConfigurator:
                 return False
try:
-                self.network.bringUp()
+                haveNet = self.network.bringUp()
             except Exception, e:
                 import logging
                 log = logging.getLogger("anaconda")
@@ -279,10 +291,8 @@ class NetworkConfigurator:
                 self._handleIPError(_("Error configuring network device:"), e)
                 return False
- if self.rc != gtk.RESPONSE_OK:
-            gui.MessageWindow(_("Error"),
-                              _("Error configuring network device"),
-                              type = "ok", custom_icon="error")
+        if not haveNet:
+            self._handleNetworkError(netdev.get('DEVICE'))
             return False
return True
diff --git a/textw/netconfig_text.py b/textw/netconfig_text.py
index 433f5d8..6a92782 100644
--- a/textw/netconfig_text.py
+++ b/textw/netconfig_text.py
@@ -266,6 +266,8 @@ class NetworkConfiguratorText:
             w.pop()
             if result:
                 break
+            else:
+                 self.anaconda.intf.messageWindow(_("Error"), _("Error configuring network device"), _("Error configuring network device %s") % netdev.get('DEVICE'))
self.screen.popWindow()
         return INSTALL_OK

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux