Skip to content

Commit

Permalink
Spelling: ... wox (#3775)
Browse files Browse the repository at this point in the history
* spelling: arguments

* spelling: config

* spelling: deactivated

* spelling: exception

* spelling: folder

* spelling: initialize

* spelling: makesure

* spelling: response

* spelling: storage

* spelling: visibility

* spelling: serialized

* spelling: zipped
  • Loading branch information
jsoref committed May 27, 2020
1 parent c2c163a commit 84169cc
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/modules/launcher/PowerLauncher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
Margin="24,8,24,24"
BorderThickness="4"
CornerRadius="4"
Visibility="{Binding Results.Visbility}">
Visibility="{Binding Results.Visibility}">
<Border.Effect>
<DropShadowEffect BlurRadius="16" Opacity="0.8" ShadowDepth="0" />
</Border.Effect>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/launcher/PowerLauncher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private void OnPreviewDragOver(object sender, DragEventArgs e)

private void OnDeactivated(object sender, EventArgs e)
{
if (_settings.HideWhenDeactive)
if (_settings.HideWhenDeactivated)
{
if (isDPIChanged)
{
Expand Down
4 changes: 2 additions & 2 deletions src/modules/launcher/Wox.Core/Plugin/JsonRPCPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ private List<Result> DeserializedResult(string output)
}
else
{
string actionReponse = ExecuteCallback(result1.JsonRPCAction);
JsonRPCRequestModel jsonRpcRequestModel = JsonConvert.DeserializeObject<JsonRPCRequestModel>(actionReponse);
string actionResponse = ExecuteCallback(result1.JsonRPCAction);
JsonRPCRequestModel jsonRpcRequestModel = JsonConvert.DeserializeObject<JsonRPCRequestModel>(actionResponse);
if (jsonRpcRequestModel != null
&& !String.IsNullOrEmpty(jsonRpcRequestModel.Method)
&& jsonRpcRequestModel.Method.StartsWith("Wox."))
Expand Down
2 changes: 1 addition & 1 deletion src/modules/launcher/Wox.Core/Plugin/PluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static PluginMetadata GetPluginMetadata(string pluginDirectory)

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;
}

Expand Down
24 changes: 12 additions & 12 deletions src/modules/launcher/Wox.Core/Plugin/PluginInstaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,28 @@ internal static void Install(string path)
{
if (File.Exists(path))
{
string tempFoler = Path.Combine(Path.GetTempPath(), "wox\\plugins");
if (Directory.Exists(tempFoler))
string tempFolder = Path.Combine(Path.GetTempPath(), "wox\\plugins");
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))
{
MessageBox.Show("Install failed: plugin config is missing");
return;
}

PluginMetadata plugin = GetMetadataFromJson(tempFoler);
PluginMetadata plugin = GetMetadataFromJson(tempFolder);
if (plugin == null || plugin.Name == null)
{
MessageBox.Show("Install failed: plugin config is invalid");
return;
}

string pluginFolerPath = Infrastructure.Constant.PluginsDirectory;
string pluginFolderPath = Infrastructure.Constant.PluginsDirectory;

string newPluginName = plugin.Name
.Replace("/", "_")
Expand All @@ -46,7 +46,7 @@ internal static void Install(string path)
.Replace("*", "_")
.Replace("|", "_")
+ "-" + 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}" +
$"Name: {plugin.Name}{Environment.NewLine}" +
$"Version: {plugin.Version}{Environment.NewLine}" +
Expand All @@ -72,7 +72,7 @@ internal static void Install(string path)
}

UnZip(path, newPluginPath, true);
Directory.Delete(tempFoler, true);
Directory.Delete(tempFolder, true);

//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
Expand Down Expand Up @@ -146,17 +146,17 @@ private static PluginMetadata GetMetadataFromJson(string pluginDirectory)
/// <summary>
/// unzip
/// </summary>
/// <param name="zipedFile">The ziped file.</param>
/// <param name="zippedFile">The zipped file.</param>
/// <param name="strDirectory">The STR directory.</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 == "")
strDirectory = Directory.GetCurrentDirectory();
if (!strDirectory.EndsWith("\\"))
strDirectory = strDirectory + "\\";

using (ZipInputStream s = new ZipInputStream(File.OpenRead(zipedFile)))
using (ZipInputStream s = new ZipInputStream(File.OpenRead(zippedFile)))
{
ZipEntry theEntry;

Expand Down
6 changes: 3 additions & 3 deletions src/modules/launcher/Wox.Core/Resource/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Theme()
{
_themeDirectories.Add(DirectoryPath);
_themeDirectories.Add(UserDirectoryPath);
MakesureThemeDirectoriesExist();
MakeSureThemeDirectoriesExist();

var dicts = Application.Current.Resources.MergedDictionaries;
_oldResource = dicts.First(d =>
Expand All @@ -45,7 +45,7 @@ public Theme()
_oldTheme = Path.GetFileNameWithoutExtension(_oldResource.Source.AbsolutePath);
}

private void MakesureThemeDirectoriesExist()
private void MakeSureThemeDirectoriesExist()
{
foreach (string dir in _themeDirectories)
{
Expand All @@ -57,7 +57,7 @@ private void MakesureThemeDirectoriesExist()
}
catch (Exception e)
{
Log.Exception($"|Theme.MakesureThemeDirectoriesExist|Exception when create directory <{dir}>", e);
Log.Exception($"|Theme.MakeSureThemeDirectoriesExist|Exception when create directory <{dir}>", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Wox.Infrastructure.Exception
{
public class ExceptionFormatter
{
public static string FormatExcpetion(System.Exception exception)
public static string FormatException(System.Exception exception)
{
return CreateExceptionReport(exception);
}
Expand Down
16 changes: 8 additions & 8 deletions src/modules/launcher/Wox.Infrastructure/Storage/JsonStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Wox.Infrastructure.Storage
/// <summary>
/// Serialize object using json format.
/// </summary>
public class JsonStrorage<T>
public class JsonStorage<T>
{
private readonly JsonSerializerSettings _serializerSettings;
private T _data;
Expand All @@ -20,7 +20,7 @@ public class JsonStrorage<T>
public string DirectoryPath { get; set; }


internal JsonStrorage()
internal JsonStorage()
{
// use property initialization instead of DefaultValueAttribute
// easier and flexible for default value of object
Expand All @@ -35,10 +35,10 @@ public T Load()
{
if (File.Exists(FilePath))
{
var searlized = File.ReadAllText(FilePath);
if (!string.IsNullOrWhiteSpace(searlized))
var serialized = File.ReadAllText(FilePath);
if (!string.IsNullOrWhiteSpace(serialized))
{
Deserialize(searlized);
Deserialize(serialized);
}
else
{
Expand All @@ -52,16 +52,16 @@ public T Load()
return _data.NonNull();
}

private void Deserialize(string searlized)
private void Deserialize(string serialized)
{
try
{
_data = JsonConvert.DeserializeObject<T>(searlized, _serializerSettings);
_data = JsonConvert.DeserializeObject<T>(serialized, _serializerSettings);
}
catch (JsonException e)
{
LoadDefault();
Log.Exception($"|JsonStrorage.Deserialize|Deserialize error for json <{FilePath}>", e);
Log.Exception($"|JsonStorage.Deserialize|Deserialize error for json <{FilePath}>", e);
}

if (_data == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Wox.Infrastructure.Storage
{
public class PluginJsonStorage<T> :JsonStrorage<T> where T : new()
public class PluginJsonStorage<T> :JsonStorage<T> where T : new()
{
public PluginJsonStorage()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Wox.Infrastructure.Storage
{
public class WoxJsonStorage<T> : JsonStrorage<T> where T : new()
public class WoxJsonStorage<T> : JsonStorage<T> where T : new()
{
public WoxJsonStorage()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public bool HideNotifyIcon
}
}
public bool LeaveCmdOpen { get; set; }
public bool HideWhenDeactive { get; set; } = true;
public bool HideWhenDeactivated { get; set; } = true;
public bool RememberLastLaunchLocation { get; set; }
public bool IgnoreHotkeysOnFullscreen { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions src/modules/launcher/Wox.Plugin/SharedCommands/SearchWeb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public static void NewBrowserWindow(this string url, string 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
var browserArguements = browserExecutableName == "iexplore.exe" ? url : "--new-window " + url;
var browserArguments = browserExecutableName == "iexplore.exe" ? url : "--new-window " + url;

try
{
Process.Start(browser, browserArguements);
Process.Start(browser, browserArguments);
}
catch (System.ComponentModel.Win32Exception)
{
Expand Down
2 changes: 1 addition & 1 deletion src/modules/launcher/Wox/Helper/ErrorReporting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static class ErrorReporting
private static void Report(Exception e)
{
var logger = LogManager.GetLogger("UnHandledException");
logger.Fatal(ExceptionFormatter.FormatExcpetion(e));
logger.Fatal(ExceptionFormatter.FormatException(e));

var reportWindow = new ReportWindow(e);
reportWindow.Show();
Expand Down
2 changes: 1 addition & 1 deletion src/modules/launcher/Wox/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void OnContextMenusForSettingsClick(object sender, RoutedEventArgs e)

private void OnDeactivated(object sender, EventArgs e)
{
if (_settings.HideWhenDeactive)
if (_settings.HideWhenDeactivated)
{
Hide();
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/launcher/Wox/ResultListBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
SelectedItem="{Binding SelectedItem, Mode=OneWayToSource}"
HorizontalContentAlignment="Stretch" ItemsSource="{Binding Results}"
Margin="{Binding Margin}"
Visibility="{Binding Visbility}"
Visibility="{Binding Visibility}"
Style="{DynamicResource BaseListboxStyle}" Focusable="False"
KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard"
Expand Down
14 changes: 7 additions & 7 deletions src/modules/launcher/Wox/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ private ResultsViewModel SelectedResults
_selectedResults = value;
if (SelectedIsFromQueryResults())
{
ContextMenu.Visbility = Visibility.Collapsed;
History.Visbility = Visibility.Collapsed;
ContextMenu.Visibility = Visibility.Collapsed;
History.Visibility = Visibility.Collapsed;
ChangeQueryText(_queryTextBeforeLeaveResults);
}
else
{
Results.Visbility = Visibility.Collapsed;
Results.Visibility = Visibility.Collapsed;
_queryTextBeforeLeaveResults = QueryText;


Expand All @@ -299,7 +299,7 @@ private ResultsViewModel SelectedResults
QueryText = string.Empty;
}
}
_selectedResults.Visbility = Visibility.Visible;
_selectedResults.Visibility = Visibility.Visible;
}
}

Expand Down Expand Up @@ -471,7 +471,7 @@ private void QueryResults()
{
Results.SelectedItem = null;
Results.Clear();
Results.Visbility = Visibility.Collapsed;
Results.Visibility = Visibility.Collapsed;
}
}

Expand Down Expand Up @@ -654,9 +654,9 @@ public void UpdateResultView(List<Result> list, PluginMetadata metadata, Query o
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;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/launcher/Wox/ViewModel/PluginViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class PluginViewModel : BaseModel

public ImageSource Image => ImageLoader.Load(PluginPair.Metadata.IcoPath);
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 ActionKeywordsText => string.Join(Query.ActionKeywordSeparator, PluginPair.Metadata.ActionKeywords);
}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/launcher/Wox/ViewModel/ResultsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public ResultViewModel SelectedItem


public Thickness Margin { get; set; }
public Visibility Visbility { get; set; } = Visibility.Hidden;
public Visibility Visibility { get; set; } = Visibility.Hidden;

#endregion

Expand Down Expand Up @@ -203,7 +203,7 @@ public void AddResults(List<Result> newRawResults, string resultId)
else
{
Margin = new Thickness { Top = 0 };
Visbility = Visibility.Collapsed;
Visibility = Visibility.Collapsed;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/runner/unhandled_exception_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void log_stack_trace(std::wstring& generalErrorDescription)
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)
{
Expand Down Expand Up @@ -164,7 +164,7 @@ extern "C" void AbortHandler(int signal_number)

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);
}
#endif

0 comments on commit 84169cc

Please sign in to comment.