summaryrefslogtreecommitdiff
path: root/extra/source/wicd/wicd.netentry_curses.py.save.settings.patch
blob: 512a467a0b64e072a384970f19b9583d5551e4d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- ./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'))
         )