mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-11 05:52:19 +02:00
Add browse more plugin and theme link to setting dialog.
This commit is contained in:
@@ -182,7 +182,7 @@ namespace Wox.Plugin.PluginManagement {
|
|||||||
private void UnInstalledPlugins(PluginMetadata plugin) {
|
private void UnInstalledPlugins(PluginMetadata plugin) {
|
||||||
string content = string.Format("Do you want to uninstall following plugin?\r\n\r\nName: {0}\r\nVersion: {1}\r\nAuthor: {2}", plugin.Name, plugin.Version, plugin.Author);
|
string content = string.Format("Do you want to uninstall following plugin?\r\n\r\nName: {0}\r\nVersion: {1}\r\nAuthor: {2}", plugin.Name, plugin.Version, plugin.Author);
|
||||||
if (MessageBox.Show(content, "Wox", MessageBoxButtons.YesNo) == DialogResult.Yes) {
|
if (MessageBox.Show(content, "Wox", MessageBoxButtons.YesNo) == DialogResult.Yes) {
|
||||||
File.Create(Path.Combine(plugin.PluginDirecotry, "NeedDelete.txt")).Close();
|
File.Create(Path.Combine(plugin.PluginDirectory, "NeedDelete.txt")).Close();
|
||||||
MessageBox.Show("This plugin has been removed, restart Wox to take effect");
|
MessageBox.Show("This plugin has been removed, restart Wox to take effect");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ namespace Wox.Plugin.PluginManagement {
|
|||||||
try {
|
try {
|
||||||
metadata = JsonConvert.DeserializeObject<PluginMetadata>(File.ReadAllText(configPath));
|
metadata = JsonConvert.DeserializeObject<PluginMetadata>(File.ReadAllText(configPath));
|
||||||
metadata.PluginType = PluginType.ThirdParty;
|
metadata.PluginType = PluginType.ThirdParty;
|
||||||
metadata.PluginDirecotry = pluginDirectory;
|
metadata.PluginDirectory = pluginDirectory;
|
||||||
}
|
}
|
||||||
catch (Exception) {
|
catch (Exception) {
|
||||||
string error = string.Format("Parse plugin config {0} failed: json format is not valid", configPath);
|
string error = string.Format("Parse plugin config {0} failed: json format is not valid", configPath);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Wox.Infrastructure.Storage.UserSettings;
|
using Wox.Infrastructure.Storage.UserSettings;
|
||||||
|
|
||||||
@@ -14,6 +15,19 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
public virtual string Description { get { return "System workflow"; } }
|
public virtual string Description { get { return "System workflow"; } }
|
||||||
public virtual string IcoPath { get { return null; } }
|
public virtual string IcoPath { get { return null; } }
|
||||||
|
|
||||||
|
public string FullIcoPath
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (IcoPath.StartsWith("data:"))
|
||||||
|
{
|
||||||
|
return IcoPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Path.Combine(PluginDirectory, IcoPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected abstract List<Result> QueryInternal(Query query);
|
protected abstract List<Result> QueryInternal(Query query);
|
||||||
|
|
||||||
protected abstract void InitInternal(PluginInitContext context);
|
protected abstract void InitInternal(PluginInitContext context);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
IcoPath = "Images\\app.png",
|
IcoPath = "Images\\app.png",
|
||||||
Action = (c) =>
|
Action = (c) =>
|
||||||
{
|
{
|
||||||
context.CloseApp();
|
context.API.CloseApp();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -99,7 +99,7 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
Info.CreateNoWindow = true;
|
Info.CreateNoWindow = true;
|
||||||
Info.FileName = "cmd.exe";
|
Info.FileName = "cmd.exe";
|
||||||
Process.Start(Info);
|
Process.Start(Info);
|
||||||
context.CloseApp();
|
context.API.CloseApp();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -111,7 +111,7 @@ namespace Wox.Plugin.SystemPlugins
|
|||||||
IcoPath = "Images\\app.png",
|
IcoPath = "Images\\app.png",
|
||||||
Action = (c) =>
|
Action = (c) =>
|
||||||
{
|
{
|
||||||
context.OpenSettingDialog();
|
context.API.OpenSettingDialog();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,14 +31,27 @@ namespace Wox.Plugin
|
|||||||
|
|
||||||
public string ExecuteFilePath
|
public string ExecuteFilePath
|
||||||
{
|
{
|
||||||
get { return Path.Combine(PluginDirecotry, ExecuteFileName); }
|
get { return Path.Combine(PluginDirectory, ExecuteFileName); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ExecuteFileName { get; set; }
|
public string ExecuteFileName { get; set; }
|
||||||
public string PluginDirecotry { get; set; }
|
public string PluginDirectory { get; set; }
|
||||||
public string ActionKeyword { get; set; }
|
public string ActionKeyword { get; set; }
|
||||||
public PluginType PluginType { get; set; }
|
public PluginType PluginType { get; set; }
|
||||||
|
|
||||||
public string IcoPath { get; set; }
|
public string IcoPath { get; set; }
|
||||||
|
|
||||||
|
public string FullIcoPath
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (IcoPath.StartsWith("data:"))
|
||||||
|
{
|
||||||
|
return IcoPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Path.Combine(PluginDirectory, IcoPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,17 +13,12 @@ namespace Wox.Converters
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
if (value == null || value == DependencyProperty.UnsetValue) return null;
|
if (value == null || value == DependencyProperty.UnsetValue)
|
||||||
|
|
||||||
string fullPath = value.ToString();
|
|
||||||
|
|
||||||
if (fullPath.StartsWith("data:", StringComparison.OrdinalIgnoreCase))
|
|
||||||
{
|
{
|
||||||
return new BitmapImage(new Uri(fullPath));
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ImageLoader.Load(value.ToString());
|
||||||
return ImageLoader.Load(fullPath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
|||||||
@@ -55,28 +55,28 @@ namespace Wox.Helper
|
|||||||
|
|
||||||
public static ImageSource Load(string path)
|
public static ImageSource Load(string path)
|
||||||
{
|
{
|
||||||
ImageSource img = null;
|
if (string.IsNullOrEmpty(path)) return null;
|
||||||
if (path == null) return null;
|
|
||||||
if (imageCache.ContainsKey(path))
|
if (imageCache.ContainsKey(path))
|
||||||
{
|
{
|
||||||
return imageCache[path];
|
return imageCache[path];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImageSource img = null;
|
||||||
string ext = Path.GetExtension(path).ToLower();
|
string ext = Path.GetExtension(path).ToLower();
|
||||||
string resolvedPath = string.Empty;
|
|
||||||
if (!string.IsNullOrEmpty(path) && path.Contains(":\\") && File.Exists(path))
|
if (path.StartsWith("data:", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
resolvedPath = path;
|
img = new BitmapImage(new Uri(path));
|
||||||
|
}
|
||||||
|
else if (selfExts.Contains(ext))
|
||||||
|
{
|
||||||
|
img = GetIcon(path);
|
||||||
|
}
|
||||||
|
else if (!string.IsNullOrEmpty(path) && imageExts.Contains(ext) && File.Exists(path))
|
||||||
|
{
|
||||||
|
img = new BitmapImage(new Uri(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selfExts.Contains(ext))
|
|
||||||
{
|
|
||||||
img = GetIcon(resolvedPath);
|
|
||||||
}
|
|
||||||
else if (!string.IsNullOrEmpty(resolvedPath) && imageExts.Contains(ext) && File.Exists(resolvedPath))
|
|
||||||
{
|
|
||||||
img = new BitmapImage(new Uri(resolvedPath));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (img != null)
|
if (img != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ namespace Wox.Helper
|
|||||||
MessageBoxButton.YesNo, MessageBoxImage.Question);
|
MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||||
if (result == MessageBoxResult.Yes)
|
if (result == MessageBoxResult.Yes)
|
||||||
{
|
{
|
||||||
if (existingPlugin != null && Directory.Exists(existingPlugin.Metadata.PluginDirecotry))
|
if (existingPlugin != null && Directory.Exists(existingPlugin.Metadata.PluginDirectory))
|
||||||
{
|
{
|
||||||
File.Create(Path.Combine(existingPlugin.Metadata.PluginDirecotry, "NeedDelete.txt")).Close();
|
File.Create(Path.Combine(existingPlugin.Metadata.PluginDirectory, "NeedDelete.txt")).Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
UnZip(path, newPluginPath, true);
|
UnZip(path, newPluginPath, true);
|
||||||
@@ -106,7 +106,7 @@ namespace Wox.Helper
|
|||||||
{
|
{
|
||||||
metadata = JsonConvert.DeserializeObject<PluginMetadata>(File.ReadAllText(configPath));
|
metadata = JsonConvert.DeserializeObject<PluginMetadata>(File.ReadAllText(configPath));
|
||||||
metadata.PluginType = PluginType.ThirdParty;
|
metadata.PluginType = PluginType.ThirdParty;
|
||||||
metadata.PluginDirecotry = pluginDirectory;
|
metadata.PluginDirectory = pluginDirectory;
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
results.ForEach(o =>
|
results.ForEach(o =>
|
||||||
{
|
{
|
||||||
o.PluginDirectory = plugin.PluginDirecotry;
|
o.PluginDirectory = plugin.PluginDirectory;
|
||||||
o.OriginQuery = query;
|
o.OriginQuery = query;
|
||||||
});
|
});
|
||||||
OnUpdateResultView(results);
|
OnUpdateResultView(results);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Wox.PluginLoader {
|
|||||||
|
|
||||||
var sys = pair.Plugin as BaseSystemPlugin;
|
var sys = pair.Plugin as BaseSystemPlugin;
|
||||||
if (sys != null) {
|
if (sys != null) {
|
||||||
sys.PluginDirectory = metadata.PluginDirecotry;
|
sys.PluginDirectory = metadata.PluginDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins.Add(pair);
|
plugins.Add(pair);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace Wox.PluginLoader {
|
|||||||
PluginType = PluginType.System,
|
PluginType = PluginType.System,
|
||||||
ActionKeyword = "*",
|
ActionKeyword = "*",
|
||||||
ExecuteFileName = "Wox.Plugin.SystemPlugins.dll",
|
ExecuteFileName = "Wox.Plugin.SystemPlugins.dll",
|
||||||
PluginDirecotry = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
|
PluginDirectory = Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ namespace Wox.PluginLoader {
|
|||||||
try {
|
try {
|
||||||
metadata = JsonConvert.DeserializeObject<PluginMetadata>(File.ReadAllText(configPath));
|
metadata = JsonConvert.DeserializeObject<PluginMetadata>(File.ReadAllText(configPath));
|
||||||
metadata.PluginType = PluginType.ThirdParty;
|
metadata.PluginType = PluginType.ThirdParty;
|
||||||
metadata.PluginDirecotry = pluginDirectory;
|
metadata.PluginDirectory = pluginDirectory;
|
||||||
}
|
}
|
||||||
catch (Exception) {
|
catch (Exception) {
|
||||||
string error = string.Format("Parse plugin config {0} failed: json format is not valid", configPath);
|
string error = string.Format("Parse plugin config {0} failed: json format is not valid", configPath);
|
||||||
|
|||||||
@@ -12,12 +12,12 @@
|
|||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Height="600" Width="800">
|
Height="600" Width="800">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<converters:ImagePathConverter x:Key="ImagePathConverter"/>
|
|
||||||
<ListBoxItem HorizontalContentAlignment="Stretch"
|
<ListBoxItem HorizontalContentAlignment="Stretch"
|
||||||
IsEnabled="False"
|
IsEnabled="False"
|
||||||
IsHitTestVisible="False" x:Key="FeatureBoxSeperator">
|
IsHitTestVisible="False" x:Key="FeatureBoxSeperator">
|
||||||
<Separator Width="{Binding ElementName=lbPlugins, Path=ActualWidth}"/>
|
<Separator Width="{Binding ElementName=lbPlugins, Path=ActualWidth}"/>
|
||||||
</ListBoxItem>
|
</ListBoxItem>
|
||||||
|
<converters:ImagePathConverter x:Key="ImageConverter" />
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<TabControl Height="auto" >
|
<TabControl Height="auto" >
|
||||||
<TabItem Header="General">
|
<TabItem Header="General">
|
||||||
@@ -38,62 +38,49 @@
|
|||||||
<ColumnDefinition Width="200"/>
|
<ColumnDefinition Width="200"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<ListBox x:Name="lbPlugins" Grid.Column="0" Margin="0" SelectionChanged="lbPlugins_OnSelectionChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Grid.IsSharedSizeScope="True" >
|
<DockPanel Grid.Column="0" >
|
||||||
<ListBox.Resources>
|
<TextBlock DockPanel.Dock="Top" Margin="6" HorizontalAlignment="Left" Cursor="Hand" MouseUp="tbMorePlugins_MouseUp" x:Name="tbMorePlugins" Foreground="Blue" Text="Browse more plugins"></TextBlock>
|
||||||
<DataTemplate DataType="{x:Type system:BaseSystemPlugin}">
|
<ListBox x:Name="lbPlugins" Margin="0" SelectionChanged="lbPlugins_OnSelectionChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Grid.IsSharedSizeScope="True" >
|
||||||
<Grid Height="36" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="3">
|
<ListBox.Resources>
|
||||||
<Grid.ColumnDefinitions>
|
<DataTemplate DataType="{x:Type system:BaseSystemPlugin}">
|
||||||
<ColumnDefinition Width="32"></ColumnDefinition>
|
<Grid Height="36" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="3">
|
||||||
<ColumnDefinition/>
|
<Grid.ColumnDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<ColumnDefinition Width="32"></ColumnDefinition>
|
||||||
<Image Width="32" Height="32" HorizontalAlignment="Left">
|
<ColumnDefinition/>
|
||||||
<Image.Source>
|
</Grid.ColumnDefinitions>
|
||||||
<MultiBinding Converter="{StaticResource ImagePathConverter}">
|
<Image Width="32" Height="32" HorizontalAlignment="Left" Source="{Binding FullIcoPath,Converter={StaticResource ImageConverter},IsAsync=True}">
|
||||||
<MultiBinding.Bindings>
|
</Image>
|
||||||
<Binding Path="IcoPath" />
|
<Grid Margin="3 0 3 0" Grid.Column="1" HorizontalAlignment="Stretch">
|
||||||
<Binding Path="PluginDirectory" />
|
<Grid.RowDefinitions>
|
||||||
</MultiBinding.Bindings>
|
<RowDefinition></RowDefinition>
|
||||||
</MultiBinding>
|
<RowDefinition Height="Auto"></RowDefinition>
|
||||||
</Image.Source>
|
</Grid.RowDefinitions>
|
||||||
</Image>
|
<TextBlock VerticalAlignment="Center" ToolTip="{Binding Name}" x:Name="tbTitle" Text="{Binding Name}"></TextBlock>
|
||||||
<Grid Margin="3 0 3 0" Grid.Column="1" HorizontalAlignment="Stretch">
|
<TextBlock ToolTip="{Binding Description}" Visibility="{Binding Description, Converter={converters:StringNullOrEmptyToVisibilityConverter}}" Grid.Row="1" x:Name="tbSubTitle" Text="{Binding Description}" Opacity="0.5"></TextBlock>
|
||||||
<Grid.RowDefinitions>
|
</Grid>
|
||||||
<RowDefinition></RowDefinition>
|
|
||||||
<RowDefinition Height="Auto"></RowDefinition>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock VerticalAlignment="Center" ToolTip="{Binding Name}" x:Name="tbTitle" Text="{Binding Name}"></TextBlock>
|
|
||||||
<TextBlock ToolTip="{Binding Description}" Visibility="{Binding Description, Converter={converters:StringNullOrEmptyToVisibilityConverter}}" Grid.Row="1" x:Name="tbSubTitle" Text="{Binding Description}" Opacity="0.5"></TextBlock>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</DataTemplate>
|
||||||
</DataTemplate>
|
<DataTemplate DataType="{x:Type woxPlugin:PluginPair}">
|
||||||
<DataTemplate DataType="{x:Type woxPlugin:PluginPair}">
|
<Grid Height="36" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="3">
|
||||||
<Grid Height="36" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="3">
|
<Grid.ColumnDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="32"></ColumnDefinition>
|
||||||
<ColumnDefinition Width="32"></ColumnDefinition>
|
<ColumnDefinition/>
|
||||||
<ColumnDefinition/>
|
</Grid.ColumnDefinitions>
|
||||||
</Grid.ColumnDefinitions>
|
<Image Width="32" Height="32" HorizontalAlignment="Left" Source="{Binding Metadata.FullIcoPath,Converter={StaticResource ImageConverter},IsAsync=True}">
|
||||||
<Image Width="32" Height="32" HorizontalAlignment="Left">
|
</Image>
|
||||||
<Image.Source>
|
<Grid Margin="3 0 3 0" Grid.Column="1" HorizontalAlignment="Stretch">
|
||||||
<MultiBinding Converter="{StaticResource ImagePathConverter}">
|
<Grid.RowDefinitions>
|
||||||
<MultiBinding.Bindings>
|
<RowDefinition></RowDefinition>
|
||||||
<Binding Path="Metadata.IcoPath" />
|
<RowDefinition Height="Auto"></RowDefinition>
|
||||||
<Binding Path="Metadata.PluginDirecotry" />
|
</Grid.RowDefinitions>
|
||||||
</MultiBinding.Bindings>
|
<TextBlock VerticalAlignment="Center" ToolTip="{Binding Metadata.Name}" x:Name="tbTitle" Text="{Binding Metadata.Name}"></TextBlock>
|
||||||
</MultiBinding>
|
<TextBlock ToolTip="{Binding Metadata.Description}" Visibility="{Binding Metadata.Description, Converter={converters:StringNullOrEmptyToVisibilityConverter}}" Grid.Row="1" x:Name="tbSubTitle" Text="{Binding Metadata.Description}" Opacity="0.5"></TextBlock>
|
||||||
</Image.Source>
|
</Grid>
|
||||||
</Image>
|
|
||||||
<Grid Margin="3 0 3 0" Grid.Column="1" HorizontalAlignment="Stretch">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition></RowDefinition>
|
|
||||||
<RowDefinition Height="Auto"></RowDefinition>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<TextBlock VerticalAlignment="Center" ToolTip="{Binding Metadata.Name}" x:Name="tbTitle" Text="{Binding Metadata.Name}"></TextBlock>
|
|
||||||
<TextBlock ToolTip="{Binding Metadata.Description}" Visibility="{Binding Metadata.Description, Converter={converters:StringNullOrEmptyToVisibilityConverter}}" Grid.Row="1" x:Name="tbSubTitle" Text="{Binding Metadata.Description}" Opacity="0.5"></TextBlock>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</DataTemplate>
|
||||||
</DataTemplate>
|
</ListBox.Resources>
|
||||||
</ListBox.Resources>
|
</ListBox>
|
||||||
</ListBox>
|
</DockPanel>
|
||||||
<Grid Margin="0" Grid.Column="1">
|
<Grid Margin="0" Grid.Column="1">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
@@ -140,7 +127,10 @@
|
|||||||
<ColumnDefinition Width="200"/>
|
<ColumnDefinition Width="200"/>
|
||||||
<ColumnDefinition/>
|
<ColumnDefinition/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<ListBox x:Name="themeComboBox" Grid.Column="0" Margin="10" SelectionChanged="ThemeComboBox_OnSelectionChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="180"/>
|
<DockPanel Grid.Column="0" >
|
||||||
|
<TextBlock DockPanel.Dock="Top" Margin="6" HorizontalAlignment="Left" Cursor="Hand" MouseUp="tbMoreThemes_MouseUp" x:Name="tbMoreThemes" Foreground="Blue" Text="Browse more themes"></TextBlock>
|
||||||
|
<ListBox x:Name="themeComboBox" Margin="0" SelectionChanged="ThemeComboBox_OnSelectionChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="180"/>
|
||||||
|
</DockPanel>
|
||||||
<Grid Margin="0" Grid.Column="1">
|
<Grid Margin="0" Grid.Column="1">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ using Application = System.Windows.Forms.Application;
|
|||||||
using File = System.IO.File;
|
using File = System.IO.File;
|
||||||
using MessageBox = System.Windows.MessageBox;
|
using MessageBox = System.Windows.MessageBox;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
|
using Label = System.Windows.Forms.Label;
|
||||||
|
|
||||||
namespace Wox
|
namespace Wox
|
||||||
{
|
{
|
||||||
@@ -32,11 +33,6 @@ namespace Wox
|
|||||||
bool settingsLoaded = false;
|
bool settingsLoaded = false;
|
||||||
private Dictionary<ISettingProvider, Control> featureControls = new Dictionary<ISettingProvider, Control>();
|
private Dictionary<ISettingProvider, Control> featureControls = new Dictionary<ISettingProvider, Control>();
|
||||||
|
|
||||||
public SettingWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public SettingWindow(MainWindow mainWindow)
|
public SettingWindow(MainWindow mainWindow)
|
||||||
{
|
{
|
||||||
this.MainWindow = mainWindow;
|
this.MainWindow = mainWindow;
|
||||||
@@ -419,14 +415,7 @@ namespace Wox
|
|||||||
pluginSubTitle.Text = pair.Metadata.Description;
|
pluginSubTitle.Text = pair.Metadata.Description;
|
||||||
pluginId = pair.Metadata.ID;
|
pluginId = pair.Metadata.ID;
|
||||||
SyntaxSugars.CallOrRescueDefault(
|
SyntaxSugars.CallOrRescueDefault(
|
||||||
() =>
|
() => pluginIcon.Source = ImageLoader.Load(pair.Metadata.FullIcoPath));
|
||||||
pluginIcon.Source = (ImageSource)new ImagePathConverter().Convert(
|
|
||||||
new object[]
|
|
||||||
{
|
|
||||||
pair.Metadata.IcoPath,
|
|
||||||
pair.Metadata.PluginDirecotry
|
|
||||||
}, null, null,
|
|
||||||
null));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -443,13 +432,7 @@ namespace Wox
|
|||||||
tbOpenPluginDirecoty.Visibility = Visibility.Collapsed;
|
tbOpenPluginDirecoty.Visibility = Visibility.Collapsed;
|
||||||
pluginActionKeywordTitle.Visibility = Visibility.Collapsed;
|
pluginActionKeywordTitle.Visibility = Visibility.Collapsed;
|
||||||
pluginTitle.Cursor = Cursors.Arrow;
|
pluginTitle.Cursor = Cursors.Arrow;
|
||||||
SyntaxSugars.CallOrRescueDefault(
|
SyntaxSugars.CallOrRescueDefault(() => pluginIcon.Source = ImageLoader.Load(sys.FullIcoPath));
|
||||||
() =>
|
|
||||||
pluginIcon.Source = (ImageSource)new ImagePathConverter().Convert(new object[]
|
|
||||||
{
|
|
||||||
sys.IcoPath,
|
|
||||||
sys.PluginDirectory
|
|
||||||
}, null, null, null));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -565,7 +548,7 @@ namespace Wox
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Process.Start(pair.Metadata.PluginDirecotry);
|
Process.Start(pair.Metadata.PluginDirectory);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{ }
|
{ }
|
||||||
@@ -573,5 +556,15 @@ namespace Wox
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void tbMorePlugins_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
Process.Start("http://www.getwox.com/plugin");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void tbMoreThemes_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
Process.Start("http://www.getwox.com/theme");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user