diff --git a/.github/workflows/pr_assignee.yml b/.github/workflows/pr_assignee.yml index 5be603df6..33098672b 100644 --- a/.github/workflows/pr_assignee.yml +++ b/.github/workflows/pr_assignee.yml @@ -14,4 +14,4 @@ jobs: runs-on: ubuntu-latest steps: - name: Assign PR to creator - uses: toshimaru/auto-author-assign@v2.1.1 + uses: toshimaru/auto-author-assign@v3.0.1 diff --git a/Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs b/Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs index 4a3e6474e..53df05bf2 100644 --- a/Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs +++ b/Flow.Launcher.Infrastructure/DialogJump/DialogJump.cs @@ -496,6 +496,8 @@ namespace Flow.Launcher.Infrastructure.DialogJump uint dwmsEventTime ) { + if (hwnd.IsNull) return; + await _foregroundChangeLock.WaitAsync(); try { @@ -647,6 +649,8 @@ namespace Flow.Launcher.Infrastructure.DialogJump uint dwmsEventTime ) { + if (hwnd.IsNull) return; + // If the dialog window is moved, update the Dialog Jump window position var dialogWindowExist = false; lock (_dialogWindowLock) @@ -672,6 +676,8 @@ namespace Flow.Launcher.Infrastructure.DialogJump uint dwmsEventTime ) { + if (hwnd.IsNull) return; + // If the dialog window is moved or resized, update the Dialog Jump window position if (_dragMoveTimer != null) { @@ -697,6 +703,8 @@ namespace Flow.Launcher.Infrastructure.DialogJump uint dwmsEventTime ) { + if (hwnd.IsNull) return; + // If the dialog window is destroyed, set _dialogWindowHandle to null var dialogWindowExist = false; lock (_dialogWindowLock) @@ -728,6 +736,8 @@ namespace Flow.Launcher.Infrastructure.DialogJump uint dwmsEventTime ) { + if (hwnd.IsNull) return; + // If the dialog window is hidden, set _dialogWindowHandle to null var dialogWindowExist = false; lock (_dialogWindowLock) @@ -759,6 +769,8 @@ namespace Flow.Launcher.Infrastructure.DialogJump uint dwmsEventTime ) { + if (hwnd.IsNull) return; + // If the dialog window is ended, set _dialogWindowHandle to null var dialogWindowExist = false; lock (_dialogWindowLock) diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 576bf6f2f..f3c614702 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -138,7 +138,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Flow.Launcher/Helper/HotKeyMapper.cs b/Flow.Launcher/Helper/HotKeyMapper.cs index bb1cddc6c..0a2826484 100644 --- a/Flow.Launcher/Helper/HotKeyMapper.cs +++ b/Flow.Launcher/Helper/HotKeyMapper.cs @@ -143,6 +143,8 @@ internal static class HotKeyMapper return; App.API.ShowMainWindow(); + // Make sure to go back to the query results page first since it can cause issues if current page is context menu + App.API.BackToQueryResults(); App.API.ChangeQuery(hotkey.ActionKeyword, true); }); } diff --git a/Flow.Launcher/Languages/ja.xaml b/Flow.Launcher/Languages/ja.xaml index 51ec99ddd..6ebe5271e 100644 --- a/Flow.Launcher/Languages/ja.xaml +++ b/Flow.Launcher/Languages/ja.xaml @@ -64,10 +64,10 @@ 位置のリセット 検索ウィンドウの位置をリセット ここに入力して検索 - {0}: This plugin is still initializing... - Select this result to requery - {0}: Failed to respond! - Select this result for more info + {0}: このプラグインはまだ初期化中です… + この結果を選択して再検索する + {0}: 応答に失敗しました! + 詳細については、この結果を選択してください 設定 @@ -454,7 +454,7 @@ アイコン あなたはFlow Launcherを {0} 回利用しました アップデートを確認する - Become a Sponsor + スポンサーになる 新しいバージョン {0} が利用可能です。Flow Launcherを再起動してください。 アップデートの確認に失敗しました、api.github.com への接続とプロキシ設定を確認してください。 diff --git a/Flow.Launcher/Languages/pt-pt.xaml b/Flow.Launcher/Languages/pt-pt.xaml index 3746ada13..b9bafc3a4 100644 --- a/Flow.Launcher/Languages/pt-pt.xaml +++ b/Flow.Launcher/Languages/pt-pt.xaml @@ -420,13 +420,13 @@ Default search window position. Displayed when triggered by search window hotkey Dialog Jump Result Navigation Behaviour Behaviour to navigate Open/Save As dialog window to the selected result path - Left click or Enter key - Right click + Clique esquerdo ou tecla Enter + Clique direito Dialog Jump File Navigation Behaviour Behaviour to navigate Open/Save As dialog window when the result is a file path - Fill full path in file name box - Fill full path in file name box and open - Fill directory in path box + Preencher caminho total na caixa Nome do ficheiro + Preencher caminho total na caixa Nome do ficheiro e abrir + Preencher diretório na caixa Caminho Proxy HTTP diff --git a/Flow.Launcher/Languages/sk.xaml b/Flow.Launcher/Languages/sk.xaml index e76061a3b..881ccf340 100644 --- a/Flow.Launcher/Languages/sk.xaml +++ b/Flow.Launcher/Languages/sk.xaml @@ -636,7 +636,7 @@ Ak pri zadávaní skratky pred ňu pridáte "@", bude sa zhodovať s Po aktualizácii pluginov reštartovať Flow Launcher - {0}: Aktualizované z v{1} na v{2} + {0}: Aktualizácia z v{1} na v{2} Nie je vybraný žiaden plugin diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index dd47f9d4e..747975b2a 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -526,7 +526,7 @@ + Text="{Binding PreviewDescription}" /> diff --git a/Flow.Launcher/Resources/Controls/CustomScrollViewerEx.cs b/Flow.Launcher/Resources/Controls/CustomScrollViewerEx.cs deleted file mode 100644 index 78985108c..000000000 --- a/Flow.Launcher/Resources/Controls/CustomScrollViewerEx.cs +++ /dev/null @@ -1,253 +0,0 @@ -using iNKORE.UI.WPF.Modern.Controls; -using iNKORE.UI.WPF.Modern.Controls.Helpers; -using iNKORE.UI.WPF.Modern.Controls.Primitives; -using System; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; - -namespace Flow.Launcher.Resources.Controls -{ - // TODO: Use IsScrollAnimationEnabled property in future: https://github.com/iNKORE-NET/UI.WPF.Modern/pull/347 - public class CustomScrollViewerEx : ScrollViewer - { - private double LastVerticalLocation = 0; - private double LastHorizontalLocation = 0; - - public CustomScrollViewerEx() - { - Loaded += OnLoaded; - var valueSource = DependencyPropertyHelper.GetValueSource(this, AutoPanningMode.IsEnabledProperty).BaseValueSource; - if (valueSource == BaseValueSource.Default) - { - AutoPanningMode.SetIsEnabled(this, true); - } - } - - #region Orientation - - public static readonly DependencyProperty OrientationProperty = - DependencyProperty.Register( - nameof(Orientation), - typeof(Orientation), - typeof(CustomScrollViewerEx), - new PropertyMetadata(Orientation.Vertical)); - - public Orientation Orientation - { - get => (Orientation)GetValue(OrientationProperty); - set => SetValue(OrientationProperty, value); - } - - #endregion - - #region AutoHideScrollBars - - public static readonly DependencyProperty AutoHideScrollBarsProperty = - ScrollViewerHelper.AutoHideScrollBarsProperty - .AddOwner( - typeof(CustomScrollViewerEx), - new PropertyMetadata(true, OnAutoHideScrollBarsChanged)); - - public bool AutoHideScrollBars - { - get => (bool)GetValue(AutoHideScrollBarsProperty); - set => SetValue(AutoHideScrollBarsProperty, value); - } - - private static void OnAutoHideScrollBarsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is CustomScrollViewerEx sv) - { - sv.UpdateVisualState(); - } - } - - #endregion - - private void OnLoaded(object sender, RoutedEventArgs e) - { - LastVerticalLocation = VerticalOffset; - LastHorizontalLocation = HorizontalOffset; - UpdateVisualState(false); - } - - /// - protected override void OnInitialized(EventArgs e) - { - base.OnInitialized(e); - - if (Style == null && ReadLocalValue(StyleProperty) == DependencyProperty.UnsetValue) - { - SetResourceReference(StyleProperty, typeof(ScrollViewer)); - } - } - - /// - protected override void OnMouseWheel(MouseWheelEventArgs e) - { - var Direction = GetDirection(); - ScrollViewerBehavior.SetIsAnimating(this, true); - - if (Direction == Orientation.Vertical) - { - if (ScrollableHeight > 0) - { - e.Handled = true; - } - - var WheelChange = e.Delta * (ViewportHeight / 1.5) / ActualHeight; - var newOffset = LastVerticalLocation - WheelChange; - - if (newOffset < 0) - { - newOffset = 0; - } - - if (newOffset > ScrollableHeight) - { - newOffset = ScrollableHeight; - } - - if (newOffset == LastVerticalLocation) - { - return; - } - - ScrollToVerticalOffset(LastVerticalLocation); - - ScrollToValue(newOffset, Direction); - LastVerticalLocation = newOffset; - } - else - { - if (ScrollableWidth > 0) - { - e.Handled = true; - } - - var WheelChange = e.Delta * (ViewportWidth / 1.5) / ActualWidth; - var newOffset = LastHorizontalLocation - WheelChange; - - if (newOffset < 0) - { - newOffset = 0; - } - - if (newOffset > ScrollableWidth) - { - newOffset = ScrollableWidth; - } - - if (newOffset == LastHorizontalLocation) - { - return; - } - - ScrollToHorizontalOffset(LastHorizontalLocation); - - ScrollToValue(newOffset, Direction); - LastHorizontalLocation = newOffset; - } - } - - /// - protected override void OnScrollChanged(ScrollChangedEventArgs e) - { - base.OnScrollChanged(e); - if (!ScrollViewerBehavior.GetIsAnimating(this)) - { - LastVerticalLocation = VerticalOffset; - LastHorizontalLocation = HorizontalOffset; - } - } - - private Orientation GetDirection() - { - var isShiftDown = Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift); - - if (Orientation == Orientation.Horizontal) - { - return isShiftDown ? Orientation.Vertical : Orientation.Horizontal; - } - else - { - return isShiftDown ? Orientation.Horizontal : Orientation.Vertical; - } - } - - /// - /// Causes the to load a new view into the viewport using the specified offsets and zoom factor. - /// - /// A value between 0 and that specifies the distance the content should be scrolled horizontally. - /// A value between 0 and that specifies the distance the content should be scrolled vertically. - /// A value between MinZoomFactor and MaxZoomFactor that specifies the required target ZoomFactor. - /// if the view is changed; otherwise, . - public bool ChangeView(double? horizontalOffset, double? verticalOffset, float? zoomFactor) - { - return ChangeView(horizontalOffset, verticalOffset, zoomFactor, false); - } - - /// - /// Causes the to load a new view into the viewport using the specified offsets and zoom factor, and optionally disables scrolling animation. - /// - /// A value between 0 and that specifies the distance the content should be scrolled horizontally. - /// A value between 0 and that specifies the distance the content should be scrolled vertically. - /// A value between MinZoomFactor and MaxZoomFactor that specifies the required target ZoomFactor. - /// to disable zoom/pan animations while changing the view; otherwise, . The default is false. - /// if the view is changed; otherwise, . - public bool ChangeView(double? horizontalOffset, double? verticalOffset, float? zoomFactor, bool disableAnimation) - { - if (disableAnimation) - { - if (horizontalOffset.HasValue) - { - ScrollToHorizontalOffset(horizontalOffset.Value); - } - - if (verticalOffset.HasValue) - { - ScrollToVerticalOffset(verticalOffset.Value); - } - } - else - { - if (horizontalOffset.HasValue) - { - ScrollToHorizontalOffset(LastHorizontalLocation); - ScrollToValue(Math.Min(ScrollableWidth, horizontalOffset.Value), Orientation.Horizontal); - LastHorizontalLocation = horizontalOffset.Value; - } - - if (verticalOffset.HasValue) - { - ScrollToVerticalOffset(LastVerticalLocation); - ScrollToValue(Math.Min(ScrollableHeight, verticalOffset.Value), Orientation.Vertical); - LastVerticalLocation = verticalOffset.Value; - } - } - - return true; - } - - private void ScrollToValue(double value, Orientation Direction) - { - if (Direction == Orientation.Vertical) - { - ScrollToVerticalOffset(value); - } - else - { - ScrollToHorizontalOffset(value); - } - - ScrollViewerBehavior.SetIsAnimating(this, false); - } - - private void UpdateVisualState(bool useTransitions = true) - { - var stateName = AutoHideScrollBars ? "NoIndicator" : "MouseIndicator"; - VisualStateManager.GoToState(this, stateName, useTransitions); - } - } -} diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index c5b45890b..c3831e68f 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -252,12 +252,14 @@ - - - - + - + diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index d4382fb7f..f2f49f8f1 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -288,6 +288,8 @@ namespace Flow.Launcher.ViewModel } } + public string PreviewDescription => Result.Preview?.Description ?? Result.SubTitle; + public Result Result { get; } public int ResultProgress { diff --git a/Flow.Launcher/packages.lock.json b/Flow.Launcher/packages.lock.json index b4b929d19..8c3a16e5e 100644 --- a/Flow.Launcher/packages.lock.json +++ b/Flow.Launcher/packages.lock.json @@ -28,9 +28,9 @@ }, "iNKORE.UI.WPF.Modern": { "type": "Direct", - "requested": "[0.10.1, )", - "resolved": "0.10.1", - "contentHash": "nRYmBosiL+42eUpLbHeqP7qJqtp5EpzuIMZTpvq4mFV33VB/JjkFg1y82gk50pjkXlAQWDvRyrfSAmPR5AM+3g==", + "requested": "[0.10.2.1, )", + "resolved": "0.10.2.1", + "contentHash": "nGwuuVul+TcLCTgPmaAZCc0fYFqUpCNZ8PiulVT3gZnsWt/AvxMZ0DSPpuyI/iRPc/NhFIg9lSIR7uaHWV0I/Q==", "dependencies": { "iNKORE.UI.WPF": "1.2.8" } @@ -1619,7 +1619,7 @@ "FSharp.Core": "[9.0.303, )", "Flow.Launcher.Infrastructure": "[1.0.0, )", "Flow.Launcher.Localization": "[0.0.6, )", - "Flow.Launcher.Plugin": "[5.0.0, )", + "Flow.Launcher.Plugin": "[5.1.0, )", "Meziantou.Framework.Win32.Jobs": "[3.4.5, )", "Microsoft.IO.RecyclableMemoryStream": "[3.0.1, )", "SemanticVersioning": "[3.0.0, )", @@ -1634,7 +1634,7 @@ "BitFaster.Caching": "[2.5.4, )", "CommunityToolkit.Mvvm": "[8.4.0, )", "Flow.Launcher.Localization": "[0.0.6, )", - "Flow.Launcher.Plugin": "[5.0.0, )", + "Flow.Launcher.Plugin": "[5.1.0, )", "InputSimulator": "[1.0.4, )", "MemoryPack": "[1.21.4, )", "Microsoft.VisualStudio.Threading": "[17.14.15, )", diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 76f97240f..d73028453 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -106,7 +106,7 @@ - + diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ar.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ar.xaml index 608fe88a1..1edc1f2aa 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ar.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ar.xaml @@ -56,6 +56,8 @@ بحث في محتوى الملفات: بحث مفهرس: وصول سريع: + Folder Search: + File Search: الكلمة المفتاحية الحالية للإجراء تم مفعّل diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/cs.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/cs.xaml index 2381d501b..3fd1b721a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/cs.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/cs.xaml @@ -56,6 +56,8 @@ Vyhledávání obsahu souborů: Vyhledávání v indexu: Rychlý přístup: + Folder Search: + File Search: Aktuální aktivační příkaz Hotovo Povoleno diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/da.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/da.xaml index f5f13e5a3..59b1216e7 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/da.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/da.xaml @@ -56,6 +56,8 @@ File Content Search: Index Search: Quick Access: + Folder Search: + File Search: Current Action Keyword Færdig Enabled diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/de.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/de.xaml index 8e352e614..3292568a6 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/de.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/de.xaml @@ -56,6 +56,8 @@ Suche nach Dateiinhalten: Index-Suche: Schnellzugriff: + Folder Search: + File Search: Aktuelles Aktions-Schlüsselwort Fertig Aktiviert diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es-419.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es-419.xaml index 7379571a7..dc8860bd7 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es-419.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es-419.xaml @@ -56,6 +56,8 @@ File Content Search: Index Search: Quick Access: + Folder Search: + File Search: Current Action Keyword Hecho Enabled diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es.xaml index b59ada7ea..860d64572 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/es.xaml @@ -56,6 +56,8 @@ Búsqueda de contenido de archivo: Buscar índice: Acceso rápido: + Folder Search: + File Search: Palabra clave de acción actual Aceptar Activado diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/fr.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/fr.xaml index b0b714154..5a91d3648 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/fr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/fr.xaml @@ -56,6 +56,8 @@ Recherche de contenu de fichier : Recherche dans l'index : Accès rapide : + Recherche de dossier : + Recherche de fichier : Mot-clé de l'action en cours Terminer Activé diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/he.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/he.xaml index a84d7707d..a5d4c3829 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/he.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/he.xaml @@ -56,6 +56,8 @@ חיפוש תוכן קובץ: חיפוש אינדקס: גישה מהירה: + Folder Search: + File Search: מילת פעולה נוכחית בוצע מופעל diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/it.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/it.xaml index a88ad2da1..ca774ce80 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/it.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/it.xaml @@ -56,6 +56,8 @@ Ricerca Contenuto File: Ricerca in Indice: Accesso Rapido: + Folder Search: + File Search: Parola Chiave Corrente Conferma Abilitato diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ja.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ja.xaml index b9a825bf2..34b9095cd 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ja.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ja.xaml @@ -56,6 +56,8 @@ File Content Search: Index Search: Quick Access: + Folder Search: + File Search: Current Action Keyword 完了 Enabled diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ko.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ko.xaml index e437926c8..0cbf40621 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ko.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ko.xaml @@ -56,6 +56,8 @@ 파일 내용 검색: 색인 검색: 빠른 접근: + Folder Search: + File Search: 현재 액션 키워드 완료 diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/nb.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/nb.xaml index b0672d3ad..9e96011b3 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/nb.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/nb.xaml @@ -56,6 +56,8 @@ Søk etter filinnhold: Indekssøk: Hurtigtilgang: + Folder Search: + File Search: Nåværende nøkkelord for handling Utført Aktivert diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/nl.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/nl.xaml index 3de4ce5e5..796bd0a97 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/nl.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/nl.xaml @@ -56,6 +56,8 @@ File Content Search: Index Search: Quick Access: + Folder Search: + File Search: Current Action Keyword Klaar Enabled diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pl.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pl.xaml index 1a01e8b90..11c3b83b6 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pl.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pl.xaml @@ -56,6 +56,8 @@ Przeszukiwanie zawartości plików: Wyszukiwanie indeksowe: Szybki dostęp: + Folder Search: + File Search: Bieżące słowo kluczowe akcji Zapisz Aktywny diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml index 9a3a4ffeb..360342aed 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml @@ -56,6 +56,8 @@ File Content Search: Index Search: Quick Access: + Folder Search: + File Search: Current Action Keyword Finalizado Enabled diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-pt.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-pt.xaml index 2d33768f9..82990de3c 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-pt.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-pt.xaml @@ -56,6 +56,8 @@ Pesquisa no conteúdo dos ficheiros: Pesquisa no índice: Acesso rápido: + Pesquisar pasta: + Pesquisar ficheiro: Palavra-chave atual OK Ativo diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ru.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ru.xaml index cb28fcfd5..08d28d76f 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ru.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/ru.xaml @@ -56,6 +56,8 @@ File Content Search: Index Search: Quick Access: + Folder Search: + File Search: Current Action Keyword Подтвердить Включено diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sk.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sk.xaml index 1350969b6..1fc487585 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sk.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sk.xaml @@ -56,6 +56,8 @@ Vyhľadávanie obsahu súborov: Vyhľadávanie v indexe: Rýchly prístup: + Vyhľadávanie priečinkov: + Vyhľadávanie súborov: Aktuálny aktivačný príkaz Hotovo Povolené diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sr-Cyrl-RS.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sr-Cyrl-RS.xaml index e7979f6dd..e9c2f6f84 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sr-Cyrl-RS.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sr-Cyrl-RS.xaml @@ -56,6 +56,8 @@ File Content Search: Index Search: Quick Access: + Folder Search: + File Search: Current Action Keyword Done Enabled diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sr.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sr.xaml index ef7e6a5c3..00bf880a6 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/sr.xaml @@ -56,6 +56,8 @@ File Content Search: Index Search: Quick Access: + Folder Search: + File Search: Current Action Keyword Gotovo Enabled diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/tr.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/tr.xaml index 92461291b..38104d366 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/tr.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/tr.xaml @@ -56,6 +56,8 @@ Dosya İçeriğini Ara: Dizin Araması: Hızlı Erişim: + Folder Search: + File Search: Geçerli Anahtar Kelime Tamam Etkin diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/uk-UA.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/uk-UA.xaml index 7600757a2..a6536afb4 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/uk-UA.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/uk-UA.xaml @@ -56,6 +56,8 @@ Пошук вмісту файлу: Індексний пошук: Швидкий доступ: + Пошук теки: + Пошук файлу: Поточне ключове слово дії Готово Увімкнено diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/vi.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/vi.xaml index 6416fc447..3b960522d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/vi.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/vi.xaml @@ -56,6 +56,8 @@ Tìm kiếm nội dung tệp: Tìm kiếm chỉ mục: Truy cập nhanh + Folder Search: + File Search: Từ hành động hiện tại Xong Đã bật diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-cn.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-cn.xaml index bcef2b668..9758062b3 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-cn.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-cn.xaml @@ -56,6 +56,8 @@ 文件内容搜索: 索引搜索: 快速访问: + 目录搜索: + 文件搜索: 当前触发关键字 确认 已启用 diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-tw.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-tw.xaml index d64cd7698..43e428093 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-tw.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/zh-tw.xaml @@ -56,6 +56,8 @@ File Content Search: Index Search: 快速存取: + Folder Search: + File Search: Current Action Keyword 已啟用 diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index 456085fca..9c84747d2 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -334,7 +334,7 @@ namespace Flow.Launcher.Plugin.Program } } - public static async Task IndexWin32ProgramsAsync() + public static async Task IndexWin32ProgramsAsync(bool resetCache) { await _win32sLock.WaitAsync(); try @@ -345,7 +345,10 @@ namespace Flow.Launcher.Plugin.Program { _win32s.Add(win32); } - ResetCache(); + if (resetCache) + { + ResetCache(); + } await Context.API.SaveCacheBinaryStorageAsync>(Win32CacheName, Context.CurrentPluginMetadata.PluginCacheDirectoryPath); lock (_lastIndexTimeLock) { @@ -362,7 +365,7 @@ namespace Flow.Launcher.Plugin.Program } } - public static async Task IndexUwpProgramsAsync() + public static async Task IndexUwpProgramsAsync(bool resetCache) { await _uwpsLock.WaitAsync(); try @@ -373,7 +376,10 @@ namespace Flow.Launcher.Plugin.Program { _uwps.Add(uwp); } - ResetCache(); + if (resetCache) + { + ResetCache(); + } await Context.API.SaveCacheBinaryStorageAsync>(UwpCacheName, Context.CurrentPluginMetadata.PluginCacheDirectoryPath); lock (_lastIndexTimeLock) { @@ -394,12 +400,12 @@ namespace Flow.Launcher.Plugin.Program { var win32Task = Task.Run(async () => { - await Context.API.StopwatchLogInfoAsync(ClassName, "Win32Program index cost", IndexWin32ProgramsAsync); + await Context.API.StopwatchLogInfoAsync(ClassName, "Win32Program index cost", () => IndexWin32ProgramsAsync(resetCache: true)); }); var uwpTask = Task.Run(async () => { - await Context.API.StopwatchLogInfoAsync(ClassName, "UWPProgram index cost", IndexUwpProgramsAsync); + await Context.API.StopwatchLogInfoAsync(ClassName, "UWPProgram index cost", () => IndexUwpProgramsAsync(resetCache: true)); }); await Task.WhenAll(win32Task, uwpTask).ConfigureAwait(false); @@ -407,9 +413,21 @@ namespace Flow.Launcher.Plugin.Program internal static void ResetCache() { - var oldCache = cache; - cache = new MemoryCache(cacheOptions); - oldCache.Dispose(); + var newCache = new MemoryCache(cacheOptions); + + // Atomically swap and get the previous cache instance, avoids double-dispose/lost-assignment race + // where each caller receives a distinct prior instance to dispose. + var oldCache = Interlocked.Exchange(ref cache, newCache); + + // Dispose the previous instance (if any)- each caller gets a unique prior instance from above + try + { + oldCache?.Dispose(); + } + catch (Exception e) + { + Context.API.LogException(ClassName, "Failed to dispose old program cache", e); + } } public Control CreateSettingPanel() @@ -442,12 +460,26 @@ namespace Flow.Launcher.Plugin.Program Title = Context.API.GetTranslation("flowlauncher_plugin_program_disable_program"), Action = c => { - _ = DisableProgramAsync(program); - Context.API.ShowMsg( - Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"), - Context.API.GetTranslation( - "flowlauncher_plugin_program_disable_dlgtitle_success_message")); - Context.API.ReQuery(); + _ = Task.Run(async () => + { + try + { + var disabled = await DisableProgramAsync(program); + if (disabled) + { + ResetCache(); + Context.API.ShowMsg( + Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"), + Context.API.GetTranslation( + "flowlauncher_plugin_program_disable_dlgtitle_success_message")); + } + Context.API.ReQuery(); + } + catch (Exception e) + { + Context.API.LogException(ClassName, "Failed to disable program", e); + } + }); return false; }, IcoPath = "Images/disable.png", @@ -458,52 +490,50 @@ namespace Flow.Launcher.Plugin.Program return menuOptions; } - private static async Task DisableProgramAsync(IProgram programToDelete) + private static async Task DisableProgramAsync(IProgram programToDelete) { if (_settings.DisabledProgramSources.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)) - return; + { + return false; + } await _uwpsLock.WaitAsync(); - var reindexUwps = true; try { - reindexUwps = _uwps.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier); - var program = _uwps.First(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier); - program.Enabled = false; - _settings.DisabledProgramSources.Add(new ProgramSource(program)); + var program = _uwps.FirstOrDefault(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier); + if (program != null) + { + program.Enabled = false; + _settings.DisabledProgramSources.Add(new ProgramSource(program)); + // Reindex UWP programs + _ = Task.Run(() => IndexUwpProgramsAsync(resetCache: false)); + return true; + } } finally { _uwpsLock.Release(); } - // Reindex UWP programs - if (reindexUwps) - { - _ = Task.Run(IndexUwpProgramsAsync); - return; - } - await _win32sLock.WaitAsync(); - var reindexWin32s = true; try { - reindexWin32s = _win32s.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier); - var program = _win32s.First(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier); - program.Enabled = false; - _settings.DisabledProgramSources.Add(new ProgramSource(program)); + var program = _win32s.FirstOrDefault(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier); + if (program != null) + { + program.Enabled = false; + _settings.DisabledProgramSources.Add(new ProgramSource(program)); + // Reindex Win32 programs + _ = Task.Run(() => IndexWin32ProgramsAsync(resetCache: false)); + return true; + } } finally { _win32sLock.Release(); } - // Reindex Win32 programs - if (reindexWin32s) - { - _ = Task.Run(IndexWin32ProgramsAsync); - return; - } + return false; } public static void StartProcess(Func runProcess, ProcessStartInfo info) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs index 9a8326e9a..8e3362285 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWPPackage.cs @@ -290,7 +290,7 @@ namespace Flow.Launcher.Plugin.Program.Programs } private static readonly Channel PackageChangeChannel = Channel.CreateBounded(1); - private static PackageCatalog? catalog; + private static PackageCatalog catalog; public static async Task WatchPackageChangeAsync() { @@ -317,7 +317,7 @@ namespace Flow.Launcher.Plugin.Program.Programs { await Task.Delay(3000).ConfigureAwait(false); PackageChangeChannel.Reader.TryRead(out _); - await Task.Run(Main.IndexUwpProgramsAsync); + await Main.IndexUwpProgramsAsync(resetCache: true).ConfigureAwait(false); } } } diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index 7aca8f3b6..6c7ff1dc1 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -796,7 +796,7 @@ namespace Flow.Launcher.Plugin.Program.Programs { } - await Task.Run(Main.IndexWin32ProgramsAsync); + await Main.IndexWin32ProgramsAsync(resetCache: true).ConfigureAwait(false); } } diff --git a/README.md b/README.md index f2f7a495d..e7595fff5 100644 --- a/README.md +++ b/README.md @@ -246,9 +246,9 @@ Or download the [early access version](https://github.com/Flow-Launcher/Prerelea -### [Clipboard History](https://github.com/liberize/Flow.Launcher.Plugin.ClipboardHistory) +### [Clipboard+](https://github.com/Jack251970/Flow.Launcher.Plugin.ClipboardPlus) - + ### [Home Assistant Commander](https://github.com/Garulf/HA-Commander) @@ -348,8 +348,8 @@ Or download the [early access version](https://github.com/Flow-Launcher/Prerelea - - + +