From 40b5b047a9c2269a8067b572ffbb4fed4328421d Mon Sep 17 00:00:00 2001 From: Odotocodot <48138990+Odotocodot@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:50:00 +0100 Subject: [PATCH 01/39] Change submodule to nuget package --- .gitmodules | 4 --- .../Flow.Launcher.Plugin.OneNote.csproj | 5 +--- Flow.Launcher.Plugin.OneNote/Main.cs | 2 +- Flow.Launcher.Plugin.OneNote/ResultCreator.cs | 26 +++++++++---------- Flow.Launcher.Plugin.OneNote/SearchManager.cs | 4 +-- Odotocodot.OneNote.Linq | 1 - 6 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 .gitmodules delete mode 160000 Odotocodot.OneNote.Linq diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index c957232..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "Odotocodot.OneNote.Linq"] - path = Odotocodot.OneNote.Linq - url = https://github.com/Odotocodot/Odotocodot.OneNote.Linq - branch = flow-plugin diff --git a/Flow.Launcher.Plugin.OneNote/Flow.Launcher.Plugin.OneNote.csproj b/Flow.Launcher.Plugin.OneNote/Flow.Launcher.Plugin.OneNote.csproj index d40de89..cd15ad6 100644 --- a/Flow.Launcher.Plugin.OneNote/Flow.Launcher.Plugin.OneNote.csproj +++ b/Flow.Launcher.Plugin.OneNote/Flow.Launcher.Plugin.OneNote.csproj @@ -27,6 +27,7 @@ + @@ -35,8 +36,4 @@ Always - - - - diff --git a/Flow.Launcher.Plugin.OneNote/Main.cs b/Flow.Launcher.Plugin.OneNote/Main.cs index 1e4f456..7a854a5 100644 --- a/Flow.Launcher.Plugin.OneNote/Main.cs +++ b/Flow.Launcher.Plugin.OneNote/Main.cs @@ -38,7 +38,7 @@ private static async Task OneNoteInitAsync(CancellationToken token = default) return; await semaphore.WaitAsync(token); - OneNoteApplication.Init(); + OneNoteApplication.InitComObject(); semaphore.Release(); } public async Task> QueryAsync(Query query, CancellationToken token) diff --git a/Flow.Launcher.Plugin.OneNote/ResultCreator.cs b/Flow.Launcher.Plugin.OneNote/ResultCreator.cs index 5c9258b..c3a7cdd 100644 --- a/Flow.Launcher.Plugin.OneNote/ResultCreator.cs +++ b/Flow.Launcher.Plugin.OneNote/ResultCreator.cs @@ -20,7 +20,7 @@ public ResultCreator(PluginInitContext context, Settings settings) private static string GetNicePath(IOneNoteItem item, bool includeSelf = true, string separator = PathSeparator) { - return item.RelativePath.Replace(OneNoteParser.RelativePathSeparator.ToString(), separator); + return item.RelativePath.Replace(OneNoteApplication.RelativePathSeparator.ToString(), separator); } private string GetTitle(IOneNoteItem item, List highlightData) @@ -139,7 +139,7 @@ public static Result CreateNewPageResult(string pageTitle, OneNoteSection sectio IcoPath = Icons.NewPage, Action = c => { - OneNoteApplication.CreatePage(section, pageTitle); + OneNoteApplication.CreatePage(section, pageTitle, true); return true; } }; @@ -148,14 +148,14 @@ public static Result CreateNewPageResult(string pageTitle, OneNoteSection sectio public Result CreateNewSectionResult(string sectionTitle, IOneNoteItem parent) { sectionTitle = sectionTitle.Trim(); - bool validTitle = OneNoteParser.IsSectionNameValid(sectionTitle); + bool validTitle = OneNoteApplication.IsSectionNameValid(sectionTitle); return new Result { Title = $"Create section: \"{sectionTitle}\"", SubTitle = validTitle ? $"Path: {GetNicePath(parent, true)} > {sectionTitle}" - : $"Section names cannot contain: {string.Join(' ', OneNoteParser.InvalidSectionChars)}", + : $"Section names cannot contain: {string.Join(' ', OneNoteApplication.InvalidSectionChars)}", IcoPath = Icons.NewSection, Action = c => { @@ -165,10 +165,10 @@ public Result CreateNewSectionResult(string sectionTitle, IOneNoteItem parent) switch (parent) { case OneNoteNotebook notebook: - OneNoteApplication.CreateSection(notebook, sectionTitle); + OneNoteApplication.CreateSection(notebook, sectionTitle, true); break; case OneNoteSectionGroup sectionGroup: - OneNoteApplication.CreateSection(sectionGroup, sectionTitle); + OneNoteApplication.CreateSection(sectionGroup, sectionTitle, true); break; default: break; @@ -183,14 +183,14 @@ public Result CreateNewSectionResult(string sectionTitle, IOneNoteItem parent) public Result CreateNewSectionGroupResult(string sectionGroupTitle, IOneNoteItem parent) { sectionGroupTitle = sectionGroupTitle.Trim(); - bool validTitle = OneNoteParser.IsSectionGroupNameValid(sectionGroupTitle); + bool validTitle = OneNoteApplication.IsSectionGroupNameValid(sectionGroupTitle); return new Result { Title = $"Create section group: \"{sectionGroupTitle}\"", SubTitle = validTitle ? $"Path: {GetNicePath(parent, true)} > {sectionGroupTitle}" - : $"Section group names cannot contain: {string.Join(' ', OneNoteParser.InvalidSectionGroupChars)}", + : $"Section group names cannot contain: {string.Join(' ', OneNoteApplication.InvalidSectionGroupChars)}", IcoPath = Icons.NewSectionGroup, Action = c => { @@ -200,10 +200,10 @@ public Result CreateNewSectionGroupResult(string sectionGroupTitle, IOneNoteItem switch (parent) { case OneNoteNotebook notebook: - OneNoteApplication.CreateSectionGroup(notebook, sectionGroupTitle); + OneNoteApplication.CreateSectionGroup(notebook, sectionGroupTitle, true); break; case OneNoteSectionGroup sectionGroup: - OneNoteApplication.CreateSectionGroup(sectionGroup, sectionGroupTitle); + OneNoteApplication.CreateSectionGroup(sectionGroup, sectionGroupTitle, true); break; default: break; @@ -218,21 +218,21 @@ public Result CreateNewSectionGroupResult(string sectionGroupTitle, IOneNoteItem public Result CreateNewNotebookResult(string notebookTitle) { notebookTitle = notebookTitle.Trim(); - bool validTitle = OneNoteParser.IsNotebookNameValid(notebookTitle); + bool validTitle = OneNoteApplication.IsNotebookNameValid(notebookTitle); return new Result { Title = $"Create notebook: \"{notebookTitle}\"", SubTitle = validTitle ? $"Location: {OneNoteApplication.GetDefaultNotebookLocation()}" - : $"Notebook names cannot contain: {string.Join(' ', OneNoteParser.InvalidNotebookChars)}", + : $"Notebook names cannot contain: {string.Join(' ', OneNoteApplication.InvalidNotebookChars)}", IcoPath = Icons.NewNotebook, Action = c => { if (!validTitle) return false; - OneNoteApplication.CreateNotebook(notebookTitle); + OneNoteApplication.CreateNotebook(notebookTitle, true); context.API.ChangeQuery(context.CurrentPluginMetadata.ActionKeyword); return true; diff --git a/Flow.Launcher.Plugin.OneNote/SearchManager.cs b/Flow.Launcher.Plugin.OneNote/SearchManager.cs index 1862b25..cb8c93e 100644 --- a/Flow.Launcher.Plugin.OneNote/SearchManager.cs +++ b/Flow.Launcher.Plugin.OneNote/SearchManager.cs @@ -145,7 +145,7 @@ private List ScopedSearch(string query, IOneNoteItem parent) string currentSearch = query[settings.Keywords.TitleSearch.Length..]; var results = new List(); - results = OneNoteApplication.FindPages(parent, currentSearch) + results = OneNoteApplication.FindPages(currentSearch, parent) .Select(pg => rc.CreatePageResult(pg, currentSearch)) .ToList(); @@ -220,7 +220,7 @@ public List EmptyQuery() Score = -4000, Action = c => { - OneNoteApplication.CreateQuickNote(); + OneNoteApplication.CreateQuickNote(true); return true; } }, diff --git a/Odotocodot.OneNote.Linq b/Odotocodot.OneNote.Linq deleted file mode 160000 index f1cf1d0..0000000 --- a/Odotocodot.OneNote.Linq +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f1cf1d0204b43a7d982a9ea580a3945d23c6be12 From 9d09d21a7a0cb9901015b09a9208ee0b0cdba283 Mon Sep 17 00:00:00 2001 From: Odotocodot <48138990+Odotocodot@users.noreply.github.com> Date: Tue, 5 Dec 2023 11:13:37 +0000 Subject: [PATCH 02/39] Update ResultCreator.cs --- Flow.Launcher.Plugin.OneNote/ResultCreator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Plugin.OneNote/ResultCreator.cs b/Flow.Launcher.Plugin.OneNote/ResultCreator.cs index c3a7cdd..83f41be 100644 --- a/Flow.Launcher.Plugin.OneNote/ResultCreator.cs +++ b/Flow.Launcher.Plugin.OneNote/ResultCreator.cs @@ -135,7 +135,7 @@ public static Result CreateNewPageResult(string pageTitle, OneNoteSection sectio return new Result { Title = $"Create page: \"{pageTitle}\"", - SubTitle = $"Path: {GetNicePath(section, true)} > {pageTitle}", + SubTitle = $"Path: {GetNicePath(section, true)}{PathSeparator}{pageTitle}", IcoPath = Icons.NewPage, Action = c => { @@ -154,7 +154,7 @@ public Result CreateNewSectionResult(string sectionTitle, IOneNoteItem parent) { Title = $"Create section: \"{sectionTitle}\"", SubTitle = validTitle - ? $"Path: {GetNicePath(parent, true)} > {sectionTitle}" + ? $"Path: {GetNicePath(parent, true)}{PathSeparator}{sectionTitle}" : $"Section names cannot contain: {string.Join(' ', OneNoteApplication.InvalidSectionChars)}", IcoPath = Icons.NewSection, Action = c => @@ -189,7 +189,7 @@ public Result CreateNewSectionGroupResult(string sectionGroupTitle, IOneNoteItem { Title = $"Create section group: \"{sectionGroupTitle}\"", SubTitle = validTitle - ? $"Path: {GetNicePath(parent, true)} > {sectionGroupTitle}" + ? $"Path: {GetNicePath(parent, true)}{PathSeparator}{sectionGroupTitle}" : $"Section group names cannot contain: {string.Join(' ', OneNoteApplication.InvalidSectionGroupChars)}", IcoPath = Icons.NewSectionGroup, Action = c => From e91068dc503842a29fa1bac6abd0013b37b2d42a Mon Sep 17 00:00:00 2001 From: Odotocodot <48138990+Odotocodot@users.noreply.github.com> Date: Fri, 24 May 2024 17:05:01 +0100 Subject: [PATCH 03/39] Add and Update Icons Refactored icon generation Refactored ResultCreator.cs --- Flow.Launcher.Plugin.OneNote/Icons.cs | 211 ++++++++--- .../Images/notebook.color.png | Bin 0 -> 663 bytes .../Images/notebook.dark.png | Bin 0 -> 498 bytes .../Images/notebook.light.png | Bin 0 -> 452 bytes .../Images/notebook_explorer.color.png | Bin 0 -> 1603 bytes .../Images/notebook_explorer.dark.png | Bin 0 -> 924 bytes .../Images/notebook_explorer.light.png | Bin 0 -> 830 bytes .../Images/notebook_new.color.png | Bin 0 -> 882 bytes .../Images/notebook_new.dark.png | Bin 0 -> 558 bytes .../Images/notebook_new.light.png | Bin 0 -> 524 bytes .../Images/page.color.png | Bin 0 -> 759 bytes .../Images/page.dark.png | Bin 0 -> 458 bytes .../Images/page.light.png | Bin 0 -> 426 bytes .../Images/page_new.color.png | Bin 0 -> 972 bytes .../Images/page_new.dark.png | Bin 0 -> 625 bytes .../Images/page_new.light.png | Bin 0 -> 565 bytes .../Images/page_recent.color.png | Bin 0 -> 2087 bytes .../Images/page_recent.dark.png | Bin 0 -> 1138 bytes .../Images/page_recent.light.png | Bin 0 -> 1095 bytes .../Images/recycle_bin.color.png | Bin 0 -> 1603 bytes .../Images/recycle_bin.dark.png | Bin 0 -> 1111 bytes .../Images/recycle_bin.light.png | Bin 0 -> 1003 bytes .../Images/search.color.png | Bin 0 -> 1933 bytes .../Images/search.dark.png | Bin 0 -> 885 bytes .../Images/search.light.png | Bin 0 -> 811 bytes .../Images/section.color.png | Bin 0 -> 679 bytes .../Images/section.dark.png | Bin 0 -> 433 bytes .../Images/section.light.png | Bin 0 -> 408 bytes .../Images/section_group.color.png | Bin 0 -> 1084 bytes .../Images/section_group.dark.png | Bin 0 -> 677 bytes .../Images/section_group.light.png | Bin 0 -> 642 bytes .../Images/section_group_new.color.png | Bin 0 -> 1294 bytes .../Images/section_group_new.dark.png | Bin 0 -> 731 bytes .../Images/section_group_new.light.png | Bin 0 -> 660 bytes .../Images/section_new.color.png | Bin 0 -> 784 bytes .../Images/section_new.dark.png | Bin 0 -> 640 bytes .../Images/section_new.light.png | Bin 0 -> 547 bytes .../Images/sync.color.png | Bin 0 -> 1835 bytes .../Images/sync.dark.png | Bin 0 -> 984 bytes .../Images/sync.light.png | Bin 0 -> 826 bytes .../Images/warning.dark.png | Bin 0 -> 1462 bytes .../Images/warning.light.png | Bin 0 -> 1557 bytes Flow.Launcher.Plugin.OneNote/PluginTheme.cs | 14 + Flow.Launcher.Plugin.OneNote/ResultCreator.cs | 354 +++++++++++++----- Flow.Launcher.Plugin.OneNote/Settings.cs | 2 + .../UI/ViewModels/SettingsViewModel.cs | 9 +- .../UI/Views/SettingsView.xaml | 70 ++-- .../UI/Views/SettingsView.xaml.cs | 18 +- 48 files changed, 475 insertions(+), 203 deletions(-) create mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook_explorer.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook_explorer.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook_explorer.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook_new.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook_new.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook_new.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/page.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/page.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/page.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/page_new.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/page_new.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/page_new.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/page_recent.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/page_recent.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/page_recent.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/recycle_bin.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/recycle_bin.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/recycle_bin.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/search.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/search.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/search.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_group.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_group.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_group.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_group_new.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_group_new.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_group_new.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_new.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_new.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_new.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/sync.color.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/sync.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/sync.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/warning.dark.png create mode 100644 Flow.Launcher.Plugin.OneNote/Images/warning.light.png create mode 100644 Flow.Launcher.Plugin.OneNote/PluginTheme.cs diff --git a/Flow.Launcher.Plugin.OneNote/Icons.cs b/Flow.Launcher.Plugin.OneNote/Icons.cs index e118d92..ddf10b1 100644 --- a/Flow.Launcher.Plugin.OneNote/Icons.cs +++ b/Flow.Launcher.Plugin.OneNote/Icons.cs @@ -1,37 +1,67 @@ using Odotocodot.OneNote.Linq; using System; +using System.Collections.Concurrent; using System.IO; +using System.Linq; +using System.Windows; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using Color = System.Drawing.Color; namespace Flow.Launcher.Plugin.OneNote { - public class Icons : BaseModel + public class Icons// : BaseModel { + public const string Logo = "Images/logo.png"; - public const string Sync = "Images/refresh.png"; - public const string Warning = "Images/warning.png"; - public const string Search = Logo; - public const string RecycleBin = "Images/recycle_bin.png"; - public const string Recent = "Images/recent.png"; - public const string RecentPage = "Images/recent_page.png"; - - public const string Page = Logo; - public const string Section = "Images/section.png"; - public const string SectionGroup = "Images/section_group.png"; - public const string Notebook = "Images/notebook.png"; - - public const string NewPage = "Images/new_page.png"; - public const string NewSection = "Images/new_section.png"; - public const string NewSectionGroup = "Images/new_section_group.png"; - public const string NewNotebook = "Images/new_notebook.png"; - - private OneNoteItemIcons notebookIcons; - private OneNoteItemIcons sectionIcons; + + public static string Sync => GetIconLocal("sync"); + + public static string Warning => pluginTheme == PluginTheme.Color + ? $"Images/warning.{GetPluginThemeString(PluginTheme.Dark)}.png" + : GetIconLocal("warning"); + + public static string Search => GetIconLocal("search"); + //public static string RecycleBin => GetIconLocal("recycle_bin"); + public static string Recent => GetIconLocal("page_recent"); + public static string NotebookExplorer => GetIconLocal("notebook_explorer"); + public static string QuickNote => NewPage; + // public const string Page = Logo; + // public const string Section = "Images/section.png"; + // public const string SectionGroup = "Images/section_group.png"; + // public const string Notebook = "Images/notebook.png"; + public static string NewPage => GetIconLocal("page_new"); + public static string NewSection => GetIconLocal("section_new"); + public static string NewSectionGroup => GetIconLocal("section_group_new"); + public static string NewNotebook => GetIconLocal("notebook_new"); + + // private OneNoteItemIcons notebookIcons; + // private OneNoteItemIcons sectionIcons; private Settings settings; + private static PluginTheme pluginTheme; - public int CachedIconCount => notebookIcons.IconCount + sectionIcons.IconCount; - public string CachedIconsFileSize => GetBytesReadable(notebookIcons.IconsFileSize + sectionIcons.IconsFileSize); - public static string NotebookIconDirectory { get; private set; } - public static string SectionIconDirectory { get; private set; } + private static string GetPluginThemeString(PluginTheme pluginTheme) + { + if (pluginTheme == PluginTheme.System) + throw new NotImplementedException(); //TODO get the system theme return either light or dark. + return Enum.GetName(pluginTheme).ToLower(); + } + + private static string GetIconLocal(string icon) => $"Images/{icon}.{GetPluginThemeString(pluginTheme)}.png"; + + // May need this? https://stackoverflow.com/questions/21867842/concurrentdictionarys-getoradd-is-not-atomic-any-alternatives-besides-locking + private ConcurrentDictionary iconCache = new(); + private string imagesDirectory; + + public static DirectoryInfo GeneratedImagesDirectoryInfo { get; private set; } + + //TODO: Update on use UI + public int CachedIconCount => iconCache.Keys.Count(k => char.IsDigit(k.Split('.')[1][1])); + + //TODO: UPdate on use for UI + public string CachedIconsFileSize => GetCachedIconsMemorySize();//GetBytesReadable(notebookIcons.IconsFileSize + sectionIcons.IconsFileSize); + // public static string NotebookIconDirectory { get; private set; } + // public static string SectionIconDirectory { get; private set; } private static readonly Lazy lazy = new(); @@ -39,58 +69,125 @@ public class Icons : BaseModel public static void Init(PluginInitContext context, Settings settings) { - NotebookIconDirectory = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "Images", "NotebookIcons"); - SectionIconDirectory = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "Images", "SectionIcons"); - - Instance.notebookIcons = new OneNoteItemIcons(NotebookIconDirectory, Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Notebook)); - Instance.sectionIcons = new OneNoteItemIcons(SectionIconDirectory, Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Section)); - - - Instance.notebookIcons.PropertyChanged += Instance.IconCountChanged; - Instance.sectionIcons.PropertyChanged += Instance.IconCountChanged; + pluginTheme = settings.PluginTheme; + // NotebookIconDirectory = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "Images", "NotebookIcons"); + // SectionIconDirectory = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "Images", "SectionIcons"); + // + // Instance.notebookIcons = new OneNoteItemIcons(NotebookIconDirectory, Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Notebook)); + // Instance.sectionIcons = new OneNoteItemIcons(SectionIconDirectory, Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Section)); + + Instance.imagesDirectory = $"{context.CurrentPluginMetadata.PluginDirectory}/Images/"; + // Instance.GeneratedImagesDirectory = $"{context.CurrentPluginMetadata.PluginDirectory}/Images/Generated/"; + + GeneratedImagesDirectoryInfo = Directory.CreateDirectory($"{context.CurrentPluginMetadata.PluginDirectory}/Images/Generated/"); + // Instance.notebookIcons.PropertyChanged += Instance.IconCountChanged; + // Instance.sectionIcons.PropertyChanged += Instance.IconCountChanged; Instance.settings = settings; + + foreach (var image in GeneratedImagesDirectoryInfo.EnumerateFiles()) + { + Instance.iconCache.TryAdd(image.Name, BitmapImageFromPath(image.FullName)); + } } public static void Close() { - Instance.notebookIcons.PropertyChanged -= Instance.IconCountChanged; - Instance.sectionIcons.PropertyChanged -= Instance.IconCountChanged; + // Instance.notebookIcons.PropertyChanged -= Instance.IconCountChanged; + // Instance.sectionIcons.PropertyChanged -= Instance.IconCountChanged; } - private void IconCountChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + // private void IconCountChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) + // { + // OnPropertyChanged(nameof(CachedIconCount)); + // OnPropertyChanged(nameof(CachedIconsFileSize)); + // } + private static BitmapImage BitmapImageFromPath(string path) => new BitmapImage(new Uri(path)); + + public static Result.IconDelegate GetIcon(string prefix, Color? color) { - OnPropertyChanged(nameof(CachedIconCount)); - OnPropertyChanged(nameof(CachedIconsFileSize)); + return () => + { + bool generate = (string.CompareOrdinal(prefix, "notebook") == 0 + || string.CompareOrdinal(prefix, "section") == 0) + && Instance.settings.CreateColoredIcons + && color.HasValue; + + if (generate) + { + return Instance.iconCache.GetOrAdd($"{prefix}.{color.Value.ToArgb()}.png", ImageSourceFactory, + color.Value); + } + + return Instance.iconCache.GetOrAdd($"{prefix}.{GetPluginThemeString(pluginTheme)}.png", key => + { + var path = Path.Combine(Instance.imagesDirectory, key); + return BitmapImageFromPath(path); + }); + }; } - public static string GetIcon(IOneNoteItem item) + private static ImageSource ImageSourceFactory(string key, Color color) + { + var prefix = key.Split('.')[0]; + var path = Path.Combine(Instance.imagesDirectory, $"{prefix}.dark.png"); + var bitmap = BitmapImageFromPath(path); + var newBitmap = ChangeIconColor(bitmap, color); + + path = $"{GeneratedImagesDirectoryInfo.FullName}{key}"; + // https://stackoverflow.com/questions/65860129/pngbitmapencoder-failling + + using var fileStream = new FileStream(path, FileMode.Create); + var encoder = new PngBitmapEncoder(); //TODO Lazy load this and only one + encoder.Frames.Add(BitmapFrame.Create(newBitmap)); + encoder.Save(fileStream); + return newBitmap; + } + + private static BitmapSource ChangeIconColor(BitmapImage bitmapImage, Color color) { - return item switch + var writeableBitmap = new WriteableBitmap(bitmapImage); + + var stride = writeableBitmap.BackBufferStride; + var pixelHeight = writeableBitmap.PixelHeight; + + var pixelData = new byte[stride * pixelHeight]; + var bytesPerPixel = writeableBitmap.Format.BitsPerPixel / 8; + + writeableBitmap.CopyPixels(pixelData, stride, 0); + for (int j = 0; j < pixelHeight; j++) { - OneNoteNotebook notebook => Instance.settings.CreateColoredIcons && notebook.Color.HasValue - ? Instance.notebookIcons.GetIcon(notebook.Color.Value) - : Notebook, - OneNoteSectionGroup sectionGroup => sectionGroup.IsRecycleBin - ? RecycleBin - : SectionGroup, - OneNoteSection section => Instance.settings.CreateColoredIcons && section.Color.HasValue - ? Instance.sectionIcons.GetIcon(section.Color.Value) - : Section, - OneNotePage => Page, - _ => Warning, - }; + int line = j * stride; + for (int i = 0; i < stride; i += bytesPerPixel) + { + pixelData[line + i] = color.B; + pixelData[line + i + 1] = color.G; + pixelData[line + i + 2] = color.R; + } + } + writeableBitmap.WritePixels(new Int32Rect(0, 0, writeableBitmap.PixelWidth, pixelHeight), + pixelData, stride, 0); + + return writeableBitmap; } public void ClearCachedIcons() { - notebookIcons.ClearCachedIcons(); - sectionIcons.ClearCachedIcons(); + iconCache.Clear(); + foreach (var file in GeneratedImagesDirectoryInfo.EnumerateFiles()) + { + file.Delete(); + } } - // Returns the human-readable file size for an arbitrary, 64-bit file size - // The default format is "0.### XB", e.g. "4.2 KB" or "1.434 GB" - private static string GetBytesReadable(long i) + + private string GetCachedIconsMemorySize() { + var i = GeneratedImagesDirectoryInfo.EnumerateFiles() + .Select(file => file.Length) + .Aggregate(0L, (a, b) => a + b); + + // Returns the human-readable file size for an arbitrary, 64-bit file size + // The default format is "0.### XB", e.g. "4.2 KB" or "1.434 GB" // Get absolute value long absolute_i = Math.Abs(i); // Determine the suffix and readable value diff --git a/Flow.Launcher.Plugin.OneNote/Images/notebook.color.png b/Flow.Launcher.Plugin.OneNote/Images/notebook.color.png new file mode 100644 index 0000000000000000000000000000000000000000..41c09e09b43018c41c1b03d8725bbab022075a4d GIT binary patch literal 663 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=EX7WqAsj$Z!;#X#z`*3^>Eakt zG3V{({P*eglUw^dIT-k^x0$XBl0M>V zuuh4U?KkhN_^EzXyv@PqKIhL7l$d`!`Fhmd)yEmt*%>Z8ytUz2_zP``tv*2qQn?eH zrl0?JXXpQQAB`Ot`c`i#{r8O9ky&srmu?w@9M`E84h!5DZsl``z2MsImXWBEx$xw{ z$us`)7|nE6``mKh-9^@EQ{WATO9=(S3u2e+F5+Z98^q4=!*j!x2!>lsw^H_T8C1;Q z`Kf4W?b`^a7fSI_f1?X-uqpm{rp7(fT4Cjfs?>E=d1a*_FO#r_X!sT6T!xd3VgXd3?F*f7_KC zH?14a-IKBH&ga^3=E;MXC*Nu%x@XmV@^-)c=lkhL3=NL&x7#O$H~s``Mi3(3GB@1* z`_7zW!O7kuSN^j6WWL5I*08O?3@6cAEA{5MebXy0X@?t|_SCYhVP3<$h4sk>K8{5j zWF0o|6P?>w3N%3G8lz(bJ4bX(9>?5IWekDsoYI2KwM=54CZ6iO_xj-D1@W6Llm2Ps zPBuUCLm=w4-{cfwhj;%O1)j95`lGbv#@csR9~U<5=BYb>K;P3i(T(R#u#oQE>fIJx cwHM=grY_PccYgL0n9>+LUHx3vIVCg!00mqoPyhe` literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/notebook.dark.png b/Flow.Launcher.Plugin.OneNote/Images/notebook.dark.png new file mode 100644 index 0000000000000000000000000000000000000000..0b7aa0fee611f25c60dacf655283ff8f9202b28f GIT binary patch literal 498 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=EX7WqAsj$Z!;#X#z`(fD)5S5Q zV$R#y8@-qvMO@Ew|7%0cyEfFMRp@U^`o^Zv z87C**T)p}ImHe{vF=^%BbbAO+=bat%w$nd7X3V-7=eKa@?&;eC6Vj#yn``JUIwt=4#k^^9^X01T*G`de#*NTmwPV2NM!JI^>bP0l+XkKS8CPs literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/notebook.light.png b/Flow.Launcher.Plugin.OneNote/Images/notebook.light.png new file mode 100644 index 0000000000000000000000000000000000000000..243267b0a9e038b14474f76f8280db9ad2b649ea GIT binary patch literal 452 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=EX7WqAsj$Z!;#X#z`$7T>Eakt zG3V`UUoU1y0k`-j^?*f=M_Q#7XUCk@-uaz@?T@2PLowgc4ucBT*q)mlFH6kt{`Fl` z6|j5WhhK}+mT?;y7_h%qKpV4&JCThL?ry4O<}t|<$w zyT}^oQ>Xu<-zQ1TH#@qgAvg9Dla6kQLq`4FuM9qSm>g{wwl+xdD?FYhx*?(B#FiDT zA7*Uc84=_kdE7L0TfxMKI~8~6JvWsoJ+#VU-SYix&NKKQIOtwzc%b`Qc7a$%gFTCL z1%u@EIilNdoUJ@7?{AxUmub3b>%R>w?~HBCMeI4>an}j;9ApmQUh$FP3RBh@_Jl;S z519rnt$ZJv1335{bQc_hOG4ZN5;~;w;Bo>7w=9UnqUJSY$u#B{4cgqB51h*^xa+Y* z_5DWfve37jdjRayH#W}{MiOLGQtLeN(@XRCYmr~ ze1maAOiUC(jW0AAZ;Xk97ivH=!aGBWiP;A&vVb`+3$Y$yQepX81?KNEGHxD1fxa}7D7b?5;mB!mAcez z2&8fxG0qSO7bYjU*3C!FUNsLfWY5mQa>`?uKqyZsDOr?+NvTFk>R8DYASxGyBF}F) zVjWiU;6zs=`%Z$N5we13->4aJG22@-Ohy+muvgV=Vhdo_Fc-aKRWsnTk%gYR*ybgG zK#U;G5d<*U8N$0~d;t=PK#c%9%&D8sToKSXs|x_gC&5{%xdP~&fZj^`DnOtvBEy$W zoljrOWI~D5-RfBh4jo`nUEHLiv`0YLK)bR94**S_mTSDh@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)ipRci#D zq!{en0na;^A_#4?niqrT`K%24rB(~Jzqk<#P0C-aWJU@8`V4kr*e!nHY;W_r8DNn+ zs)e4i$=zp!+)Y1KC_c?5J|V)0&ZuVbgozPOso97Hco+_U1|aMI1E8V$nUOwMGZG81 z`KZ}D8Ad&UP7vTza>{WH5zxiLe8c)5D^(vr_#Z1~NaM$Bk)Qwo002ovPDHLkV1feh B_=o@i literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/notebook_explorer.dark.png b/Flow.Launcher.Plugin.OneNote/Images/notebook_explorer.dark.png new file mode 100644 index 0000000000000000000000000000000000000000..1cc20b2847d831a12f268f2f44d29bbfce8adf61 GIT binary patch literal 924 zcmV;N17rM&P)m0Cf=RnV(WYm`7jk$&Bm@qWto++(6_G z!c-8u0!bB!u0Tu$n+HG(hA9f91%Z&cAI*?=r`sh6+yN8-AejKT1~3AUAWq}}mH@6q zBzJWZO@0Aj;3ci&qX6*URfIDDGn@{2KyjJ58Vkt{PD=m)$VFu6Vkji(JDU&?5pl6Q z^PNa&a5vT@(~}G<6_(^zAcU z2zf!95%Ak*LN@e&&3(o1H$;w;PIu7@5ITX-=miL!KxmwT01p6e0DOcx6cwuh`T=0I z%Q@y{@E*WaMDAV^B-Uo=NV=hLN^eLVYuk0r(>#MP;O#v$HOuAeolL zNq#4}aq!z{+ky5S=~#?S0F(Tph5v$2MPN*Gz?F#1G=VkRf74Jv?Q9n$FJl=2cR=lv z&q-d=Xwpa~`dVIL|2Pt25g^sMPAl%+);(@2(QYgJrm+Z+8$|30ua>+ege}5`weg6NTC z`(!Z`LW`0Bbq8m_`MiM73!#GKAO-=*`cin#n$s#O;pP>7)6$^pSaRFKe%)cSCOP5r zW@w`C?Tp#=I$#AL)vfC}fZGGa{0AV3p&d4#{JDpiBeJ_YLN4ULQOybV#8`zw+mdvx@0=SU>T#jd|N$!GVrhUygnZ7qL>?dZRt_k2wo{D(t`r=bP^=G?DT@s)v`I5|n zYRC5jE0#l&*Q{O%NOnhnw&Zuh5TM?!NtT{)aPp+H0C{KuypSiI1jtFIAqDV8o@`Lu z(QO?)G`y0h-br@B8Gt)ywGM}caaj4T;{F#A`K3kri|w9(E0)fdR82#OQ7|`h_-R~! y$&)7)m!y$gR3c=oK1T8hTZ9)4dnyi%$o~grK|Ch4b4}F%0000P)^lN;-if!1>CKEkHVfBVg$2h618yYR$F8@GMS$EOVmJLR@+NE%{=Ev) z1iS2B6PULMyP6foW>%7Duz>WURt#Z3l^nqO`2l-*H%a%IXxmCXINj_os zH2gdU0WyO?VO?AG5a7Y8TM)@aXp4I)yu!WSPqa^4%MvHoWzPn|Pc1%cV8QNUXhHLz zK+Krp1bxZR4ivK>lI8FaX5{xju!YbBOA9a*c^?6CbRTk#l9Cq$K}Hy(i#{ z=RVE~nO3kea`9vw#%J$SZ=D2f-Wn8t$?p@kjD}qMydInX44FE?piV=d3 zt410Cf*O@bv0XLLt5by}lf6kcN08hYk{c(?G9ro)vZ0DKzzPPp0W@St3z39@wyHJ& zFbBb^#x+1%fHbye0S1pVdoHvOZ<^5|Xf>~T;=5qrIta&f)NeZjvL5a$SLXqseYj!9 z>+zh`RljWm4i5zqI)s#>HN54WuDYv!3~&vQ79dT7ATEtfV2QXl z8=S3=VzfnVs#^=|zidXw!!roJ-wnV)v%uZvi`qL6084cVOq{q~P%dtOoq2w(EY%gh z)Dky98rJ}60n)ezNDGk0@w>r)P3+^JKP0a@16D84#2^T5s{||sh z<};KzuNrK0js%lGve?hyM+_|LRHm6v42)COd!Qq{L%AQn0Jwhr*=UtfE&u=k07*qo IM6N<$f=~^EMgRZ+ literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/notebook_new.dark.png b/Flow.Launcher.Plugin.OneNote/Images/notebook_new.dark.png new file mode 100644 index 0000000000000000000000000000000000000000..7e45f313887ec5f14b3c948d6092cc1cfab1510f GIT binary patch literal 558 zcmV+}0@3}6P)&@wZ-6J-;$`37 z8Bl@&|L*gl4-2gmO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fkdEw9R z)(Th^PG-zuoLwWIzkA3a*nd~D@{epMIG`M|(u@O1TaS?83{1OTQ7rv?B3 literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/page_new.color.png b/Flow.Launcher.Plugin.OneNote/Images/page_new.color.png new file mode 100644 index 0000000000000000000000000000000000000000..bd209be1d453091a7dbd16ff67047be0395b9dde GIT binary patch literal 972 zcmV;-12g=IP)7j_Z8U95xatb1l=cV^Ea=K z_q?3*K0jV(&Y4{WCYor|E&#YnP-+2`aFYp8pqR{Pef-npx8UW8Q%z#u4w&K?GWjzi#gfMDt76P*C4kwx~P(OC#`14uHTcn2&* znlY(5fWy$(Q-8$cTK`o%G`whl+YsaiV9~suGpj|| zZJQ9}24KUyo-?az>{i_i%MhdnP+DAM%RC_wn^84(vu?-|gtUiq0x8eVPOWW9HaW^0 z$IHrmc9u*Tp9!n@Fgb0@d~$4GMR~9zbcXvpLFx|JzqbPQhYz5%q}aB30^$3D%DRs} z=XOGVPMl<+Dt{%a{FNI4`%j%1Lg_Q5?tom#10cEp(Mk(IfkL?~M3lS^5M6+1c>qKg zAX**((FKUswg({nS>Wr=_jp>{iKPOKo44yvIa)qR zfW&?NdPZ09t<=_hFeO&k>>~hkP}W*MUi=wM9uwXH12yKG9EaowIqfR=fKW*so*U?D<8z!%;)7l5Lm$JugnuN|Npym2mo?#QJ<5SjoQ ugMwdfoCe(x0V@O=C!%wW{da4GJ<=^#!ANeAk{b_EtI z`0`*fqfs>YApjm=V;>0$IIJk*4gv&_w3GBx(yO-TArxO#=E+-3ybTGG9t|gcC+TD= zLAKxit)zo0OZXIMzo{{3EY7(ja0^Vp_ZkvH0?er`p?LvNS3(y8pq_+o1V9}LT?v5l z61o!rWhHbe0Ln?|RsfWd(6s=_m(aZc*d}9KO-3#7b;VfKYlmbq1l+G2ubhO8;8mcH zS4oH35?n~Yng9Ttb1t_J-~{{tj=*!`XAi*rc`VmxT|g0h0^Y?cki!sQ9e_1MfOP=Y z3<1^wSTh7z2Vl(*U>!gNe}KIU0PN>`lknC8B`8n}?45JZkz?(Er_1ZBi=h(a3h)IV zJD#tP fok{Y-bJ-h>|G6Yx$um$th*puGQI_=Ken%@yB@e;h?1bkUmmKL4>?>e8_ zSwx<2!@O4*Bx6T6WmkBYI?1)@?bMqj{mT{1e*#-CmrFd$xGnqyOc?^K1F&WYunxeQ z4==!54faye$aLvRv~DD3J+9@Lz#agL#bQtiW-(Zk`Fo_7h9QcoT4F zsTkUd7vL9XlZU`d@Vzh&NO%|mtOKy7c>yVT!kXo@c>zS`2^Z^pG|lG$B^axKhmRm& z@->D8B>&yqAisT$ApxsSY&XON-1% literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/page_new.light.png b/Flow.Launcher.Plugin.OneNote/Images/page_new.light.png new file mode 100644 index 0000000000000000000000000000000000000000..990c51d379c45b59a460733c46e255657389b63d GIT binary patch literal 565 zcmV-50?Pe~P)G{(x;6hog70L2fP9opcg)#Bl4|^LucS-B)oY-NgR(rhq46CZ+{Q$ zP?n&1>F>u3suC;+07VH_1b~tRO9DVaf;9mkEWx4x5R_n500>F2EC2)~SQh{*OQ=Br ztSF%t0brnP_K_>#kkOY(3AqBEGW%OpLdhju+QwxZOb*c!Hi3rv!22<6m$cCVFTe+I zPCR$VbQO8WX(AT9eMV!kNXRXwhB;tWngHzpLiE5V!?R8< z^+c_Eg25R)GxLQ62@(QMDS--bV_!YPvrkb-2ymGL%E2-H8~__PMWvU^-#i<*ok`G3 z6QCVHn2#)Tv>Ds6RmYk5C7Mp!$)q;uByG%S(&;oGbYpbVPAg!nuK`hGj4!Kcd5N%ZfN{YE z!~yj5!|vXFzq>0e_s%rW%))ZcbDn#D|9#GR&OOX(h+^$8+P(+8B+!%qT3KfS8Z=QN z#@>JFV#l#H?cc18c8^oBS#q7HUbHh!9Z#fzSXMiMVL2CWJtEep?;=#&;@@ zO}hy48KAIv;oX@4R{MZ)XT|i2pl$*D;N9=Q;^;TNU2$~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#1I{;%BLmCKxNtZhS6EBwTAnlW zkUD_WItP$CfYdq%kUD_WItP$CfYdtk0PfElFvj%ZSFEq=lD?62Ea?YHzZ+wI1|F64 zgruh=y(sAgNiQdhGOGrsL4XzT0q{)ZnhybQ0pFHg#f>yQN`eUma3X0|Fzrc6e@lAL z81skoGn6!zv?FOKY2?|jWKWC>Nmq?A3vc~bj4@x-3A|BH&<7CEJR*(>@LA;YKLLBd zpv-@&=m!8rKDYB%(dv5bWj13QQM>1j!?OS&rQR$$&#(or6Syg*V^!1p=!3#$L4WB}}A zpCDNs^&P-J0oyB;gT6cd5f)rlANLtRR?|AkdutB}Lzt{>dbbC7+Fd^pdh|h%p=I`q+zMbrFG%F*!Ulb9 z0i$xWunKR1(w}<;Dp~iDx&a3?kUi*BfsnPikqf}x0&VHBx)XDr=~W?QPlGpdEot{G z0Ja(8uQvt`sDA331$^Etf&d(6>|aU=;0-r^g}a*{vnl{$AppaG?ZuP;4&C@DFg9!m zVOhbhxJ^d;0R93lIGbf=ta{_(baE>)6+jsBw2I?40RX)1Y<6k|cp5?|`2n^|>}y`d zVcQh|@GJ0uvzu=K!Z470cH@Jpui*#H0l literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/page_recent.light.png b/Flow.Launcher.Plugin.OneNote/Images/page_recent.light.png new file mode 100644 index 0000000000000000000000000000000000000000..68c9ea5248a33c44ab7a30adc3330fbd6677330a GIT binary patch literal 1095 zcmV-N1i1T&P)mE;dYayv6`-uun$ z$GlxA)*j$7@B@e)mw5yK8r2@)3+@AN4TJ{@hg_8#v;e|Nj&m-`G%y3K;t_(+r9Ykc z;0?k=38(8UUC9?O5ZVL)JV0n00B{VUjR3$Qgth_zM-bW!031MQI{;`H!v6pO8ieq_ z0DuM|_ylmm($^WO@4S7e_$2;~7>C^44zy@N_+0o*P*Uac#k$`Y<>V-+}D(r;r3 zMaw)cs5h})#RkAFU>W#i*>488n(<{!Isg;EU&}#NwyOfDL%DHoa_L1IwE@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RS=%*m`aE*(~I>X3&5#0D%6VCDeU1FV@p z7W79x6cDQFe?Rb*0}Nr4DS*`j>iPES0hSGpY-Le=wW-^8aJA6r)w%VApqtVziUW5?Su z9&O`ZZ-uqu9O!lylV=-ez7AoJd>@FXE2fH5RS1T{&J`yQccuV5DmEHL&A{!&HPaYR zxy{3!9Rk$wd^~R5B15XT_`kilUiJ2`46s9qQp3Lh@ZkZy0RdloI1|{3ujb2$r_Hf{ zTi<*IJkE)FyI4E)_QXcMX0bG72w-zUfOa;U7 zRm@rpal&l6g3ggELn^*Vl&Vg2Z_bx7kzB`6 zSi!lljDc?9P2Z3$8%Py4v5?b|$W&^615g!$Z_fl=^%_P!1P~0Gry{=s1KkpSyx55^ ze<~sMx4Bi$mJLj&HmZ)$nD;y=V(NnX!&Sjx_cF{oiej7V91sc!xHsJC`;(Tc5R4sf z$GzcBPhBPtcjjGlx!*kR0^`v(+#l(3eYCAA1S9n? zP}B@OUfKErydCd55erHP1q7T6%ghRo6NSNJk@s1Pc$@h=d-AN`qUEmsJfKYR8` zZ@BNJKU%wo-f-W`Plku B<>&wa literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/recycle_bin.dark.png b/Flow.Launcher.Plugin.OneNote/Images/recycle_bin.dark.png new file mode 100644 index 0000000000000000000000000000000000000000..b032988d4b72bd0eee69a9896fd49b6e81e03e75 GIT binary patch literal 1111 zcmV-d1gQIoP)f}@q?Crk2f5`Hr~JC?1drzbuAc@l8Pk(|Ov&Hy~iDbvGB zMB2h-#6fbGkR-PSx;DTmwMCn2gzoG253_CPaXqE(v!Rb(5A|Em|=Z< zxe$>@nahd8(<+||mi5UktW;SsO1V5NSk}Yb2FUILB9e7#EnVLIo?KH^FCsUjQCYrqZXNJg)b{tXN6s{cBUz1z(fL@=gv(>gpV_>@0EkkD%2$R)i4O$a_Qbi2a8sMitJ9E&S z9GykTIiu2j6tbF7{+tV;KQN=WtKdffM=)`HEi(WoHg8dK8elFW*SZ_Y0|0voGWV>E z%|LQr*<~9~-nByvCHs*&Cdtdy0~U@_6@a&yWEUle0ahZiaMFtVZZ3ulpxF;J-3R_# z&Tb3AIt&>=Glw?LbLz!~_b~&8LSC>AIb6WCaGgQsWCRZuX_m9+K><#wvZUfw~;OH)h$JVF$N&X6OK3+?8vIEj8P<2+EFBQK(gcfd>k<1fRf}( znfTo~1fH}=_wt@9`=bIYlKx7vYexAyd_X7Y^v0Y3#jSZk(2W-oJAcjWs zk=6jW>Aui4Zpvn;7`NF4R65^g7f|V}UMgl?SWJL+85}bPd>*OGCMcsTO-%1JafMcr dQ<@-*n!jwsXo==Vr-1+f002ovPDHLkV1oFV{(b-e literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/recycle_bin.light.png b/Flow.Launcher.Plugin.OneNote/Images/recycle_bin.light.png new file mode 100644 index 0000000000000000000000000000000000000000..080cee64d2ead4847b850a1e2c49ec64c0c88aee GIT binary patch literal 1003 zcmVK%{E&O*ad!dzpIgOQBbLpsJq`A;4ARS?BL6w zlbB;O!fLB61XeJ!?Iy!%i_Zbe0*Z_Ur!77QJPG(5&W0{k4d8;eKnVh%zRS?`ZpotBuOyHWI&h>2yLUA5W^fH@HwKdBCUj_ zjdt%!PYhOth`#giL(Bubd}Pby-vjR~LJCPjU@AxB=IyhJ3?Z;72P4<4@9GY6FqY(i zl#sPyGL3eR*BsFP*KB<#0#QKL^yE5-D+S8|J6N_f@R1HmHD*5GwlJC%(Xb zp0F3eLy4{QKm~-Da3!WaWQ(e%>)S^clY-Nv^p>UXOPf4yfe*N6kD4~7YwnAvP1j$0 z-cz(gKjtcKwp*()BVhGBXGv^7phMsA6r+y=?r87jRS9xc$D?l&%?9levSpC1&k1qM z)@{;D>RKX58Y7xK$Iwge<6Im6DcaGpL!K-5=VYu-Y0|#N7^EeJNteP?*$>1(OFBs% z@R;rk{ew-}3>Cv;4grzQk2wTHI>#&(vo0(KfXKF(9Pp*5B4ePKu5;Sh8heg+(FKu} ZqQ75iRZ4Mpa8CdL002ovPDHLkV1i+N&ZYnW literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/search.color.png b/Flow.Launcher.Plugin.OneNote/Images/search.color.png new file mode 100644 index 0000000000000000000000000000000000000000..a8c3c76d28793360392f8c4e2b55194abdccb8f4 GIT binary patch literal 1933 zcmV;82Xgp{P)Nkl$eQXnD9LK-c_Ih1y%Z6-e6?V~e(U$78M!}5A9~&W#sSqGY z)I=xX%OAcZCjOy`7!`HkOZZ0;zBU_+xiiDVOQcjv zFW-hT8naYo<%m>K(FdFDgtTVOXFDk>HQQrSbGJSB+H>;c+o{399jS{Kmm!mx(RU?- z0a&)|Z*l3;uik5Dcz>qHE@}XKPM`ij=;?Va6N#AB*q>;(C(|C!=O3JGH7Ti0?kKLrioqr-=P z7yA2G=KG9sxj=ip&^w(Ff$OiV?0r5>$8peib-~czpZAzoJf6VrO`BFt=BZ!->^gMl zT#Dm7N}Xm|l=*zn*VNn;bSh0hFaVR^4>}y4aO^Ah+|#*xb`6@^NAAbAoA7g+1 zxk9O18XIA%ub&a=j;$M-AYDT4vFO`BAQ z7XifU>oK}{^R>&PtZd!gkGyjH_L>UaIXla3Q`Eu3aa~kh< z1nqWf4xiKF%a`L)V?4o8HN$nzY{DgBOdmNiNw5s7XcU(3Bqc+ ztSqH|4=|f!^0vhD^8#K3z$kh^(rk{Ye;G8HLPVS6<^{Y6Uw>{~0iOk64+aUZ@$&L^)dLVIYOh4oH-xb<=*D|NG2yE?4zz3zAw$#9Q`BD71K8Qr z6bH+Ou~Iow+;RM&<_k04Zd<<0Jke9PDaK( zY7)Tv4Gp`*s;Z=1Gx_~R8wXr|KjAM{Rdw}9L&GjWyJvz@rn>r|T%f~Ylm!9>hrcTj zK$T*)=%1RJuW;=KRlBFcyPBI{&Nv*zJ%P2O159sk!Qhwn^`TBNOB7+*;UCtneKptC zbY5VruI_2kWFoX%fBFfAp&`xT7Yz+z#gQY#u~Q}!IJf&5xu$6V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vQ%}e^LUfv>8=gOCBjv1o5k;zLNz))L*HyYj?-#gpnnhkHx9jCh4G0jHF6W}d* zZj@{#yy>Sz^@r3V@Ci5y^m!D2w-_H=a*EZk=}f|RrHb%H_#%7}z6f80?{O93i||GG zB770P2;bu>!e7+zO5P zLmix*!fgRu*@D=E0=ueGB;5~2*{F$&E1Mh4bh2s&)-JCSEuk6@1 zbI)C1oAiRqvSl@L$ur;xzxh7NkX`{AKpm*rQn#P2*lYS{v~y&&a>WLI!<#@Wpv{*3 zuCLwoX-%ia8{7uFBzJXM8n!K$#>*7ipNdzwjjbwZt$MUxC}@qvvct@8pslFcwi;4* zSy9u;E#Q#R@bejH&okNy2f*zNwEy#g(Yv5|=Ot~2{#I7v#v!ipKYt#sXTlS0(F(9D zM7!FeXV4X1zLR)VqseHmr}0x4O2gr&sVUeIVw;*`VZ1NxK_e9DWlp05gRXGXw1*^0YPfR8iB5 zaTw8jCipf-*A=wR#dyrfUkB~&@z*J|KQYE*##gisNNh}zAsFK^V<^E98RIczPF*uc z@^duF2$`g8TaC;y9z(`+{Y)K`GagfBjPEXz4C#=Ak^|r^7kp6C5FY+CRgy`{8t{o^ zeNndAvwvH&*Q!lv$HkCN_(Ecc;bZt1o)|ucpLq;1d<-AM6T`>wGmjyLkKto@N)+CA pMCLil`{#MXP_jGk!cfBSe*wV;NKPyp#o7P>002ovPDHLkV1iGOb@l)N literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/section.color.png b/Flow.Launcher.Plugin.OneNote/Images/section.color.png new file mode 100644 index 0000000000000000000000000000000000000000..2c5e32055f897df1b9b196b95ca8d14dcf80752f GIT binary patch literal 679 zcmV;Y0$BZtP)!+R;pQIftHvm{=w0!Wp6TlI4 z01o{-L%y7TQ7ok$cPMScooexNcU**SiC>)%qug{Rk7~rv1i-?@)v`$BMBoUHkpMt& z^VO?q*8r^4KgYdD9M|`Bh0JEb8>J3l;Xd#-|p^s+NCRQUNemZ`Zuf|Kb5907>F&BDpzYY$+80B+GfI@Y|6R02~AM1_7-M z(6CjJ5&*AZt0ENu-h2jl>j2DWfOP<&2ABunjkiJb84zkf0AL(|4<|wM074touvJlL zgBqshGa!5qu$}>-281?fJp-&4!B7JN0OJ6{7O-9f!#TkE76>&U0I&|gdKd7a3mDIU z0Dx=*7}4-fTUtMjy~7>>P|&eubNxa@x(u_h;bo3f})9Jq8&X+OL=2Un;QWAnmXJXMxp0K`YulcHy*7u9%uPpnds*6nIluBmnXISe*^rl^>6Y`hR6T_ N002ovPDHLkV1k#;C$sEakt zG3V{D$^O3GzFbDQ_1}U%PKLvrePw2g9x4q49 zAo=X!^I8lWR@MGk!B8#e?5(+a!Op9lTpKuMMbFhs%D7VccGtRH`B!*n@Jb#K+i;R$ zTZ1p#2G$&-2Hk|oj5&<6c@ns9q%cGuP-DKqWJaozMNE5G&#v_gX?PB?ly8=`{Ees2 zKiR(dbjXEYIDRH)rLG-|=(J@@aoy(JA7uaSFcTMaV6QAJGBVg_^*hVjtoh;7m(jPq h87>GvtGECF literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/section.light.png b/Flow.Launcher.Plugin.OneNote/Images/section.light.png new file mode 100644 index 0000000000000000000000000000000000000000..f10d2cdc86ca6a09b576dd691fb5da6d53859487 GIT binary patch literal 408 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=EX7WqAsj$Z!;#X#z`*G5>Eakt zG3V`UML*|20S0ypWSUze@A$nb_i{eY>#^V*N^_EuzV>}m9V zFmb(ieVz1SjvWl|BKLne#$v&6uEDx)Tgg|(zDCIn559MYOF!t^uOFM+Abm%`oJq!A#H7~f z^Tf3NWxp~$<-D^#W>R5s^Z2gIH`V=fD}MDYKOd?*vG##R)(`3LU*CNG#kb=IFsKR literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/section_group.color.png b/Flow.Launcher.Plugin.OneNote/Images/section_group.color.png new file mode 100644 index 0000000000000000000000000000000000000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3WcZ|wbr2X@9pP+elO~Skbl7_ literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/section_group_new.color.png b/Flow.Launcher.Plugin.OneNote/Images/section_group_new.color.png new file mode 100644 index 0000000000000000000000000000000000000000..3ab0ac75125b92155111f7c73157f01b2b66a55d GIT binary patch literal 1294 zcmV+p1@ZccP)by(t`xm_&T3>q~tWL|K0W=24= z#7yHAF$3boyb!$FT%s}jaTl6sG%;aXR>{0_cY5JAHDgBImMO*}9i^0oW&Oh_YhN## z0&Qu(^Frw%`u(oj)APLNIZwW}X}|LVW#mF=&@~nu@NhJPBO%wBbAPimQR;CmEc7aA z1gG$N@CJu#?LtTpNdOW61c|Pr4JSS-qhy$*>yO)e!3U^F<;BFHAi%!~x^XrXyTXvjQ1b8f1| z4k7)ifCNNA4X~n#EcCVrK{CDw2~l{R)tW+VIDqq^!2=>`lMs*qnpNIZiD)(6`zp|v zep`s<^k{KmO?4Qt#hyL@5}@Xd`p&Sf&j8<@VK)*&0we*ns%Rc0DiNDA5T9#6e7;U; z9cNVpP4yG-7!zo$^RLG$96N@J?vZr`oS*)%)n=pPlz;@tp`wY;*C7(}AU0PIN~$f_ zSm(!+kNl1%V*=akOB{=AlmqZh4}AhbuM?Ti%`p4NAw+^6mZ8H3FJhnPSC(cYCH_J@x)8F8+-M3hpjbbyK;F}&g2Il6YAvb&TkMFrz_RRwd0YHdj z+@g_iBiqPc_YJnD6qpA^Xwi8_l@o6tdKL$3>RI)-{1tHO>Lt_713)ky#p&_O?D|_ifSHAu@?4dm za@q0$Y&KQ^x((>Y3P863-IyMb@CAn%H^kHY_5D%hxgqg0u84OK!)@*|T>KEJ*M4cg z``zk6?N`7R^p|7v0N?@HKFb}{9zaY?mvcE!?tu0HbYlge+kkGY0CXGBjTL}y1G>>3 zKn0xTTy8RVKzjf$&=4GCdZ@b;OhTky%^lSKpP-AHaRlGujhEhE^Y!O1e8H;s!;x3A zo|_$()_w)(MkN40w`j#f>i^?qxEJRit}F#A0bJ)6t#I%UJ`Ox)hf(v$+F55YF0y8}d@atgcl z|A?K2pJnFaPZBr%*=MsI72B2d^_5CZELpI6hL&4q(!F_QX_@)$?i5a4y<~cWq`uOD zzNencyESI^HTb`8n%Z#ZXkOc#0*Pofrp90F&u*J5PEB*w+)6xp~+l=m}EY0fH*#erA zo$f46R_iR*Xq^T8jvYfyD8i=v7U&QiNdRL2#@1?{25>e{(;=2M1)8VxG(wCnYu0L> zCd$`n#TWkA_&R*{365sK7dAflGQiTrsMolE|4k*$zYH(4Sq$>U=>Px#07*qoM6N<$ Ef;2l^EdT%j literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/section_group_new.dark.png b/Flow.Launcher.Plugin.OneNote/Images/section_group_new.dark.png new file mode 100644 index 0000000000000000000000000000000000000000..ef4059ba5434280062c4b449981c95c31a5aea9b GIT binary patch literal 731 zcmV<10wn#3P)v_{K6o!vj0JDL!LD--hzy^2&x&drJH)xpvm>^*SvVq+R z5+->0VXHNc6CEd(j@w7?za;+7<+Byb7l|YUD1c&#nrL*zd;)&(Otl0}RDch_J+SAP zZ6eJ+W{+dVtbuPpJyJ{q+yZ4}&3~k5x&%H0e@5~jfIDCvS(DZP#>d-`uk`+iB5KkZ z0NikTy!ELPX@bnvcmZsbIjck(6>}M&9d}J4jhZ={uO{TH5^2$3$P{|U|oPU z*#PSTtjPvg7hp{`z`6iyvH{iwSd$H~F2I_XV8Cw?S-Airvg)>-#7np(wsOujnpm{Y z5bLq{C-W#lV8}2|z9$$U8(>|4HRcA;J^GFq-&1$F%Kq=>e}dYWS`@htBJ$p! zS=e!LkcE+a|QDuaLHc2249=cyM!TNN;bf{ z0Bf=V)&*FT4X`f28gm0k_+Ec+()H-SGdDm)jxJDQ(B-)AKJNVY<}*QUOf8Dse??@y zq>G{NiSj&($S>(NFQPjF4kGeanZ&>JIGbh(_XKz0O`ha5%Szzi_+&O0DS{3YiupiU9*NO4_x3V`F|#yS{I130zRqZKpYU>)D(|d25NOOqUqYB2yezgQma#-N<`F~YGxevloV^078 N002ovPDHLkV1jFEakt zG3V{0A%@kR-B46Twncsu`{dx7sN1(h zd-h5CrYZPWRbABDDBP&)d*ACy%3{VkhW(As_is6wMDAphYrK2n!UZ$8S$7{rYV2gG zW4hfjlWzyJ%I0S~Qr#P(ALOTeu>G*wd`@t(oWq)XeYctCn=guyy3DZ7A~yf=HL1)q zOc@Q+k1$3n_hvGzEWIw7>BF2M+Pu|m)>S48e;$RY=RA_T(v-7$OjfUL*xbTkQfl&L zdi3JNqCQR44{KL4R!DzX#`Ylhz-+08?Tq~@xPddFZE zE|%>G_gQvw!Nol1(`?3#f;@@z@bh&v%+pc5m*{L$;=W8XmZ7s$1lOi8W9hf2Qx4%kS`E1=y mk!y-!zjGC(io2}s{_{C9uyJpFm{Jc+W(=OLelF{r5}E+Hvmdws literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/section_new.color.png b/Flow.Launcher.Plugin.OneNote/Images/section_new.color.png new file mode 100644 index 0000000000000000000000000000000000000000..4d9edb8fdd54975f438b0b2bc73620206e31547e GIT binary patch literal 784 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=EX7WqAsj$Z!;#X#z`%6e)5S5Q zV$R#yzS+WoB5n7DW0!PvyG3mb?BLK_G$n6Iih4<4c=>d_U4e$0XAjvwINmQ1YZA7y zG;m?;7yTXCY8@d5eZw_x98*!*A?SKrM%+|FZSiEo;v%=I`A<_S-p^Dw-r0U;ufq|| zr&;OS#a3&steM0m*Rs8Qb+Y}w$(hE|0@4kP0gAzMBDkv8oZxt%Ghbu=O6h0Y7&j+6 zEqWc?uwj0rm)c>u?IIMe-vOF=auNF|&>lCgzbX(!VOjvxIS zn6_|VIL38B&p}$-VK+nW8iuz_TQ*`746HYOcKlq1r2b|8i#_iXv(!Fr|9?$;!MC?> z-#owW_({2*ea$lY1(Nq)KffYku}#Rt{u5Kw$G-~8mp46gk83aqYbay96~TCmHDmET z_BTD#HdZ~Y+aEkvKlpY18&R9zEMKi3xc-XE5P#pCK7WDU0#l)kdGb@H{BGEV>84Uf zW%lLmmUq?xWg8CdKJHN?8p-i4P5jEfr*;~f(r%tKulxFV|Lr2XsL%IXcc*^0+ip;7 zdf~?H;BV%g?Gp#n5=%}&1Kb^ne-{?#^Y7{#a}o` zmvAHqA4q%uEVE(8{1;&>j?8X7W~u)FEakt zG3V{wBH)Lw{*h5v#0|HxgXt;{vd?;6DIK0Uf7&a{Cc zuiPQWBji-JnLKE$7^+~L2FT2ZOz6rjLC~6 z9*8|yhL=bSVJo@fV}3>Td!^s(#abOIo2Gu*x@y((DU*+XVEHq(B(PNB+wU^gc zRh-CYwCp$es&3xk`^q%ko~7t@L+<^R*LxE=T7q~AxC@LUnS(yJob+pAKXFR9YU0i_ ze@{lf>bqc)|BI=j<%${KciBDR{H7@IaqoM9wcEDc2P$4E!hDD64uZJB`=F(o z@t#WT`L~9<87FPxo>`mmYe#n7y4#Px`E2NJn7%OFv-?}>3z>Nh!5?*AZokK(?>WEO zs(R`d)fI15?wB4d{jT}kaSG#i$G3cbPwqdxK1r`XH~mcNNA0VV&jmht!nylerS+BQ zw0DiUX-ik6PMxG~a&=y4v2V`F)%;hYGo~GI_E!$NxlAH$>CR~T#;*;H_JOml%a2cI z{d(-=ZMBBx9b4O&YtsMMY%G0kE%|1i{J1{an^L HB{Ts5H?SlN literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/section_new.light.png b/Flow.Launcher.Plugin.OneNote/Images/section_new.light.png new file mode 100644 index 0000000000000000000000000000000000000000..193ba210913710337b451ab6ca813f3829a6e864 GIT binary patch literal 547 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=EX7WqAsj$Z!;#X#z`%IR)5S5Q zV$R#y2Llfq2)N4gl*crAd2qgDuu_n9P`|)f!XT?6JAsc$R3(Ig-TJXW(uCZ#`%=E7 zl@)m|*>8U>OSfOKc9q&cQPBcs8|L}GI#ZgG3R!KKqHi7fzESj*Q7YRVX6ZV$TA9fQ z8MhzMu2;8}WcFM8df!CV;$7FjF5z9#p!#_7xoZvkURMXP>2S=i31eGx;z)yWx8q9g zd9J^uV%AS(44a-^u=n{w_A|Xn4N(oV@Dq1d)3wfV$!gG?UvC5-Ei@98VEteALsWK_JF|s9)gcnO?dw~x$uDO z!&ffP?dCHZKWMaSyufN`z3$~YaqGEje#}`V&b?4hbJ_ay^^EVny;oUUk+l#Q>kOW* KelF{r5}E*tD&^e( literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/sync.color.png b/Flow.Launcher.Plugin.OneNote/Images/sync.color.png new file mode 100644 index 0000000000000000000000000000000000000000..e09b7a6a5a5d6c31ec76336632d8c5bef1d76130 GIT binary patch literal 1835 zcmV+`2h{k9P)j&Lr|+WL4Bxdln+z_A=N=ttq7?j)DKnTD1a;^0)&@}*lZji5{?rJwozEG9oyJW zY$pz0+ovCPcV-{<%&ghJF^NAXnTC1M4U=9ifltzjtK+_ z9w^3A<}jBL#AF;z&k({#fq-M@_LoZs&3b4m+a4b%kxbiep?)X zKL4d)%i=09I~E;aw*huT1$cT@>&Eu>|1tQ@2vbv2XtO)Gp{#EvhbB(=Q$j+swM($G zE*liU=~O9NQOK=pR*|2VlX`|G$as2H>&6U+d^A3O#W^!GLn_G&Fg-KF<*{)t`1>d= zT25BhP1db7O@i?lAG>DQ?r=Edk0O#CZER}DhtG(>^wbQWcV0-GQIg>R9$9Ge;p2+~ zL#g6r8LEinBtpLA_B>W^T|tF=1zEXH047EQ^mUAI?kzvP9ha~|9$+#MNI5~D?;+wrLzvS{-KrJ|5OztzAL6T&25+-@aYT!JobxHDGLH*$p)j^6x$0 zfv5QkCPo8M39sv9KLWhI|5Iuj*YdzqRRCn?X0rR0`{M?UPN?=moomiFG*@fnuZ;yb zyyJcPIxZPz`>UgqoM>w2?3+GzAA5kTTqoJNnNb6#6L|<#g0bZ9-Lszjl}iBYP5(Mb<^ix$k+m=E6YG5bSSn@aJIC1~-7ER#2109yg18l0RpweArIAA1s`{{>n zh9bjq-9u$s=wIr&il_Mt%SDb=Xyntt18QuAx7xizYxEqpPF@5~AMK{o)32S?KlOu1 z^63x*YHWF15fQ@OCkHH(2RPl*6+Aa<`J8^_0o2&qKAijjdOJoEs_lc#@#Jr=E=EHA zIz9cmY#KO0jWk0<_{tmcdTkQO1N`dM2Q`(yDgKw<$A13tbwKlu_Y(?xGx7y4{oY|> zbW-n=9{l6$fMk*vgtDpvZ7~1YkvRRSM(^M^hV5!B`Dc9fh8<2cwexmUyCw1hY^c?r zWqj%Bi+66yVLXaf2P85lt&%S+U&dYaYqWme|8&MgmbLLx2{k_KjS-tOjF!5e|E)&r z*Xg;)kZ+tw@(U9K#$%{f=H$mM-L&lWTE6mO@;6r(YdVhYYa^C?8U#RiKLCub$L9J< zvhtj??D2B-^0y)BP@fp`*}0kg?1gGJJgm?C4-TE9=j@P8>GwvAS4_rH=OPb5gIo81 zLi=$a4KGwv5VIi~ImaV0+%wLxKezGO@e79J(;*9}u|>{_ruNWr=$r^$o__wajQMR?0h zMsvWo)6>5P7W_8=DMXLrls}jWX%5)_a_L}TnvH@S7Z^#cZ7Ic&K&vvXZr=Kja?=+O Z{ttnB=2@O!N2dS)002ovPDHLkV1k;Wg5>}J literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/sync.dark.png b/Flow.Launcher.Plugin.OneNote/Images/sync.dark.png new file mode 100644 index 0000000000000000000000000000000000000000..39a3861624011aa0361e94a58479687f4d7e7a38 GIT binary patch literal 984 zcmV;}11J26P)Px&l1W5CRCt{2Tg!3VFc5v~$=yEW9_gN$$Q6VgM6Mtz!Kol}1y%=EDv;a(RYB-O z&Zh5~u~@;&0iXjxpa@bVK}&oy9FIYKcAv1o?gA75AUOhX4`2ddg!hRQKmy>0h@`%a zL@WOrz*Q?^b&oB8YhMyB04#7i$^%N5g>Pjc`HIsb002@E8T(Wel5AU=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%J@tGR3^4JLLX=sNWDAQ&(k>I^xiUdP22_Wr&G)6DLJw<{i z^p)2RXp9}qGi6y}EEv-Fcp>+EQG`19-JJk?5Ah|i#UB?u0c+qJk-?fYQJ(9!oN_Wdz4Rv>;%|bjvqYFccg8>=Y+lfBQ8K;9A0^z zRSCphR5=UKzRaYqNWMhJ1h&29DnMbJ-Z<$E=_gOCNFT(=H^yP##8)Pgj}}03H`sRn zg3EvVmFtZCAV}^8Z2^4gsi?SIS$ZKUKsy8$PWt|X_14CMAvFiI#NG6p9=l7P3U{5_ z4*mYY-flC86QMz0fAQd}n;^q}J$g z)+VCRS7Pf9;;pc5Ae5y5Eg|0tajG5Y8Ae@dOA63p^}#k80)i*0PiI2}0Nop^1mYEe zlcz$a7sO(Yz7pH;zNfcsZ%8i_>PDe^LY+Y5RssxyKeh*F@Qa{Axc~qF07*qoM6N<$ Ef_L10AOHXW literal 0 HcmV?d00001 diff --git a/Flow.Launcher.Plugin.OneNote/Images/warning.dark.png b/Flow.Launcher.Plugin.OneNote/Images/warning.dark.png new file mode 100644 index 0000000000000000000000000000000000000000..ab87991340d2170ccfaca0dc12ca55001a04980f GIT binary patch literal 1462 zcmV;n1xfmeP)2o_DH^(F|l@$XQz ztq1Y175r`%U#olSPX zneW@Ed0=7p-I;fudFPqkeP$Ne#3nYeiB0@}LG2n?W^fC_;NCKeaFTNPv0YqJhZOm9 zDY6)kPuszT(;iTYd;-8B%UjP#iHFnXlj;_b0y@Dw44F)p02*AJYUdS zC_0rmFQiZaDdK*B_Uh5P6}QA_pA@k>DPFZvk{&>c{5=qrvrJJ=2JLNW5}^BP0iy3H z8{U;9zeE)v#oz#7>}4hSh8@iJMDCRH!G8bDR*{$j zx`=J6n|iS9l_-)@z@PjgqLT*zQu(I)*SGD&U;Ml)E$dLe6Ur<)u);qB=!lHc^y=60 z)T>|-8MTXU*1Ur={43yZego0T1B>R0ih!iVBT}M?@`Fc2jKwJTiB5JqmiblRbiFE| zf!#exIimn2{tALe4JK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?Hv13(&$vAYcXh{B;xf^*QQ>kV0W?ynFMQUt3V6aQ0GB_DVr=aIN>c76 z;8C}y!d+b{#(XjgT-M(K{+AsAxT~wUa9JyWal<%>7I0Trao}?30Bqd#zPwxmcXbtn z%d9bv&>ee(IEoOst1A^Qm!*6;?0BI9n9SwcY2^XNP@Jpp$iBvq$7DV;nac&8Hm#~q z0W8eVzXc84)m4VkUDE zYv67YiVBxo3SdkK3E&O4$G~8ctM4d3Gc)A}C1O5q*VwdL3Lp)9h-Pp%Aw_}9O$T5j zsONE`i@Umt0+*W(ATHe1l`bwf6+oQ0t1DexZYqGdaaUJ5xV&ZnB_a03fV--fnp!V9 z!{Tx?JHUHR9|7(X(TQffRumSOSA8u$ZWsrN=sQn`Mq^JD|MOqz>e`+r+6e$l%o7h@ zyY`#znB{D?pHrz}w@1MKylH+P)F&{2OF(*;5EF0{AJJ%`Qt8(%G)|SI90Bv=F6+m< zX%+}*sM-hK0zE<;LyWk4rK@ZEST@@~md*BG>FU}Z)wlt;9C*5{+yT0$yKAW|)cpQ?*?Y zfQ`HF`s}E2R|PCBLCk7W;W7aODqLO>z+xsdfZG6fb)~}PdM5L>znv!l8znt&R${?j z=8H{v8dBjh6P@tmvL}Ev^BE+7yLrnx1mHZFN5DJ+;JoccssLPeAGiPW6c`3FQivM> zHani`Z2#XT)prakrg`Tc;1=N80e5AyyWyHVZWG+ql>(RBg<(A6e8?=@sZ`z9cgNbxqn2)** z&r_gaS(njhJPqIn05_7XEN1-yqRY(uRKc "; + private const string Unread = "\u2022 "; + private string ActionKeyword => context.CurrentPluginMetadata.ActionKeyword; public ResultCreator(PluginInitContext context, Settings settings) { this.settings = settings; this.context = context; } - private static string GetNicePath(IOneNoteItem item, bool includeSelf = true, string separator = PathSeparator) - { - return item.RelativePath.Replace(OneNoteApplication.RelativePathSeparator.ToString(), separator); - } + private static string GetNicePath(IOneNoteItem item, string separator = PathSeparator) => item.RelativePath.Replace(OneNoteApplication.RelativePathSeparator.ToString(), separator); private string GetTitle(IOneNoteItem item, List highlightData) { string title = item.Name; - if (item.IsUnread && settings.ShowUnread) + if (!item.IsUnread || !settings.ShowUnread) + return title; + + title = title.Insert(0, Unread); + + if (highlightData == null) + return title; + + for (int i = 0; i < highlightData.Count; i++) { - string unread = "\u2022 "; - title = title.Insert(0, unread); + highlightData[i] += Unread.Length; + } + return title; + + } + //TODO replace with humanizer + private static string GetLastEdited(TimeSpan diff) + { + string lastEdited = "Last edited "; + if (PluralCheck(diff.TotalDays, "day", ref lastEdited) + || PluralCheck(diff.TotalHours, "hour", ref lastEdited) + || PluralCheck(diff.TotalMinutes, "min", ref lastEdited) + || PluralCheck(diff.TotalSeconds, "sec", ref lastEdited)) + { + return lastEdited; + } + else + { + return lastEdited += "Now."; + } - if (highlightData != null) + static bool PluralCheck(double totalTime, string timeType, ref string lastEdited) + { + var roundedTime = (int)Math.Round(totalTime); + if (roundedTime > 0) { - for (int i = 0; i < highlightData.Count; i++) - { - highlightData[i] += unread.Length; - } + string plural = roundedTime == 1 ? string.Empty : "s"; + lastEdited += $"{roundedTime} {timeType}{plural} ago."; + return true; + } + else + { + return false; } } - return title; } + + //TODO + private string GetAutoCompleteText(IOneNoteItem item) + => $"{ActionKeyword} {settings.Keywords.NotebookExplorer}{GetNicePath(item, Keywords.NotebookExplorerSeparator)}{Keywords.NotebookExplorerSeparator}"; + - #region Create OneNote Item Results - public Result CreatePageResult(OneNotePage page, string query = null) + public List EmptyQuery() { - return CreateOneNoteItemResult(page, false, string.IsNullOrWhiteSpace(query) ? null : context.API.FuzzySearch(query, page.Name).MatchData); - } + return new List + { + new Result + { + Title = "Search OneNote pages", + AutoCompleteText = ActionKeyword, + IcoPath = Icons.Search, + Score = 5000, + }, + new Result + { + Title = "View notebook explorer", + SubTitle = $"Type \"{settings.Keywords.NotebookExplorer}\" or select this option to search by notebook structure ", + AutoCompleteText = $"{ActionKeyword} {settings.Keywords.NotebookExplorer}", + IcoPath = Icons.NotebookExplorer, + Score = 2000, + Action = _ => + { + context.API.ChangeQuery($"{ActionKeyword} {settings.Keywords.NotebookExplorer}", true); + return false; + }, + }, + new Result + { + Title = "See recent pages", + SubTitle = $"Type \"{settings.Keywords.RecentPages}\" or select this option to see recently modified pages", + AutoCompleteText = $"{ActionKeyword} {settings.Keywords.RecentPages}", + IcoPath = Icons.Recent, + Score = -1000, + Action = c => + { + context.API.ChangeQuery($"{ActionKeyword} {settings.Keywords.RecentPages}", true); + return false; + }, + }, + new Result + { + Title = "New quick note", + IcoPath = Icons.QuickNote, + Score = -4000, + Action = c => + { + OneNoteApplication.CreateQuickNote(true); + return true; + }, + }, + new Result + { + Title = "Open and sync notebooks", + IcoPath = Icons.Sync, + Score = int.MinValue, + Action = c => + { + foreach (var notebook in OneNoteApplication.GetNotebooks()) + { + notebook.Sync(); + } + OneNoteApplication.GetNotebooks() + .GetPages() + .Where(i => !i.IsInRecycleBin) + .OrderByDescending(pg => pg.LastModified) + .First() + .OpenInOneNote(); + return true; + }, + }, + }; + } + public Result CreateOneNoteItemResult(IOneNoteItem item, bool actionIsAutoComplete, List highlightData = null, int score = 0) { string title = GetTitle(item, highlightData); - string titleToolTip = null; - string subTitle = GetNicePath(item, true); - string subTitleToolTip = null; - string autoCompleteText = $"{context.CurrentPluginMetadata.ActionKeyword} {settings.Keywords.NotebookExplorer}{GetNicePath(item, true, Keywords.NotebookExplorerSeparator)}"; + string toolTip = string.Empty; + string subTitle = GetNicePath(item); + string autoCompleteText = GetAutoCompleteText(item); + //Icon gen + string prefix = null; + System.Drawing.Color? color = null; + switch (item) { case OneNoteNotebook notebook: - titleToolTip = $"{notebook.Name}\n\n" + - $"Last Modified:\t{notebook.LastModified:F}\n" + - $"Sections:\t\t{notebook.Sections.Count()}\n" + - $"Sections Groups:\t{notebook.SectionGroups.Count()}"; + toolTip = + $"Last Modified:\t{notebook.LastModified:F}\n" + + $"Sections:\t\t{notebook.Sections.Count()}\n" + + $"Sections Groups:\t{notebook.SectionGroups.Count()}"; subTitle = string.Empty; - autoCompleteText += Keywords.NotebookExplorerSeparator; + prefix = "notebook"; + color = notebook.Color; break; case OneNoteSectionGroup sectionGroup: - subTitleToolTip = $"{subTitle}\n\n" + - $"Last Modified:\t{sectionGroup.LastModified:F}\n" + - $"Sections:\t\t{sectionGroup.Sections.Count()}\n" + - $"Sections Groups:\t{sectionGroup.SectionGroups.Count()}"; + toolTip = + $"Path:\t\t{subTitle}\n" + + $"Last Modified:\t{sectionGroup.LastModified:F}\n" + + $"Sections:\t\t{sectionGroup.Sections.Count()}\n" + + $"Sections Groups:\t{sectionGroup.SectionGroups.Count()}"; - autoCompleteText += Keywords.NotebookExplorerSeparator; + prefix = sectionGroup.IsRecycleBin ? "recycle_bin" : "section_group"; break; case OneNoteSection section: if (section.Encrypted) { - title += " [Encrypted]"; - if (section.Locked) - title += "[Locked]"; - else - title += "[Unlocked]"; + title += $" [Encrypted] {(section.Locked ? "[Locked]" : "[Unlocked]")}"; } - subTitleToolTip = $"{subTitle}\n\n" + - $"Last Modified:\t{section.LastModified}\n" + - $"Pages:\t\t{section.Pages.Count()}"; - - autoCompleteText += Keywords.NotebookExplorerSeparator; + toolTip = + $"Path:\t\t{subTitle}\n" + + $"Last Modified:\t{section.LastModified}\n" + + $"Pages:\t\t{section.Pages.Count()}"; + + prefix = "section"; + color = section.Color; break; case OneNotePage page: + autoCompleteText = actionIsAutoComplete ? autoCompleteText[..^1] : string.Empty; + actionIsAutoComplete = false; - subTitle = subTitle.Remove(subTitle.Length - (page.Name.Length + PathSeparator.Length)); - subTitleToolTip = $"{subTitle}\n\n" + - $"Created:\t\t{page.Created:F}\n" + - $"Last Modified:\t{page.LastModified:F}"; + + subTitle = subTitle[..^(page.Name.Length + PathSeparator.Length)]; + toolTip = + $"Path:\t\t {subTitle} \n" + + $"Created:\t\t{page.Created:F}\n" + + $"Last Modified:\t{page.LastModified:F}"; + + prefix = "page"; break; } + return new Result { Title = title, - TitleToolTip = titleToolTip, + TitleToolTip = toolTip, TitleHighlightData = highlightData, - SubTitle = subTitle, - SubTitleToolTip = subTitleToolTip, AutoCompleteText = autoCompleteText, + SubTitle = subTitle, Score = score, - IcoPath = Icons.GetIcon(item), + Icon = Icons.GetIcon(prefix, color), ContextData = item, - AsyncAction = async c => + Action = c => { if (actionIsAutoComplete) { - context.API.ChangeQuery(autoCompleteText); + context.API.ChangeQuery($"{autoCompleteText}", true); return false; } - await Task.Run(() => - { - OneNoteApplication.SyncItem(item); - OneNoteApplication.OpenInOneNote(item); - }); + + item.Sync(); + item.OpenInOneNote(); return true; - } + }, }; } - #endregion + + + public Result CreatePageResult(OneNotePage page, string query) + { + return CreateOneNoteItemResult(page, false, string.IsNullOrWhiteSpace(query) ? null : context.API.FuzzySearch(query, page.Name).MatchData); + } + + public Result CreateRecentPageResult(OneNotePage page) + { + var result = CreateOneNoteItemResult(page, false, null); + result.SubTitle = $"{GetLastEdited(DateTime.Now - page.LastModified)}\t{result.SubTitle}"; + result.IcoPath = Icons.Recent; + return result; + } - #region Create New OneNote Item Results - public static Result CreateNewPageResult(string pageTitle, OneNoteSection section) + public Result CreateNewPageResult(string newPageName, OneNoteSection section) { - pageTitle = pageTitle.Trim(); + newPageName = newPageName.Trim(); return new Result { - Title = $"Create page: \"{pageTitle}\"", - SubTitle = $"Path: {GetNicePath(section, true)}{PathSeparator}{pageTitle}", + Title = $"Create page: \"{newPageName}\"", + SubTitle = $"Path: {GetNicePath(section)}{PathSeparator}{newPageName}", + AutoCompleteText = $"{GetAutoCompleteText}{newPageName}", IcoPath = Icons.NewPage, Action = c => { - OneNoteApplication.CreatePage(section, pageTitle, true); + OneNoteApplication.CreatePage(section, newPageName, true); return true; - } + }, }; } - public Result CreateNewSectionResult(string sectionTitle, IOneNoteItem parent) + public Result CreateNewSectionResult(string newSectionName, IOneNoteItem parent) { - sectionTitle = sectionTitle.Trim(); - bool validTitle = OneNoteApplication.IsSectionNameValid(sectionTitle); + newSectionName = newSectionName.Trim(); + bool validTitle = OneNoteApplication.IsSectionNameValid(newSectionName); return new Result { - Title = $"Create section: \"{sectionTitle}\"", + Title = $"Create section: \"{newSectionName}\"", SubTitle = validTitle - ? $"Path: {GetNicePath(parent, true)}{PathSeparator}{sectionTitle}" + ? $"Path: {GetNicePath(parent)}{PathSeparator}{newSectionName}" : $"Section names cannot contain: {string.Join(' ', OneNoteApplication.InvalidSectionChars)}", + AutoCompleteText = $"{GetAutoCompleteText}{newSectionName}", IcoPath = Icons.NewSection, Action = c => { if (!validTitle) + { return false; + } switch (parent) { case OneNoteNotebook notebook: - OneNoteApplication.CreateSection(notebook, sectionTitle, true); + OneNoteApplication.CreateSection(notebook, newSectionName, true); break; case OneNoteSectionGroup sectionGroup: - OneNoteApplication.CreateSection(sectionGroup, sectionTitle, true); - break; - default: + OneNoteApplication.CreateSection(sectionGroup, newSectionName, true); break; } - context.API.ChangeQuery(context.CurrentPluginMetadata.ActionKeyword); + context.API.ChangeQuery(ActionKeyword, true); return true; - - } + }, }; } - public Result CreateNewSectionGroupResult(string sectionGroupTitle, IOneNoteItem parent) + + public Result CreateNewSectionGroupResult(string newSectionGroupName, IOneNoteItem parent) { - sectionGroupTitle = sectionGroupTitle.Trim(); - bool validTitle = OneNoteApplication.IsSectionGroupNameValid(sectionGroupTitle); + newSectionGroupName = newSectionGroupName.Trim(); + bool validTitle = OneNoteApplication.IsSectionGroupNameValid(newSectionGroupName); return new Result { - Title = $"Create section group: \"{sectionGroupTitle}\"", + Title = $"Create section group: \"{newSectionGroupName}\"", SubTitle = validTitle - ? $"Path: {GetNicePath(parent, true)}{PathSeparator}{sectionGroupTitle}" + ? $"Path: {GetNicePath(parent)}{PathSeparator}{newSectionGroupName}" : $"Section group names cannot contain: {string.Join(' ', OneNoteApplication.InvalidSectionGroupChars)}", + AutoCompleteText = $"{GetAutoCompleteText}{newSectionGroupName}", IcoPath = Icons.NewSectionGroup, Action = c => { if (!validTitle) + { return false; + } switch (parent) { case OneNoteNotebook notebook: - OneNoteApplication.CreateSectionGroup(notebook, sectionGroupTitle, true); + OneNoteApplication.CreateSectionGroup(notebook, newSectionGroupName, true); break; case OneNoteSectionGroup sectionGroup: - OneNoteApplication.CreateSectionGroup(sectionGroup, sectionGroupTitle, true); - break; - default: + OneNoteApplication.CreateSectionGroup(sectionGroup, newSectionGroupName, true); break; } - context.API.ChangeQuery(context.CurrentPluginMetadata.ActionKeyword); + context.API.ChangeQuery(ActionKeyword, true); return true; - } + }, }; } - public Result CreateNewNotebookResult(string notebookTitle) + public Result CreateNewNotebookResult(string newNotebookName) { - notebookTitle = notebookTitle.Trim(); - bool validTitle = OneNoteApplication.IsNotebookNameValid(notebookTitle); + newNotebookName = newNotebookName.Trim(); + bool validTitle = OneNoteApplication.IsNotebookNameValid(newNotebookName); return new Result { - Title = $"Create notebook: \"{notebookTitle}\"", + Title = $"Create notebook: \"{newNotebookName}\"", SubTitle = validTitle ? $"Location: {OneNoteApplication.GetDefaultNotebookLocation()}" : $"Notebook names cannot contain: {string.Join(' ', OneNoteApplication.InvalidNotebookChars)}", + AutoCompleteText = $"{GetAutoCompleteText}{newNotebookName}", IcoPath = Icons.NewNotebook, Action = c => { if (!validTitle) + { return false; + } - OneNoteApplication.CreateNotebook(notebookTitle, true); - - context.API.ChangeQuery(context.CurrentPluginMetadata.ActionKeyword); + OneNoteApplication.CreateNotebook(newNotebookName, true); + context.API.ChangeQuery(ActionKeyword, true); return true; - } + }, }; } + + public List ContextMenu(Result selectedResult) + { + var results = new List(); + if (selectedResult.ContextData is IOneNoteItem item) + { + var result = CreateOneNoteItemResult(item, false); + result.Title = $"Open and sync \"{item.Name}\""; + result.SubTitle = string.Empty; + result.ContextData = null; + results.Add(result); - #endregion - - public static List NoMatchesFoundResult() + if (item is not OneNotePage) + { + results.Add(new Result + { + Title = "Show in Notebook Explorer", + SubTitle = result.AutoCompleteText, + Score = - 1000, + IcoPath = Icons.NotebookExplorer, + Action = _ => + { + context.API.ChangeQuery(result.AutoCompleteText); + return false; + } + }); + } + } + return results; + } + + + public static List NoMatchesFound() { return SingleResult("No matches found", "Try searching something else, or syncing your notebooks.", diff --git a/Flow.Launcher.Plugin.OneNote/Settings.cs b/Flow.Launcher.Plugin.OneNote/Settings.cs index ba823fc..9f3abbb 100644 --- a/Flow.Launcher.Plugin.OneNote/Settings.cs +++ b/Flow.Launcher.Plugin.OneNote/Settings.cs @@ -34,5 +34,7 @@ public bool CreateColoredIcons get => createColoredIcons; set => SetProperty(ref createColoredIcons, value); } + + public PluginTheme PluginTheme { get; set; } = PluginTheme.Color; } } diff --git a/Flow.Launcher.Plugin.OneNote/UI/ViewModels/SettingsViewModel.cs b/Flow.Launcher.Plugin.OneNote/UI/ViewModels/SettingsViewModel.cs index 4a0e9b3..23c928a 100644 --- a/Flow.Launcher.Plugin.OneNote/UI/ViewModels/SettingsViewModel.cs +++ b/Flow.Launcher.Plugin.OneNote/UI/ViewModels/SettingsViewModel.cs @@ -25,10 +25,11 @@ public SettingsViewModel(PluginInitContext context, Settings settings) public IEnumerable DefaultRecentCountOptions => Enumerable.Range(1, 16); #pragma warning restore CA1822 // Mark members as static - public string NotebookIcon => Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Icons.Notebook); - public string SectionIcon => Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Icons.Section); - public void OpenNotebookIconsFolder() => context.API.OpenDirectory(Icons.NotebookIconDirectory); - public void OpenSectionIconsFolder() => context.API.OpenDirectory(Icons.SectionIconDirectory); + // public string NotebookIcon => Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Icons.Notebook); + // public string SectionIcon => Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Icons.Section); + public void OpenGeneratedIconsFolder() => context.API.OpenDirectory(Icons.GeneratedImagesDirectoryInfo.FullName); + // public void OpenNotebookIconsFolder() => context.API.OpenDirectory(Icons.NotebookIconDirectory); + // public void OpenSectionIconsFolder() => context.API.OpenDirectory(Icons.SectionIconDirectory); public void ClearCachedIcons() => Icons.ClearCachedIcons(); } } \ No newline at end of file diff --git a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml index fdbb7af..fcc79dc 100644 --- a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml +++ b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml @@ -95,42 +95,42 @@ - diff --git a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml.cs b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml.cs index a068b9a..dff5619 100644 --- a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml.cs +++ b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml.cs @@ -45,15 +45,19 @@ private async void ClearCachedIcons(object sender, RoutedEventArgs e) } } - private void OpenNotebookIconsFolder(object sender, RoutedEventArgs e) + private void OpenGeneratedIconsFolder(object sender, RoutedEventArgs e) { - viewModel.OpenNotebookIconsFolder(); - } - - private void OpenSectionIconsFolder(object sender, RoutedEventArgs e) - { - viewModel.OpenSectionIconsFolder(); + viewModel.OpenGeneratedIconsFolder(); } + // private void OpenNotebookIconsFolder(object sender, RoutedEventArgs e) + // { + // viewModel.OpenNotebookIconsFolder(); + // } + // + // private void OpenSectionIconsFolder(object sender, RoutedEventArgs e) + // { + // viewModel.OpenSectionIconsFolder(); + // } private void EditButton_Click(object sender, RoutedEventArgs e) { From d09f5fa4488145f47e02a02292054f3a3347b935 Mon Sep 17 00:00:00 2001 From: Odotocodot <48138990+Odotocodot@users.noreply.github.com> Date: Fri, 24 May 2024 17:06:49 +0100 Subject: [PATCH 04/39] Update SearchManager.cs --- Flow.Launcher.Plugin.OneNote.sln | 6 - Flow.Launcher.Plugin.OneNote/Main.cs | 16 +- Flow.Launcher.Plugin.OneNote/SearchManager.cs | 510 ++++++++---------- 3 files changed, 228 insertions(+), 304 deletions(-) diff --git a/Flow.Launcher.Plugin.OneNote.sln b/Flow.Launcher.Plugin.OneNote.sln index 7c6236a..7c0a2a6 100644 --- a/Flow.Launcher.Plugin.OneNote.sln +++ b/Flow.Launcher.Plugin.OneNote.sln @@ -13,8 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution release.ps1 = release.ps1 EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Odotocodot.OneNote.Linq", "Odotocodot.OneNote.Linq\Odotocodot.OneNote.Linq\Odotocodot.OneNote.Linq.csproj", "{AB2CEDD9-15DB-4EAF-A675-10928E83918D}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -25,10 +23,6 @@ Global {3801047C-BEF0-4774-91DB-B64EEE874BB2}.Debug|Any CPU.Build.0 = Debug|Any CPU {3801047C-BEF0-4774-91DB-B64EEE874BB2}.Release|Any CPU.ActiveCfg = Release|Any CPU {3801047C-BEF0-4774-91DB-B64EEE874BB2}.Release|Any CPU.Build.0 = Release|Any CPU - {AB2CEDD9-15DB-4EAF-A675-10928E83918D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AB2CEDD9-15DB-4EAF-A675-10928E83918D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AB2CEDD9-15DB-4EAF-A675-10928E83918D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AB2CEDD9-15DB-4EAF-A675-10928E83918D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Flow.Launcher.Plugin.OneNote/Main.cs b/Flow.Launcher.Plugin.OneNote/Main.cs index 7a854a5..568e23b 100644 --- a/Flow.Launcher.Plugin.OneNote/Main.cs +++ b/Flow.Launcher.Plugin.OneNote/Main.cs @@ -9,6 +9,7 @@ public class Main : IAsyncPlugin, IContextMenu, ISettingProvider, IDisposable { private PluginInitContext context; + private ResultCreator resultCreator; private SearchManager searchManager; private Settings settings; @@ -18,7 +19,8 @@ public Task InitAsync(PluginInitContext context) this.context = context; settings = context.API.LoadSettingJsonStorage(); Icons.Init(context, settings); - searchManager = new SearchManager(context, settings, new ResultCreator(context, settings)); + resultCreator = new ResultCreator(context, settings); + searchManager = new SearchManager(context, settings, resultCreator); semaphore = new SemaphoreSlim(1,1); context.API.VisibilityChanged += OnVisibilityChanged; return Task.CompletedTask; @@ -46,22 +48,16 @@ public async Task> QueryAsync(Query query, CancellationToken token) var init = OneNoteInitAsync(token); if (string.IsNullOrEmpty(query.Search)) - return searchManager.EmptyQuery(); + return resultCreator.EmptyQuery(); await init; - return query.FirstSearch switch - { - string fs when fs.StartsWith(settings.Keywords.RecentPages) => searchManager.RecentPages(fs), - string fs when fs.StartsWith(settings.Keywords.NotebookExplorer) => searchManager.NotebookExplorer(query), - string fs when fs.StartsWith(settings.Keywords.TitleSearch) => searchManager.TitleSearch(string.Join(' ', query.SearchTerms), OneNoteApplication.GetNotebooks()), - _ => searchManager.DefaultSearch(query.Search) - }; + return searchManager.Query(query); } public List LoadContextMenus(Result selectedResult) { - return searchManager.ContextMenu(selectedResult); + return resultCreator.ContextMenu(selectedResult); } public System.Windows.Controls.Control CreateSettingPanel() diff --git a/Flow.Launcher.Plugin.OneNote/SearchManager.cs b/Flow.Launcher.Plugin.OneNote/SearchManager.cs index cb8c93e..d54f349 100644 --- a/Flow.Launcher.Plugin.OneNote/SearchManager.cs +++ b/Flow.Launcher.Plugin.OneNote/SearchManager.cs @@ -9,357 +9,291 @@ public class SearchManager { private readonly PluginInitContext context; private readonly Settings settings; - private readonly ResultCreator rc; + private readonly ResultCreator resultCreator; + private readonly NotebookExplorer notebookExplorer; public SearchManager(PluginInitContext context, Settings settings, ResultCreator resultCreator) { this.context = context; this.settings = settings; - rc = resultCreator; + this.resultCreator = resultCreator; + notebookExplorer = new NotebookExplorer(this, resultCreator); } - #region Notebook Explorer - public List NotebookExplorer(Query query) - { - var results = new List(); - - string fullSearch = query.Search.Remove(query.Search.IndexOf(settings.Keywords.NotebookExplorer), settings.Keywords.NotebookExplorer.Length); - - IOneNoteItem parent = null; - IEnumerable collection = OneNoteApplication.GetNotebooks(); - string[] searches = fullSearch.Split(Keywords.NotebookExplorerSeparator, StringSplitOptions.None); - - for (int i = -1; i < searches.Length - 1; i++) + internal List Query(Query query) + { + return query.Search switch { - if (i < 0) - continue; + string s when s.StartsWith(settings.Keywords.RecentPages) + => RecentPages(s), - parent = collection.FirstOrDefault(item => item.Name == searches[i]); - if (parent == null) - return results; + string s when s.StartsWith(settings.Keywords.NotebookExplorer) + => notebookExplorer.Query(query), - collection = parent.Children; - } + string s when s.StartsWith(settings.Keywords.TitleSearch) + => TitleSearch(s, null, OneNoteApplication.GetNotebooks()), - string lastSearch = searches[^1]; + _ => DefaultSearch(query.Search), + }; + } - results = lastSearch switch + private List DefaultSearch(string query) + { + // Check for invalid start of query i.e. symbols + if (!char.IsLetterOrDigit(query[0])) { - //Empty search so show all in collection - string ls when string.IsNullOrWhiteSpace(ls) - => NotebookEmptySearch(parent, collection), - - //Search by title - string ls when ls.StartsWith(settings.Keywords.TitleSearch) && parent is not OneNotePage - => TitleSearch(ls, collection, parent), + return ResultCreator.InvalidQuery(); + } - //scoped search - string ls when ls.StartsWith(settings.Keywords.ScopedSearch) && (parent is OneNoteNotebook || parent is OneNoteSectionGroup) - => ScopedSearch(ls, parent), + var results = OneNoteApplication.FindPages(query) + .Select(pg => resultCreator.CreatePageResult(pg, query)); - //default search - _ => NotebookDefaultSearch(parent, collection, lastSearch) - }; + return results.Any() ? results.ToList() : ResultCreator.NoMatchesFound(); + } - if (parent != null) + private List TitleSearch(string query, IOneNoteItem? parent, IEnumerable currentCollection) + { + if (query.Length == settings.Keywords.TitleSearch.Length && parent == null) { - var result = rc.CreateOneNoteItemResult(parent, false, score: 4000); - result.Title = $"Open \"{parent.Name}\" in OneNote"; - result.SubTitle = lastSearch switch - { - string ls when ls.StartsWith(settings.Keywords.TitleSearch) - => $"Now search by title in \"{parent.Name}\"", + return ResultCreator.SingleResult($"Now searching by title.", null, Icons.Search); + } - string ls when ls.StartsWith(settings.Keywords.ScopedSearch) - => $"Now searching all pages in \"{parent.Name}\"", + List highlightData = null; + int score = 0; - _ => $"Use \'{settings.Keywords.ScopedSearch}\' to search this item. Use \'{settings.Keywords.TitleSearch}\' to search by title in this item", - }; + var currentSearch = query[settings.Keywords.TitleSearch.Length..]; - results.Add(result); - } + var results = currentCollection.Traverse(item => SettingsCheck(item) && FuzzySearch(item.Name, currentSearch, out highlightData, out score)) + .Select(item => resultCreator.CreateOneNoteItemResult(item, false, highlightData, score)) + .ToList(); - return results; + return results.Any() ? results : ResultCreator.NoMatchesFound(); } - private List NotebookDefaultSearch(IOneNoteItem parent, IEnumerable collection, string lastSearch) + private List RecentPages(string query) { - List highlightData = null; - int score = 0; - - var results = collection.Where(SettingsCheck) - .Where(item => FuzzySearch(item.Name, lastSearch, out highlightData, out score)) - .Select(item => rc.CreateOneNoteItemResult(item, true, highlightData, score)) - .ToList(); - - AddCreateNewOneNoteItemResults(results, parent, lastSearch); - return results; + int count = settings.DefaultRecentsCount; + + if (query.Length > settings.Keywords.RecentPages.Length && int.TryParse(query[settings.Keywords.RecentPages.Length..], out int userChosenCount)) + count = userChosenCount; + + return OneNoteApplication.GetNotebooks() + .GetPages() + .Where(SettingsCheck) + .OrderByDescending(pg => pg.LastModified) + .Take(count) + .Select(resultCreator.CreateRecentPageResult) + .ToList(); + } + private bool FuzzySearch(string itemName, string search, out List highlightData, out int score) + { + var matchResult = context.API.FuzzySearch(search, itemName); + highlightData = matchResult.MatchData; + score = matchResult.Score; + return matchResult.IsSearchPrecisionScoreMet(); } + private bool SettingsCheck(IOneNoteItem item) + { + bool success = true; + if (!settings.ShowEncrypted && item is OneNoteSection section) + success = !section.Encrypted; - private List NotebookEmptySearch(IOneNoteItem parent, IEnumerable collection) + if (!settings.ShowRecycleBin && item.IsInRecycleBin()) + success = false; + return success; + } + private sealed class NotebookExplorer { - List results = collection.Where(SettingsCheck) - .Select(item => rc.CreateOneNoteItemResult(item, true)) - .ToList(); - if (!results.Any()) + private readonly SearchManager searchManager; + private readonly ResultCreator resultCreator; + //private readonly IconProvider _iconProvider; + + private Keywords Keywords => searchManager.settings.Keywords; + internal NotebookExplorer(SearchManager searchManager, ResultCreator resultCreator/*, IconProvider iconProvider*/) { - switch (parent) //parent can be null if the collection contains notebooks. - { - case OneNoteNotebook: - case OneNoteSectionGroup: - //can create section/section group - results.Add(NoItemsInCollectionResult("section", Icons.NewSection, "(unencrypted) section")); - results.Add(NoItemsInCollectionResult("section group", Icons.NewSectionGroup)); - break; - case OneNoteSection section: - //can create page - if (!section.Locked) - results.Add(NoItemsInCollectionResult("page", Icons.NewPage)); - break; - default: - break; - } + this.searchManager = searchManager; + this.resultCreator = resultCreator; + //_iconProvider = iconProvider; } - return results; - - static Result NoItemsInCollectionResult(string title, string iconPath, string subTitle = null) + internal List Query(Query query) { - return new Result + var results = new List(); + + string fullSearch = query.Search[(query.Search.IndexOf(Keywords.NotebookExplorer) + Keywords.NotebookExplorer.Length)..]; + + IOneNoteItem parent = null; + IEnumerable collection = OneNoteApplication.GetNotebooks(); + + string[] searches = fullSearch.Split(Keywords.NotebookExplorerSeparator, StringSplitOptions.None); + + for (int i = -1; i < searches.Length - 1; i++) { - Title = $"Create {title}: \"\"", - SubTitle = $"No {subTitle ?? title}s found. Type a valid title to create one", - IcoPath = iconPath, - }; - } - } + if (i < 0) + { + continue; + } - private List ScopedSearch(string query, IOneNoteItem parent) - { - if (query.Length == settings.Keywords.ScopedSearch.Length) - return ResultCreator.NoMatchesFoundResult(); + parent = collection.FirstOrDefault(item => item.Name.Equals(searches[i])); + if (parent == null) + { + return results; + } - if (!char.IsLetterOrDigit(query[settings.Keywords.ScopedSearch.Length])) - return ResultCreator.InvalidQuery(); + collection = parent.Children; + } - string currentSearch = query[settings.Keywords.TitleSearch.Length..]; - var results = new List(); + string lastSearch = searches[^1]; - results = OneNoteApplication.FindPages(currentSearch, parent) - .Select(pg => rc.CreatePageResult(pg, currentSearch)) - .ToList(); + results = lastSearch switch + { + // Empty search so show all in collection + string search when string.IsNullOrWhiteSpace(search) + => EmptySearch(parent, collection), - if (!results.Any()) - results = ResultCreator.NoMatchesFoundResult(); + // Search by title + string search when search.StartsWith(Keywords.TitleSearch) && parent is not OneNotePage + => searchManager.TitleSearch(search, parent, collection), - return results; - } + // Scoped search + string search when search.StartsWith(Keywords.ScopedSearch) && parent is OneNoteNotebook or OneNoteSectionGroup + => ScopedSearch(search, parent), - private void AddCreateNewOneNoteItemResults(List results, IOneNoteItem parent, string query) - { - if (!results.Any(result => string.Equals(query.Trim(), result.Title, StringComparison.OrdinalIgnoreCase))) - { - if (parent?.IsInRecycleBin() == true) - return; + // Default search + _ => Explorer(lastSearch, parent, collection), + }; - switch (parent) + if (parent != null) { - case null: - results.Add(rc.CreateNewNotebookResult(query)); - break; - case OneNoteNotebook: - case OneNoteSectionGroup: - results.Add(rc.CreateNewSectionResult(query, parent)); - results.Add(rc.CreateNewSectionGroupResult(query, parent)); - break; - case OneNoteSection section: - if (!section.Locked) - results.Add(ResultCreator.CreateNewPageResult(query, section)); - break; - default: - break; + var result = resultCreator.CreateOneNoteItemResult(parent, false, score: 4000); + result.Title = $"Open \"{parent.Name}\" in OneNote"; + result.SubTitle = lastSearch switch + { + string search when search.StartsWith(Keywords.TitleSearch) + => $"Now search by title in \"{parent.Name}\"", + + string search when search.StartsWith(Keywords.ScopedSearch) + => $"Now searching all pages in \"{parent.Name}\"", + + _ => $"Use \'{Keywords.ScopedSearch}\' to search this item. Use \'{Keywords.TitleSearch}\' to search by title in this item", + }; + + results.Add(result); } + + return results; } - } - #endregion - public List EmptyQuery() - { - return new List + private List EmptySearch(IOneNoteItem parent, IEnumerable collection) { - new Result - { - Title = "Search OneNote pages", - SubTitle = $"Type \"{settings.Keywords.NotebookExplorer}\" or select this option to search by notebook structure ", - AutoCompleteText = $"{context.CurrentPluginMetadata.ActionKeyword} {settings.Keywords.NotebookExplorer}", - IcoPath = Icons.Logo, - Score = 2000, - Action = c => - { - context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeyword} {settings.Keywords.NotebookExplorer}"); - return false; - }, - }, - new Result - { - Title = "See recent pages", - SubTitle = $"Type \"{settings.Keywords.RecentPages}\" or select this option to see recently modified pages", - AutoCompleteText = $"{context.CurrentPluginMetadata.ActionKeyword} {settings.Keywords.RecentPages}", - IcoPath = Icons.Recent, - Score = -1000, - Action = c => - { - context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeyword} {settings.Keywords.RecentPages}"); - return false; - }, - }, - new Result - { - Title = "New quick note", - IcoPath = Icons.NewPage, - Score = -4000, - Action = c => - { - OneNoteApplication.CreateQuickNote(true); - return true; - } - }, - new Result + List results = collection.Where(searchManager.SettingsCheck) + .Select(item => resultCreator.CreateOneNoteItemResult(item, true)) + .ToList(); + if (!results.Any()) { - Title = "Open and sync notebooks", - IcoPath = Icons.Sync, - Score = int.MinValue, - Action = c => + // parent can be null if the collection only contains notebooks. + switch (parent) { - foreach (var notebook in OneNoteApplication.GetNotebooks()) - { - notebook.Sync(); - } - OneNoteApplication.GetNotebooks() - .GetPages() - .OrderByDescending(pg => pg.LastModified) - .First() - .OpenInOneNote(); - return true; + case OneNoteNotebook: + case OneNoteSectionGroup: + // Can create section/section group + results.Add(NoItemsInCollectionResult("section", Icons.NewSection, "(unencrypted) section")); + results.Add(NoItemsInCollectionResult("section group", Icons.NewSectionGroup)); + break; + case OneNoteSection section: + // Can create page + if (!section.Locked) + { + results.Add(NoItemsInCollectionResult("page", Icons.NewPage)); + } + + break; } - }, - }; - } - public List DefaultSearch(string query) - { - //Check for invalid start of query i.e. symbols - if (!char.IsLetterOrDigit(query[0])) - return ResultCreator.InvalidQuery(); + } - var results = OneNoteApplication.FindPages(query) - .Select(pg => rc.CreatePageResult(pg, query)); - if (results.Any()) - return results.ToList(); + return results; - return ResultCreator.NoMatchesFoundResult(); - } - public List TitleSearch(string query, IEnumerable currentCollection, IOneNoteItem parent = null) - { - if (query.Length == settings.Keywords.TitleSearch.Length && parent == null) - return ResultCreator.SingleResult($"Now searching by title.", null, Icons.Search); + static Result NoItemsInCollectionResult(string title, string iconPath, string? subTitle = null) + { + return new Result + { + Title = $"Create {title}: \"\"", + SubTitle = $"No {subTitle ?? title}s found. Type a valid title to create one", + IcoPath = iconPath, + }; + } + } - List highlightData = null; - int score = 0; + private List ScopedSearch(string query, IOneNoteItem parent) + { + if (query.Length == Keywords.ScopedSearch.Length) + { + return ResultCreator.NoMatchesFound(); + } - var currentSearch = query[settings.Keywords.TitleSearch.Length..]; + if (!char.IsLetterOrDigit(query[Keywords.ScopedSearch.Length])) + { + return ResultCreator.InvalidQuery(); + } - var results = currentCollection.Traverse(item => - { - if (!SettingsCheck(item)) - return false; + string currentSearch = query[Keywords.TitleSearch.Length..]; + var results = new List(); - return FuzzySearch(item.Name, currentSearch, out highlightData, out score); - }) - .Select(item => rc.CreateOneNoteItemResult(item, false, highlightData, score)) + results = OneNoteApplication.FindPages(currentSearch, parent) + .Select(pg => resultCreator.CreatePageResult(pg, currentSearch)) .ToList(); - if (!results.Any()) - results = ResultCreator.NoMatchesFoundResult(); - - return results; - } - public List RecentPages(string query) - { - int count = settings.DefaultRecentsCount; - if (query.Length > settings.Keywords.RecentPages.Length && int.TryParse(query[settings.Keywords.RecentPages.Length..], out int userChosenCount)) - count = userChosenCount; + if (!results.Any()) + { + results = ResultCreator.NoMatchesFound(); + } - return OneNoteApplication.GetNotebooks() - .GetPages() - .Where(SettingsCheck) - .OrderByDescending(pg => pg.LastModified) - .Take(count) - .Select(pg => - { - Result result = rc.CreatePageResult(pg); - result.SubTitleToolTip = result.SubTitle; - result.SubTitle = $"{GetLastEdited(DateTime.Now - pg.LastModified)}\t{result.SubTitle}"; - result.IcoPath = Icons.RecentPage; - return result; - }) - .ToList(); - } - public List ContextMenu(Result selectedResult) - { - var results = new List(); - if (selectedResult.ContextData is IOneNoteItem item) + return results; + } +#nullable enable + private List Explorer(string search, IOneNoteItem? parent, IEnumerable collection) { - var result = rc.CreateOneNoteItemResult(item, false); - result.Title = $"Open and sync \"{item.Name}\""; - result.SubTitle = string.Empty; - result.ContextData = null; - results.Add(result); + List? highlightData = null; + int score = 0; + + var results = collection.Where(searchManager.SettingsCheck) + .Where(item => searchManager.FuzzySearch(item.Name, search, out highlightData, out score)) + .Select(item => resultCreator.CreateOneNoteItemResult(item, true, highlightData, score)) + .ToList(); + + AddCreateNewOneNoteItemResults(search, parent, results); + return results; } - return results; - } - private static string GetLastEdited(TimeSpan diff) - { - string lastEdited = "Last edited "; - if (PluralCheck(diff.TotalDays, "day", ref lastEdited) - || PluralCheck(diff.TotalHours, "hour", ref lastEdited) - || PluralCheck(diff.TotalMinutes, "min", ref lastEdited) - || PluralCheck(diff.TotalSeconds, "sec", ref lastEdited)) - return lastEdited; - else - return lastEdited += "Now."; - - static bool PluralCheck(double totalTime, string timeType, ref string lastEdited) + + private void AddCreateNewOneNoteItemResults(string newItemName, IOneNoteItem? parent, List results) { - var roundedTime = (int)Math.Round(totalTime); - if (roundedTime > 0) + if (!results.Any(result => string.Equals(newItemName.Trim(), result.Title, StringComparison.OrdinalIgnoreCase))) { - string plural = roundedTime == 1 ? "" : "s"; - lastEdited += $"{roundedTime} {timeType}{plural} ago."; - return true; - } - else - return false; + if (parent?.IsInRecycleBin() == true) + { + return; + } + switch (parent) + { + case null: + results.Add(resultCreator.CreateNewNotebookResult(newItemName)); + break; + case OneNoteNotebook: + case OneNoteSectionGroup: + results.Add(resultCreator.CreateNewSectionResult(newItemName, parent)); + results.Add(resultCreator.CreateNewSectionGroupResult(newItemName, parent)); + break; + case OneNoteSection section: + if (!section.Locked) + { + results.Add(resultCreator.CreateNewPageResult(newItemName, section)); + } + + break; + } + } } } - private bool FuzzySearch(string itemName, string search, out List highlightData, out int score) - { - var matchResult = context.API.FuzzySearch(search, itemName); - highlightData = matchResult.MatchData; - score = matchResult.Score; - return matchResult.IsSearchPrecisionScoreMet(); - } - private bool SettingsCheck(IOneNoteItem item) - { - bool success = true; - if (!settings.ShowEncrypted && item is OneNoteSection section) - success = !section.Encrypted; - - if (!settings.ShowRecycleBin && item.IsInRecycleBin()) - success = false; - return success; - } - } - } From 6c4b08363d307778c5f44eed77b81ab8e958fa21 Mon Sep 17 00:00:00 2001 From: Odotocodot <48138990+Odotocodot@users.noreply.github.com> Date: Fri, 24 May 2024 17:13:41 +0100 Subject: [PATCH 05/39] Remove unneeded files and comments --- Flow.Launcher.Plugin.OneNote/Icons.cs | 35 ++------ .../Images/new_notebook.png | Bin 2184 -> 0 bytes .../Images/new_page.png | Bin 6356 -> 0 bytes .../Images/new_section.png | Bin 2281 -> 0 bytes .../Images/new_section_group.png | Bin 2840 -> 0 bytes .../Images/notebook.png | Bin 298 -> 0 bytes .../Images/recent.png | Bin 3130 -> 0 bytes .../Images/recent_page.png | Bin 6921 -> 0 bytes .../Images/recycle_bin.png | Bin 2181 -> 0 bytes .../Images/refresh.png | Bin 3169 -> 0 bytes .../Images/section.png | Bin 274 -> 0 bytes .../Images/section_group.png | Bin 469 -> 0 bytes .../Images/warning.png | Bin 1867 -> 0 bytes .../OneNoteItemIcons.cs | 85 ------------------ .../UI/Views/SettingsView.xaml | 34 ------- 15 files changed, 6 insertions(+), 148 deletions(-) delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/new_notebook.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/new_page.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/new_section.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/new_section_group.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/notebook.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/recent.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/recent_page.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/recycle_bin.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/refresh.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/section.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/section_group.png delete mode 100644 Flow.Launcher.Plugin.OneNote/Images/warning.png delete mode 100644 Flow.Launcher.Plugin.OneNote/OneNoteItemIcons.cs diff --git a/Flow.Launcher.Plugin.OneNote/Icons.cs b/Flow.Launcher.Plugin.OneNote/Icons.cs index ddf10b1..7a5bdf4 100644 --- a/Flow.Launcher.Plugin.OneNote/Icons.cs +++ b/Flow.Launcher.Plugin.OneNote/Icons.cs @@ -10,7 +10,7 @@ namespace Flow.Launcher.Plugin.OneNote { - public class Icons// : BaseModel + public class Icons { public const string Logo = "Images/logo.png"; @@ -22,21 +22,14 @@ public class Icons// : BaseModel : GetIconLocal("warning"); public static string Search => GetIconLocal("search"); - //public static string RecycleBin => GetIconLocal("recycle_bin"); public static string Recent => GetIconLocal("page_recent"); public static string NotebookExplorer => GetIconLocal("notebook_explorer"); public static string QuickNote => NewPage; - // public const string Page = Logo; - // public const string Section = "Images/section.png"; - // public const string SectionGroup = "Images/section_group.png"; - // public const string Notebook = "Images/notebook.png"; public static string NewPage => GetIconLocal("page_new"); public static string NewSection => GetIconLocal("section_new"); public static string NewSectionGroup => GetIconLocal("section_group_new"); public static string NewNotebook => GetIconLocal("notebook_new"); - - // private OneNoteItemIcons notebookIcons; - // private OneNoteItemIcons sectionIcons; + private Settings settings; private static PluginTheme pluginTheme; @@ -59,29 +52,18 @@ private static string GetPluginThemeString(PluginTheme pluginTheme) public int CachedIconCount => iconCache.Keys.Count(k => char.IsDigit(k.Split('.')[1][1])); //TODO: UPdate on use for UI - public string CachedIconsFileSize => GetCachedIconsMemorySize();//GetBytesReadable(notebookIcons.IconsFileSize + sectionIcons.IconsFileSize); - // public static string NotebookIconDirectory { get; private set; } - // public static string SectionIconDirectory { get; private set; } - - + public string CachedIconsFileSize => GetCachedIconsMemorySize(); + private static readonly Lazy lazy = new(); public static Icons Instance => lazy.Value; public static void Init(PluginInitContext context, Settings settings) { pluginTheme = settings.PluginTheme; - // NotebookIconDirectory = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "Images", "NotebookIcons"); - // SectionIconDirectory = Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "Images", "SectionIcons"); - // - // Instance.notebookIcons = new OneNoteItemIcons(NotebookIconDirectory, Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Notebook)); - // Instance.sectionIcons = new OneNoteItemIcons(SectionIconDirectory, Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Section)); Instance.imagesDirectory = $"{context.CurrentPluginMetadata.PluginDirectory}/Images/"; - // Instance.GeneratedImagesDirectory = $"{context.CurrentPluginMetadata.PluginDirectory}/Images/Generated/"; GeneratedImagesDirectoryInfo = Directory.CreateDirectory($"{context.CurrentPluginMetadata.PluginDirectory}/Images/Generated/"); - // Instance.notebookIcons.PropertyChanged += Instance.IconCountChanged; - // Instance.sectionIcons.PropertyChanged += Instance.IconCountChanged; Instance.settings = settings; @@ -93,14 +75,9 @@ public static void Init(PluginInitContext context, Settings settings) public static void Close() { - // Instance.notebookIcons.PropertyChanged -= Instance.IconCountChanged; - // Instance.sectionIcons.PropertyChanged -= Instance.IconCountChanged; + // TODO } - // private void IconCountChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) - // { - // OnPropertyChanged(nameof(CachedIconCount)); - // OnPropertyChanged(nameof(CachedIconsFileSize)); - // } + private static BitmapImage BitmapImageFromPath(string path) => new BitmapImage(new Uri(path)); public static Result.IconDelegate GetIcon(string prefix, Color? color) diff --git a/Flow.Launcher.Plugin.OneNote/Images/new_notebook.png b/Flow.Launcher.Plugin.OneNote/Images/new_notebook.png deleted file mode 100644 index 6eef320280454caeff83a39dd88c300d45d93fdd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2184 zcmV;32zU31P)Px-LPAKoG~_&Es{EHcb_=3`?>Lix?4x+!hj8bqwDJ|9cKUCa3*x z000000000000%_GoV(@jIgWYc=GR&Qe+{bJE)PR5kqZQSZ2xYCa)Drvzy*TA0fB%J z5Yh2t0pS9HfDjM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RC9BrW5S1kUCZFo_O; z+MO`_#MA98@onJ|!i?GZ0t)4{W3=-L+QK8Lh<#z95>eYfsz*^ww~OKkL92Mu+g8mP zP^e7Q9-eZ{lb`zxX3y)VTg{v|hetj8Nkp-01CKB?obx(RXa;=@GT!ncVO;6sp^tqe zpZMOFF%w7+{Bgp)Z(GAS@z4L~zR7z&^5d`KO3}d=37cO69K?MkqDr}CJVH2WYvSv9 z0t(G_)7hk<)(^>WP@XlNs8W9L!%&-FiBTIGB`X)Z{qITa?uCb}MZ)wo;9ACmgq-fo zc?%Sp=cZ3;uX41jLTG6hGi!JO~8b`*wSH5Hc44<=rErSsgj)4~dN0 z+qX4YJOVjgoAV?(^w_wcSW%&Pn%^_(3?5T`tX5f;GoVnJm`BC43&$goRq=Qv~L$RWrVkA$IPfW;jI6slYF6Pbqc-14}{5mowl)%)MV(_is?p7N6C@Z^^~d;fpG z?1OJ6?knM9mn$A&gXP%&q8G1J{|pZFSPpaR9&fCftkL>Tj4{0;^{pIHo%B{+*{)zJh zZ<$JXWOhlpRDCZ{@9sr5Lla5lJ|yY7se?y1m6POSO+4KP6sjiDyG^=&3gEfcVQ&Y9 zdh1H{q3tsw{|1v?)Vp&YT{b>mdJC|fjJiJu3RMnV0bbwjB|MV;QI3ay2Go1|U+W1? z0N*p|6NU|SACC>n{6~QwH1SLgK%tY9M(J55I~p@}1&?$NYCIn}jkKu+D6|#$f|=f8 zVsXdtm==2J4Z!<>jpUsB&gvrwb)`3W$Ipe{giW2Wdk5tJ0000< KMNUMnLSTaKrT}mN diff --git a/Flow.Launcher.Plugin.OneNote/Images/new_page.png b/Flow.Launcher.Plugin.OneNote/Images/new_page.png deleted file mode 100644 index aee4a9b4184154f7804973ffbe88b2003e1f560a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6356 zcmZ{pcTf}EyT?iBC`IW4!V3sO=qSAiB8UnoN>Lz$E>abcL;{B10ugydI--IFFsOtY zNGKunprJ_#p^LO6D81Zx@B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;e!-}vbRFOT)&m5nvW^Z8_;bulbTyD;R}I_ zlSWgi{foZ`cFg>W=Sa?k#FdTy?xm7W?tM+gxgCaczx7f{5Bth`H$&U$bj?z$HdR8A zCd+X7PBI2jHT`0pJo}zZDV}X6B{oSI4t*eJmdn0P+r0QQ42|_*47|PfCHy3C9c_`&yd#>pML{PtfUHOJ;%WNEhzV>3(FXSaJ7zblN9upCIfYO z-dOe|v-aO|G47t)u%M>mZS-8f(T=1#HSbTfl zyXn`6i+%huxMm<5NnUDICJ{d*kwQVR=02@XJzW;f}}%>*?_KEw|=#Yy8!$&HTt zovy+1I2jULEvqX=q6k8EmuDzR+mJ8(-=pfq-c#8TF+X`XHqF1k7p$+? KT6{8x#Qhf^+?5~z diff --git a/Flow.Launcher.Plugin.OneNote/Images/new_section.png b/Flow.Launcher.Plugin.OneNote/Images/new_section.png deleted file mode 100644 index 0e46a9564201aec73ba84844ad38b00a6878acd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2281 zcmVPx-qe(vLl7oG>8w z%4>S>_x!WQ@*8K%DgiOKO=OjTY@PXwT_+$8jYmKN5|DU8KuO1cZPP5CQ@L zAs_^VfIvV92mv7=5D)@FKnMr~gn$qb0zyC_AOwVfc(iv9V2&hz9LC@3?qt?F+qP}n zmLC0W+qP}n=Gm6!Y>bg~_wRd3o@Zxo`!?C@%4BZqT~-#OPpc|e)=DH1>P+9)H7uc- zqgibaleRUqk)(})6(r3^HdBDX2(msyk4fAj=~joX(#-S%V1y3mUZQ|R7xs0obUeRR zl&j^pGfz{4*wKmpLVCIZ?gH+!Sx4g$qZ z7)yf(ftY|P6Z#wGJ^}piB?2e_`ZiZPV1F}vpU|#N2&LkA-dGn3_b%W+;UszrH%f|` zecxpN=pY^hyGizM<=G$VHnv6pGzIIWk6-F0aGW8D4&p%)NXT(`Y{~VxWhYQZ;SlD( z9OF_R;ATCB5R-;y(Z3`6@?d}U^+2sl0R=!Q#=q(1ehqdPp5|EkuT|Cl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R2Fnk_vsG8~6=_jnHe`S}y3rb(gbLB~bUtBOsu+~rL z8h3Vc2#8wTlR+RMV9Jy$T98mxr%p`9#$n)0qm~NK+^`5aD@{Ed_@`x}4?dh2<#G=k zA2uTIHJ9>;dSpJ_H=_iu({(MXVvWAoBGUL4?@nK_76vvRMnLd-5IpEX98z=xZ7D`} W5al`FOV5i|U4XrfGp^jqFaAHI;}jqO diff --git a/Flow.Launcher.Plugin.OneNote/Images/notebook.png b/Flow.Launcher.Plugin.OneNote/Images/notebook.png deleted file mode 100644 index b9f296d024d5f530135cd8b8681f689538814cf2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 298 zcmeAS@N?(olHy`uVBq!ia0vp^6F``S8Ays|{O<-*jKx9jP7LeL$-D$|6a#!hT!Hj| zyx_dz>z_bH+$BMN!3@$%uKa&pazw4lvCYf)Ay9aMr;B4q#jUs375SJ9cpNS|nKAVh zuv##&&vyK78${}ax#KOgLz^t7pqS0Lcu?envFS&qcBZ~#Gv zE)xq791&x@bzlCGHruN7;vmQF>%K*fpPxt1-C8IhC}{bcLFwDn=NT_b?SO7&@O1Ta JS?83{1OO#!eNF%X diff --git a/Flow.Launcher.Plugin.OneNote/Images/recent.png b/Flow.Launcher.Plugin.OneNote/Images/recent.png deleted file mode 100644 index ee9733660fac3f2230b8978a44961731e5e52842..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3130 zcmV-A48`+_P)MZQB--tZm!2ZQIP^Tx;uf%}XB7Bsm*t{_p!EP4{1!Ms;-! z#exM37A#n>V8Ma~3l`&riGaV{RLB#X2zfELTTZ=~QUPwW`Qd?E1$=W;5pNUuZ7WkD zKat#*6E+bJ5&kaWkmR*;Ga)ZQ^4X2Ih`2x8CgR>t83RbAdkI0pl5rWqZlW0xaI&d@ zCzJ?1MhHq0f1`|0U?$*CqAtxer3?*sTJ!I|O2tcWzcBGWN*<0Jx!zRB`OHMfwIkw> z;&;_a$uZo`MBIs#|I8aG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;Lk@OW2ek0%8=_0203ByhMHO=+At&y|6LCf{tij8+RF2#a@IJG3Q}v^f`3M8L$P`(8^7%&CUPr$?z0&_@!Ck|T<|VWFj@nM@&lQgpAnVs6?ols zMI8!`+ezPcUkz`#t)#=Wrv@J~N&{d(+WQ{sm_|SLl&bN#-Mp`D77ap~p4G-DOfcved!97+};0OO* zMrVL8eYP@nz71*#PebLH@eR zficMiZqzV%1N03IGR=IE9hkmA-5C-i7!Ho^34=Gl{!~X9oAh{_D7Ax3uT2HqKd({% z91~;gkii-N!*j6tW!##C8}u{*l5q7XLm_aKgehMP&H%VMnCJmGE;JG^qv}w0X8RCFo};G(poM#Ga>hwjDlgR z7kxJXCV`ccnSH`kZRZRvl`$q(n-Tg#9sXs2zA#6%9OHPVyR3vw$V-%#A)Omsk##0) zh!?7UCq4N+6uvLq2_LK6&$B(rT3!mCbn3{=n<-tu-6YSliJauEGeVE3W^|yoir_yDvyNz6d~~cyCs=ZGh0?=KeE_zPm{*e! zVl zIEJ}F>Cuk90xwI2vqc3fjC}--nCM9C8Wmi?p}MCTce7*k0{-^3UBE%WpGg@4Fs~+F z7KEX)a{CGl{ll14&$4)oM8-|y_-~e8!UP}VYxo`p%F>^mA8}INh(@Mwhi>l;4Q2w~ z1nFg~bd*iBSJRMz;To7-5YxcxknkOZn`wW(u>hCuFu@%zWN1rxTtLS)T)LArW)KnH z{pa-~xq})IeuU5+BbWatdVvKt0oVqkmyxi9@NX3ej=xb%coD+|uc4V?f%$fB5%9jp zjSi%_upsyG68Co#p_uS@3B{7vN^x6|Hhf`ty@A4%U^ U?l1&iE&u=k07*qoM6N<$f={62cK`qY diff --git a/Flow.Launcher.Plugin.OneNote/Images/recent_page.png b/Flow.Launcher.Plugin.OneNote/Images/recent_page.png deleted file mode 100644 index 9f7a5de6ed165239b33e26fc0bd3b026896be4f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6921 zcmZu$2UHW=)}9bLgx;Hli%1Pc0RiD+0j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c#w<9ii9fHtZ_U z37@7JGGIgHcKFKIGl1x>RYiR|dFV0#L=ep#@VRjoAjjMDg9IqBAp?d z&Bo3F8a2-Ze@Jr&JWjBH6VD4wP3?l!is2#XT?d9BFeyQ>8oUdn*#~+6(JHtrZ=40R z@%=&$itNlJtZTp?2{gg4>G z=d{Ds6vJoJ(JBUjXCe^If;;nC7Vu681cG<9t__v=a1{%f(*R%qo@9VH z0UwCWAUWA?r3p1Ae0G@c*6e~dAhQVGp`*_N^hbFI!2l4+2xO8DSgB0DwB7U!04HJd z%+vuj6 diff --git a/Flow.Launcher.Plugin.OneNote/Images/refresh.png b/Flow.Launcher.Plugin.OneNote/Images/refresh.png deleted file mode 100644 index 98e70e3f5ad012c4ee9cc53683706eb57ee39de5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3169 zcmZ`*dpMMN8y=@w$3z$*j6=>d6U9cG*whxPO(~~IshpBSIiCil+9~>$qO>6~PJ@_X z#t;%}ow9{6PQwgl#$Ysrc)#DYyZ?RPd)@Ez-p~De?&o=~_j><$@0~hvR8Cq=8U};O z9sA|*Y4BVW-jZS#*j+pFyhe&;xQeOHL99Drut-jC&1H*zoGVQ z5<}zdd@_Nd%_E*pV(OR78+n+<1@opQwWkyN8W#67EPMxV4~>VSE&`VYjVDwFA zrXOm8KsVJV6J~YuCKL{;UU&*xfz+&y3t&;hLQ}XvG^^#BkT{q+;RwJ%2NMcgIJb_6 zqVP;>xd33CDVYl(oC`)YZ~!-|VWX%#K)^&(64#UjmH~ugTEhYRfS$%A4v0qN1=HHa z?+Xh>6L4BR3!*VVH2~WP;1%1bifsr`IcES+F}IsIXFvpTc6a%#K0w*5o)9y7r89aZ zGrFa0po3Fgz>9^@D;8RS_;;#Jm@yD?md3t1!_0leBpOt2&vtyMU!Q^Z0RGLc105VZ+_u(SdB4&9gk=$bEu z3aHcql?DG66ft)dGqek*g_Z&)>34hw_|R8xo<89M!$JS&`qJbK-NrfTUrW<_ty2v_ zua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3&EZ(_D~b^?lm#BNb9dh@uG7NGMej{PVjdyMxlH&t-Y!jaH;cs^;`1s}Gur6KS!xJg41*;PeD~ibU%A zlFaH&X zL{O7zdlD{8R_&7T`BmaVwz?b6_6mX?7+mKeN=F34qw*R@7euO7U&o2fPc2DKXKxr4 z<6?sp<0N>kA{VGamuS-r8I>_2nQWNWByC|a+BG9xW7O59Vbiruy><8c^N3Qh47czH zV@?~1N#|?@$K8MCh^J{8TuMWaMM$Wpf4rR3imtGtuqhexu0iyxRY61b-BGO%1Dvjp zHEco=T>9MA>L0c^&`ah=V_5I+IMG~WT(~I4QPawK`YmYVTF$e;tjL%yI~8J ztCXCwv@-g@fY^6IYi}COsOQu1JEu?^8StUWL!DaZY?8x8iT(5VcRQAwTuRLr z+9Cqi6~pS|94KE3xYM`y$1A&e(XhP>XF@!!(B<;$M|SY*qw&@i1jGP8NZZ46HTU84 zoI|l3VIdEfy}u%6K_|aPCMZf<|P=iHji%TFh8 zfwE0;5=zP=iT21k-9CJ3eT%i4SyO_Tk}^T7u0VGP-+$n%(`S!7%8zy?o`U-1DFS=f zDc5ID*kPI z=rOeXfR|wXUJxycKI-4d%X9%Iay7_xCt0jp9@yOpJI)U$6T6st+sk8gkZrO?V6HOFjey6T2T zyPC}~TXxh`cSc9Q>iHe3S)OaoWVT%hf4su?{)5@j@HK~54SXF@%NtuMtE`l0^abcp zt|dnDHC)swdO1){jhB&n^y$MscTuO9W%XU^T3YH3t{llK!eEn}Ao-8Rt<7tRX;Ltl vHVk)qrnjf{|}BioH$%z@16W#_du9_ diff --git a/Flow.Launcher.Plugin.OneNote/Images/section.png b/Flow.Launcher.Plugin.OneNote/Images/section.png deleted file mode 100644 index e3368830d941e83970547faf1fa28938a986a1b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 274 zcmeAS@N?(olHy`uVBq!ia0vp^6F``S8Ays|{O<-*jKx9jP7LeL$-D%K1^9%x0_neh z|Nch;zkmO(>X&*1lwdCj@(X6@|9{h8^4QMm%2hz28J;eVAr-gY-U^p=GGuUmX#M+6 zVuQX=7mG?m)35Ib>e5?ll^&QET#DVRlX+2+?MtkHKtR0j1uwabOU)OmD(^K1WLdp8 z%utS85MX;@&eO)KTB(qjfZrw>Cs=svnHX^Z*1tK{ue$2C{Wu$WY)=;dzHKaTyC0qN ld2i46V?ECu+lGdQvh|C#8a^$ISr2q0gQu&X%Q~loCIA&7YYYGY diff --git a/Flow.Launcher.Plugin.OneNote/Images/section_group.png b/Flow.Launcher.Plugin.OneNote/Images/section_group.png deleted file mode 100644 index 9859d55aeb21da16dc72ca0a9cb91c37dddefa27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 469 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=7>k44ofy`glX(f`cnA1|xB}^8 z?>4V}K55;dH(e{9{P;cl>(BfhuNThR^5Xlirt=^7?>_V4*Pqo_KOf)tWby26Pv>vH zz326^wWn?^*!|?u>s24W_HDU&_{f#xUw*Xmmw6}vjT0&f@(X4-_a6j*{`}e2)@Jbk z|Nl=~3$>+y4v_M6aSW-r_2%5wg{=-etOxE2Y}yh1f2!S1J@)6_KCH=Mn@UpcDr!>g zeio&cEmP#p^l+BCG@-35O_ryUk?-e2$Au>ZxsEa(4iGwJxUfU+p8cN>9|do!PuW%e z-ESIu{*QGW_umR{+NQE#RhHYVWuiH?8oeARt=hWc)|K&1?VDhgzC!lNgn%s0lUi+E zZck=RP+gIkD7={d9AO diff --git a/Flow.Launcher.Plugin.OneNote/Images/warning.png b/Flow.Launcher.Plugin.OneNote/Images/warning.png deleted file mode 100644 index da4f21833369d41b1472f4c827d63cd388af22dd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1867 zcmV-R2ekN!P)Ae7C34%BaFlBuyIc_u+fGO({#7X&N2G{8qiO3h>jD7|8O`1gz z$CjQ86O?Z(!UY7e4}^1i#W6E+`LY1&7-;GcL97GU5gL*IO2XpJMR)`5BRK@I2I%x) ztMX-l(SrzL>B3dUHT5^^@*^mK$d|{`zkn(AXkNa> zsMCjCmv1h@DjpTAh z-${0}z2%sK{~i6Z0QyM_ENsZi2XG&mlub*|@m5Yc;S=-Xj((8`PoHb?RHPi2B{yEB zjx+U7E62=xPFWat^!N4k!IS6AwthFbOKHr8j}<;@^^E`U8S|uk)99B4c;SMXHg3rD zNw|(o$lxZx<*804ErzsMVxPPcVI1E%hnnexNA^Ep$$w{x?7@xoc-%9jP` z?d^s4ubN`-hOE&aArxGci5u_DcI1n^aoLQx@qkFOxKdyX{-|ont)B)_Yx3szsQ#Yy?b4SDzUl7ClD9%t%LPRkcrcBCUF-Y8#Wy_FiBmM>?)FQBP~ z>9q0Q=7xNcRhDfti5KbY?1W8MuX9|!3=b=zba{h)Ew|*0ti583NxVo$M+a=PcC{<= zWgtw~Ol|ogGKDkxv0L&*Hd?hYCf+DtWasrO-4Jg)mVO5Jk!dOXasxfvP5B~QtXXFg z-`?IH&EA`oyCz?Thv``)6#*^K&Na&2F2MHd)|kY%wY5ca(3T~x%8%U*v_N+Xp84tX zZp#EockXm|#hdR2{2Q{UxbI1G0-LqdDlLG zDX;n^U%cgb_8tpig`p~_udk10*?}rJeb+Lz7%a`FS;7wZut|^E3CI81;g0SxL zWijz}b#<}S*4DzB%an<~@l?Dqzyb%m-#&oR-~3v3j@>R#$To?Wsi~=fW42x7i+mBz z6xkNRrS<_#xyR4VcCfozh&D-=sjjYu{*DSiyP*m#M0% zf|}|o@wdLnmjR}1>hRJ-W{UH!-^a|QddsDBlX#h-u2TQxi-Z;6A>|v;$Qx-pdA`b*;i14~PQBPR;N6)&zK}ofRAJjS@=ek!Dk`E`f4Tg~ zQB?I^z6`JlqxRbeXv*vU$~W%?*Bm?>)>^s{8tclSp|%`W87_ni_L?m&W icons; - private readonly string iconDirectory; - private readonly string baseIconPath; - - public OneNoteItemIcons(string folderPath, string baseIconPath) - { - icons = new Dictionary(); - iconDirectory = folderPath; - this.baseIconPath = baseIconPath; - - Directory.CreateDirectory(iconDirectory); - foreach (var imagePath in Directory.EnumerateFiles(iconDirectory)) - { - if (int.TryParse(Path.GetFileNameWithoutExtension(imagePath), out int argb)) - icons.Add(Color.FromArgb(argb), imagePath); - } - } - public int IconCount => icons.Count; - - public long IconsFileSize => new DirectoryInfo(iconDirectory).EnumerateFiles() - .Select(file => file.Length) - .Aggregate(0L, (a, b) => a + b); - public void ClearCachedIcons() - { - icons.Clear(); - foreach (var img in new DirectoryInfo(iconDirectory).EnumerateFiles()) - { - img.Delete(); - } - OnPropertyChanged(nameof(IconCount)); - OnPropertyChanged(nameof(IconsFileSize)); - } - - public string GetIcon(Color color) - { - if (!icons.TryGetValue(color, out string path)) - { - //Create Colored Image - using var bitmap = new Bitmap(baseIconPath); - BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadWrite, bitmap.PixelFormat); - - int bytesPerPixel = Bitmap.GetPixelFormatSize(bitmap.PixelFormat) / 8; - byte[] pixels = new byte[bitmapData.Stride * bitmap.Height]; - IntPtr pointer = bitmapData.Scan0; - Marshal.Copy(pointer, pixels, 0, pixels.Length); - int bytesWidth = bitmapData.Width * bytesPerPixel; - - for (int j = 0; j < bitmapData.Height; j++) - { - int line = j * bitmapData.Stride; - for (int i = 0; i < bytesWidth; i += bytesPerPixel) - { - pixels[line + i] = color.B; - pixels[line + i + 1] = color.G; - pixels[line + i + 2] = color.R; - } - } - - Marshal.Copy(pixels, 0, pointer, pixels.Length); - bitmap.UnlockBits(bitmapData); - path = Path.Combine(iconDirectory, color.ToArgb() + ".png"); - bitmap.Save(path, ImageFormat.Png); - - icons.Add(color, path); - OnPropertyChanged(nameof(IconCount)); - OnPropertyChanged(nameof(IconsFileSize)); - - } - - return path; - } - } -} \ No newline at end of file diff --git a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml index fcc79dc..1cd16c5 100644 --- a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml +++ b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml @@ -97,40 +97,6 @@ From 4f61a4862de04e9e0b8ed21cccfe82b72715f9b1 Mon Sep 17 00:00:00 2001 From: Odotocodot <48138990+Odotocodot@users.noreply.github.com> Date: Sat, 25 May 2024 17:12:02 +0100 Subject: [PATCH 06/39] Fix clearing cached icons not working --- Flow.Launcher.Plugin.OneNote/Icons.cs | 62 +++++++++++-------- .../UI/ViewModels/SettingsViewModel.cs | 8 +-- .../UI/Views/SettingsView.xaml | 13 +--- .../UI/Views/SettingsView.xaml.cs | 18 ------ 4 files changed, 39 insertions(+), 62 deletions(-) diff --git a/Flow.Launcher.Plugin.OneNote/Icons.cs b/Flow.Launcher.Plugin.OneNote/Icons.cs index 7a5bdf4..d58c415 100644 --- a/Flow.Launcher.Plugin.OneNote/Icons.cs +++ b/Flow.Launcher.Plugin.OneNote/Icons.cs @@ -1,5 +1,4 @@ -using Odotocodot.OneNote.Linq; -using System; +using System; using System.Collections.Concurrent; using System.IO; using System.Linq; @@ -10,17 +9,10 @@ namespace Flow.Launcher.Plugin.OneNote { - public class Icons + public class Icons : BaseModel { - public const string Logo = "Images/logo.png"; - public static string Sync => GetIconLocal("sync"); - - public static string Warning => pluginTheme == PluginTheme.Color - ? $"Images/warning.{GetPluginThemeString(PluginTheme.Dark)}.png" - : GetIconLocal("warning"); - public static string Search => GetIconLocal("search"); public static string Recent => GetIconLocal("page_recent"); public static string NotebookExplorer => GetIconLocal("notebook_explorer"); @@ -29,29 +21,18 @@ public class Icons public static string NewSection => GetIconLocal("section_new"); public static string NewSectionGroup => GetIconLocal("section_group_new"); public static string NewNotebook => GetIconLocal("notebook_new"); + public static string Warning => pluginTheme == PluginTheme.Color + ? $"Images/warning.{GetPluginThemeString(PluginTheme.Dark)}.png" + : GetIconLocal("warning"); private Settings settings; private static PluginTheme pluginTheme; - - private static string GetPluginThemeString(PluginTheme pluginTheme) - { - if (pluginTheme == PluginTheme.System) - throw new NotImplementedException(); //TODO get the system theme return either light or dark. - return Enum.GetName(pluginTheme).ToLower(); - } - - private static string GetIconLocal(string icon) => $"Images/{icon}.{GetPluginThemeString(pluginTheme)}.png"; - // May need this? https://stackoverflow.com/questions/21867842/concurrentdictionarys-getoradd-is-not-atomic-any-alternatives-besides-locking private ConcurrentDictionary iconCache = new(); private string imagesDirectory; public static DirectoryInfo GeneratedImagesDirectoryInfo { get; private set; } - - //TODO: Update on use UI public int CachedIconCount => iconCache.Keys.Count(k => char.IsDigit(k.Split('.')[1][1])); - - //TODO: UPdate on use for UI public string CachedIconsFileSize => GetCachedIconsMemorySize(); private static readonly Lazy lazy = new(); @@ -71,6 +52,16 @@ public static void Init(PluginInitContext context, Settings settings) { Instance.iconCache.TryAdd(image.Name, BitmapImageFromPath(image.FullName)); } + Instance.context = context; + } + private PluginInitContext context; + private static string GetIconLocal(string icon) => $"Images/{icon}.{GetPluginThemeString(pluginTheme)}.png"; + + private static string GetPluginThemeString(PluginTheme pluginTheme) + { + if (pluginTheme == PluginTheme.System) + throw new NotImplementedException(); //TODO get the system theme return either light or dark. + return Enum.GetName(pluginTheme).ToLower(); } public static void Close() @@ -88,11 +79,14 @@ public static Result.IconDelegate GetIcon(string prefix, Color? color) || string.CompareOrdinal(prefix, "section") == 0) && Instance.settings.CreateColoredIcons && color.HasValue; - + if (generate) { - return Instance.iconCache.GetOrAdd($"{prefix}.{color.Value.ToArgb()}.png", ImageSourceFactory, + var imageSource = Instance.iconCache.GetOrAdd($"{prefix}.{color.Value.ToArgb()}.png", ImageSourceFactory, color.Value); + Instance.OnPropertyChanged(nameof(CachedIconCount)); + Instance.OnPropertyChanged(nameof(CachedIconsFileSize)); + return imageSource; } return Instance.iconCache.GetOrAdd($"{prefix}.{GetPluginThemeString(pluginTheme)}.png", key => @@ -100,6 +94,7 @@ public static Result.IconDelegate GetIcon(string prefix, Color? color) var path = Path.Combine(Instance.imagesDirectory, key); return BitmapImageFromPath(path); }); + }; } @@ -117,6 +112,7 @@ private static ImageSource ImageSourceFactory(string key, Color color) var encoder = new PngBitmapEncoder(); //TODO Lazy load this and only one encoder.Frames.Add(BitmapFrame.Create(newBitmap)); encoder.Save(fileStream); + // encoder.Frames.Clear(); return newBitmap; } @@ -148,12 +144,24 @@ private static BitmapSource ChangeIconColor(BitmapImage bitmapImage, Color color } public void ClearCachedIcons() + { iconCache.Clear(); foreach (var file in GeneratedImagesDirectoryInfo.EnumerateFiles()) { - file.Delete(); + try + { + file.Delete(); + } + catch (Exception e) + { + context.API.ShowMsg("Failed to delete", $"Failed to delete {file.Name}"); + Instance.context.API.LogException(nameof(Icons), "Failed to delete",e); + } + } + OnPropertyChanged(nameof(CachedIconCount)); + OnPropertyChanged(nameof(CachedIconsFileSize)); } diff --git a/Flow.Launcher.Plugin.OneNote/UI/ViewModels/SettingsViewModel.cs b/Flow.Launcher.Plugin.OneNote/UI/ViewModels/SettingsViewModel.cs index 23c928a..39d0560 100644 --- a/Flow.Launcher.Plugin.OneNote/UI/ViewModels/SettingsViewModel.cs +++ b/Flow.Launcher.Plugin.OneNote/UI/ViewModels/SettingsViewModel.cs @@ -1,6 +1,5 @@  using System.Collections.Generic; -using System.IO; using System.Linq; namespace Flow.Launcher.Plugin.OneNote.UI.ViewModels @@ -14,6 +13,7 @@ public SettingsViewModel(PluginInitContext context, Settings settings) this.context = context; Keywords = KeywordViewModel.GetKeywordViewModels(settings.Keywords); Icons = Icons.Instance; + Icons.PropertyChanged += (sender, args) => OnPropertyChanged(nameof(CanClearCachedIcons)); } public Settings Settings { get; init; } @@ -24,12 +24,8 @@ public SettingsViewModel(PluginInitContext context, Settings settings) #pragma warning disable CA1822 // Mark members as static public IEnumerable DefaultRecentCountOptions => Enumerable.Range(1, 16); #pragma warning restore CA1822 // Mark members as static - - // public string NotebookIcon => Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Icons.Notebook); - // public string SectionIcon => Path.Combine(context.CurrentPluginMetadata.PluginDirectory, Icons.Section); public void OpenGeneratedIconsFolder() => context.API.OpenDirectory(Icons.GeneratedImagesDirectoryInfo.FullName); - // public void OpenNotebookIconsFolder() => context.API.OpenDirectory(Icons.NotebookIconDirectory); - // public void OpenSectionIconsFolder() => context.API.OpenDirectory(Icons.SectionIconDirectory); public void ClearCachedIcons() => Icons.ClearCachedIcons(); + public bool CanClearCachedIcons => Icons.CachedIconCount > 0; } } \ No newline at end of file diff --git a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml index 1cd16c5..8686816 100644 --- a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml +++ b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml @@ -80,20 +80,11 @@ Margin="0,4,4,4" HorizontalAlignment="Center" HorizontalContentAlignment="Center" - Click="ClearCachedIcons"> + Click="ClearCachedIcons" + IsEnabled="{Binding CanClearCachedIcons}"> - - - diff --git a/Flow.Launcher.Plugin.OneNote/UI/Views/ChangeKeywordWindow.xaml.cs b/Flow.Launcher.Plugin.OneNote/UI/Views/ChangeKeywordWindow.xaml.cs index 965dce3..928ec73 100644 --- a/Flow.Launcher.Plugin.OneNote/UI/Views/ChangeKeywordWindow.xaml.cs +++ b/Flow.Launcher.Plugin.OneNote/UI/Views/ChangeKeywordWindow.xaml.cs @@ -5,34 +5,15 @@ namespace Flow.Launcher.Plugin.OneNote.UI.Views { public partial class ChangeKeywordWindow { - private readonly ChangeKeywordViewModel viewModel; - - public ChangeKeywordWindow(SettingsViewModel settingsViewModel) + public ChangeKeywordWindow(SettingsViewModel viewModel, PluginInitContext context) { InitializeComponent(); - DataContext = viewModel = new ChangeKeywordViewModel(settingsViewModel); + DataContext = new ChangeKeywordViewModel(viewModel, context, Close); } private void WindowLoaded(object sender, RoutedEventArgs e) { TextBox_NewKeyword.Focus(); } - - private void CloseWindow(object sender, RoutedEventArgs e) - { - Close(); - } - - private void Button_ChangeKeyword(object sender, RoutedEventArgs e) - { - if(viewModel.ChangeKeyword(out string errorMessage)) - { - Close(); - } - else - { - MessageBox.Show(this, errorMessage,"Invalid Keyword", MessageBoxButton.OK, MessageBoxImage.Error); - } - } } } diff --git a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml index ffe169c..d003504 100644 --- a/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml +++ b/Flow.Launcher.Plugin.OneNote/UI/Views/SettingsView.xaml @@ -3,7 +3,10 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:icon="clr-namespace:Flow.Launcher.Plugin.OneNote.Icons" + xmlns:linq="clr-namespace:System.Linq;assembly=System.Core" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:vm="clr-namespace:Flow.Launcher.Plugin.OneNote.UI.ViewModels" d:DataContext="{d:DesignInstance Type=vm:SettingsViewModel}" @@ -17,6 +20,23 @@ + + + + + + + + 1 + 20 + + @@ -80,13 +100,12 @@ Margin="0,4,4,4" HorizontalAlignment="Center" HorizontalContentAlignment="Center" - Click="ClearCachedIcons" - IsEnabled="{Binding CanClearCachedIcons}"> + Command="{Binding ClearCachedIconsCommand}"> - @@ -95,7 +114,7 @@ - + @@ -107,13 +126,13 @@ Width="100" Margin="10,0,18,0" HorizontalContentAlignment="Center" - ItemsSource="{Binding PluginThemes}" + ItemsSource="{Binding Source={StaticResource IconThemeEnumDataSource}}" SelectedItem="{Binding Settings.IconTheme}" /> - + @@ -126,7 +145,7 @@ Width="100" Margin="10,0,18,0" HorizontalContentAlignment="Center" - ItemsSource="{Binding DefaultRecentCountOptions}" + ItemsSource="{Binding Source={StaticResource DefaultRecentCountOptions}}" SelectedItem="{Binding Settings.DefaultRecentsCount}" /> @@ -158,7 +177,7 @@ HorizontalAlignment="Right" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" - Click="EditButton_Click"> + Command="{Binding EditCommand}">