Browse Source

Added a dialog for the Source_Capabilities

It's a simple GtkMessageDialog with the text returned by the
`get_source_cap` command.  Nothing fancy, but it works great.

Great, that is, except for the bug I found in the Python library.  Off
to go fix that!
Clara Hobbs 6 years ago
parent
commit
9d2ab8e8b2
1 changed files with 12 additions and 1 deletions
  1. 12
    1
      pd-buddy-gtk.py

+ 12
- 1
pd-buddy-gtk.py View File

@@ -336,8 +336,19 @@ class Handler:
336 336
         # Get the source capabilities
337 337
         with pdbuddy.Sink(self.serial_port) as pdbs:
338 338
             caps = pdbs.get_source_cap()
339
+            s = ""
339 340
             for i, cap in enumerate(caps):
340
-                print("PDO {}: {}".format(i+1, cap))
341
+                s += "PDO {}: {}\n".format(i+1, cap)
342
+            flags = Gtk.DialogFlags.DESTROY_WITH_PARENT;
343
+            window = self.builder.get_object("pdb-window")
344
+            dialog = Gtk.MessageDialog(window,
345
+                             flags,
346
+                             Gtk.MessageType.INFO,
347
+                             Gtk.ButtonsType.CLOSE,
348
+                             None)
349
+            dialog.set_markup("<span font_family='monospace'>{}</span>".format(s[:-1]))
350
+            dialog.run()
351
+            dialog.destroy()
341 352
 
342 353
 
343 354
 class Application(Gtk.Application):

Loading…
Cancel
Save