IdentityActionRow.vala 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. using Gtk;
  2. using Adw;
  3. namespace Publicate {
  4. private class IdentityActionRow : ActionRow {
  5. private Gtk.Window toplevel;
  6. public Ppub.CollectionMemberCredentials creds;
  7. public Pprf.MemberIdentity? identity;
  8. public IdentityActionRow(Gtk.Window window, Ppub.CollectionMemberCredentials credentials, Pprf.MemberIdentity? identity, string? name) {
  9. toplevel = window;
  10. creds = credentials;
  11. this.identity = identity;
  12. if(identity != null) {
  13. title = identity.name;
  14. }
  15. else {
  16. title = name;
  17. }
  18. subtitle = credentials.get_public_keys().to_string();
  19. var copy_key_button = new Gtk.Button.from_icon_name ("edit-copy-symbolic");
  20. copy_key_button.valign = Align.CENTER;
  21. copy_key_button.clicked.connect (() => get_clipboard ().set_text(subtitle));
  22. copy_key_button.tooltip_text = "Copy the public key of this identity";
  23. add_suffix (copy_key_button);
  24. }
  25. }
  26. }