mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Merge branch 'master' into dev/crutkas/upgradeNuget
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
<Application x:Class="PowerLauncher.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:theming="clr-namespace:Wox.Plugin;assembly=Wox.Plugin"
|
||||
ShutdownMode="OnMainWindowClose"
|
||||
Startup="OnStartup">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<theming:CustomLibraryThemeProvider x:Key="{x:Static theming:CustomLibraryThemeProvider.DefaultInstance}" />
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Themes/Dark.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace PowerLauncher
|
||||
|
||||
private const string Unique = "PowerLauncher_Unique_Application_Mutex";
|
||||
private static bool _disposed;
|
||||
private Settings _settings;
|
||||
private PowerToysRunSettings _settings;
|
||||
private MainViewModel _mainVM;
|
||||
private MainWindow _mainWindow;
|
||||
private ThemeManager _themeManager;
|
||||
@@ -107,7 +107,7 @@ namespace PowerLauncher
|
||||
Current.MainWindow.Title = Constant.ExeFileName;
|
||||
|
||||
// main windows needs initialized before theme change because of blur settings
|
||||
Http.Proxy = _settings.Proxy;
|
||||
HttpClient.Proxy = _settings.Proxy;
|
||||
|
||||
RegisterExitEvents();
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ namespace PowerLauncher.Helper
|
||||
{
|
||||
string uriString = uri.AbsoluteUri;
|
||||
|
||||
int commaIndex = uriString.IndexOf(',', StringComparison.InvariantCultureIgnoreCase);
|
||||
// Using Ordinal since this is internal and used with a symbol
|
||||
int commaIndex = uriString.IndexOf(',', StringComparison.Ordinal);
|
||||
var headers = uriString.Substring(0, commaIndex).Split(';');
|
||||
_contentType = headers[0];
|
||||
string dataString = uriString.Substring(commaIndex + 1);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.IO.Pipes;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
@@ -29,6 +30,10 @@ namespace PowerLauncher.Helper
|
||||
public static class SingleInstance<TApplication>
|
||||
where TApplication : Application, ISingleInstanceApp
|
||||
{
|
||||
private static readonly IFileSystem FileSystem = new FileSystem();
|
||||
private static readonly IPath Path = FileSystem.Path;
|
||||
private static readonly IFile File = FileSystem.File;
|
||||
|
||||
/// <summary>
|
||||
/// String delimiter used in channel names.
|
||||
/// </summary>
|
||||
|
||||
@@ -22,14 +22,14 @@ namespace PowerLauncher
|
||||
{
|
||||
public partial class MainWindow : IDisposable
|
||||
{
|
||||
private readonly Settings _settings;
|
||||
private readonly PowerToysRunSettings _settings;
|
||||
private readonly MainViewModel _viewModel;
|
||||
private bool _isTextSetProgrammatically;
|
||||
private bool _deletePressed;
|
||||
private Timer _firstDeleteTimer = new Timer();
|
||||
private bool _coldStateHotkeyPressed;
|
||||
|
||||
public MainWindow(Settings settings, MainViewModel mainVM)
|
||||
public MainWindow(PowerToysRunSettings settings, MainViewModel mainVM)
|
||||
: this()
|
||||
{
|
||||
DataContext = mainVM;
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace PowerLauncher.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Powertoys Run deserialization error.
|
||||
/// Looks up a localized string similar to PowerToys Run deserialization error.
|
||||
/// </summary>
|
||||
public static string deseralization_error_title {
|
||||
get {
|
||||
|
||||
@@ -137,9 +137,11 @@
|
||||
</data>
|
||||
<data name="reportWindow_file_bug" xml:space="preserve">
|
||||
<value>Please file a bug in the</value>
|
||||
<comment>reportWindow_file_bug + reportWindow_github_repo string</comment>
|
||||
</data>
|
||||
<data name="reportWindow_github_repo" xml:space="preserve">
|
||||
<value>PowerToys GitHub repository</value>
|
||||
<comment>reportWindow_file_bug + reportWindow_github_repo string</comment>
|
||||
</data>
|
||||
<data name="reportWindow_upload_log" xml:space="preserve">
|
||||
<value>Make sure to upload the log file and to include the error message.</value>
|
||||
@@ -181,7 +183,7 @@
|
||||
<value>Title</value>
|
||||
</data>
|
||||
<data name="deseralization_error_title" xml:space="preserve">
|
||||
<value>Powertoys Run deserialization error</value>
|
||||
<value>PowerToys Run deserialization error</value>
|
||||
</data>
|
||||
<data name="deseralization_error_message" xml:space="preserve">
|
||||
<value>Settings will be reset to default and program will continue to function.</value>
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
@@ -21,6 +22,9 @@ namespace PowerLauncher
|
||||
{
|
||||
internal partial class ReportWindow
|
||||
{
|
||||
private static readonly IFileSystem FileSystem = new FileSystem();
|
||||
private static readonly IFile File = FileSystem.File;
|
||||
|
||||
public ReportWindow(Exception exception)
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -44,7 +48,9 @@ namespace PowerLauncher
|
||||
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.AppendLine(ErrorReporting.RuntimeInfo());
|
||||
content.AppendLine($"Date: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
|
||||
|
||||
// Using CurrentCulture since this is displayed to user in the report window
|
||||
content.AppendLine($"Date: {DateTime.Now.ToString(CultureInfo.CurrentCulture)}");
|
||||
content.AppendLine("Exception:");
|
||||
content.AppendLine(exception.ToString());
|
||||
var paragraph = new Paragraph();
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.Threading;
|
||||
using System.Windows.Input;
|
||||
using ManagedCommon;
|
||||
using Microsoft.PowerToys.Settings.UI.Library;
|
||||
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
|
||||
using PowerLauncher.Helper;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Infrastructure.Hotkey;
|
||||
@@ -26,13 +26,14 @@ namespace PowerLauncher
|
||||
|
||||
private const int MaxRetries = 10;
|
||||
private static readonly object _watcherSyncObject = new object();
|
||||
private readonly FileSystemWatcher _watcher;
|
||||
private readonly Settings _settings;
|
||||
private readonly IFileSystemWatcher _watcher;
|
||||
private readonly PowerToysRunSettings _settings;
|
||||
|
||||
private readonly ThemeManager _themeManager;
|
||||
|
||||
public SettingsWatcher(Settings settings, ThemeManager themeManager)
|
||||
public SettingsWatcher(PowerToysRunSettings settings, ThemeManager themeManager)
|
||||
{
|
||||
_settingsUtils = new SettingsUtils(new SystemIOProvider());
|
||||
_settingsUtils = new SettingsUtils();
|
||||
_settings = settings;
|
||||
_themeManager = themeManager;
|
||||
|
||||
@@ -41,6 +42,9 @@ namespace PowerLauncher
|
||||
|
||||
// Load initial settings file
|
||||
OverloadSettings();
|
||||
|
||||
// Apply theme at startup
|
||||
_themeManager.ChangeTheme(_settings.Theme, _settings.Theme == Theme.System);
|
||||
}
|
||||
|
||||
public void CreateSettingsIfNotExists()
|
||||
@@ -91,6 +95,7 @@ namespace PowerLauncher
|
||||
_settings.IgnoreHotkeysOnFullscreen = overloadSettings.Properties.IgnoreHotkeysInFullscreen;
|
||||
}
|
||||
|
||||
// Using OrdinalIgnoreCase since this is internal
|
||||
var indexer = PluginManager.AllPlugins.Find(p => p.Metadata.Name.Equals("Windows Indexer", StringComparison.OrdinalIgnoreCase));
|
||||
if (indexer != null)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
@@ -14,6 +12,7 @@
|
||||
<system:String x:Key="Theme.BaseColorScheme">Dark</system:String>
|
||||
<system:String x:Key="Theme.ColorScheme">Accent1</system:String>
|
||||
<Color x:Key="Theme.PrimaryAccentColor">Black</Color>
|
||||
<system:Boolean x:Key="Theme.IsHighContrast">False</system:Boolean>
|
||||
|
||||
<Color x:Key="SystemBaseMediumLowColor">#FF818181</Color>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="#FF171717" options:Freeze="True" />
|
||||
@@ -37,7 +36,7 @@
|
||||
|
||||
<Color x:Key="ScrollBarBackgroundPointerOver">#FF1b1b1b</Color>
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground">#FFcdcdcd</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground" Color="#FFcdcdcd" />
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerOver">#FFcdcdcd</Color>
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerPressed">#FF171717</Color>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
@@ -14,6 +12,7 @@
|
||||
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
|
||||
<system:String x:Key="Theme.ColorScheme">Accent2</system:String>
|
||||
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
|
||||
<system:Boolean x:Key="Theme.IsHighContrast">True</system:Boolean>
|
||||
|
||||
<Color x:Key="SystemBaseMediumLowColor">#ffff00</Color>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="Black" options:Freeze="True" />
|
||||
@@ -37,7 +36,7 @@
|
||||
|
||||
<Color x:Key="ScrollBarBackgroundPointerOver">#FF000000</Color>
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground">#FFFFFFFF</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground" Color="#FFFFFFFF" />
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerOver">#FFFFFFFF</Color>
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerPressed">#FFFFFFFF</Color>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
@@ -14,6 +12,7 @@
|
||||
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
|
||||
<system:String x:Key="Theme.ColorScheme">Accent3</system:String>
|
||||
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
|
||||
<system:Boolean x:Key="Theme.IsHighContrast">True</system:Boolean>
|
||||
|
||||
<Color x:Key="SystemBaseMediumLowColor">#ffff00</Color>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="Black" options:Freeze="True" />
|
||||
@@ -37,7 +36,7 @@
|
||||
|
||||
<Color x:Key="ScrollBarBackgroundPointerOver">#FF000000</Color>
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground">#FFFFFFFF</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground" Color="#FFFFFFFF" />
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerOver">#FFFFFFFF</Color>
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerPressed">#FFFFFFFF</Color>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
@@ -14,6 +12,7 @@
|
||||
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
|
||||
<system:String x:Key="Theme.ColorScheme">Accent4</system:String>
|
||||
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
|
||||
<system:Boolean x:Key="Theme.IsHighContrast">True</system:Boolean>
|
||||
|
||||
<Color x:Key="SystemBaseMediumLowColor">#66FFFFFF</Color>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="Black" options:Freeze="True" />
|
||||
@@ -37,7 +36,7 @@
|
||||
|
||||
<Color x:Key="ScrollBarBackgroundPointerOver">#FF000000</Color>
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground">#FFFFFFFF</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground" Color="#FFFFFFFF" />
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerOver">#FFFFFFFF</Color>
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerPressed">#FFFFFFFF</Color>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
@@ -14,6 +12,7 @@
|
||||
<system:String x:Key="Theme.BaseColorScheme">HighContrast</system:String>
|
||||
<system:String x:Key="Theme.ColorScheme">Accent5</system:String>
|
||||
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
|
||||
<system:Boolean x:Key="Theme.IsHighContrast">True</system:Boolean>
|
||||
|
||||
<Color x:Key="SystemBaseMediumLowColor">#66000000</Color>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="White" options:Freeze="True" />
|
||||
@@ -37,7 +36,7 @@
|
||||
|
||||
<Color x:Key="ScrollBarBackgroundPointerOver">#FFf0f0f0</Color>
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground">#FF000000</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground" Color="#FF000000" />
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerOver">#FF000000</Color>
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerPressed">#FF000000</Color>
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:markup="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:markupWithAssembly="clr-namespace:MahApps.Metro.Markup;assembly=MahApps.Metro"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
@@ -14,6 +12,7 @@
|
||||
<system:String x:Key="Theme.BaseColorScheme">Light</system:String>
|
||||
<system:String x:Key="Theme.ColorScheme">Accent1</system:String>
|
||||
<Color x:Key="Theme.PrimaryAccentColor">White</Color>
|
||||
<system:Boolean x:Key="Theme.IsHighContrast">False</system:Boolean>
|
||||
|
||||
<Color x:Key="SystemBaseMediumLowColor">#66000000</Color>
|
||||
<SolidColorBrush x:Key="SystemChromeLow" Color="#FFF2F2F2" options:Freeze="True" />
|
||||
@@ -37,7 +36,7 @@
|
||||
|
||||
<Color x:Key="ScrollBarBackgroundPointerOver">#FFf0f0f0</Color>
|
||||
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground">#FF1d1d1d</SolidColorBrush>
|
||||
<SolidColorBrush x:Key="ScrollBarLineButtonForeground" Color="#FF1d1d1d" />
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerOver">#FF1d1d1d</Color>
|
||||
<Color x:Key="ScrollBarLineButtonForegroundPointerPressed">#FFf3f3f3</Color>
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace PowerLauncher.ViewModel
|
||||
private readonly WoxJsonStorage<QueryHistory> _historyItemsStorage;
|
||||
private readonly WoxJsonStorage<UserSelectedRecord> _userSelectedRecordStorage;
|
||||
private readonly WoxJsonStorage<TopMostRecord> _topMostRecordStorage;
|
||||
private readonly Settings _settings;
|
||||
private readonly PowerToysRunSettings _settings;
|
||||
private readonly QueryHistory _history;
|
||||
private readonly UserSelectedRecord _userSelectedRecord;
|
||||
private readonly TopMostRecord _topMostRecord;
|
||||
@@ -53,7 +53,7 @@ namespace PowerLauncher.ViewModel
|
||||
|
||||
internal HotkeyManager HotkeyManager { get; set; }
|
||||
|
||||
public MainViewModel(Settings settings)
|
||||
public MainViewModel(PowerToysRunSettings settings)
|
||||
{
|
||||
_saved = false;
|
||||
_queryTextBeforeLeaveResults = string.Empty;
|
||||
@@ -87,7 +87,7 @@ namespace PowerLauncher.ViewModel
|
||||
HotkeyManager = new HotkeyManager();
|
||||
_settings.PropertyChanged += (s, e) =>
|
||||
{
|
||||
if (e.PropertyName == nameof(Settings.Hotkey))
|
||||
if (e.PropertyName == nameof(PowerToysRunSettings.Hotkey))
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
@@ -132,6 +132,7 @@ namespace PowerLauncher.ViewModel
|
||||
|
||||
if (index != null)
|
||||
{
|
||||
// Using InvariantCulture since this is internal
|
||||
results.SelectedIndex = int.Parse(index.ToString(), CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
@@ -438,8 +439,9 @@ namespace PowerLauncher.ViewModel
|
||||
|
||||
private void QueryHistory()
|
||||
{
|
||||
// Using CurrentCulture since query is received from user and used in downstream comparisons using CurrentCulture
|
||||
#pragma warning disable CA1308 // Normalize strings to uppercase
|
||||
var query = QueryText.ToLower(CultureInfo.InvariantCulture).Trim();
|
||||
var query = QueryText.ToLower(CultureInfo.CurrentCulture).Trim();
|
||||
#pragma warning restore CA1308 // Normalize strings to uppercase
|
||||
History.Clear();
|
||||
|
||||
@@ -528,6 +530,7 @@ namespace PowerLauncher.ViewModel
|
||||
|
||||
lock (_addResultsLock)
|
||||
{
|
||||
// Using CurrentCultureIgnoreCase since this is user facing
|
||||
if (queryText.Equals(_currentQuery, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
Results.Clear();
|
||||
@@ -565,6 +568,7 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
lock (_addResultsLock)
|
||||
{
|
||||
// Using CurrentCultureIgnoreCase since this is user facing
|
||||
if (queryText.Equals(_currentQuery, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
currentCancellationToken.ThrowIfCancellationRequested();
|
||||
@@ -630,6 +634,7 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
// Using CurrentCultureIgnoreCase since this is user facing
|
||||
if (queryText.Equals(_currentQuery, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
Results.Results.NotifyChanges();
|
||||
@@ -818,6 +823,7 @@ namespace PowerLauncher.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
// Using CurrentCultureIgnoreCase since this is user facing
|
||||
if (originQuery.Equals(_currentQuery, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
ct.ThrowIfCancellationRequested();
|
||||
@@ -879,6 +885,7 @@ namespace PowerLauncher.ViewModel
|
||||
}
|
||||
else
|
||||
{
|
||||
// Using Ordinal this is internal
|
||||
return string.IsNullOrEmpty(queryText) || autoCompleteText.IndexOf(queryText, StringComparison.Ordinal) != 0;
|
||||
}
|
||||
}
|
||||
@@ -889,6 +896,7 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
if (index == 0)
|
||||
{
|
||||
// Using OrdinalIgnoreCase because we want the characters to be exact in autocomplete text and the query
|
||||
if (input.IndexOf(query, StringComparison.OrdinalIgnoreCase) == 0)
|
||||
{
|
||||
// Use the same case as the input query for the matched portion of the string
|
||||
@@ -906,6 +914,7 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
if (index == 0 && !string.IsNullOrEmpty(query))
|
||||
{
|
||||
// Using OrdinalIgnoreCase since this is internal
|
||||
if (input.IndexOf(query, StringComparison.OrdinalIgnoreCase) == 0)
|
||||
{
|
||||
return query + input.Substring(query.Length);
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
private readonly object _collectionLock = new object();
|
||||
|
||||
private readonly Settings _settings;
|
||||
private readonly PowerToysRunSettings _settings;
|
||||
|
||||
public ResultsViewModel()
|
||||
{
|
||||
@@ -28,7 +28,7 @@ namespace PowerLauncher.ViewModel
|
||||
BindingOperations.EnableCollectionSynchronization(Results, _collectionLock);
|
||||
}
|
||||
|
||||
public ResultsViewModel(Settings settings)
|
||||
public ResultsViewModel(PowerToysRunSettings settings)
|
||||
: this()
|
||||
{
|
||||
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
|
||||
|
||||
@@ -11,11 +11,11 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
public class SettingWindowViewModel : BaseModel
|
||||
{
|
||||
private readonly WoxJsonStorage<Settings> _storage;
|
||||
private readonly WoxJsonStorage<PowerToysRunSettings> _storage;
|
||||
|
||||
public SettingWindowViewModel()
|
||||
{
|
||||
_storage = new WoxJsonStorage<Settings>();
|
||||
_storage = new WoxJsonStorage<PowerToysRunSettings>();
|
||||
Settings = _storage.Load();
|
||||
Settings.PropertyChanged += (s, e) =>
|
||||
{
|
||||
@@ -26,7 +26,7 @@ namespace PowerLauncher.ViewModel
|
||||
};
|
||||
}
|
||||
|
||||
public Settings Settings { get; set; }
|
||||
public PowerToysRunSettings Settings { get; set; }
|
||||
|
||||
public void Save()
|
||||
{
|
||||
|
||||
@@ -120,10 +120,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";deseralization_error_title" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
<Val><![CDATA[PowerToys Run deserialization error]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Chyba deserializace nástroje Spuštění PowerToys]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -154,7 +157,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Please file a bug in the]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
@@ -163,7 +166,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[PowerToys GitHub repository]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
|
||||
@@ -120,10 +120,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";deseralization_error_title" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
<Val><![CDATA[PowerToys Run deserialization error]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Powertoys Run-Deserialisierungsfehler]]></Val>
|
||||
<Val><![CDATA[Deserialisierungsfehler in PowerToys-Startprogramm]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -154,7 +157,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Please file a bug in the]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
@@ -163,7 +166,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[PowerToys GitHub repository]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
|
||||
@@ -120,10 +120,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";deseralization_error_title" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
<Val><![CDATA[PowerToys Run deserialization error]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Errore di deserializzazione dell'Utilità di avvio di PowerToys]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -154,7 +157,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Please file a bug in the]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
@@ -163,7 +166,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[PowerToys GitHub repository]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
|
||||
@@ -120,10 +120,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";deseralization_error_title" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
<Val><![CDATA[PowerToys Run deserialization error]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Powertoys Run のシリアル化解除エラー]]></Val>
|
||||
<Val><![CDATA[PowerToys Run の逆シリアル化エラー]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -154,7 +157,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Please file a bug in the]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
@@ -163,7 +166,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[PowerToys GitHub repository]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
|
||||
@@ -120,10 +120,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";deseralization_error_title" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
<Val><![CDATA[PowerToys Run deserialization error]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[PowerToys Run 역직렬화 오류]]></Val>
|
||||
<Val><![CDATA[PowerToys Run deserialization 오류]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -154,7 +157,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Please file a bug in the]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
@@ -163,7 +166,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[PowerToys GitHub repository]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
|
||||
@@ -120,10 +120,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";deseralization_error_title" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
<Val><![CDATA[PowerToys Run deserialization error]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Błąd deserializacji narzędzia Uruchamianie PowerToys]]></Val>
|
||||
<Val><![CDATA[Błąd deserializacji programu Uruchamianie PowerToys]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -154,7 +157,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Please file a bug in the]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
@@ -163,7 +166,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[PowerToys GitHub repository]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
|
||||
@@ -120,10 +120,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";deseralization_error_title" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
<Val><![CDATA[PowerToys Run deserialization error]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Fel vid deserialisering av PowerToys Run]]></Val>
|
||||
<Val><![CDATA[Deserialiseringsfel för PowerToys-startprogram]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -154,7 +157,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Please file a bug in the]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
@@ -163,7 +166,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[PowerToys GitHub repository]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
|
||||
@@ -120,10 +120,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";deseralization_error_title" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
<Val><![CDATA[PowerToys Run deserialization error]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Powertoys Run 反序列化错误]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Powertoys Run deserialization error]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -154,7 +157,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_file_bug" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Please file a bug in the]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
@@ -163,7 +166,7 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" Leaf="true">
|
||||
<Item ItemId=";reportWindow_github_repo" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[PowerToys GitHub repository]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
|
||||
Reference in New Issue
Block a user