Skip to content

Commit 16f2ddd

Browse files
committed
Toast fixed / added
1 parent f534d1e commit 16f2ddd

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

FetchXmlBuilder/DockControls/AiChatControl.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ internal static void PromptToUseForFree(PluginControlBase tool)
217217
internal void AllMetadataLoadedChanged(bool allLoaded)
218218
{
219219
metadataavailable = allLoaded;
220-
txtAiChat.Text = allLoaded ? string.Empty : "Please wait until all metadata is loaded before asking the AI chat.\nWe need to be able to provide some metadata (NO data!) to solve the issue more correctly.";
220+
txtAiChat.Text = allLoaded ? string.Empty : $"Please wait until all metadata is loaded before asking the AI chat.{Environment.NewLine}We need to be able to provide some metadata (NO data!) to solve the issue more correctly.";
221221
EnableButtons();
222222
}
223223

@@ -382,6 +382,16 @@ private void HandlingResponseFromAi(ChatResponse response)
382382
txtUsage.Text = chatHistory?.Responses?.UsageToString() ?? "?";
383383
EnableButtons();
384384
txtAiChat.Focus();
385+
if (!fxb.IsShownAndActive())
386+
{
387+
ToastHelper.ToastIt(
388+
fxb,
389+
$"AiChatControl",
390+
$"FetchXML Builder AI Chat has answered!",
391+
$"{provider} {model} was thinking in {callingstopwatch.Elapsed.ToSmartString()}.\n\nClick to read my thoughts!",
392+
response.Text,
393+
logo: "https://rappen.github.io/Tools/Images/Robot100.png");
394+
}
385395
}
386396

387397
[Description("Executes FetchXML Query")]

FetchXmlBuilder/FXBQueries.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,11 +367,13 @@ internal void HandleRetrieveMultipleResult(object result)
367367
{
368368
if (!this.IsShownAndActive())
369369
{
370+
var entitylogicalname = queryinfo.Results.EntityName;
371+
var entitydisplayname = GetEntity(entitylogicalname)?.ToDisplayName() ?? entitylogicalname;
370372
ToastHelper.ToastIt(
371373
this,
372374
$"result-{settings.ExecuteOptions.ResultOutput}",
373375
$"FetchXML Builder executed.",
374-
$"Retrieved {queryinfo.Results.Entities.Count} records\nin {queryinfo.Elapsed.ToSmartString()}.\n\nClick to see result!",
376+
$"Retrieved {queryinfo.Results.Entities.Count} {entitydisplayname} records\nin {queryinfo.Elapsed.ToSmartString()}.\n\nClick to see the results!",
375377
logo: "https://rappen.github.io/Tools/Images/FXB150.png");
376378
}
377379
switch (settings.ExecuteOptions.ResultOutput)

0 commit comments

Comments
 (0)