diff --git a/OneMore/Commands/Tagging/HashtagDialog.Designer.cs b/OneMore/Commands/Tagging/HashtagDialog.Designer.cs index 7fc204e54b..75e473c69e 100644 --- a/OneMore/Commands/Tagging/HashtagDialog.Designer.cs +++ b/OneMore/Commands/Tagging/HashtagDialog.Designer.cs @@ -49,6 +49,7 @@ private void InitializeComponent() this.contextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.scanButton = new System.Windows.Forms.ToolStripMenuItem(); this.scheduleButton = new System.Windows.Forms.ToolStripMenuItem(); + this.offlineNotebooksButton = new System.Windows.Forms.ToolStripMenuItem(); this.topPanel.SuspendLayout(); this.controlPanel.SuspendLayout(); this.contextMenu.SuspendLayout(); @@ -138,6 +139,8 @@ private void InitializeComponent() this.barLabel.Size = new System.Drawing.Size(14, 20); this.barLabel.TabIndex = 7; this.barLabel.Text = "|"; + this.barLabel.ThemedBack = null; + this.barLabel.ThemedFore = null; // // checkAllLink // @@ -332,24 +335,34 @@ private void InitializeComponent() this.contextMenu.ImageScalingSize = new System.Drawing.Size(24, 24); this.contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.scanButton, - this.scheduleButton}); + this.scheduleButton, + this.offlineNotebooksButton}); this.contextMenu.Name = "contextMenu"; - this.contextMenu.Size = new System.Drawing.Size(241, 101); + this.contextMenu.Size = new System.Drawing.Size(282, 100); + this.contextMenu.Opened += new System.EventHandler(this.PrepareContextMenu); // // scanButton // this.scanButton.Name = "scanButton"; - this.scanButton.Size = new System.Drawing.Size(240, 32); + this.scanButton.Size = new System.Drawing.Size(281, 32); this.scanButton.Text = "Scan Now"; this.scanButton.Click += new System.EventHandler(this.ScanNow); // // scheduleButton // this.scheduleButton.Name = "scheduleButton"; - this.scheduleButton.Size = new System.Drawing.Size(240, 32); + this.scheduleButton.Size = new System.Drawing.Size(281, 32); this.scheduleButton.Text = "Schedule Scan"; this.scheduleButton.Click += new System.EventHandler(this.DoScheduleScan); // + // offlineNotebooksButton + // + this.offlineNotebooksButton.Image = global::River.OneMoreAddIn.Properties.Resources.e_CheckMark; + this.offlineNotebooksButton.Name = "offlineNotebooksButton"; + this.offlineNotebooksButton.Size = new System.Drawing.Size(281, 32); + this.offlineNotebooksButton.Text = "Hide Offline Notebooks"; + this.offlineNotebooksButton.Click += new System.EventHandler(this.ToggleOfflineNotebooks); + // // HashtagDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); @@ -365,6 +378,7 @@ private void InitializeComponent() this.MinimumSize = new System.Drawing.Size(900, 400); this.Name = "HashtagDialog"; this.Text = "Find Hashtags"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SaveSettings); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DoKeyDown); this.topPanel.ResumeLayout(false); this.topPanel.PerformLayout(); @@ -384,7 +398,6 @@ private void InitializeComponent() private UI.MoreTextBox tagBox; private UI.MoreButton searchButton; private System.Windows.Forms.ComboBox scopeBox; - private System.Windows.Forms.Label barLabel; private UI.MoreLinkLabel checkAllLink; private UI.MoreLinkLabel uncheckAllLink; private UI.MoreButton indexButton; @@ -396,5 +409,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem scanButton; private UI.MoreMultilineLabel introBox; private System.Windows.Forms.ToolStripMenuItem scheduleButton; + private System.Windows.Forms.ToolStripMenuItem offlineNotebooksButton; + private UI.MoreLabel barLabel; } } \ No newline at end of file diff --git a/OneMore/Commands/Tagging/HashtagDialog.cs b/OneMore/Commands/Tagging/HashtagDialog.cs index 1ff38046f5..ce04b1b85e 100644 --- a/OneMore/Commands/Tagging/HashtagDialog.cs +++ b/OneMore/Commands/Tagging/HashtagDialog.cs @@ -19,6 +19,8 @@ namespace River.OneMoreAddIn.Commands internal partial class HashtagDialog : MoreForm { + private const string SettingsKey = "Hashtags"; + private const string T0 = "0001-01-01T00:00:00.0000Z"; private readonly MoreAutoCompleteList palette; @@ -78,6 +80,10 @@ public HashtagDialog() .GetCollection("GeneralSheet").Get("experimental"); ShowScanTimes(); + + ShowOfflineNotebooks = new SettingsProvider() + .GetCollection(SettingsKey) + .Get("showOffline", true); } @@ -87,6 +93,9 @@ public HashtagDialog() public IEnumerable SelectedPages => selections; + public bool ShowOfflineNotebooks { get; private set; } = true; + + private void ShowScanTimes() { var scan = new HashtagProvider().ReadScanTime(); @@ -149,9 +158,10 @@ private async void DoKeyDown(object sender, KeyEventArgs e) } - private void DoSearchTags(object sender, EventArgs e) + private async void DoSearchTags(object sender, EventArgs e) { - Task.Run(async () => { await SearchTags(sender, e); }); + await SearchTags(sender, e); + //Task.Run(async () => { await SearchTags(sender, e); }); } @@ -178,6 +188,14 @@ private async Task SearchTags(object sender, EventArgs e) _ => provider.SearchTags(where, out parsed) }; + if (!ShowOfflineNotebooks) + { + // must be ToList?! + var loaded = tags.Where(t => loadedBookIDs.Contains(t.NotebookID)).ToList(); + tags.Clear(); + tags.AddRange(loaded); + } + logger.Verbose($"found {tags.Count} tags using [{parsed}]"); var width = contextPanel.ClientSize.Width - @@ -408,10 +426,45 @@ private async void ScanNow(object sender, EventArgs e) } + private void PrepareContextMenu(object sender, System.EventArgs e) + { + if (ShowOfflineNotebooks) + { + offlineNotebooksButton.Image = Resx.e_CheckMark; + offlineNotebooksButton.Text = Resx.HashtagDialog_showOfflineMenuItem; + } + else + { + offlineNotebooksButton.Image = null; + offlineNotebooksButton.Text = Resx.HashtagDialog_hideOfflineMenuItem; + } + } + + + private void ToggleOfflineNotebooks(object sender, EventArgs e) + { + ShowOfflineNotebooks = !ShowOfflineNotebooks; + } + + private void DoCancel(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; Close(); } + + + private void SaveSettings(object sender, FormClosingEventArgs e) + { + var provider = new SettingsProvider(); + var settings = provider.GetCollection(SettingsKey); + settings.Add("showOffline", ShowOfflineNotebooks); + + if (settings.IsModified) + { + provider.SetCollection(settings); + provider.Save(); + } + } } } diff --git a/OneMore/Properties/Resources.Designer.cs b/OneMore/Properties/Resources.Designer.cs index 8c200f3584..b18e8dc041 100644 --- a/OneMore/Properties/Resources.Designer.cs +++ b/OneMore/Properties/Resources.Designer.cs @@ -3390,6 +3390,15 @@ internal static string HashtagDialog_checkAllLink_Text { } } + /// + /// Looks up a localized string similar to Hide Offline Notebooks. + /// + internal static string HashtagDialog_hideOfflineMenuItem { + get { + return ResourceManager.GetString("HashtagDialog_hideOfflineMenuItem", resourceCulture); + } + } + /// /// Looks up a localized string similar to Type any part of one or more hashtags. Wildcards are implied unless a tag is ended with a period. Parenthesis and logical operators are allowed.. /// @@ -3455,6 +3464,15 @@ internal static string HashtagDialog_scopeBox_Text { } } + /// + /// Looks up a localized string similar to Show Offline Notebooks. + /// + internal static string HashtagDialog_showOfflineMenuItem { + get { + return ResourceManager.GetString("HashtagDialog_showOfflineMenuItem", resourceCulture); + } + } + /// /// Looks up a localized string similar to Find Hashtags. /// diff --git a/OneMore/Properties/Resources.ar-SA.resx b/OneMore/Properties/Resources.ar-SA.resx index cfc8469e1f..7afd7853fb 100644 --- a/OneMore/Properties/Resources.ar-SA.resx +++ b/OneMore/Properties/Resources.ar-SA.resx @@ -1271,6 +1271,10 @@ تحقق من الكل link label + + إخفاء دفاتر الملاحظات غير المتصلة + context menu item + اكتب أي جزء من هاشتاج واحد أو أكثر. يتم تضمين أحرف البدل ما لم تنتهي العلامة بنقطة. يُسمح بالأقواس والعوامل المنطقية. label @@ -1301,6 +1305,10 @@ هذا القسم combobox + + إظهار دفاتر الملاحظات غير المتصلة + context menu item + الغاءالكل link label diff --git a/OneMore/Properties/Resources.de-DE.resx b/OneMore/Properties/Resources.de-DE.resx index bbbea23046..2465d65ab6 100644 --- a/OneMore/Properties/Resources.de-DE.resx +++ b/OneMore/Properties/Resources.de-DE.resx @@ -1269,6 +1269,10 @@ Die Suche nach Hashtags ist erst möglich, wenn dies abgeschlossen ist. Alle überprüfen link label + + Offline-Notizbücher ausblenden + context menu item + Geben Sie einen beliebigen Teil eines oder mehrerer Hashtags ein. Platzhalter sind impliziert, es sei denn, ein Tag endet mit einem Punkt. Klammern und logische Operatoren sind zulässig. label @@ -1299,6 +1303,10 @@ Dieses Notizbuch Diese Abteilung combobox + + Offline-Notizbücher anzeigen + context menu item + Alle deaktivieren link label diff --git a/OneMore/Properties/Resources.es-ES.resx b/OneMore/Properties/Resources.es-ES.resx index 59436273c1..9a9f04baaa 100644 --- a/OneMore/Properties/Resources.es-ES.resx +++ b/OneMore/Properties/Resources.es-ES.resx @@ -1271,6 +1271,10 @@ La búsqueda de hashtags no estará disponible hasta que se complete. Comprobar todo link label + + Ocultar cuadernos sin conexión + context menu item + Escribe cualquier parte de uno o más hashtags. Los comodines están implícitos a menos que una etiqueta termine con un punto. Se permiten paréntesis y operadores lógicos. label @@ -1301,6 +1305,10 @@ este cuaderno Esta sección combobox + + Mostrar cuadernos sin conexión + context menu item + Desmarcar todo link label diff --git a/OneMore/Properties/Resources.fr-FR.resx b/OneMore/Properties/Resources.fr-FR.resx index 3a750427c6..fc80349c60 100644 --- a/OneMore/Properties/Resources.fr-FR.resx +++ b/OneMore/Properties/Resources.fr-FR.resx @@ -1271,6 +1271,10 @@ La recherche de hashtags n'est pas disponible tant qu'elle n'est pas terminée.< Vérifie tout link label + + Masquer les blocs-notes hors ligne + context menu item + Tapez n’importe quelle partie d’un ou plusieurs hashtags. Les caractères génériques sont implicites, sauf si une balise se termine par un point. Les parenthèses et les opérateurs logiques sont autorisés. label @@ -1301,6 +1305,10 @@ Ce carnet Cette section combobox + + Afficher les blocs-notes hors ligne + context menu item + Décocher tout link label diff --git a/OneMore/Properties/Resources.he-IL.resx b/OneMore/Properties/Resources.he-IL.resx index dc5b0d9c0d..0b76438020 100644 --- a/OneMore/Properties/Resources.he-IL.resx +++ b/OneMore/Properties/Resources.he-IL.resx @@ -1280,6 +1280,10 @@ Total Row Font סמן הכל link label + + הסתר מחברות לא מקוונות + context menu item + הקלד כל חלק מהאשטאג אחד או יותר. תווים כלליים משתמעים אלא אם כן תג מסתיים בנקודה. מותר להשתמש בסוגריים ואופרטורים לוגיים. label @@ -1310,6 +1314,10 @@ Total Row Font הסעיף הזה combobox + + הצג מחברות לא מקוונות + context menu item + בטל את הסימון של הכל link label diff --git a/OneMore/Properties/Resources.nl-NL.resx b/OneMore/Properties/Resources.nl-NL.resx index 9964017d1e..1204ac929b 100644 --- a/OneMore/Properties/Resources.nl-NL.resx +++ b/OneMore/Properties/Resources.nl-NL.resx @@ -1272,6 +1272,10 @@ Zoeken naar hashtags is pas beschikbaar als dit is voltooid. Controleer alles link label + + Offline notitieblokken verbergen + context menu item + Typ een deel van een of meer hashtags. Wildcards worden geïmpliceerd, tenzij een tag wordt afgesloten met een punt. Haakjes en logische operatoren zijn toegestaan. label @@ -1302,6 +1306,10 @@ Dit notitieboekje Deze sectie combobox + + Offline notitieboekjes tonen + context menu item + Schakel alles uit link label diff --git a/OneMore/Properties/Resources.pl-PL.resx b/OneMore/Properties/Resources.pl-PL.resx index aabea8136d..0ab9f1766e 100644 --- a/OneMore/Properties/Resources.pl-PL.resx +++ b/OneMore/Properties/Resources.pl-PL.resx @@ -1280,6 +1280,10 @@ Wyszukiwanie hashtagów nie jest możliwe, dopóki nie zostanie zakończone.Zaznacz wszystkie link label + + Ukryj notesy offline + context menu item + Wpisz dowolną część jednego lub większej liczby hashtagów. Symbole wieloznaczne są dorozumiane, chyba że tag jest zakończony kropką. Dozwolone są nawiasy i operatory logiczne. label @@ -1310,6 +1314,10 @@ Ten notatnik Ta sekcja combobox + + Pokaż notesy offline + context menu item + Odznacz wszystkie link label diff --git a/OneMore/Properties/Resources.pt-BR.resx b/OneMore/Properties/Resources.pt-BR.resx index 229e222545..1a0cbfa862 100644 --- a/OneMore/Properties/Resources.pt-BR.resx +++ b/OneMore/Properties/Resources.pt-BR.resx @@ -1272,6 +1272,10 @@ A pesquisa de hashtags não estará disponível até que isso seja concluído.Verifique tudo link label + + Ocultar blocos de anotações off-line + context menu item + Digite qualquer parte de uma ou mais hashtags. Os curingas estão implícitos, a menos que uma tag termine com um ponto final. Parênteses e operadores lógicos são permitidos. label @@ -1302,6 +1306,10 @@ Este caderno Esta seção combobox + + Mostrar blocos de anotações off-line + context menu item + Desmarcar todos link label diff --git a/OneMore/Properties/Resources.resx b/OneMore/Properties/Resources.resx index f8a18fcf1a..8fc7fee191 100644 --- a/OneMore/Properties/Resources.resx +++ b/OneMore/Properties/Resources.resx @@ -1284,6 +1284,10 @@ Searching for hashtags is unavailable until this is completed. Check all link label + + Hide Offline Notebooks + context menu item + Type any part of one or more hashtags. Wildcards are implied unless a tag is ended with a period. Parenthesis and logical operators are allowed. label @@ -1314,6 +1318,10 @@ This notebook This section combobox + + Show Offline Notebooks + context menu item + Uncheck all link label diff --git a/OneMore/Properties/Resources.zh-CN.resx b/OneMore/Properties/Resources.zh-CN.resx index 8c2b5ddc6f..15f1b6a390 100644 --- a/OneMore/Properties/Resources.zh-CN.resx +++ b/OneMore/Properties/Resources.zh-CN.resx @@ -1270,6 +1270,10 @@ OneNote 文件 (*.one) 选择所有 link label + + 隐藏离线笔记本 + context menu item + 输入一个或多个主题标签的任意部分。除非标签以句点结束,否则隐含通配符。允许使用括号和逻辑运算符。 label @@ -1300,6 +1304,10 @@ OneNote 文件 (*.one) 本节 combobox + + 显示离线笔记本 + context menu item + 取消所有 link label