Add open pluign directory link in plugin setting page.

This commit is contained in:
qianlifeng 2014-07-14 23:18:57 +08:00
parent 15e27e7e1d
commit e7f000147b
2 changed files with 32 additions and 8 deletions

View File

@ -117,12 +117,13 @@
<TextBlock Opacity="0.5" VerticalAlignment="Bottom" HorizontalAlignment="Right" x:Name="pluginAuthor" Text="Author"></TextBlock>
</DockPanel>
<TextBlock Grid.Row="1" x:Name="pluginSubTitle" Opacity="0.5" ToolTip="{Binding Source=pluginSubTitle, Path=Text}" Visibility="{Binding Source=pluginSubTitle, Path=Text, Converter={converters:StringNullOrEmptyToVisibilityConverter}}" ></TextBlock>
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0 8 0 0">
<DockPanel Grid.Row="2" Margin="0 8 0 0">
<CheckBox x:Name="cbDisablePlugin" Click="CbDisablePlugin_OnClick"></CheckBox>
<TextBlock x:Name="pluginDisableTitle" Margin="5 -2 0 0">Disable</TextBlock>
<TextBlock x:Name="pluginActionKeywordTitle" Margin="50 -2 0 0">ActionKeyword:</TextBlock>
<TextBlock Margin="5 -2 0 0" ToolTip="Change Action Keyword" Cursor="Hand" MouseUp="PluginActionKeyword_OnMouseUp" Foreground="Blue" Text="key" x:Name="pluginActionKeyword"></TextBlock>
</StackPanel>
<TextBlock HorizontalAlignment="Right" Cursor="Hand" MouseUp="tbOpenPluginDirecoty_MouseUp" Foreground="Blue" Text="Plugin Directory" x:Name="tbOpenPluginDirecoty"></TextBlock>
</DockPanel>
</Grid>
</Grid>
</ContentControl>

View File

@ -411,6 +411,7 @@ namespace Wox
pluginAuthor.Visibility = Visibility.Visible;
pluginActionKeyword.Visibility = Visibility.Visible;
pluginActionKeywordTitle.Visibility = Visibility.Visible;
tbOpenPluginDirecoty.Visibility = Visibility.Visible;
pluginTitle.Text = pair.Metadata.Name;
pluginTitle.Cursor = Cursors.Hand;
pluginActionKeyword.Text = pair.Metadata.ActionKeyword;
@ -439,6 +440,7 @@ namespace Wox
pluginSubTitle.Text = sys.Description;
pluginAuthor.Visibility = Visibility.Collapsed;
pluginActionKeyword.Visibility = Visibility.Collapsed;
tbOpenPluginDirecoty.Visibility = Visibility.Collapsed;
pluginActionKeywordTitle.Visibility = Visibility.Collapsed;
pluginTitle.Cursor = Cursors.Arrow;
SyntaxSugars.CallOrRescueDefault(
@ -550,5 +552,26 @@ namespace Wox
}
}
}
private void tbOpenPluginDirecoty_MouseUp(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
{
var pair = lbPlugins.SelectedItem as PluginPair;
if (pair != null)
{
//third-party plugin
if (!string.IsNullOrEmpty(pair.Metadata.Website))
{
try
{
Process.Start(pair.Metadata.PluginDirecotry);
}
catch
{ }
}
}
}
}
}
}