slackware-current/extra/source/wicd/wicd.netentry_curses.py.save.settings.patch

32 lines
1.1 KiB
Diff
Raw Normal View History

--- ./curses/netentry_curses.py.orig 2018-03-15 12:02:07.569646094 -0500
+++ ./curses/netentry_curses.py 2018-03-15 12:03:15.711650457 -0500
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python2
"""
netentry_curses -- everyone's favorite networks settings dialogs... in text
form!
@@ -538,12 +538,16 @@
self.bitrates = wireless.GetAvailableBitrates()
self.bitrates.append('auto')
self.bitrate_combo.set_list(self.bitrates)
- if wireless.GetWirelessProperty(networkID, 'bitrate'):
- self.bitrate_combo.set_focus(
- self.bitrates.index(
- wireless.GetWirelessProperty(networkID, 'bitrate')
- )
- )
+
+ # bitrate property is sometimes None
+ chosen_bitrate = wireless.GetWirelessProperty(networkID, 'bitrate')
+ if chosen_bitrate not in self.bitrates:
+ chosen_bitrate = 'auto'
+
+ self.bitrate_combo.set_focus(
+ self.bitrates.index(chosen_bitrate)
+ )
+
self.allow_lower_bitrates_chkbox.set_state(
to_bool(self.format_entry(networkID, 'allow_lower_bitrates'))
)