Pārlūkot izejas kodu

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 gadus atpakaļ
vecāks
revīzija
c4a5a8e7e7
1 mainītis faili ar 7 papildinājumiem un 3 dzēšanām
  1. 7
    3
      pd-buddy-gtk.py

+ 7
- 3
pd-buddy-gtk.py Parādīt failu

@@ -180,9 +180,13 @@ class Handler:
180 180
                 try:
181 181
                     pdbs.load()
182 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 190
         except OSError as e:
187 191
             comms_error_dialog(window, e)
188 192
             return

Notiek ielāde…
Atcelt
Saglabāt