Browse Source

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 years ago
parent
commit
55b5a5067e
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      pd-buddy-gtk.py

+ 6
- 2
pd-buddy-gtk.py View File

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

Loading…
Cancel
Save