mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
merge pull request #60
- update ActionKeyword window - settings: UI improvements in plugin/hotkey tabs
This commit is contained in:
commit
a3374f2383
25 changed files with 150 additions and 127 deletions
|
|
@ -1,4 +1,4 @@
|
|||
<Window x:Class="Flow.Launcher.ActionKeywords"
|
||||
<Window x:Class="Flow.Launcher.ActionKeywords"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="ActionKeywords"
|
||||
|
|
@ -6,38 +6,36 @@
|
|||
ResizeMode="NoResize"
|
||||
Loaded="ActionKeyword_OnLoaded"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Height="200" Width="600">
|
||||
Height="250" Width="500">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="60"/>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="170" />
|
||||
<ColumnDefinition Width="150" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right" Text="{DynamicResource oldActionKeyword}" />
|
||||
<TextBlock x:Name="tbOldActionKeyword" Margin="10" FontSize="14" Grid.Row="0" Grid.Column="1"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left">
|
||||
Old ActionKeywords:
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right" Text="{DynamicResource newActionKeyword}" />
|
||||
<TextBlock FontSize="14" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left" Text="{DynamicResource currentActionKeywords}" />
|
||||
<TextBlock x:Name="tbOldActionKeyword" Grid.Row="0" Grid.Column="1" Margin="170 10 10 10" FontSize="14"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Left" />
|
||||
|
||||
<TextBlock FontSize="14" Grid.Row="1" Grid.Column="1" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left" Text="{DynamicResource newActionKeyword}" />
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1">
|
||||
<TextBox x:Name="tbAction" Margin="10" Width="400" VerticalAlignment="Center" HorizontalAlignment="Left" />
|
||||
<TextBox x:Name="tbAction" Margin="170 10 15 10" Width="105" VerticalAlignment="Center" HorizontalAlignment="Left" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.ColumnSpan="1" Grid.Column="1" Padding="5" Foreground="Gray"
|
||||
<TextBlock Grid.Row="2" Grid.ColumnSpan="1" Grid.Column="1" Foreground="Gray"
|
||||
Text="{DynamicResource actionkeyword_tips}" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="3" Grid.Column="1">
|
||||
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="25"
|
||||
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="30"
|
||||
Content="{DynamicResource cancel}" />
|
||||
<Button x:Name="btnDone" Margin="10 0 10 0" Width="80" Height="25" Click="btnDone_OnClick">
|
||||
<Button x:Name="btnDone" Margin="10 0 10 0" Width="80" Height="30" Click="btnDone_OnClick">
|
||||
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
|
|
|||
|
|
@ -4,30 +4,33 @@ using Flow.Launcher.Core.Resource;
|
|||
using Flow.Launcher.Infrastructure.Exception;
|
||||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using Flow.Launcher.Plugin;
|
||||
using Flow.Launcher.ViewModel;
|
||||
|
||||
namespace Flow.Launcher
|
||||
{
|
||||
public partial class ActionKeywords : Window
|
||||
{
|
||||
private PluginPair _plugin;
|
||||
private Settings _settings;
|
||||
private readonly Internationalization _translater = InternationalizationManager.Instance;
|
||||
private readonly PluginPair plugin;
|
||||
private Settings settings;
|
||||
private readonly Internationalization translater = InternationalizationManager.Instance;
|
||||
private readonly PluginViewModel pluginViewModel;
|
||||
|
||||
public ActionKeywords(string pluginId, Settings settings)
|
||||
public ActionKeywords(string pluginId, Settings settings, PluginViewModel pluginViewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
_plugin = PluginManager.GetPluginForId(pluginId);
|
||||
_settings = settings;
|
||||
if (_plugin == null)
|
||||
plugin = PluginManager.GetPluginForId(pluginId);
|
||||
this.settings = settings;
|
||||
this.pluginViewModel = pluginViewModel;
|
||||
if (plugin == null)
|
||||
{
|
||||
MessageBox.Show(_translater.GetTranslation("cannotFindSpecifiedPlugin"));
|
||||
MessageBox.Show(translater.GetTranslation("cannotFindSpecifiedPlugin"));
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void ActionKeyword_OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
tbOldActionKeyword.Text = string.Join(Query.ActionKeywordSeperater, _plugin.Metadata.ActionKeywords.ToArray());
|
||||
tbOldActionKeyword.Text = string.Join(Query.ActionKeywordSeperater, plugin.Metadata.ActionKeywords.ToArray());
|
||||
tbAction.Focus();
|
||||
}
|
||||
|
||||
|
|
@ -38,19 +41,17 @@ namespace Flow.Launcher
|
|||
|
||||
private void btnDone_OnClick(object sender, RoutedEventArgs _)
|
||||
{
|
||||
var oldActionKeyword = _plugin.Metadata.ActionKeywords[0];
|
||||
var oldActionKeyword = plugin.Metadata.ActionKeywords[0];
|
||||
var newActionKeyword = tbAction.Text.Trim();
|
||||
newActionKeyword = newActionKeyword.Length > 0 ? newActionKeyword : "*";
|
||||
if (!PluginManager.ActionKeywordRegistered(newActionKeyword))
|
||||
if (!pluginViewModel.IsActionKeywordRegistered(newActionKeyword))
|
||||
{
|
||||
var id = _plugin.Metadata.ID;
|
||||
PluginManager.ReplaceActionKeyword(id, oldActionKeyword, newActionKeyword);
|
||||
MessageBox.Show(_translater.GetTranslation("success"));
|
||||
pluginViewModel.ChangeActionKeyword(newActionKeyword, oldActionKeyword);
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
string msg = _translater.GetTranslation("newActionKeywordsHasBeenAssigned");
|
||||
string msg = translater.GetTranslation("newActionKeywordsHasBeenAssigned");
|
||||
MessageBox.Show(msg);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<Window x:Class="Flow.Launcher.CustomQueryHotkeySetting"
|
||||
<Window x:Class="Flow.Launcher.CustomQueryHotkeySetting"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
|
||||
|
|
@ -6,6 +6,12 @@
|
|||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="Custom Plugin Hotkey" Height="200" Width="674.766">
|
||||
<Window.InputBindings>
|
||||
<KeyBinding Key="Escape" Command="Close"/>
|
||||
</Window.InputBindings>
|
||||
<Window.CommandBindings>
|
||||
<CommandBinding Command="Close" Executed="cmdEsc_OnPress"/>
|
||||
</Window.CommandBindings>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
|
|
@ -18,7 +24,7 @@
|
|||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right" Text="{DynamicResource hotkey}" />
|
||||
<flowlauncher:HotkeyControl x:Name="ctlHotkey" Margin="10" Grid.Column="1" />
|
||||
<flowlauncher:HotkeyControl x:Name="ctlHotkey" Margin="10,0,10,0" Grid.Column="1" VerticalAlignment="Center" Height="32" />
|
||||
|
||||
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right" Text="{DynamicResource actionKeyword}" />
|
||||
|
|
@ -29,9 +35,9 @@
|
|||
</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"
|
||||
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="32"
|
||||
Content="{DynamicResource cancel}" />
|
||||
<Button x:Name="btnAdd" Margin="10 0 10 0" Width="80" Height="25" Click="btnAdd_OnClick">
|
||||
<Button x:Name="btnAdd" Margin="10 0 10 0" Width="80" Height="32" Click="btnAdd_OnClick">
|
||||
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Flow.Launcher.Core.Resource;
|
||||
using Flow.Launcher.Infrastructure.Hotkey;
|
||||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using NHotkey;
|
||||
using NHotkey.Wpf;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using NHotkey;
|
||||
using NHotkey.Wpf;
|
||||
using Flow.Launcher.Core.Resource;
|
||||
using Flow.Launcher.Infrastructure.Hotkey;
|
||||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Flow.Launcher
|
||||
{
|
||||
|
|
@ -125,5 +125,10 @@ namespace Flow.Launcher
|
|||
MessageBox.Show(errorMsg);
|
||||
}
|
||||
}
|
||||
|
||||
private void cmdEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@
|
|||
<system:String x:Key="actionKeywords">Nøgleord</system:String>
|
||||
<system:String x:Key="pluginDirectory">Plugin bibliotek</system:String>
|
||||
<system:String x:Key="author">Forfatter</system:String>
|
||||
<system:String x:Key="plugin_init_time">Initaliseringstid: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Søgetid: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Initaliseringstid:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Søgetid:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -36,8 +36,8 @@
|
|||
<system:String x:Key="actionKeywords">Aktionsschlüsselwörter</system:String>
|
||||
<system:String x:Key="pluginDirectory">Pluginordner</system:String>
|
||||
<system:String x:Key="author">Autor</system:String>
|
||||
<system:String x:Key="plugin_init_time">Initialisierungszeit: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Abfragezeit: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Initialisierungszeit:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Abfragezeit:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Theme</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -40,11 +40,13 @@
|
|||
<system:String x:Key="plugin">Plugin</system:String>
|
||||
<system:String x:Key="browserMorePlugins">Find more plugins</system:String>
|
||||
<system:String x:Key="disable">Disable</system:String>
|
||||
<system:String x:Key="actionKeywords">Action keywords</system:String>
|
||||
<system:String x:Key="actionKeywords">Action keyword:</system:String>
|
||||
<system:String x:Key="currentActionKeywords">Current action keyword:</system:String>
|
||||
<system:String x:Key="newActionKeyword">New action keyword:</system:String>
|
||||
<system:String x:Key="pluginDirectory">Plugin Directory</system:String>
|
||||
<system:String x:Key="author">Author</system:String>
|
||||
<system:String x:Key="plugin_init_time">Init time: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Query time: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Init time:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Query time:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Theme</system:String>
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@
|
|||
<system:String x:Key="actionKeywords">Mot-clé d'action :</system:String>
|
||||
<system:String x:Key="pluginDirectory">Répertoire</system:String>
|
||||
<system:String x:Key="author">Auteur </system:String>
|
||||
<system:String x:Key="plugin_init_time">Chargement : {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Utilisation : {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Chargement :</system:String>
|
||||
<system:String x:Key="plugin_query_time">Utilisation :</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Thèmes</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -40,8 +40,8 @@
|
|||
<system:String x:Key="actionKeywords">Parole chiave</system:String>
|
||||
<system:String x:Key="pluginDirectory">Cartella Plugin</system:String>
|
||||
<system:String x:Key="author">Autore</system:String>
|
||||
<system:String x:Key="plugin_init_time">Tempo di avvio: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Tempo ricerca: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Tempo di avvio:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Tempo ricerca:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -41,8 +41,8 @@
|
|||
<system:String x:Key="actionKeywords">キーワード</system:String>
|
||||
<system:String x:Key="pluginDirectory">プラグイン・ディレクトリ</system:String>
|
||||
<system:String x:Key="author">作者</system:String>
|
||||
<system:String x:Key="plugin_init_time">初期化時間: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">クエリ時間: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">初期化時間:</system:String>
|
||||
<system:String x:Key="plugin_query_time">クエリ時間:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">テーマ</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -40,8 +40,8 @@
|
|||
<system:String x:Key="actionKeywords">액션 키워드</system:String>
|
||||
<system:String x:Key="pluginDirectory">플러그인 디렉토리</system:String>
|
||||
<system:String x:Key="author">저자</system:String>
|
||||
<system:String x:Key="plugin_init_time">초기화 시간: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">쿼리 시간: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">초기화 시간:</system:String>
|
||||
<system:String x:Key="plugin_query_time">쿼리 시간:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">테마</system:String>
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@
|
|||
<system:String x:Key="actionKeywords">Handlingsnøkkelord</system:String>
|
||||
<system:String x:Key="pluginDirectory">Utvidelseskatalog</system:String>
|
||||
<system:String x:Key="author">Forfatter</system:String>
|
||||
<system:String x:Key="plugin_init_time">Oppstartstid: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Spørringstid: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Oppstartstid:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Spørringstid:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -36,8 +36,8 @@
|
|||
<system:String x:Key="actionKeywords">Action terfwoorden</system:String>
|
||||
<system:String x:Key="pluginDirectory">Plugin map</system:String>
|
||||
<system:String x:Key="author">Auteur</system:String>
|
||||
<system:String x:Key="plugin_init_time">Init tijd: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Query tijd: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Init tijd:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Query tijd:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Thema</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -36,8 +36,8 @@
|
|||
<system:String x:Key="actionKeywords">Wyzwalacze</system:String>
|
||||
<system:String x:Key="pluginDirectory">Folder wtyczki</system:String>
|
||||
<system:String x:Key="author">Autor</system:String>
|
||||
<system:String x:Key="plugin_init_time">Czas ładowania: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Czas zapytania: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Czas ładowania:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Czas zapytania:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Skórka</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -40,8 +40,8 @@
|
|||
<system:String x:Key="actionKeywords">Palavras-chave de ação</system:String>
|
||||
<system:String x:Key="pluginDirectory">Diretório de Plugins</system:String>
|
||||
<system:String x:Key="author">Autor</system:String>
|
||||
<system:String x:Key="plugin_init_time">Tempo de inicialização: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Tempo de consulta: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Tempo de inicialização:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Tempo de consulta:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -36,8 +36,8 @@
|
|||
<system:String x:Key="actionKeywords">Ключевое слово</system:String>
|
||||
<system:String x:Key="pluginDirectory">Папка</system:String>
|
||||
<system:String x:Key="author">Автор</system:String>
|
||||
<system:String x:Key="plugin_init_time">Инициализация: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Запрос: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Инициализация:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Запрос:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Темы</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -41,8 +41,8 @@
|
|||
<system:String x:Key="actionKeywords">Skratka akcie</system:String>
|
||||
<system:String x:Key="pluginDirectory">Priečinok s pluginmy</system:String>
|
||||
<system:String x:Key="author">Autor</system:String>
|
||||
<system:String x:Key="plugin_init_time">Čas inic.: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Čas dopytu: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Čas inic.:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Čas dopytu:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Motív</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -40,8 +40,8 @@
|
|||
<system:String x:Key="actionKeywords">Ključne reči</system:String>
|
||||
<system:String x:Key="pluginDirectory">Plugin direktorijum</system:String>
|
||||
<system:String x:Key="author">Autor</system:String>
|
||||
<system:String x:Key="plugin_init_time">Vreme inicijalizacije: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Vreme upita: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Vreme inicijalizacije:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Vreme upita:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Tema</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -42,8 +42,8 @@
|
|||
<system:String x:Key="actionKeywords">Anahtar Kelimeler</system:String>
|
||||
<system:String x:Key="pluginDirectory">Eklenti Klasörü</system:String>
|
||||
<system:String x:Key="author">Yapımcı</system:String>
|
||||
<system:String x:Key="plugin_init_time">Açılış Süresi: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Sorgu Süresi: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Açılış Süresi:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Sorgu Süresi:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Temalar</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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-->
|
||||
|
|
@ -36,8 +36,8 @@
|
|||
<system:String x:Key="actionKeywords">Ключове слово</system:String>
|
||||
<system:String x:Key="pluginDirectory">Директорія плагіну</system:String>
|
||||
<system:String x:Key="author">Автор</system:String>
|
||||
<system:String x:Key="plugin_init_time">Ініціалізація: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">Запит: {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">Ініціалізація:</system:String>
|
||||
<system:String x:Key="plugin_query_time">Запит:</system:String>
|
||||
|
||||
<!--Setting Theme-->
|
||||
<system:String x:Key="theme">Теми</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
<!--主窗体-->
|
||||
|
|
@ -41,8 +41,8 @@
|
|||
<system:String x:Key="actionKeywords">触发关键字</system:String>
|
||||
<system:String x:Key="pluginDirectory">插件目录</system:String>
|
||||
<system:String x:Key="author">作者</system:String>
|
||||
<system:String x:Key="plugin_init_time">加载耗时 {0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">查询耗时 {0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">加载耗时</system:String>
|
||||
<system:String x:Key="plugin_query_time">查询耗时</system:String>
|
||||
|
||||
<!--设置,主题-->
|
||||
<system:String x:Key="theme">主题</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
<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">
|
||||
<!--主視窗-->
|
||||
|
|
@ -36,8 +36,8 @@
|
|||
<system:String x:Key="actionKeywords">觸發關鍵字</system:String>
|
||||
<system:String x:Key="pluginDirectory">外掛資料夾</system:String>
|
||||
<system:String x:Key="author">作者</system:String>
|
||||
<system:String x:Key="plugin_init_time">載入耗時:{0}ms</system:String>
|
||||
<system:String x:Key="plugin_query_time">查詢耗時:{0}ms</system:String>
|
||||
<system:String x:Key="plugin_init_time">載入耗時:</system:String>
|
||||
<system:String x:Key="plugin_query_time">查詢耗時:</system:String>
|
||||
|
||||
<!--設定,主題-->
|
||||
<system:String x:Key="theme">主題</system:String>
|
||||
|
|
|
|||
|
|
@ -175,14 +175,16 @@
|
|||
|
||||
<TextBlock Text="{DynamicResource actionKeywords}"
|
||||
Visibility="{Binding ActionKeywordsVisibility}"
|
||||
Margin="20 0 0 0" MaxWidth="100"/>
|
||||
Margin="20 0 0 0"/>
|
||||
<TextBlock Text="{Binding ActionKeywordsText}"
|
||||
Visibility="{Binding ActionKeywordsVisibility}"
|
||||
ToolTip="Change Action Keywords"
|
||||
Margin="5 0 0 0" Cursor="Hand" Foreground="Blue"
|
||||
MouseUp="OnPluginActionKeywordsClick" MaxWidth="100" />
|
||||
<TextBlock Text="{Binding InitilizaTime}" Margin="10 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{Binding QueryTime}" Margin="10 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{DynamicResource plugin_init_time}" Margin="10 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{Binding InitilizaTime}" Margin="5 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{DynamicResource plugin_query_time}" Margin="10 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{Binding QueryTime}" Margin="5 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{DynamicResource pluginDirectory}"
|
||||
MaxWidth="100" Cursor="Hand" Margin="40 0 0 0"
|
||||
MouseUp="OnPluginDirecotyClick" Foreground="Blue" />
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
|
@ -21,17 +20,17 @@ namespace Flow.Launcher
|
|||
{
|
||||
private const string StartupPath = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run";
|
||||
|
||||
public readonly IPublicAPI _api;
|
||||
private Settings _settings;
|
||||
private SettingWindowViewModel _viewModel;
|
||||
public readonly IPublicAPI API;
|
||||
private Settings settings;
|
||||
private SettingWindowViewModel viewModel;
|
||||
|
||||
public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
_settings = viewModel.Settings;
|
||||
settings = viewModel.Settings;
|
||||
DataContext = viewModel;
|
||||
_viewModel = viewModel;
|
||||
_api = api;
|
||||
this.viewModel = viewModel;
|
||||
API = api;
|
||||
}
|
||||
|
||||
#region General
|
||||
|
|
@ -94,7 +93,7 @@ namespace Flow.Launcher
|
|||
var pythonPath = Path.Combine(pythonDirectory, PluginsLoader.PythonExecutable);
|
||||
if (File.Exists(pythonPath))
|
||||
{
|
||||
_settings.PluginSettings.PythonDirectory = pythonDirectory;
|
||||
settings.PluginSettings.PythonDirectory = pythonDirectory;
|
||||
MessageBox.Show("Remember to restart Flow Launcher use new Python path");
|
||||
}
|
||||
else
|
||||
|
|
@ -111,7 +110,7 @@ namespace Flow.Launcher
|
|||
|
||||
private void OnHotkeyControlLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
HotkeyControl.SetHotkey(_viewModel.Settings.Hotkey, false);
|
||||
HotkeyControl.SetHotkey(viewModel.Settings.Hotkey, false);
|
||||
}
|
||||
|
||||
void OnHotkeyChanged(object sender, EventArgs e)
|
||||
|
|
@ -129,8 +128,8 @@ namespace Flow.Launcher
|
|||
Application.Current.MainWindow.Visibility = Visibility.Hidden;
|
||||
}
|
||||
});
|
||||
RemoveHotkey(_settings.Hotkey);
|
||||
_settings.Hotkey = HotkeyControl.CurrentHotkey.ToString();
|
||||
RemoveHotkey(settings.Hotkey);
|
||||
settings.Hotkey = HotkeyControl.CurrentHotkey.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -159,7 +158,7 @@ namespace Flow.Launcher
|
|||
|
||||
private void OnDeleteCustomHotkeyClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var item = _viewModel.SelectedCustomPluginHotkey;
|
||||
var item = viewModel.SelectedCustomPluginHotkey;
|
||||
if (item == null)
|
||||
{
|
||||
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
|
||||
|
|
@ -173,17 +172,17 @@ namespace Flow.Launcher
|
|||
MessageBox.Show(deleteWarning, InternationalizationManager.Instance.GetTranslation("delete"),
|
||||
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||
{
|
||||
_settings.CustomPluginHotkeys.Remove(item);
|
||||
settings.CustomPluginHotkeys.Remove(item);
|
||||
RemoveHotkey(item.Hotkey);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnnEditCustomHotkeyClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var item = _viewModel.SelectedCustomPluginHotkey;
|
||||
var item = viewModel.SelectedCustomPluginHotkey;
|
||||
if (item != null)
|
||||
{
|
||||
CustomQueryHotkeySetting window = new CustomQueryHotkeySetting(this, _settings);
|
||||
CustomQueryHotkeySetting window = new CustomQueryHotkeySetting(this, settings);
|
||||
window.UpdateItem(item);
|
||||
window.ShowDialog();
|
||||
}
|
||||
|
|
@ -195,7 +194,7 @@ namespace Flow.Launcher
|
|||
|
||||
private void OnAddCustomeHotkeyClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
new CustomQueryHotkeySetting(this, _settings).ShowDialog();
|
||||
new CustomQueryHotkeySetting(this, settings).ShowDialog();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -204,17 +203,17 @@ namespace Flow.Launcher
|
|||
|
||||
private void OnPluginToggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var id = _viewModel.SelectedPlugin.PluginPair.Metadata.ID;
|
||||
var id = viewModel.SelectedPlugin.PluginPair.Metadata.ID;
|
||||
// used to sync the current status from the plugin manager into the setting to keep consistency after save
|
||||
_settings.PluginSettings.Plugins[id].Disabled = _viewModel.SelectedPlugin.PluginPair.Metadata.Disabled;
|
||||
settings.PluginSettings.Plugins[id].Disabled = viewModel.SelectedPlugin.PluginPair.Metadata.Disabled;
|
||||
}
|
||||
|
||||
private void OnPluginActionKeywordsClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
var id = _viewModel.SelectedPlugin.PluginPair.Metadata.ID;
|
||||
ActionKeywords changeKeywordsWindow = new ActionKeywords(id, _settings);
|
||||
var id = viewModel.SelectedPlugin.PluginPair.Metadata.ID;
|
||||
ActionKeywords changeKeywordsWindow = new ActionKeywords(id, settings, viewModel.SelectedPlugin);
|
||||
changeKeywordsWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
|
@ -223,7 +222,7 @@ namespace Flow.Launcher
|
|||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
var website = _viewModel.SelectedPlugin.PluginPair.Metadata.Website;
|
||||
var website = viewModel.SelectedPlugin.PluginPair.Metadata.Website;
|
||||
if (!string.IsNullOrEmpty(website))
|
||||
{
|
||||
var uri = new Uri(website);
|
||||
|
|
@ -239,7 +238,7 @@ namespace Flow.Launcher
|
|||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
var directory = _viewModel.SelectedPlugin.PluginPair.Metadata.PluginDirectory;
|
||||
var directory = viewModel.SelectedPlugin.PluginPair.Metadata.PluginDirectory;
|
||||
if (!string.IsNullOrEmpty(directory))
|
||||
FilesFolders.OpenPath(directory);
|
||||
}
|
||||
|
|
@ -250,7 +249,7 @@ namespace Flow.Launcher
|
|||
|
||||
private void OnTestProxyClick(object sender, RoutedEventArgs e)
|
||||
{ // TODO: change to command
|
||||
var msg = _viewModel.TestProxy();
|
||||
var msg = viewModel.TestProxy();
|
||||
MessageBox.Show(msg); // TODO: add message box service
|
||||
}
|
||||
|
||||
|
|
@ -258,7 +257,7 @@ namespace Flow.Launcher
|
|||
|
||||
private async void OnCheckUpdates(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_viewModel.UpdateApp(); // TODO: change to command
|
||||
viewModel.UpdateApp(); // TODO: change to command
|
||||
}
|
||||
|
||||
private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
|
||||
|
|
@ -269,7 +268,7 @@ namespace Flow.Launcher
|
|||
|
||||
private void OnClosed(object sender, EventArgs e)
|
||||
{
|
||||
_viewModel.Save();
|
||||
viewModel.Save();
|
||||
}
|
||||
|
||||
private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
using System.Windows;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using Flow.Launcher.Plugin;
|
||||
using Flow.Launcher.Core.Resource;
|
||||
using Flow.Launcher.Infrastructure.Image;
|
||||
using Flow.Launcher.Core.Plugin;
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
{
|
||||
|
|
@ -22,8 +23,17 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
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 QueryTime => string.Format(_translator.GetTranslation("plugin_query_time"), PluginPair.Metadata.AvgQueryTime);
|
||||
public string InitilizaTime => PluginPair.Metadata.InitTime.ToString() + "ms";
|
||||
public string QueryTime => PluginPair.Metadata.AvgQueryTime + "ms";
|
||||
public string ActionKeywordsText => string.Join(Query.ActionKeywordSeperater, PluginPair.Metadata.ActionKeywords);
|
||||
|
||||
public void ChangeActionKeyword(string newActionKeyword, string oldActionKeyword)
|
||||
{
|
||||
PluginManager.ReplaceActionKeyword(PluginPair.Metadata.ID, oldActionKeyword, newActionKeyword);
|
||||
|
||||
OnPropertyChanged(nameof(ActionKeywordsText));
|
||||
}
|
||||
|
||||
public bool IsActionKeywordRegistered(string newActionKeyword) => PluginManager.ActionKeywordRegistered(newActionKeyword);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue