Skip to content

Commit

Permalink
Launch editor help using documentation provider
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed May 16, 2023
1 parent 7f5c4d4 commit a998d10
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Bonsai.Editor/EditorForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace Bonsai.Editor
public partial class EditorForm : Form
{
const float DefaultEditorScale = 1.0f;
const string EditorUid = "editor";
const string BonsaiExtension = ".bonsai";
const string BonsaiPackageName = "Bonsai";
const string ExtensionsDirectory = "Extensions";
Expand Down Expand Up @@ -2323,7 +2324,7 @@ private async Task OpenDocumentationAsync(string assemblyName, string uid)
var categoryName = GetPackageDisplayName(uid.Substring(0, nameSeparator));
editorControl.ExpandWebView(label: $"{name} ({categoryName})");
}
else editorControl.ExpandWebView(label: uid);
else editorControl.ExpandWebView(label: uid == EditorUid ? Resources.Editor_HelpLabel : uid);
}
else EditorDialog.OpenUrl(url);
}
Expand Down Expand Up @@ -2388,7 +2389,8 @@ private async void docsToolStripMenuItem_Click(object sender, EventArgs e)
}
}

EditorDialog.ShowDocs();
var editorAssemblyName = GetType().Assembly.GetName().Name;
await OpenDocumentationAsync(editorAssemblyName, EditorUid);
}

private void forumToolStripMenuItem_Click(object sender, EventArgs e)
Expand Down
9 changes: 9 additions & 0 deletions Bonsai.Editor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Bonsai.Editor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,7 @@ NOTE: You will have to restart Bonsai for any changes to take effect.</value>
<data name="SubjectDefinitionNotFound_Error" xml:space="preserve">
<value>The specified subject definition could not be found.</value>
</data>
<data name="Editor_HelpLabel" xml:space="preserve">
<value>Help</value>
</data>
</root>

0 comments on commit a998d10

Please sign in to comment.