浏览代码

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

正在加载...
取消
保存