From 540c009e2642d72c7832e4e8e3188ac2465f2a88 Mon Sep 17 00:00:00 2001 From: Odotocodot <48138990+Odotocodot@users.noreply.github.com> Date: Wed, 11 Jun 2025 22:18:52 +0100 Subject: [PATCH] Add context menu item to open new OneNote window See #28 --- Changelog.md | 4 ++++ Flow.Launcher.Plugin.OneNote/ResultCreator.cs | 15 +++++++++++++-- Flow.Launcher.Plugin.OneNote/plugin.json | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 2031a04..32ddd3c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## 2.1.2 - 2025-6-11 + +- Added the ability to open items in a new OneNote window using the context menu.([#28](https://github.com/Odotocodot/Flow.Launcher.Plugin.OneNote/issues/28)) + ## 2.1.1 - 2025-1-4 ### Changes diff --git a/Flow.Launcher.Plugin.OneNote/ResultCreator.cs b/Flow.Launcher.Plugin.OneNote/ResultCreator.cs index 11e813e..4824b43 100644 --- a/Flow.Launcher.Plugin.OneNote/ResultCreator.cs +++ b/Flow.Launcher.Plugin.OneNote/ResultCreator.cs @@ -395,18 +395,29 @@ public List ContextMenu(Result selectedResult) result.SubTitle = string.Empty; result.ContextData = null; results.Add(result); + results.Add(new Result + { + Title = "Open in new OneNote window", + IcoPath = IconProvider.Logo, + Action = _ => + { + OneNoteApplication.ComObject.NavigateTo(item.ID, fNewWindow: true); + WindowHelper.FocusOneNote(); + return true; + } + }); if (item is not OneNotePage) { results.Add(new Result { - Title = "Show in Notebook Explorer", + Title = "Copy Notebook Explorer path to clipboard", SubTitle = result.AutoCompleteText, Score = - 1000, IcoPath = iconProvider.NotebookExplorer, Action = _ => { - context.API.ChangeQuery(result.AutoCompleteText); + context.API.CopyToClipboard(result.AutoCompleteText); return false; } }); diff --git a/Flow.Launcher.Plugin.OneNote/plugin.json b/Flow.Launcher.Plugin.OneNote/plugin.json index 6f657d0..5abc2eb 100644 --- a/Flow.Launcher.Plugin.OneNote/plugin.json +++ b/Flow.Launcher.Plugin.OneNote/plugin.json @@ -4,7 +4,7 @@ "Name": "OneNote", "Description": "Search and create your OneNote notes", "Author": "Odotocodot", - "Version": "2.1.1", + "Version": "2.1.2", "Language": "csharp", "Website": "https://github.com/Odotocodot/Flow.Launcher.Plugin.OneNote", "IcoPath": "Images/logo.png",