Skip to content

Commit

Permalink
Fixing log names, tips to View Designers users
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Aug 24, 2022
1 parent 1ec9d11 commit 3bbf61e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions FetchXmlBuilder/FXBGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ private void OpenView()
View = viewselector.View;
dockControlBuilder.Init(View["fetchxml"].ToString(), View["layoutxml"].ToString(), "open view", false);
attributesChecksum = dockControlBuilder.GetAttributesSignature();
LogUse("OpenView");
LogUse($"OpenView-{(View.LogicalName == "savedquery" ? "S" : "P")}");
}
else
{
Expand Down Expand Up @@ -706,7 +706,7 @@ private void SaveView(bool saveas)
{
Service.Update(newView);
}
LogUse("SaveView");
LogUse($"SaveView{(newView.Contains("layoutxml") ? "Layout" : "")}-{(newView.LogicalName == "savedquery" ? "S" : "P")}");
if (newView.LogicalName == "savedquery")
{
var pubRequest = new PublishXmlRequest();
Expand Down
13 changes: 11 additions & 2 deletions FetchXmlBuilder/FXBInterfaces.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ public void OnIncomingMessage(MessageBusEventArgs message)
tsbReturnToCaller.ToolTipText = "Return " + requestedType + " to " + callerArgs.SourcePlugin;
dockControlBuilder.RecordHistory("called from " + message.SourcePlugin);
LogUse("CalledBy." + callerArgs.SourcePlugin);
if (callerArgs.SourcePlugin == "View Designer" && !connectionsettings.TipsAgainstOrViewDesignerToolShown)
{
if (MessageBox.Show("Did you know you can work with the layouts too in the FetchXML Builder?\nClick the Help button to see how!\n\nDon't show again.",
"Called from View Designer", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2, 0,
Utils.ProcessURL("https://jonasr.app/fxb-layout/")) == DialogResult.OK)
{
connectionsettings.TipsAgainstOrViewDesignerToolShown = true;
}
}
EnableControls(true);
}

Expand Down Expand Up @@ -138,7 +147,7 @@ public void ReceivePreviewKeyDownShortcut(PreviewKeyDownEventArgs e)

public void ShowAboutDialog()
{
LogUse("OpenAbout");
LogUse("ShowAbout");
var about = new About();
about.StartPosition = FormStartPosition.CenterParent;
about.lblVersion.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();
Expand All @@ -148,7 +157,7 @@ public void ShowAboutDialog()
public void ShowSettings()
{
var settingDlg = new Forms.Settings(this);
LogUse("OpenOptions");
LogUse("ShowOptions");
if (settingDlg.ShowDialog(this) == DialogResult.OK)
{
LogUse("SaveOptions");
Expand Down
4 changes: 1 addition & 3 deletions FetchXmlBuilder/FXBQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ internal void LoadViews(Action viewsLoaded)
internal void QueryExpressionToFetchXml(string query)
{
working = true;
LogUse("QueryExpressionToFetchXml");
WorkAsync(new WorkAsyncInfo("Translating QueryExpression to FetchXML...",
(eventargs) =>
{
Expand Down Expand Up @@ -258,7 +257,6 @@ private Entity GetCWPFeed(string feedid)
private void RetrieveMultiple(string fetch)
{
working = true;
LogUse("RetrieveMultiple-" + settings.Results.ResultOutput.ToString());
SendMessageToStatusBar(this, new StatusBarMessageEventArgs("Retrieving..."));
tsbAbort.Enabled = true;
WorkAsync(new WorkAsyncInfo
Expand Down Expand Up @@ -330,7 +328,7 @@ private void RetrieveMultiple(string fetch)
SendMessageToStatusBar(this, new StatusBarMessageEventArgs($"Retrieved {resultCollection.Entities.Count} records on {pageinfo} in {duration.TotalSeconds:F2} seconds"));
}
while (!eventargs.Cancel && settings.Results.RetrieveAllPages && (query is QueryExpression || query is FetchExpression) && tmpResult.MoreRecords);
LogUse("RetrieveMultiple", false, resultCollection?.Entities?.Count, (DateTime.Now - start).TotalMilliseconds);
LogUse($"RetrieveMultiple-{settings.Results.ResultOutput}", false, resultCollection?.Entities?.Count, (DateTime.Now - start).TotalMilliseconds);
if (settings.Results.ResultOutput == ResultOutput.JSON)
{
var json = EntityCollectionSerializer.ToJSONComplex(resultCollection, Formatting.Indented);
Expand Down
4 changes: 2 additions & 2 deletions FetchXmlBuilder/FetchXmlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ private void tsbClone_Click(object sender, EventArgs e)
{
var query = dockControlBuilder.GetFetchString(false, false);
var newconnection = sender == tsmiCloneNewConnection;
LogUse(newconnection ? "Clone-Connect" : "Clone");
LogUse(newconnection ? "Clone-Connection" : "Clone");
DuplicateRequested?.Invoke(this, new DuplicateToolArgs(query, newconnection));
}

Expand All @@ -585,7 +585,7 @@ private void tsbNew_Click(object sender, EventArgs e)
return;
}
var newconnection = sender == tsmiNewNewConnection;
LogUse(newconnection ? "New-NewConnection" : "New-New");
LogUse(newconnection ? "New-New-Connection" : "New-New");
DuplicateRequested?.Invoke(this, new DuplicateToolArgs(settings.QueryOptions.NewQueryTemplate, newconnection));
}

Expand Down
1 change: 1 addition & 0 deletions FetchXmlBuilder/Settings/FXBConnectionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class FXBConnectionSettings
public ShowMetaTypesAttribute ShowAttributes { get; set; } = new ShowMetaTypesAttribute();
public string FetchXML { get; set; } = QueryOptions.DefaultNewQuery;
public string LayoutXML { get; set; }
public bool TipsAgainstOrViewDesignerToolShown { get; set; }
}

public class QueryOptions
Expand Down

0 comments on commit 3bbf61e

Please sign in to comment.