Selaa lähdekoodia

Show empty config when device has no config

Before, we showed the contents of tmpcfg when the device had no
configuration.  This caused some problems when the device was erased,
then opened in the GUI: the contents of tmpcfg were still displayed
despite the device having no configuration, which was confusing.  Now
empty configuration is shown in this case.
Clara Hobbs 7 vuotta sitten
vanhempi
commit
c4a5a8e7e7
1 muutettua tiedostoa jossa 7 lisäystä ja 3 poistoa
  1. 7
    3
      pd-buddy-gtk.py

+ 7
- 3
pd-buddy-gtk.py Näytä tiedosto

180
                 try:
180
                 try:
181
                     pdbs.load()
181
                     pdbs.load()
182
                 except KeyError:
182
                 except KeyError:
183
-                    # If there's no configuration, we don't want to fail
184
-                    pass
185
-                self.cfg = pdbs.get_tmpcfg()
183
+                    # If there's no configuration, we don't want to fail.  We
184
+                    # do want to display no configuration though
185
+                    self.cfg = pdbuddy.SinkConfig(
186
+                            status=pdbuddy.SinkStatus.VALID,
187
+                            flags=pdbuddy.SinkFlags.NONE, v=0, i=0)
188
+                else:
189
+                    self.cfg = pdbs.get_tmpcfg()
186
         except OSError as e:
190
         except OSError as e:
187
             comms_error_dialog(window, e)
191
             comms_error_dialog(window, e)
188
             return
192
             return

Loading…
Peruuta
Tallenna