mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 20:07:21 +01:00
add copy user notes to clipboard
This commit is contained in:
parent
a4ab7daffc
commit
3fe6d430e3
1 changed files with 21 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
|
||||
namespace MareSynchronos.UI
|
||||
{
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue