소스 검색

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 년 전
부모
커밋
c4a5a8e7e7
1개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7
    3
      pd-buddy-gtk.py

+ 7
- 3
pd-buddy-gtk.py 파일 보기

@@ -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

Loading…
취소
저장