diff --git a/MareSynchronos/UI/GroupPanel.cs b/MareSynchronos/UI/GroupPanel.cs index 0e3dc40..b5dfb17 100644 --- a/MareSynchronos/UI/GroupPanel.cs +++ b/MareSynchronos/UI/GroupPanel.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Numerics; +using System.Text; namespace MareSynchronos.UI { @@ -280,8 +281,8 @@ namespace MareSynchronos.UI ImGui.Separator(); foreach (var pair in pairsInGroup) { - UiShared.DrawWithID(group.GID + pair.UserUID, () => DrawSyncshellPairedClient(pair, - string.Equals(group.OwnedBy, _apiController.UID, StringComparison.Ordinal), + UiShared.DrawWithID(group.GID + pair.UserUID, () => DrawSyncshellPairedClient(pair, + string.Equals(group.OwnedBy, _apiController.UID, StringComparison.Ordinal), group.IsModerator ?? false, group?.IsPaused ?? false)); } @@ -329,6 +330,24 @@ namespace MareSynchronos.UI } UiShared.AttachToolTip("Copy Syncshell ID to Clipboard"); + if (UiShared.IconTextButton(FontAwesomeIcon.UserSecret, "Copy Notes")) + { + var entries = _apiController.GroupPairedClients.Where(p => string.Equals(p.GroupGID, entry.GID, StringComparison.Ordinal)); + var comments = _configuration.GetCurrentServerUidComments(); + StringBuilder sb = new(); + sb.AppendLine("##MARE_SYNCHRONOS_USER_NOTES_START##"); + foreach (var userEntry in entries) + { + if (comments.TryGetValue(userEntry.UserUID, out var comment)) + { + sb.AppendLine(userEntry.UserUID + ":\"" + comment + "\""); + } + } + sb.AppendLine("##MARE_SYNCHRONOS_USER_NOTES_END##"); + ImGui.SetClipboardText(sb.ToString()); + } + UiShared.AttachToolTip("Copies all your notes for all users in this Syncshell to the clipboard"); + if (isOwner || (entry.IsModerator ?? false)) { ImGui.Separator();