Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<system:String x:Key="currentPriority">Current Priority</system:String>
<system:String x:Key="newPriority">New Priority</system:String>
<system:String x:Key="priority">Priority</system:String>
<system:String x:Key="priorityToolTip">Change Plugin Results Priority</system:String>
<system:String x:Key="pluginDirectory">Plugin Directory</system:String>
<system:String x:Key="author">by</system:String>
<system:String x:Key="plugin_init_time">Init time:</system:String>
Expand Down
1 change: 1 addition & 0 deletions Flow.Launcher/Languages/es-419.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">Prioridad Actual</system:String>
<system:String x:Key="newPriority">Nueva Prioridad</system:String>
<system:String x:Key="priority">Prioridad</system:String>
<system:String x:Key="priorityToolTip">Cambiar la prioridad del resultado del plugin</system:String>
<system:String x:Key="pluginDirectory">Directorio de Plugins</system:String>
<system:String x:Key="author">por</system:String>
<system:String x:Key="plugin_init_time">Tiempo de inicio:</system:String>
Expand Down
1 change: 1 addition & 0 deletions Flow.Launcher/Languages/es.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">Prioridad actual</system:String>
<system:String x:Key="newPriority">Nueva prioridad</system:String>
<system:String x:Key="priority">Prioridad</system:String>
<system:String x:Key="priorityToolTip">Cambiar la prioridad del resultado del complemento</system:String>
<system:String x:Key="pluginDirectory">Carpeta de complementos</system:String>
<system:String x:Key="author">por</system:String>
<system:String x:Key="plugin_init_time">Tiempo de inicio:</system:String>
Expand Down
1 change: 1 addition & 0 deletions Flow.Launcher/Languages/ko.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">현재 중요도:</system:String>
<system:String x:Key="newPriority">새 중요도:</system:String>
<system:String x:Key="priority">중요도</system:String>
<system:String x:Key="priorityToolTip">플러그인 결과 우선 순위 변경</system:String>
<system:String x:Key="pluginDirectory">플러그인 폴더</system:String>
<system:String x:Key="author">제작자</system:String>
<system:String x:Key="plugin_init_time">초기화 시간:</system:String>
Expand Down
1 change: 1 addition & 0 deletions Flow.Launcher/Languages/zh-cn.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">当前优先级</system:String>
<system:String x:Key="newPriority">新优先级</system:String>
<system:String x:Key="priority">优先级</system:String>
<system:String x:Key="priorityToolTip">更改插件结果优先级</system:String>
<system:String x:Key="pluginDirectory">插件目录</system:String>
<system:String x:Key="author">出自</system:String>
<system:String x:Key="plugin_init_time">加载耗时:</system:String>
Expand Down
1 change: 1 addition & 0 deletions Flow.Launcher/Languages/zh-tw.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<system:String x:Key="currentPriority">目前優先</system:String>
<system:String x:Key="newPriority">新增優先</system:String>
<system:String x:Key="priority">優先</system:String>
<system:String x:Key="priorityToolTip">更改插件結果優先順序</system:String>
<system:String x:Key="pluginDirectory">外掛資料夾</system:String>
<system:String x:Key="author">作者</system:String>
<system:String x:Key="plugin_init_time">載入耗時:</system:String>
Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher/SettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@
Click="OnPluginPriorityClick"
Content="{Binding Priority, UpdateSourceTrigger=PropertyChanged}"
Cursor="Hand"
ToolTip="Change Plugin Results Priority">
ToolTip="{DynamicResource priorityToolTip}">
<!--#region Priority Button Style-->
<Button.Resources>
<Style TargetType="Border">
Expand Down
41 changes: 31 additions & 10 deletions Flow.Launcher/ViewModel/SettingWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,44 @@ public void Save()
#region general

// todo a better name?
public class LastQueryMode
public class LastQueryMode : BaseModel
{
public string Display { get; set; }
public Infrastructure.UserSettings.LastQueryMode Value { get; set; }
}

private List<LastQueryMode> _lastQueryModes = new List<LastQueryMode>();
public List<LastQueryMode> LastQueryModes
{
get
{
List<LastQueryMode> modes = new List<LastQueryMode>();
var enums = (Infrastructure.UserSettings.LastQueryMode[])Enum.GetValues(typeof(Infrastructure.UserSettings.LastQueryMode));
foreach (var e in enums)
if (_lastQueryModes.Count == 0)
{
var key = $"LastQuery{e}";
var display = _translater.GetTranslation(key);
var m = new LastQueryMode { Display = display, Value = e, };
modes.Add(m);
_lastQueryModes = InitLastQueryModes();
}
return modes;
return _lastQueryModes;
Comment on lines -137 to +143
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!
Though, I didn't see why this can fix the issue. It seems like you only add a cache for that (which is super reasonable though)?
Would you please explain a bit?

Copy link
Contributor Author

@NeedJustWord NeedJustWord Sep 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.LastQueryMode add INotifyPropertyChanged interface
public class LastQueryMode : BaseModel

2.when modifying the language(Language set property),call UpdateLastQueryModeDisplay();

}
}

private List<LastQueryMode> InitLastQueryModes()
{
var modes = new List<LastQueryMode>();
var enums = (Infrastructure.UserSettings.LastQueryMode[])Enum.GetValues(typeof(Infrastructure.UserSettings.LastQueryMode));
foreach (var e in enums)
{
var key = $"LastQuery{e}";
var display = _translater.GetTranslation(key);
var m = new LastQueryMode { Display = display, Value = e, };
modes.Add(m);
}
return modes;
}

private void UpdateLastQueryModeDisplay()
{
foreach (var item in LastQueryModes)
{
item.Display = _translater.GetTranslation($"LastQuery{item.Value}");
}
}

Expand All @@ -159,6 +178,8 @@ public string Language

if (InternationalizationManager.Instance.PromptShouldUsePinyin(value))
ShouldUsePinyin = true;

UpdateLastQueryModeDisplay();
}
}

Expand Down Expand Up @@ -305,7 +326,7 @@ public string SelectedTheme
{
Settings.Theme = value;
ThemeManager.Instance.ChangeTheme(value);

if (ThemeManager.Instance.BlurEnabled && Settings.UseDropShadowEffect)
DropShadowEffect = false;
}
Expand Down