mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add i18n support [WIP]
This commit is contained in:
parent
bf87500e35
commit
203965043e
21 changed files with 257 additions and 124 deletions
|
|
@ -6,6 +6,7 @@ using System.Windows.Forms;
|
|||
using ICSharpCode.SharpZipLib.Zip;
|
||||
using Newtonsoft.Json;
|
||||
using Wox.Plugin;
|
||||
using MessageBox = System.Windows.Forms.MessageBox;
|
||||
|
||||
namespace Wox.Core.Plugin
|
||||
{
|
||||
|
|
@ -61,7 +62,7 @@ namespace Wox.Core.Plugin
|
|||
plugin.Name, existingPlugin.Metadata.Version, plugin.Version, plugin.Author);
|
||||
}
|
||||
|
||||
DialogResult result = MessageBox.Show(content, "Install plugin", MessageBoxButtons.YesNo,
|
||||
DialogResult result = System.Windows.Forms.MessageBox.Show(content, "Install plugin", MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Question);
|
||||
if (result == DialogResult.Yes)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,4 +2,6 @@
|
|||
=====
|
||||
|
||||
* Handle Query
|
||||
* Loading Plugins (including system plugin and user plugin)
|
||||
* Manage Plugins (including system plugin and user plugin)
|
||||
* Manage Themes
|
||||
* Manage i18n
|
||||
|
|
@ -1,12 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using Wox.Helper;
|
||||
|
||||
namespace Wox.Helper
|
||||
namespace Wox.Core.Theme
|
||||
{
|
||||
public static class FontHelper
|
||||
{
|
||||
|
|
@ -3,19 +3,40 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using Wox.Helper;
|
||||
using Wox.Core.UI;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox
|
||||
namespace Wox.Core.Theme
|
||||
{
|
||||
internal class ThemeManager
|
||||
public class ThemeManager : IUIResource
|
||||
{
|
||||
private static List<string> themeDirectories = new List<string>();
|
||||
private static ThemeManager instance;
|
||||
private static object syncObject = new object();
|
||||
|
||||
private ThemeManager() { }
|
||||
|
||||
public static ThemeManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
lock (syncObject)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new ThemeManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
static ThemeManager()
|
||||
{
|
||||
|
|
@ -40,7 +61,7 @@ namespace Wox
|
|||
{
|
||||
Directory.CreateDirectory(pluginDirectory);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Log.Error(e.Message);
|
||||
}
|
||||
|
|
@ -48,7 +69,7 @@ namespace Wox
|
|||
}
|
||||
}
|
||||
|
||||
public static void ChangeTheme(string themeName)
|
||||
public void ChangeTheme(string themeName)
|
||||
{
|
||||
string themePath = GetThemePath(themeName);
|
||||
if (string.IsNullOrEmpty(themePath))
|
||||
|
|
@ -56,7 +77,7 @@ namespace Wox
|
|||
themePath = GetThemePath("Dark");
|
||||
if (string.IsNullOrEmpty(themePath))
|
||||
{
|
||||
throw new Exception("Change theme failed");
|
||||
throw new System.Exception("Change theme failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -66,7 +87,7 @@ namespace Wox
|
|||
ResourceMerger.ApplyResources();
|
||||
}
|
||||
|
||||
internal static ResourceDictionary GetResourceDictionary()
|
||||
public ResourceDictionary GetResourceDictionary()
|
||||
{
|
||||
var dict = new ResourceDictionary
|
||||
{
|
||||
|
|
@ -100,20 +121,20 @@ namespace Wox
|
|||
return dict;
|
||||
}
|
||||
|
||||
public static List<string> LoadAvailableThemes()
|
||||
public List<string> LoadAvailableThemes()
|
||||
{
|
||||
List<string> themes = new List<string>();
|
||||
foreach (var themeDirectory in themeDirectories)
|
||||
{
|
||||
themes.AddRange(
|
||||
Directory.GetFiles(themeDirectory)
|
||||
.Where(filePath => filePath.EndsWith(".xaml") && !filePath.EndsWith("Default.xaml"))
|
||||
.Where(filePath => filePath.EndsWith(".xaml") && !filePath.EndsWith("Base.xaml"))
|
||||
.ToList());
|
||||
}
|
||||
return themes;
|
||||
}
|
||||
|
||||
private static string GetThemePath(string themeName)
|
||||
private string GetThemePath(string themeName)
|
||||
{
|
||||
foreach (string themeDirectory in themeDirectories)
|
||||
{
|
||||
27
Wox.Core/UI/ResourceMerger.cs
Normal file
27
Wox.Core/UI/ResourceMerger.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using Wox.Core.i18n;
|
||||
using Wox.Core.Theme;
|
||||
|
||||
namespace Wox.Core.UI
|
||||
{
|
||||
public class ResourceMerger
|
||||
{
|
||||
public static void ApplyResources()
|
||||
{
|
||||
var UIResourceType = typeof(IUIResource);
|
||||
var UIResources = AppDomain.CurrentDomain.GetAssemblies()
|
||||
.SelectMany(s => s.GetTypes())
|
||||
.Where(p => p.IsClass && !p.IsAbstract && UIResourceType.IsAssignableFrom(p));
|
||||
|
||||
Application.Current.Resources.MergedDictionaries.Clear();
|
||||
|
||||
foreach (var uiResource in UIResources)
|
||||
{
|
||||
Application.Current.Resources.MergedDictionaries.Add(
|
||||
((IUIResource)Activator.CreateInstance(uiResource)).GetResourceDictionary());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -40,6 +40,8 @@
|
|||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.7\lib\net35\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
|
|
@ -47,6 +49,7 @@
|
|||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Exception\ExceptionFormatter.cs" />
|
||||
|
|
@ -54,6 +57,9 @@
|
|||
<Compile Include="Exception\WoxException.cs" />
|
||||
<Compile Include="Exception\WoxHttpException.cs" />
|
||||
<Compile Include="Exception\WoxJsonRPCException.cs" />
|
||||
<Compile Include="i18n\InternationalizationManager.cs" />
|
||||
<Compile Include="UI\IUIResource.cs" />
|
||||
<Compile Include="UI\ResourceMerger.cs" />
|
||||
<Compile Include="Plugin\PluginInstaller.cs" />
|
||||
<Compile Include="Plugin\QueryDispatcher\IQueryDispatcher.cs" />
|
||||
<Compile Include="Plugin\QueryDispatcher\QueryDispatcher.cs" />
|
||||
|
|
@ -68,6 +74,8 @@
|
|||
<Compile Include="Plugin\PluginManager.cs" />
|
||||
<Compile Include="Plugin\PythonPlugin.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Theme\FontHelper.cs" />
|
||||
<Compile Include="Theme\ThemeManager.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="README.md" />
|
||||
|
|
|
|||
|
|
@ -3,20 +3,40 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Wox.Helper;
|
||||
using Wox.Core.UI;
|
||||
using Wox.Infrastructure.Logger;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox
|
||||
namespace Wox.Core.i18n
|
||||
{
|
||||
public class LanguageManager
|
||||
public class InternationalizationManager : IUIResource
|
||||
{
|
||||
private static List<string> languageDirectories = new List<string>();
|
||||
private static InternationalizationManager instance;
|
||||
private static object syncObject = new object();
|
||||
|
||||
static LanguageManager()
|
||||
private InternationalizationManager() { }
|
||||
|
||||
public static InternationalizationManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
lock (syncObject)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new InternationalizationManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
static InternationalizationManager()
|
||||
{
|
||||
languageDirectories.Add(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Languages"));
|
||||
|
||||
|
|
@ -39,7 +59,7 @@ namespace Wox
|
|||
{
|
||||
Directory.CreateDirectory(pluginDirectory);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Log.Error(e.Message);
|
||||
}
|
||||
|
|
@ -47,7 +67,7 @@ namespace Wox
|
|||
}
|
||||
}
|
||||
|
||||
public static void ChangeLanguage(string name)
|
||||
public void ChangeLanguage(string name)
|
||||
{
|
||||
string path = GetLanguagePath(name);
|
||||
if (string.IsNullOrEmpty(path))
|
||||
|
|
@ -55,7 +75,7 @@ namespace Wox
|
|||
path = GetLanguagePath("English");
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new Exception("Change Language failed");
|
||||
throw new System.Exception("Change Language failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,7 +84,7 @@ namespace Wox
|
|||
ResourceMerger.ApplyResources();
|
||||
}
|
||||
|
||||
internal static ResourceDictionary GetResourceDictionary()
|
||||
public ResourceDictionary GetResourceDictionary()
|
||||
{
|
||||
return new ResourceDictionary
|
||||
{
|
||||
|
|
@ -72,7 +92,7 @@ namespace Wox
|
|||
};
|
||||
}
|
||||
|
||||
public static List<string> LoadAvailableLanguages()
|
||||
public List<string> LoadAvailableLanguages()
|
||||
{
|
||||
List<string> themes = new List<string>();
|
||||
foreach (var directory in languageDirectories)
|
||||
|
|
@ -86,7 +106,7 @@ namespace Wox
|
|||
return themes;
|
||||
}
|
||||
|
||||
public static string GetTranslation(string key)
|
||||
public string GetTranslation(string key)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -104,7 +124,7 @@ namespace Wox
|
|||
|
||||
}
|
||||
|
||||
private static string GetLanguagePath(string name)
|
||||
private string GetLanguagePath(string name)
|
||||
{
|
||||
foreach (string directory in languageDirectories)
|
||||
{
|
||||
12
Wox.Infrastructure/ISingleton.cs
Normal file
12
Wox.Infrastructure/ISingleton.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Wox.Infrastructure
|
||||
{
|
||||
interface ISingleton<T>
|
||||
{
|
||||
T Instance { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -57,6 +57,7 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Http\HttpProxy.cs" />
|
||||
<Compile Include="ISingleton.cs" />
|
||||
<Compile Include="Logger\Log.cs" />
|
||||
<Compile Include="PeHeaderReader.cs" />
|
||||
<Compile Include="Storage\BinaryStorage.cs" />
|
||||
|
|
|
|||
|
|
@ -17,18 +17,18 @@
|
|||
<ColumnDefinition Width="200"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right">Old ActionKeyword:</TextBlock>
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Text="{DynamicResource oldActionKeyword}"></TextBlock>
|
||||
<TextBlock x:Name="tbOldActionKeyword" Margin="10" FontSize="14" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left">Old ActionKeyword:</TextBlock>
|
||||
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right">New ActionKeyword:</TextBlock>
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Text="{DynamicResource newActionKeyword}"></TextBlock>
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1" >
|
||||
<TextBox x:Name="tbAction" Margin="10" Width="400" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="1">
|
||||
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="25">Cancel</Button>
|
||||
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="25" Content="{DynamicResource cancel}"></Button>
|
||||
<Button x:Name="btnDone" Margin="10 0 10 0" Width="80" Height="25" Click="btnDone_OnClick">
|
||||
<TextBlock x:Name="lblAdd">Done</TextBlock>
|
||||
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}"></TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ using System.Windows.Input;
|
|||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using Wox.Core.i18n;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
using Wox.Plugin;
|
||||
|
|
@ -28,7 +29,7 @@ namespace Wox
|
|||
PluginPair plugin = PluginManager.GetPlugin(pluginId);
|
||||
if (plugin == null)
|
||||
{
|
||||
MessageBox.Show("Can't find specific plugin");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("cannotFindSpecifiedPlugin"));
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
|
|
@ -51,14 +52,14 @@ namespace Wox
|
|||
{
|
||||
if (string.IsNullOrEmpty(tbAction.Text))
|
||||
{
|
||||
MessageBox.Show("New ActionKeyword can't be empty");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("newActionKeywordCannotBeEmpty"));
|
||||
return;
|
||||
}
|
||||
|
||||
//check new action keyword didn't used by other plugin
|
||||
if (PluginManager.AllPlugins.Exists(o => o.Metadata.ActionKeyword == tbAction.Text.Trim()))
|
||||
{
|
||||
MessageBox.Show("New ActionKeyword has been assigned to other plugin, please assign another new action keyword");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("newActionKeywordHasBeenAssigned"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -80,10 +81,8 @@ namespace Wox
|
|||
customizedPluginConfig.Actionword = tbAction.Text.Trim();
|
||||
}
|
||||
UserSettingStorage.Instance.Save();
|
||||
MessageBox.Show("Sucessfully applied the new action keyword");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed"));
|
||||
Close();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<Window x:Class="Wox.CustomPluginHotkeySetting"
|
||||
<Window x:Class="Wox.CustomQueryHotkeySetting"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:wox="clr-namespace:Wox"
|
||||
|
|
@ -16,19 +16,19 @@
|
|||
<ColumnDefinition Width="150"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right">Hotkey:</TextBlock>
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Text="{DynamicResource hotkey}"></TextBlock>
|
||||
<wox:HotkeyControl x:Name="ctlHotkey" Margin="10" Grid.Column="1" />
|
||||
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right">Action Keyword:</TextBlock>
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Text="{DynamicResource actionKeyword}"></TextBlock>
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1" >
|
||||
<TextBox x:Name="tbAction" Margin="10" Width="400" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBox>
|
||||
<Button x:Name="btnTestActionKeyword" Padding="10 5 10 5" Height="30" Click="BtnTestActionKeyword_OnClick">Test</Button>
|
||||
<Button x:Name="btnTestActionKeyword" Padding="10 5 10 5" Height="30" Click="BtnTestActionKeyword_OnClick" Content="{DynamicResource preview}"></Button>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="2" Grid.Column="1">
|
||||
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="25">Cancel</Button>
|
||||
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="25" Content="{DynamicResource cancel}"></Button>
|
||||
<Button x:Name="btnAdd" Margin="10 0 10 0" Width="80" Height="25" Click="btnAdd_OnClick">
|
||||
<TextBlock x:Name="lblAdd">Add</TextBlock>
|
||||
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}"></TextBlock>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
|
@ -1,17 +1,18 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using Wox.Core.i18n;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
|
||||
namespace Wox
|
||||
{
|
||||
public partial class CustomPluginHotkeySetting : Window
|
||||
public partial class CustomQueryHotkeySetting : Window
|
||||
{
|
||||
private SettingWindow settingWidow;
|
||||
private bool update;
|
||||
private CustomPluginHotkey updateCustomHotkey;
|
||||
|
||||
public CustomPluginHotkeySetting(SettingWindow settingWidow)
|
||||
public CustomQueryHotkeySetting(SettingWindow settingWidow)
|
||||
{
|
||||
this.settingWidow = settingWidow;
|
||||
InitializeComponent();
|
||||
|
|
@ -28,7 +29,7 @@ namespace Wox
|
|||
{
|
||||
if (!ctlHotkey.CurrentHotkeyAvailable)
|
||||
{
|
||||
MessageBox.Show("Hotkey is unavailable, please select a new hotkey");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("hotkeyIsNotUnavailable"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -48,13 +49,13 @@ namespace Wox
|
|||
settingWidow.MainWindow.ChangeQuery(pluginHotkey.ActionKeyword);
|
||||
settingWidow.MainWindow.ShowApp();
|
||||
});
|
||||
MessageBox.Show("Add hotkey successfully!");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (updateCustomHotkey.Hotkey != ctlHotkey.CurrentHotkey.ToString() && !ctlHotkey.CurrentHotkeyAvailable)
|
||||
{
|
||||
MessageBox.Show("Hotkey is unavailable, please select a new hotkey");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("hotkeyIsNotUnavailable"));
|
||||
return;
|
||||
}
|
||||
var oldHotkey = updateCustomHotkey.Hotkey;
|
||||
|
|
@ -67,7 +68,7 @@ namespace Wox
|
|||
settingWidow.MainWindow.ShowApp();
|
||||
settingWidow.MainWindow.ChangeQuery(updateCustomHotkey.ActionKeyword);
|
||||
});
|
||||
MessageBox.Show("Update successfully!");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("succeed"));
|
||||
}
|
||||
|
||||
UserSettingStorage.Instance.Save();
|
||||
|
|
@ -80,7 +81,7 @@ namespace Wox
|
|||
updateCustomHotkey = UserSettingStorage.Instance.CustomPluginHotkeys.FirstOrDefault(o => o.ActionKeyword == item.ActionKeyword && o.Hotkey == item.Hotkey);
|
||||
if (updateCustomHotkey == null)
|
||||
{
|
||||
MessageBox.Show("Invalid plugin hotkey");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPluginHotkey"));
|
||||
Close();
|
||||
return;
|
||||
}
|
||||
|
|
@ -88,7 +89,7 @@ namespace Wox
|
|||
tbAction.Text = updateCustomHotkey.ActionKeyword;
|
||||
ctlHotkey.SetHotkey(updateCustomHotkey.Hotkey, false);
|
||||
update = true;
|
||||
lblAdd.Text = "Update";
|
||||
lblAdd.Text = InternationalizationManager.Instance.GetTranslation("update");
|
||||
}
|
||||
|
||||
private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e)
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace Wox.Helper
|
||||
{
|
||||
public class ResourceMerger
|
||||
{
|
||||
public static void ApplyResources()
|
||||
{
|
||||
var languageResource = LanguageManager.GetResourceDictionary();
|
||||
var themeResource = ThemeManager.GetResourceDictionary();
|
||||
|
||||
Application.Current.Resources.MergedDictionaries.Clear();
|
||||
Application.Current.Resources.MergedDictionaries.Add(languageResource);
|
||||
Application.Current.Resources.MergedDictionaries.Add(themeResource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ using System.Windows.Input;
|
|||
using System.Windows.Media;
|
||||
using NHotkey;
|
||||
using NHotkey.Wpf;
|
||||
using Wox.Core.i18n;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Infrastructure.Hotkey;
|
||||
|
|
@ -98,12 +99,12 @@ namespace Wox
|
|||
if (!CurrentHotkeyAvailable)
|
||||
{
|
||||
tbMsg.Foreground = new SolidColorBrush(Colors.Red);
|
||||
tbMsg.Text = "hotkey unavailable";
|
||||
tbMsg.Text = InternationalizationManager.Instance.GetTranslation("hotkeyUnavailable");
|
||||
}
|
||||
else
|
||||
{
|
||||
tbMsg.Foreground = new SolidColorBrush(Colors.Green);
|
||||
tbMsg.Text = "succeed";
|
||||
tbMsg.Text = InternationalizationManager.Instance.GetTranslation("succeed");
|
||||
}
|
||||
OnOnHotkeyChanged();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
<!--MainWindow-->
|
||||
<system:String x:Key="registerHotkeyFailed">Register hotkey: {0} failed</system:String>
|
||||
<system:String x:Key="couldnotStartCmd">Could not start {0}</system:String>
|
||||
<system:String x:Key="invalidWoxPluginFileFormat">Invalid wox plugin file format</system:String>
|
||||
|
||||
|
||||
<!--Setting General-->
|
||||
<system:String x:Key="general">General</system:String>
|
||||
<system:String x:Key="startWoxOnSystemStartup">Start Wox on system startup</system:String>
|
||||
|
|
@ -49,11 +55,30 @@
|
|||
<system:String x:Key="invalidPortFormat">Invalid port format</system:String>
|
||||
<system:String x:Key="saveProxySuccessfully">Save proxy successfully</system:String>
|
||||
<system:String x:Key="proxyIsCorrect">Proxy is correct</system:String>
|
||||
|
||||
<system:String x:Key="proxyConnectFailed">Proxy connect failed</system:String>
|
||||
|
||||
<!--Setting About-->
|
||||
<system:String x:Key="about">About</system:String>
|
||||
<system:String x:Key="website">Website</system:String>
|
||||
<system:String x:Key="version">Version</system:String>
|
||||
|
||||
<!--Action Keyword Setting Dialog-->
|
||||
<system:String x:Key="oldActionKeyword">Old Action Keyword</system:String>
|
||||
<system:String x:Key="newActionKeyword">New Action Keyword</system:String>
|
||||
<system:String x:Key="cancel">Cancel</system:String>
|
||||
<system:String x:Key="done">Done</system:String>
|
||||
<system:String x:Key="cannotFindSpecifiedPlugin">Can't find specified plugin</system:String>
|
||||
<system:String x:Key="newActionKeywordCannotBeEmpty">New Action Keyword can't be empty</system:String>
|
||||
<system:String x:Key="newActionKeywordHasBeenAssigned">New ActionKeyword has been assigned to other plugin, please assign another new action keyword</system:String>
|
||||
<system:String x:Key="succeed">Succeed</system:String>
|
||||
|
||||
<!--Custom Query Hotkey Dialog-->
|
||||
<system:String x:Key="preview">Preview</system:String>
|
||||
<system:String x:Key="hotkeyIsNotUnavailable">Hotkey is unavailable, please select a new hotkey</system:String>
|
||||
<system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String>
|
||||
<system:String x:Key="update">Update</system:String>
|
||||
|
||||
<!--Hotkey Control-->
|
||||
<system:String x:Key="hotkeyUnavailable">Hotkey unavailable</system:String>
|
||||
|
||||
</ResourceDictionary>
|
||||
|
|
@ -1,6 +1,12 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
<!--主窗体-->
|
||||
<system:String x:Key="registerHotkeyFailed">注册热键:{0} 失败</system:String>
|
||||
<system:String x:Key="couldnotStartCmd">启动命令 {0} 失败</system:String>
|
||||
<system:String x:Key="invalidWoxPluginFileFormat">不是合法的Wox插件格式</system:String>
|
||||
|
||||
|
||||
<!--设置,通用-->
|
||||
<system:String x:Key="general">通用</system:String>
|
||||
<system:String x:Key="startWoxOnSystemStartup">开机启动</system:String>
|
||||
|
|
@ -32,6 +38,8 @@
|
|||
<system:String x:Key="delete">删除</system:String>
|
||||
<system:String x:Key="edit">编辑</system:String>
|
||||
<system:String x:Key="add">增加</system:String>
|
||||
<system:String x:Key="pleaseSelectAnItem">请选择一项</system:String>
|
||||
<system:String x:Key="deleteCustomHotkeyWarning">你确定要删除插件 {0} 的热键吗?</system:String>
|
||||
|
||||
<!--设置,代理-->
|
||||
<system:String x:Key="proxy">代理</system:String>
|
||||
|
|
@ -42,10 +50,36 @@
|
|||
<system:String x:Key="password">密码</system:String>
|
||||
<system:String x:Key="testProxy">测试代理</system:String>
|
||||
<system:String x:Key="save">保存</system:String>
|
||||
|
||||
<system:String x:Key="serverCantBeEmpty">服务器不能为空</system:String>
|
||||
<system:String x:Key="portCantBeEmpty">端口不能为空</system:String>
|
||||
<system:String x:Key="invalidPortFormat">非法的端口格式</system:String>
|
||||
<system:String x:Key="saveProxySuccessfully">保存代理设置成功</system:String>
|
||||
<system:String x:Key="proxyIsCorrect">代理设置正确</system:String>
|
||||
<system:String x:Key="proxyConnectFailed">代理连接失败</system:String>
|
||||
|
||||
<!--设置,版本-->
|
||||
<system:String x:Key="about">关于</system:String>
|
||||
<system:String x:Key="website">网站</system:String>
|
||||
<system:String x:Key="version">版本</system:String>
|
||||
|
||||
|
||||
<!--Action Keyword 设置对话框-->
|
||||
<system:String x:Key="oldActionKeyword">旧触发关键字</system:String>
|
||||
<system:String x:Key="newActionKeyword">新触发关键字</system:String>
|
||||
<system:String x:Key="cancel">取消</system:String>
|
||||
<system:String x:Key="done">确定</system:String>
|
||||
<system:String x:Key="cannotFindSpecifiedPlugin">找不到指定的插件</system:String>
|
||||
<system:String x:Key="newActionKeywordCannotBeEmpty">新触发关键字不能为空</system:String>
|
||||
<system:String x:Key="newActionKeywordHasBeenAssigned">新触发关键字已经被指派给其他插件了,请重新选择一个关键字</system:String>
|
||||
<system:String x:Key="succeed">成功</system:String>
|
||||
|
||||
<!--Custom Query Hotkey 对话框-->
|
||||
<system:String x:Key="preview">预览</system:String>
|
||||
<system:String x:Key="hotkeyIsNotUnavailable">热键不可用,请选择一个新的热键</system:String>
|
||||
<system:String x:Key="invalidPluginHotkey">插件热键不合法</system:String>
|
||||
<system:String x:Key="update">更新</system:String>
|
||||
|
||||
<!--Hotkey 控件-->
|
||||
<system:String x:Key="hotkeyUnavailable">热键不可用</system:String>
|
||||
|
||||
</ResourceDictionary>
|
||||
|
|
@ -14,7 +14,9 @@ using WindowsInput;
|
|||
using WindowsInput.Native;
|
||||
using NHotkey;
|
||||
using NHotkey.Wpf;
|
||||
using Wox.Core.i18n;
|
||||
using Wox.Core.Plugin;
|
||||
using Wox.Core.Theme;
|
||||
using Wox.Helper;
|
||||
using Wox.Infrastructure;
|
||||
using Wox.Infrastructure.Hotkey;
|
||||
|
|
@ -128,7 +130,7 @@ namespace Wox
|
|||
|
||||
public void ReloadPlugins()
|
||||
{
|
||||
Dispatcher.Invoke(new Action(()=> PluginManager.Init(this)));
|
||||
Dispatcher.Invoke(new Action(() => PluginManager.Init(this)));
|
||||
}
|
||||
|
||||
public List<PluginPair> GetAllPlugins()
|
||||
|
|
@ -173,8 +175,8 @@ namespace Wox
|
|||
pnlResult.RightMouseClickEvent += pnlResult_RightMouseClickEvent;
|
||||
|
||||
ThreadPool.SetMaxThreads(30, 10);
|
||||
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
LanguageManager.ChangeLanguage(UserSettingStorage.Instance.Language);
|
||||
ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
InternationalizationManager.Instance.ChangeLanguage(UserSettingStorage.Instance.Language);
|
||||
|
||||
SetHotkey(UserSettingStorage.Instance.Hotkey, OnHotkey);
|
||||
SetCustomPluginHotkey();
|
||||
|
|
@ -266,7 +268,8 @@ namespace Wox
|
|||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Register hotkey: " + hotkeyStr + " failed.");
|
||||
string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("registerHotkeyFailed"), hotkeyStr);
|
||||
MessageBox.Show(errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -557,7 +560,7 @@ namespace Wox
|
|||
break;
|
||||
|
||||
case Key.F1:
|
||||
Process.Start("https://github.com/qianlifeng/Wox/wiki/Wox-Function-Guide");
|
||||
Process.Start("http://doc.getwox.com");
|
||||
break;
|
||||
|
||||
case Key.Enter:
|
||||
|
|
@ -568,7 +571,7 @@ namespace Wox
|
|||
}
|
||||
else
|
||||
{
|
||||
SelectResult(activeResult);
|
||||
SelectResult(activeResult);
|
||||
}
|
||||
e.Handled = true;
|
||||
break;
|
||||
|
|
@ -590,7 +593,7 @@ namespace Wox
|
|||
{
|
||||
return pnlResult.GetActiveResult();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SelectPrevItem()
|
||||
{
|
||||
|
|
@ -683,7 +686,8 @@ namespace Wox
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowMsg("Could not start " + cmd, ex.Message, null);
|
||||
string errorMsg = string.Format(InternationalizationManager.Instance.GetTranslation("couldnotStartCmd"), cmd);
|
||||
ShowMsg(errorMsg, ex.Message, null);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -700,7 +704,7 @@ namespace Wox
|
|||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("incorrect wox plugin file.");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidWoxPluginFileFormat"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<converters:ImagePathConverter x:Key="ImageConverter" />
|
||||
</Window.Resources>
|
||||
<TabControl Height="auto" >
|
||||
<TabItem Header="{DynamicResource general}" Height="23" VerticalAlignment="Top">
|
||||
<TabItem Header="{DynamicResource general}">
|
||||
<StackPanel Orientation="Vertical" Margin="10">
|
||||
<CheckBox x:Name="cbStartWithWindows" Unchecked="CbStartWithWindows_OnUnchecked" Checked="CbStartWithWindows_OnChecked" Margin="10">
|
||||
<TextBlock Text="{DynamicResource startWoxOnSystemStartup}" ></TextBlock>
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
</CheckBox>
|
||||
<StackPanel Margin="10" Orientation="Horizontal">
|
||||
<TextBlock Text="{DynamicResource language}"></TextBlock>
|
||||
<ComboBox Margin="10 0 0 0" Width="200" x:Name="cbLanguages" />
|
||||
<ComboBox Margin="10 0 0 0" Width="100" x:Name="cbLanguages" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ using Application = System.Windows.Forms.Application;
|
|||
using File = System.IO.File;
|
||||
using MessageBox = System.Windows.MessageBox;
|
||||
using System.Windows.Data;
|
||||
using Wox.Core.i18n;
|
||||
using Wox.Core.Theme;
|
||||
|
||||
namespace Wox
|
||||
{
|
||||
|
|
@ -150,7 +152,7 @@ namespace Wox
|
|||
}
|
||||
});
|
||||
|
||||
foreach (string theme in ThemeManager.LoadAvailableThemes())
|
||||
foreach (string theme in ThemeManager.Instance.LoadAvailableThemes())
|
||||
{
|
||||
string themeName = System.IO.Path.GetFileNameWithoutExtension(theme);
|
||||
themeComboBox.Items.Add(themeName);
|
||||
|
|
@ -174,7 +176,7 @@ namespace Wox
|
|||
}
|
||||
|
||||
//PreviewPanel
|
||||
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
#endregion
|
||||
|
||||
#region Plugin
|
||||
|
|
@ -244,7 +246,7 @@ namespace Wox
|
|||
|
||||
private void LoadLanguages()
|
||||
{
|
||||
cbLanguages.ItemsSource = LanguageManager.LoadAvailableLanguages();
|
||||
cbLanguages.ItemsSource = InternationalizationManager.Instance.LoadAvailableLanguages();
|
||||
cbLanguages.SelectedValue = UserSettingStorage.Instance.Language;
|
||||
cbLanguages.SelectionChanged += cbLanguages_SelectionChanged;
|
||||
}
|
||||
|
|
@ -252,7 +254,7 @@ namespace Wox
|
|||
void cbLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
string language = cbLanguages.SelectedValue.ToString();
|
||||
LanguageManager.ChangeLanguage(language);
|
||||
InternationalizationManager.Instance.ChangeLanguage(language);
|
||||
}
|
||||
|
||||
private void EnableProxy()
|
||||
|
|
@ -330,12 +332,12 @@ namespace Wox
|
|||
CustomPluginHotkey item = lvCustomHotkey.SelectedItem as CustomPluginHotkey;
|
||||
if (item == null)
|
||||
{
|
||||
MessageBox.Show(LanguageManager.GetTranslation("pleaseSelectAnItem"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
|
||||
return;
|
||||
}
|
||||
|
||||
string deleteWarning = string.Format(LanguageManager.GetTranslation("deleteCustomHotkeyWarning"), item.Hotkey);
|
||||
if (MessageBox.Show(deleteWarning, LanguageManager.GetTranslation("delete"), MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
string deleteWarning = string.Format(InternationalizationManager.Instance.GetTranslation("deleteCustomHotkeyWarning"), item.Hotkey);
|
||||
if (MessageBox.Show(deleteWarning, InternationalizationManager.Instance.GetTranslation("delete"), MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
{
|
||||
UserSettingStorage.Instance.CustomPluginHotkeys.Remove(item);
|
||||
lvCustomHotkey.Items.Refresh();
|
||||
|
|
@ -349,19 +351,19 @@ namespace Wox
|
|||
CustomPluginHotkey item = lvCustomHotkey.SelectedItem as CustomPluginHotkey;
|
||||
if (item != null)
|
||||
{
|
||||
CustomPluginHotkeySetting window = new CustomPluginHotkeySetting(this);
|
||||
CustomQueryHotkeySetting window = new CustomQueryHotkeySetting(this);
|
||||
window.UpdateItem(item);
|
||||
window.ShowDialog();
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(LanguageManager.GetTranslation("pleaseSelectAnItem"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnAddCustomeHotkey_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
new CustomPluginHotkeySetting(this).ShowDialog();
|
||||
new CustomQueryHotkeySetting(this).ShowDialog();
|
||||
}
|
||||
|
||||
public void ReloadCustomPluginHotkeyView()
|
||||
|
|
@ -375,7 +377,7 @@ namespace Wox
|
|||
private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
string themeName = themeComboBox.SelectedItem.ToString();
|
||||
ThemeManager.ChangeTheme(themeName);
|
||||
ThemeManager.Instance.ChangeTheme(themeName);
|
||||
UserSettingStorage.Instance.Theme = themeName;
|
||||
UserSettingStorage.Instance.Save();
|
||||
}
|
||||
|
|
@ -388,7 +390,7 @@ namespace Wox
|
|||
this.cbQueryBoxFontFaces.SelectedItem = ((FontFamily)cbQueryBoxFont.SelectedItem).ChooseRegularFamilyTypeface();
|
||||
|
||||
UserSettingStorage.Instance.Save();
|
||||
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
}
|
||||
|
||||
private void CbQueryBoxFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
|
|
@ -408,7 +410,7 @@ namespace Wox
|
|||
UserSettingStorage.Instance.QueryBoxFontWeight = typeface.Weight.ToString();
|
||||
UserSettingStorage.Instance.QueryBoxFontStyle = typeface.Style.ToString();
|
||||
UserSettingStorage.Instance.Save();
|
||||
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -420,7 +422,7 @@ namespace Wox
|
|||
this.cbResultItemFontFaces.SelectedItem = ((FontFamily)cbResultItemFont.SelectedItem).ChooseRegularFamilyTypeface();
|
||||
|
||||
UserSettingStorage.Instance.Save();
|
||||
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
}
|
||||
|
||||
private void CbResultItemFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
|
|
@ -438,21 +440,24 @@ namespace Wox
|
|||
UserSettingStorage.Instance.ResultItemFontWeight = typeface.Weight.ToString();
|
||||
UserSettingStorage.Instance.ResultItemFontStyle = typeface.Style.ToString();
|
||||
UserSettingStorage.Instance.Save();
|
||||
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
}
|
||||
}
|
||||
|
||||
private void slOpacity_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
UserSettingStorage.Instance.Opacity = slOpacity.Value;
|
||||
UserSettingStorage.Instance.Save();
|
||||
|
||||
if (UserSettingStorage.Instance.OpacityMode == OpacityMode.LayeredWindow)
|
||||
PreviewMainPanel.Opacity = UserSettingStorage.Instance.Opacity;
|
||||
else
|
||||
PreviewMainPanel.Opacity = 1;
|
||||
|
||||
ThemeManager.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
ThemeManager.Instance.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
Dispatcher.DelayInvoke("delaySaveUserSetting", o =>
|
||||
{
|
||||
UserSettingStorage.Instance.Save();
|
||||
}, TimeSpan.FromMilliseconds(1000));
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
@ -650,17 +655,17 @@ namespace Wox
|
|||
{
|
||||
if (string.IsNullOrEmpty(tbProxyServer.Text))
|
||||
{
|
||||
MessageBox.Show(LanguageManager.GetTranslation("serverCantBeEmpty"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("serverCantBeEmpty"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(tbProxyPort.Text))
|
||||
{
|
||||
MessageBox.Show(LanguageManager.GetTranslation("portCantBeEmpty"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("portCantBeEmpty"));
|
||||
return;
|
||||
}
|
||||
if (!int.TryParse(tbProxyPort.Text, out port))
|
||||
{
|
||||
MessageBox.Show(LanguageManager.GetTranslation("invalidPortFormat"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPortFormat"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -671,25 +676,25 @@ namespace Wox
|
|||
UserSettingStorage.Instance.ProxyPassword = tbProxyPassword.Password;
|
||||
UserSettingStorage.Instance.Save();
|
||||
|
||||
MessageBox.Show(LanguageManager.GetTranslation("saveProxySuccessfully"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("saveProxySuccessfully"));
|
||||
}
|
||||
|
||||
private void btnTestProxy_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(tbProxyServer.Text))
|
||||
{
|
||||
MessageBox.Show(LanguageManager.GetTranslation("serverCantBeEmpty"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("serverCantBeEmpty"));
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(tbProxyPort.Text))
|
||||
{
|
||||
MessageBox.Show(LanguageManager.GetTranslation("portCantBeEmpty"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("portCantBeEmpty"));
|
||||
return;
|
||||
}
|
||||
int port;
|
||||
if (!int.TryParse(tbProxyPort.Text, out port))
|
||||
{
|
||||
MessageBox.Show(LanguageManager.GetTranslation("invalidPortFormat"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("invalidPortFormat"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -710,16 +715,16 @@ namespace Wox
|
|||
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
|
||||
if (response.StatusCode == HttpStatusCode.OK)
|
||||
{
|
||||
MessageBox.Show(LanguageManager.GetTranslation("proxyIsCorrect"));
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyIsCorrect"));
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Proxy connect failed.");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyConnectFailed"));
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
MessageBox.Show("Proxy connect failed.");
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("proxyConnectFailed"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,12 +113,9 @@
|
|||
<Reference Include="WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Helper\ResourceMerger.cs" />
|
||||
<Compile Include="Helper\WoxLogPathConverter.cs" />
|
||||
<Compile Include="ImageLoader\ImageCacheStroage.cs" />
|
||||
<Compile Include="Helper\LanguageManager.cs" />
|
||||
<Compile Include="Storage\UserSelectedRecordStorage.cs" />
|
||||
<Compile Include="Helper\ThemeManager.cs" />
|
||||
<Compile Include="Update\NewVersionWindow.xaml.cs">
|
||||
<DependentUpon>NewVersionWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
|
|
@ -144,7 +141,6 @@
|
|||
<Compile Include="Helper\ErrorReporting\WPFErrorReportingDialog.xaml.cs">
|
||||
<DependentUpon>WPFErrorReportingDialog.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helper\FontHelper.cs" />
|
||||
<Compile Include="ImageLoader\ImageLoader.cs" />
|
||||
<Compile Include="Helper\SingleInstance.cs" />
|
||||
<Compile Include="Helper\SyntaxSugars.cs" />
|
||||
|
|
@ -152,8 +148,8 @@
|
|||
<Compile Include="Helper\WindowIntelopHelper.cs" />
|
||||
<Compile Include="Helper\WindowOpener.cs" />
|
||||
<Compile Include="Converters\OpacityModeConverter.cs" />
|
||||
<Compile Include="CustomPluginHotkeySetting.xaml.cs">
|
||||
<DependentUpon>CustomPluginHotkeySetting.xaml</DependentUpon>
|
||||
<Compile Include="CustomQueryHotkeySetting.xaml.cs">
|
||||
<DependentUpon>CustomQueryHotkeySetting.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helper\DispatcherExtensions.cs" />
|
||||
<Compile Include="Helper\DWMDropShadow.cs" />
|
||||
|
|
@ -181,7 +177,7 @@
|
|||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="CustomPluginHotkeySetting.xaml">
|
||||
<Page Include="CustomQueryHotkeySetting.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
|
|
|
|||
Loading…
Reference in a new issue