Spelling: ... wox (#3775)

* spelling: arguments

* spelling: config

* spelling: deactivated

* spelling: exception

* spelling: folder

* spelling: initialize

* spelling: makesure

* spelling: response

* spelling: storage

* spelling: visibility

* spelling: serialized

* spelling: zipped
This commit is contained in:
Josh Soref 2020-05-27 11:05:54 -04:00 committed by GitHub
parent c2c163ac4e
commit 84169cce10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 49 additions and 49 deletions

View File

@ -52,7 +52,7 @@
Margin="24,8,24,24" Margin="24,8,24,24"
BorderThickness="4" BorderThickness="4"
CornerRadius="4" CornerRadius="4"
Visibility="{Binding Results.Visbility}"> Visibility="{Binding Results.Visibility}">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="16" Opacity="0.8" ShadowDepth="0" /> <DropShadowEffect BlurRadius="16" Opacity="0.8" ShadowDepth="0" />
</Border.Effect> </Border.Effect>

View File

@ -196,7 +196,7 @@ namespace PowerLauncher
private void OnDeactivated(object sender, EventArgs e) private void OnDeactivated(object sender, EventArgs e)
{ {
if (_settings.HideWhenDeactive) if (_settings.HideWhenDeactivated)
{ {
if (isDPIChanged) if (isDPIChanged)
{ {

View File

@ -87,8 +87,8 @@ namespace Wox.Core.Plugin
} }
else else
{ {
string actionReponse = ExecuteCallback(result1.JsonRPCAction); string actionResponse = ExecuteCallback(result1.JsonRPCAction);
JsonRPCRequestModel jsonRpcRequestModel = JsonConvert.DeserializeObject<JsonRPCRequestModel>(actionReponse); JsonRPCRequestModel jsonRpcRequestModel = JsonConvert.DeserializeObject<JsonRPCRequestModel>(actionResponse);
if (jsonRpcRequestModel != null if (jsonRpcRequestModel != null
&& !String.IsNullOrEmpty(jsonRpcRequestModel.Method) && !String.IsNullOrEmpty(jsonRpcRequestModel.Method)
&& jsonRpcRequestModel.Method.StartsWith("Wox.")) && jsonRpcRequestModel.Method.StartsWith("Wox."))

View File

@ -90,7 +90,7 @@ namespace Wox.Core.Plugin
if (!File.Exists(metadata.ExecuteFilePath)) if (!File.Exists(metadata.ExecuteFilePath))
{ {
Log.Error($"|PluginConfig.GetPluginMetadata|execute file path didn't exist <{metadata.ExecuteFilePath}> for conifg <{configPath}"); Log.Error($"|PluginConfig.GetPluginMetadata|execute file path didn't exist <{metadata.ExecuteFilePath}> for config <{configPath}");
return null; return null;
} }

View File

@ -13,28 +13,28 @@ namespace Wox.Core.Plugin
{ {
if (File.Exists(path)) if (File.Exists(path))
{ {
string tempFoler = Path.Combine(Path.GetTempPath(), "wox\\plugins"); string tempFolder = Path.Combine(Path.GetTempPath(), "wox\\plugins");
if (Directory.Exists(tempFoler)) if (Directory.Exists(tempFolder))
{ {
Directory.Delete(tempFoler, true); Directory.Delete(tempFolder, true);
} }
UnZip(path, tempFoler, true); UnZip(path, tempFolder, true);
string iniPath = Path.Combine(tempFoler, "plugin.json"); string iniPath = Path.Combine(tempFolder, "plugin.json");
if (!File.Exists(iniPath)) if (!File.Exists(iniPath))
{ {
MessageBox.Show("Install failed: plugin config is missing"); MessageBox.Show("Install failed: plugin config is missing");
return; return;
} }
PluginMetadata plugin = GetMetadataFromJson(tempFoler); PluginMetadata plugin = GetMetadataFromJson(tempFolder);
if (plugin == null || plugin.Name == null) if (plugin == null || plugin.Name == null)
{ {
MessageBox.Show("Install failed: plugin config is invalid"); MessageBox.Show("Install failed: plugin config is invalid");
return; return;
} }
string pluginFolerPath = Infrastructure.Constant.PluginsDirectory; string pluginFolderPath = Infrastructure.Constant.PluginsDirectory;
string newPluginName = plugin.Name string newPluginName = plugin.Name
.Replace("/", "_") .Replace("/", "_")
@ -46,7 +46,7 @@ namespace Wox.Core.Plugin
.Replace("*", "_") .Replace("*", "_")
.Replace("|", "_") .Replace("|", "_")
+ "-" + Guid.NewGuid(); + "-" + Guid.NewGuid();
string newPluginPath = Path.Combine(pluginFolerPath, newPluginName); string newPluginPath = Path.Combine(pluginFolderPath, newPluginName);
string content = $"Do you want to install following plugin?{Environment.NewLine}{Environment.NewLine}" + string content = $"Do you want to install following plugin?{Environment.NewLine}{Environment.NewLine}" +
$"Name: {plugin.Name}{Environment.NewLine}" + $"Name: {plugin.Name}{Environment.NewLine}" +
$"Version: {plugin.Version}{Environment.NewLine}" + $"Version: {plugin.Version}{Environment.NewLine}" +
@ -72,7 +72,7 @@ namespace Wox.Core.Plugin
} }
UnZip(path, newPluginPath, true); UnZip(path, newPluginPath, true);
Directory.Delete(tempFoler, true); Directory.Delete(tempFolder, true);
//existing plugins could be loaded by the application, //existing plugins could be loaded by the application,
//if we try to delete those kind of plugins, we will get a error that indicate the //if we try to delete those kind of plugins, we will get a error that indicate the
@ -146,17 +146,17 @@ namespace Wox.Core.Plugin
/// <summary> /// <summary>
/// unzip /// unzip
/// </summary> /// </summary>
/// <param name="zipedFile">The ziped file.</param> /// <param name="zippedFile">The zipped file.</param>
/// <param name="strDirectory">The STR directory.</param> /// <param name="strDirectory">The STR directory.</param>
/// <param name="overWrite">overwrite</param> /// <param name="overWrite">overwrite</param>
private static void UnZip(string zipedFile, string strDirectory, bool overWrite) private static void UnZip(string zippedFile, string strDirectory, bool overWrite)
{ {
if (strDirectory == "") if (strDirectory == "")
strDirectory = Directory.GetCurrentDirectory(); strDirectory = Directory.GetCurrentDirectory();
if (!strDirectory.EndsWith("\\")) if (!strDirectory.EndsWith("\\"))
strDirectory = strDirectory + "\\"; strDirectory = strDirectory + "\\";
using (ZipInputStream s = new ZipInputStream(File.OpenRead(zipedFile))) using (ZipInputStream s = new ZipInputStream(File.OpenRead(zippedFile)))
{ {
ZipEntry theEntry; ZipEntry theEntry;

View File

@ -29,7 +29,7 @@ namespace Wox.Core.Resource
{ {
_themeDirectories.Add(DirectoryPath); _themeDirectories.Add(DirectoryPath);
_themeDirectories.Add(UserDirectoryPath); _themeDirectories.Add(UserDirectoryPath);
MakesureThemeDirectoriesExist(); MakeSureThemeDirectoriesExist();
var dicts = Application.Current.Resources.MergedDictionaries; var dicts = Application.Current.Resources.MergedDictionaries;
_oldResource = dicts.First(d => _oldResource = dicts.First(d =>
@ -45,7 +45,7 @@ namespace Wox.Core.Resource
_oldTheme = Path.GetFileNameWithoutExtension(_oldResource.Source.AbsolutePath); _oldTheme = Path.GetFileNameWithoutExtension(_oldResource.Source.AbsolutePath);
} }
private void MakesureThemeDirectoriesExist() private void MakeSureThemeDirectoriesExist()
{ {
foreach (string dir in _themeDirectories) foreach (string dir in _themeDirectories)
{ {
@ -57,7 +57,7 @@ namespace Wox.Core.Resource
} }
catch (Exception e) catch (Exception e)
{ {
Log.Exception($"|Theme.MakesureThemeDirectoriesExist|Exception when create directory <{dir}>", e); Log.Exception($"|Theme.MakeSureThemeDirectoriesExist|Exception when create directory <{dir}>", e);
} }
} }
} }

View File

@ -10,7 +10,7 @@ namespace Wox.Infrastructure.Exception
{ {
public class ExceptionFormatter public class ExceptionFormatter
{ {
public static string FormatExcpetion(System.Exception exception) public static string FormatException(System.Exception exception)
{ {
return CreateExceptionReport(exception); return CreateExceptionReport(exception);
} }

View File

@ -9,7 +9,7 @@ namespace Wox.Infrastructure.Storage
/// <summary> /// <summary>
/// Serialize object using json format. /// Serialize object using json format.
/// </summary> /// </summary>
public class JsonStrorage<T> public class JsonStorage<T>
{ {
private readonly JsonSerializerSettings _serializerSettings; private readonly JsonSerializerSettings _serializerSettings;
private T _data; private T _data;
@ -20,7 +20,7 @@ namespace Wox.Infrastructure.Storage
public string DirectoryPath { get; set; } public string DirectoryPath { get; set; }
internal JsonStrorage() internal JsonStorage()
{ {
// use property initialization instead of DefaultValueAttribute // use property initialization instead of DefaultValueAttribute
// easier and flexible for default value of object // easier and flexible for default value of object
@ -35,10 +35,10 @@ namespace Wox.Infrastructure.Storage
{ {
if (File.Exists(FilePath)) if (File.Exists(FilePath))
{ {
var searlized = File.ReadAllText(FilePath); var serialized = File.ReadAllText(FilePath);
if (!string.IsNullOrWhiteSpace(searlized)) if (!string.IsNullOrWhiteSpace(serialized))
{ {
Deserialize(searlized); Deserialize(serialized);
} }
else else
{ {
@ -52,16 +52,16 @@ namespace Wox.Infrastructure.Storage
return _data.NonNull(); return _data.NonNull();
} }
private void Deserialize(string searlized) private void Deserialize(string serialized)
{ {
try try
{ {
_data = JsonConvert.DeserializeObject<T>(searlized, _serializerSettings); _data = JsonConvert.DeserializeObject<T>(serialized, _serializerSettings);
} }
catch (JsonException e) catch (JsonException e)
{ {
LoadDefault(); LoadDefault();
Log.Exception($"|JsonStrorage.Deserialize|Deserialize error for json <{FilePath}>", e); Log.Exception($"|JsonStorage.Deserialize|Deserialize error for json <{FilePath}>", e);
} }
if (_data == null) if (_data == null)

View File

@ -2,7 +2,7 @@
namespace Wox.Infrastructure.Storage namespace Wox.Infrastructure.Storage
{ {
public class PluginJsonStorage<T> :JsonStrorage<T> where T : new() public class PluginJsonStorage<T> :JsonStorage<T> where T : new()
{ {
public PluginJsonStorage() public PluginJsonStorage()
{ {

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Wox.Infrastructure.Storage namespace Wox.Infrastructure.Storage
{ {
public class WoxJsonStorage<T> : JsonStrorage<T> where T : new() public class WoxJsonStorage<T> : JsonStorage<T> where T : new()
{ {
public WoxJsonStorage() public WoxJsonStorage()
{ {

View File

@ -128,7 +128,7 @@ namespace Wox.Infrastructure.UserSettings
} }
} }
public bool LeaveCmdOpen { get; set; } public bool LeaveCmdOpen { get; set; }
public bool HideWhenDeactive { get; set; } = true; public bool HideWhenDeactivated { get; set; } = true;
public bool RememberLastLaunchLocation { get; set; } public bool RememberLastLaunchLocation { get; set; }
public bool IgnoreHotkeysOnFullscreen { get; set; } public bool IgnoreHotkeysOnFullscreen { get; set; }

View File

@ -20,11 +20,11 @@ namespace Wox.Plugin.SharedCommands
var browser = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : browserPath; var browser = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : browserPath;
// Internet Explorer will open url in new browser window, and does not take the --new-window parameter // Internet Explorer will open url in new browser window, and does not take the --new-window parameter
var browserArguements = browserExecutableName == "iexplore.exe" ? url : "--new-window " + url; var browserArguments = browserExecutableName == "iexplore.exe" ? url : "--new-window " + url;
try try
{ {
Process.Start(browser, browserArguements); Process.Start(browser, browserArguments);
} }
catch (System.ComponentModel.Win32Exception) catch (System.ComponentModel.Win32Exception)
{ {

View File

@ -11,7 +11,7 @@ namespace Wox.Helper
private static void Report(Exception e) private static void Report(Exception e)
{ {
var logger = LogManager.GetLogger("UnHandledException"); var logger = LogManager.GetLogger("UnHandledException");
logger.Fatal(ExceptionFormatter.FormatExcpetion(e)); logger.Fatal(ExceptionFormatter.FormatException(e));
var reportWindow = new ReportWindow(e); var reportWindow = new ReportWindow(e);
reportWindow.Show(); reportWindow.Show();

View File

@ -161,7 +161,7 @@ namespace Wox
private void OnDeactivated(object sender, EventArgs e) private void OnDeactivated(object sender, EventArgs e)
{ {
if (_settings.HideWhenDeactive) if (_settings.HideWhenDeactivated)
{ {
Hide(); Hide();
} }

View File

@ -12,7 +12,7 @@
SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}" SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"
HorizontalContentAlignment="Stretch" ItemsSource="{Binding Results}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Results}"
Margin="{Binding Margin}" Margin="{Binding Margin}"
Visibility="{Binding Visbility}" Visibility="{Binding Visibility}"
Style="{DynamicResource BaseListboxStyle}" Focusable="False" Style="{DynamicResource BaseListboxStyle}" Focusable="False"
KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single" KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard"

View File

@ -276,13 +276,13 @@ namespace Wox.ViewModel
_selectedResults = value; _selectedResults = value;
if (SelectedIsFromQueryResults()) if (SelectedIsFromQueryResults())
{ {
ContextMenu.Visbility = Visibility.Collapsed; ContextMenu.Visibility = Visibility.Collapsed;
History.Visbility = Visibility.Collapsed; History.Visibility = Visibility.Collapsed;
ChangeQueryText(_queryTextBeforeLeaveResults); ChangeQueryText(_queryTextBeforeLeaveResults);
} }
else else
{ {
Results.Visbility = Visibility.Collapsed; Results.Visibility = Visibility.Collapsed;
_queryTextBeforeLeaveResults = QueryText; _queryTextBeforeLeaveResults = QueryText;
@ -299,7 +299,7 @@ namespace Wox.ViewModel
QueryText = string.Empty; QueryText = string.Empty;
} }
} }
_selectedResults.Visbility = Visibility.Visible; _selectedResults.Visibility = Visibility.Visible;
} }
} }
@ -471,7 +471,7 @@ namespace Wox.ViewModel
{ {
Results.SelectedItem = null; Results.SelectedItem = null;
Results.Clear(); Results.Clear();
Results.Visbility = Visibility.Collapsed; Results.Visibility = Visibility.Collapsed;
} }
} }
@ -654,9 +654,9 @@ namespace Wox.ViewModel
Results.AddResults(list, metadata.ID); Results.AddResults(list, metadata.ID);
} }
if (Results.Visbility != Visibility.Visible && list.Count > 0) if (Results.Visibility != Visibility.Visible && list.Count > 0)
{ {
Results.Visbility = Visibility.Visible; Results.Visibility = Visibility.Visible;
} }
} }

View File

@ -14,7 +14,7 @@ namespace Wox.ViewModel
public ImageSource Image => ImageLoader.Load(PluginPair.Metadata.IcoPath); public ImageSource Image => ImageLoader.Load(PluginPair.Metadata.IcoPath);
public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count > 1 ? Visibility.Collapsed : Visibility.Visible; public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count > 1 ? Visibility.Collapsed : Visibility.Visible;
public string InitilizaTime => string.Format(_translator.GetTranslation("plugin_init_time"), PluginPair.Metadata.InitTime); public string InitializeTime => string.Format(_translator.GetTranslation("plugin_init_time"), PluginPair.Metadata.InitTime);
public string QueryTime => string.Format(_translator.GetTranslation("plugin_query_time"), PluginPair.Metadata.AvgQueryTime); public string QueryTime => string.Format(_translator.GetTranslation("plugin_query_time"), PluginPair.Metadata.AvgQueryTime);
public string ActionKeywordsText => string.Join(Query.ActionKeywordSeparator, PluginPair.Metadata.ActionKeywords); public string ActionKeywordsText => string.Join(Query.ActionKeywordSeparator, PluginPair.Metadata.ActionKeywords);
} }

View File

@ -83,7 +83,7 @@ namespace Wox.ViewModel
public Thickness Margin { get; set; } public Thickness Margin { get; set; }
public Visibility Visbility { get; set; } = Visibility.Hidden; public Visibility Visibility { get; set; } = Visibility.Hidden;
#endregion #endregion
@ -203,7 +203,7 @@ namespace Wox.ViewModel
else else
{ {
Margin = new Thickness { Top = 0 }; Margin = new Thickness { Top = 0 };
Visbility = Visibility.Collapsed; Visibility = Visibility.Collapsed;
} }
} }
} }

View File

@ -128,7 +128,7 @@ void log_stack_trace(std::wstring& generalErrorDescription)
MessageBoxW(NULL, errorString.c_str(), L"Unhandled Error", MB_OK | MB_ICONERROR); MessageBoxW(NULL, errorString.c_str(), L"Unhandled Error", MB_OK | MB_ICONERROR);
} }
LONG WINAPI unhandled_exceptiont_handler(PEXCEPTION_POINTERS info) LONG WINAPI unhandled_exception_handler(PEXCEPTION_POINTERS info)
{ {
if (!processing_exception) if (!processing_exception)
{ {
@ -164,7 +164,7 @@ extern "C" void AbortHandler(int signal_number)
void init_global_error_handlers() void init_global_error_handlers()
{ {
default_top_level_exception_handler = SetUnhandledExceptionFilter(unhandled_exceptiont_handler); default_top_level_exception_handler = SetUnhandledExceptionFilter(unhandled_exception_handler);
signal(SIGABRT, &AbortHandler); signal(SIGABRT, &AbortHandler);
} }
#endif #endif