diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 08035ee44..e33bf04ac 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -226,25 +226,25 @@ namespace Flow.Launcher.Infrastructure.UserSettings { _showHistoryQueryResultsForHomePage = value; OnPropertyChanged(); - if (value && _showHistoryExecutedResultsForHomePage) + if (value && _showHistoryLastOpenedResultsForHomePage) { - _showHistoryExecutedResultsForHomePage = false; - OnPropertyChanged(nameof(ShowHistoryExecutedResultsForHomePage)); + _showHistoryLastOpenedResultsForHomePage = false; + OnPropertyChanged(nameof(ShowHistoryLastOpenedResultsForHomePage)); } } } } - private bool _showHistoryExecutedResultsForHomePage = false; - public bool ShowHistoryExecutedResultsForHomePage + private bool _showHistoryLastOpenedResultsForHomePage = false; + public bool ShowHistoryLastOpenedResultsForHomePage { - get => _showHistoryExecutedResultsForHomePage; + get => _showHistoryLastOpenedResultsForHomePage; set { - if (_showHistoryExecutedResultsForHomePage != value) + if (_showHistoryLastOpenedResultsForHomePage != value) { - _showHistoryExecutedResultsForHomePage = value; + _showHistoryLastOpenedResultsForHomePage = value; OnPropertyChanged(); if (value && _showHistoryQueryResultsForHomePage) { diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index abadab964..14677e1ea 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -167,9 +167,9 @@ Home Page History Choose the type of history to show on the home page Query History - Executed History + Last Opened History Show History Query Results in Home Page - Show History Executed Results in Home Page + Show History Last Opened Results in Home Page Maximum History Results Shown in Home Page This can only be edited if plugin supports Home feature and Home Page is enabled. Show Search Window at Foremost diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index 9fe45e89e..e694a84d8 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -377,8 +377,8 @@ - diff --git a/Flow.Launcher/Storage/ExecutedHistory.cs b/Flow.Launcher/Storage/LastOpenedHistory.cs similarity index 85% rename from Flow.Launcher/Storage/ExecutedHistory.cs rename to Flow.Launcher/Storage/LastOpenedHistory.cs index d9b9966af..6394e2ce5 100644 --- a/Flow.Launcher/Storage/ExecutedHistory.cs +++ b/Flow.Launcher/Storage/LastOpenedHistory.cs @@ -8,14 +8,14 @@ using Flow.Launcher.Plugin; using Flow.Launcher.ViewModel; namespace Flow.Launcher.Storage; -public class ExecutedHistory +public class LastOpenedHistory { - [JsonInclude] public List Items { get; private set; } = []; + [JsonInclude] public List Items { get; private set; } = []; private const int MaxHistory = 300; public void Add(Result result) { - var item = new ExecutedHistoryItem + var item = new LastOpenedHistoryItem { Title = result.Title, SubTitle = result.SubTitle, diff --git a/Flow.Launcher/Storage/ExecutedHistoryItem.cs b/Flow.Launcher/Storage/LastOpenedHistoryItem.cs similarity index 93% rename from Flow.Launcher/Storage/ExecutedHistoryItem.cs rename to Flow.Launcher/Storage/LastOpenedHistoryItem.cs index 8ae6d3336..28bd49a95 100644 --- a/Flow.Launcher/Storage/ExecutedHistoryItem.cs +++ b/Flow.Launcher/Storage/LastOpenedHistoryItem.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Flow.Launcher.Plugin; namespace Flow.Launcher.Storage; -public class ExecutedHistoryItem +public class LastOpenedHistoryItem { public string Title { get; set; } = string.Empty; public string SubTitle { get; set; } = string.Empty; diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index abdd239e9..2e3e8d4d7 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -41,11 +41,11 @@ namespace Flow.Launcher.ViewModel private string _ignoredQueryText; // Used to ignore query text change when switching between context menu and query results private readonly FlowLauncherJsonStorage _historyItemsStorage; - private readonly FlowLauncherJsonStorage _executedHistoryStorage; + private readonly FlowLauncherJsonStorage _lastOpenedHistoryStorage; private readonly FlowLauncherJsonStorage _userSelectedRecordStorage; private readonly FlowLauncherJsonStorageTopMostRecord _topMostRecord; private readonly History _history; - private readonly ExecutedHistory _executedHistory; + private readonly LastOpenedHistory _lastOpenedHistory; private int lastHistoryIndex = 1; private readonly UserSelectedRecord _userSelectedRecord; @@ -150,11 +150,11 @@ namespace Flow.Launcher.ViewModel }; _historyItemsStorage = new FlowLauncherJsonStorage(); - _executedHistoryStorage = new FlowLauncherJsonStorage(); + _lastOpenedHistoryStorage = new FlowLauncherJsonStorage(); _userSelectedRecordStorage = new FlowLauncherJsonStorage(); _topMostRecord = new FlowLauncherJsonStorageTopMostRecord(); _history = _historyItemsStorage.Load(); - _executedHistory = _executedHistoryStorage.Load(); + _lastOpenedHistory = _lastOpenedHistoryStorage.Load(); _userSelectedRecord = _userSelectedRecordStorage.Load(); ContextMenu = new ResultsViewModel(Settings, this) @@ -533,8 +533,8 @@ namespace Flow.Launcher.ViewModel if (QueryResultsSelected()) { - if(Settings.ShowHistoryExecutedResultsForHomePage) - _executedHistory.Add(result); + if(Settings.ShowHistoryLastOpenedResultsForHomePage) + _lastOpenedHistory.Add(result); _userSelectedRecord.Add(result); _history.Add(result.OriginQuery.RawQuery); @@ -1459,9 +1459,9 @@ namespace Flow.Launcher.ViewModel { QueryHistoryTask(currentCancellationToken); } - else if (Settings.ShowHistoryExecutedResultsForHomePage) + else if (Settings.ShowHistoryLastOpenedResultsForHomePage) { - QueryExecutedHistoryTask(currentCancellationToken); + QueryLastOpenedHistoryTask(currentCancellationToken); } } else @@ -1586,9 +1586,9 @@ namespace Flow.Launcher.ViewModel } } - void QueryExecutedHistoryTask(CancellationToken token) + void QueryLastOpenedHistoryTask(CancellationToken token) { - var historyItems = _executedHistory.Items.TakeLast(Settings.MaxHistoryResultsToShowForHomePage).Reverse(); + var historyItems = _lastOpenedHistory.Items.TakeLast(Settings.MaxHistoryResultsToShowForHomePage).Reverse(); var results = new List(); foreach (var item in historyItems) @@ -1612,7 +1612,7 @@ namespace Flow.Launcher.ViewModel if (token.IsCancellationRequested) return; - App.API.LogDebug(ClassName, "Update results for executed history"); + App.API.LogDebug(ClassName, "Update results for last opened history"); if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(results, _historyMetadata, query, token, reSelect))) @@ -2209,7 +2209,7 @@ namespace Flow.Launcher.ViewModel public void Save() { _historyItemsStorage.Save(); - _executedHistoryStorage.Save(); + _lastOpenedHistoryStorage.Save(); _userSelectedRecordStorage.Save(); _topMostRecord.Save(); }