浏览代码

Produce better output with no capabilities

Instead of making a little empty dialog, now we make a dialog that says
a helpful message.
Clara Hobbs 7 年前
父节点
当前提交
55b5a5067e
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6
    2
      pd-buddy-gtk.py

+ 6
- 2
pd-buddy-gtk.py 查看文件

@@ -338,7 +338,11 @@ class Handler:
338 338
             caps = pdbs.get_source_cap()
339 339
             s = ""
340 340
             for i, cap in enumerate(caps):
341
-                s += "PDO {}: {}\n".format(i+1, cap)
341
+                s += "PDO {}: {}".format(i+1, cap)
342
+                if i < len(caps) - 1:
343
+                    s += "\n"
344
+            if not s:
345
+                s = "No Source_Capabilities"
342 346
             flags = Gtk.DialogFlags.DESTROY_WITH_PARENT;
343 347
             window = self.builder.get_object("pdb-window")
344 348
             dialog = Gtk.MessageDialog(window,
@@ -346,7 +350,7 @@ class Handler:
346 350
                              Gtk.MessageType.INFO,
347 351
                              Gtk.ButtonsType.CLOSE,
348 352
                              None)
349
-            dialog.set_markup("<span font_family='monospace'>{}</span>".format(s[:-1]))
353
+            dialog.set_markup("<span font_family='monospace'>{}</span>".format(s))
350 354
             dialog.run()
351 355
             dialog.destroy()
352 356
 

正在加载...
取消
保存