Skip to content

Commit cffdb07

Browse files
committed
Merge branch 'dev' into WelcomeWindow
2 parents 848ee1c + 2e67979 commit cffdb07

File tree

70 files changed

+44009
-758
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+44009
-758
lines changed

Flow.Launcher.Core/Plugin/PythonPlugin.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Diagnostics;
33
using System.IO;
44
using System.Threading;
@@ -28,6 +28,11 @@ public PythonPlugin(string filename)
2828
var path = Path.Combine(Constant.ProgramDirectory, JsonRPC);
2929
_startInfo.EnvironmentVariables["PYTHONPATH"] = path;
3030

31+
_startInfo.EnvironmentVariables["FLOW_VERSION"] = Constant.Version;
32+
_startInfo.EnvironmentVariables["FLOW_PROGRAM_DIRECTORY"] = Constant.ProgramDirectory;
33+
_startInfo.EnvironmentVariables["FLOW_APPLICATION_DIRECTORY"] = Constant.ApplicationDirectory;
34+
35+
3136
//Add -B flag to tell python don't write .py[co] files. Because .pyc contains location infos which will prevent python portable
3237
_startInfo.ArgumentList.Add("-B");
3338
}
@@ -57,4 +62,4 @@ public override Task InitAsync(PluginInitContext context)
5762
return Task.CompletedTask;
5863
}
5964
}
60-
}
65+
}

Flow.Launcher.Core/Resource/Internationalization.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Flow.Launcher.Infrastructure.UserSettings;
1111
using Flow.Launcher.Plugin;
1212
using System.Globalization;
13+
using System.Threading.Tasks;
1314

1415
namespace Flow.Launcher.Core.Resource
1516
{
@@ -95,10 +96,13 @@ public void ChangeLanguage(Language language)
9596
{
9697
LoadLanguage(language);
9798
}
98-
UpdatePluginMetadataTranslations();
9999
Settings.Language = language.LanguageCode;
100100
CultureInfo.CurrentCulture = new CultureInfo(language.LanguageCode);
101101
CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture;
102+
Task.Run(() =>
103+
{
104+
UpdatePluginMetadataTranslations();
105+
});
102106
}
103107

104108
public bool PromptShouldUsePinyin(string languageCodeToSet)

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class Settings : BaseModel
1515
private string language = "en";
1616
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
1717
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
18-
public string DarkMode { get; set; } = "System";
18+
public string ColorScheme { get; set; } = "System";
1919
public bool ShowOpenResultHotkey { get; set; } = true;
2020
public double WindowSize { get; set; } = 580;
2121

@@ -168,7 +168,7 @@ public enum LastQueryMode
168168
Preserved
169169
}
170170

171-
public enum DarkMode
171+
public enum ColorSchemes
172172
{
173173
System,
174174
Light,

Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace Flow.Launcher.Plugin
1+
using System.Globalization;
2+
3+
namespace Flow.Launcher.Plugin
24
{
35
/// <summary>
46
/// Represent plugins that support internationalization
@@ -8,5 +10,13 @@ public interface IPluginI18n : IFeatures
810
string GetTranslatedPluginTitle();
911

1012
string GetTranslatedPluginDescription();
13+
14+
/// <summary>
15+
/// The method will be invoked when language of flow changed
16+
/// </summary>
17+
void OnCultureInfoChanged(CultureInfo newCulture)
18+
{
19+
20+
}
1121
}
1222
}

Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ public interface IPublicAPI
3737
/// <exception cref="FileNotFoundException">Thrown when unable to find the file specified in the command </exception>
3838
/// <exception cref="Win32Exception">Thrown when error occurs during the execution of the command </exception>
3939
void ShellRun(string cmd, string filename = "cmd.exe");
40+
41+
/// <summary>
42+
/// Copy Text to clipboard
43+
/// </summary>
44+
/// <param name="Text">Text to save on clipboard</param>
45+
public void CopyToClipboard(string text);
4046

4147
/// <summary>
4248
/// Save everything, all of Flow Launcher and plugins' data and settings

Flow.Launcher.sln

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{3A73
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launcher\Flow.Launcher.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}"
1515
ProjectSection(ProjectDependencies) = postProject
16-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}
1716
{0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {0B9DE348-9361-4940-ADB6-F5953BFFCCEC}
1817
{4792A74A-0CEA-4173-A8B2-30E6764C6217} = {4792A74A-0CEA-4173-A8B2-30E6764C6217}
1918
{FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {FDB3555B-58EF-4AE6-B5F1-904719637AB4}
@@ -23,6 +22,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launc
2322
{9B130CC5-14FB-41FF-B310-0A95B6894C37} = {9B130CC5-14FB-41FF-B310-0A95B6894C37}
2423
{FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {FDED22C8-B637-42E8-824A-63B5B6E05A3A}
2524
{A3DCCBCA-ACC1-421D-B16E-210896234C26} = {A3DCCBCA-ACC1-421D-B16E-210896234C26}
25+
{5043CECE-E6A7-4867-9CBE-02D27D83747A} = {5043CECE-E6A7-4867-9CBE-02D27D83747A}
2626
{403B57F2-1856-4FC7-8A24-36AB346B763E} = {403B57F2-1856-4FC7-8A24-36AB346B763E}
2727
{588088F4-3262-4F9F-9663-A05DE12534C3} = {588088F4-3262-4F9F-9663-A05DE12534C3}
2828
EndProjectSection
@@ -35,8 +35,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Progra
3535
EndProject
3636
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.WebSearch", "Plugins\Flow.Launcher.Plugin.WebSearch\Flow.Launcher.Plugin.WebSearch.csproj", "{403B57F2-1856-4FC7-8A24-36AB346B763E}"
3737
EndProject
38-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.ControlPanel", "Plugins\Flow.Launcher.Plugin.ControlPanel\Flow.Launcher.Plugin.ControlPanel.csproj", "{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}"
39-
EndProject
4038
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.PluginIndicator", "Plugins\Flow.Launcher.Plugin.PluginIndicator\Flow.Launcher.Plugin.PluginIndicator.csproj", "{FDED22C8-B637-42E8-824A-63B5B6E05A3A}"
4139
EndProject
4240
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Sys", "Plugins\Flow.Launcher.Plugin.Sys\Flow.Launcher.Plugin.Sys.csproj", "{0B9DE348-9361-4940-ADB6-F5953BFFCCEC}"
@@ -68,6 +66,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Proces
6866
EndProject
6967
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.PluginsManager", "Plugins\Flow.Launcher.Plugin.PluginsManager\Flow.Launcher.Plugin.PluginsManager.csproj", "{4792A74A-0CEA-4173-A8B2-30E6764C6217}"
7068
EndProject
69+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.WindowsSettings", "Plugins\Flow.Launcher.Plugin.WindowsSettings\Flow.Launcher.Plugin.WindowsSettings.csproj", "{5043CECE-E6A7-4867-9CBE-02D27D83747A}"
70+
EndProject
7171
Global
7272
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7373
Debug|Any CPU = Debug|Any CPU
@@ -162,18 +162,6 @@ Global
162162
{403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|x64.Build.0 = Release|Any CPU
163163
{403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|x86.ActiveCfg = Release|Any CPU
164164
{403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|x86.Build.0 = Release|Any CPU
165-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
166-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
167-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x64.ActiveCfg = Debug|Any CPU
168-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x64.Build.0 = Debug|Any CPU
169-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x86.ActiveCfg = Debug|Any CPU
170-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x86.Build.0 = Debug|Any CPU
171-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
172-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|Any CPU.Build.0 = Release|Any CPU
173-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x64.ActiveCfg = Release|Any CPU
174-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x64.Build.0 = Release|Any CPU
175-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x86.ActiveCfg = Release|Any CPU
176-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x86.Build.0 = Release|Any CPU
177165
{FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
178166
{FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
179167
{FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -283,14 +271,25 @@ Global
283271
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x64.Build.0 = Release|Any CPU
284272
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.ActiveCfg = Release|Any CPU
285273
{4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.Build.0 = Release|Any CPU
274+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
275+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|Any CPU.Build.0 = Debug|Any CPU
276+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.ActiveCfg = Debug|Any CPU
277+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.Build.0 = Debug|Any CPU
278+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x86.ActiveCfg = Debug|Any CPU
279+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x86.Build.0 = Debug|Any CPU
280+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|Any CPU.ActiveCfg = Release|Any CPU
281+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|Any CPU.Build.0 = Release|Any CPU
282+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.ActiveCfg = Release|Any CPU
283+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.Build.0 = Release|Any CPU
284+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x86.ActiveCfg = Release|Any CPU
285+
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x86.Build.0 = Release|Any CPU
286286
EndGlobalSection
287287
GlobalSection(SolutionProperties) = preSolution
288288
HideSolutionNode = FALSE
289289
EndGlobalSection
290290
GlobalSection(NestedProjects) = preSolution
291291
{FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
292292
{403B57F2-1856-4FC7-8A24-36AB346B763E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
293-
{1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
294293
{FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
295294
{0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
296295
{A3DCCBCA-ACC1-421D-B16E-210896234C26} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
@@ -300,6 +299,7 @@ Global
300299
{F9C4C081-4CC3-4146-95F1-E102B4E10A5F} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
301300
{588088F4-3262-4F9F-9663-A05DE12534C3} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
302301
{4792A74A-0CEA-4173-A8B2-30E6764C6217} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
302+
{5043CECE-E6A7-4867-9CBE-02D27D83747A} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
303303
EndGlobalSection
304304
GlobalSection(ExtensibilityGlobals) = postSolution
305305
SolutionGuid = {F26ACB50-3F6C-4907-B0C9-1ADACC1D0DED}

Flow.Launcher/Languages/en.xaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@
8787
<system:String x:Key="theme_load_failure_parse_error">Fail to load theme {0}, fallback to default theme</system:String>
8888
<system:String x:Key="ThemeFolder">Theme Folder</system:String>
8989
<system:String x:Key="OpenThemeFolder">Open Theme Folder</system:String>
90-
<system:String x:Key="DarkMode">Dark Mode</system:String>
91-
<system:String x:Key="DarkModeSystem">System Default</system:String>
92-
<system:String x:Key="DarkModeLight">Light</system:String>
93-
<system:String x:Key="DarkModeDark">Dark</system:String>
90+
<system:String x:Key="ColorScheme">Color Scheme</system:String>
91+
<system:String x:Key="ColorSchemeSystem">System Default</system:String>
92+
<system:String x:Key="ColorSchemeLight">Light</system:String>
93+
<system:String x:Key="ColorSchemeDark">Dark</system:String>
9494
<system:String x:Key="SoundEffect">Sound Effect</system:String>
9595
<system:String x:Key="SoundEffectTip">Play a small sound when the search window opens</system:String>
9696
<system:String x:Key="Animation">Animation</system:String>
@@ -179,7 +179,7 @@
179179
<system:String x:Key="newActionKeywordsHasBeenAssigned">This new Action Keyword is already assigned to another plugin, please choose a different one</system:String>
180180
<system:String x:Key="success">Success</system:String>
181181
<system:String x:Key="completedSuccessfully">Completed successfully</system:String>
182-
<system:String x:Key="actionkeyword_tips">Enter the action keyword you need to start the plug-in. Use * if you don't want to specify an action keyword. In the case, The plug-in works without keywords.</system:String>
182+
<system:String x:Key="actionkeyword_tips">Enter the action keyword you like to use to start the plugin. Use * if you don't want to specify any, and the plugin will be triggered without any action keywords.</system:String>
183183

184184
<!-- Custom Query Hotkey Dialog -->
185185
<system:String x:Key="customeQueryHotkeyTitle">Custom Query Hotkey</system:String>

Flow.Launcher/Languages/ko.xaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,10 @@
8787
<system:String x:Key="theme_load_failure_parse_error">{0} 테마 로드에 실패했습니다. 기본 테마로 변경합니다.</system:String>
8888
<system:String x:Key="ThemeFolder">테마 폴더</system:String>
8989
<system:String x:Key="OpenThemeFolder">테마 폴더 열기</system:String>
90-
<system:String x:Key="DarkMode">다크 모드</system:String>
91-
<system:String x:Key="DarkModeTip">System settings will take effect from the next run</system:String>
92-
<system:String x:Key="DarkModeSystem">시스템 기본</system:String>
93-
<system:String x:Key="DarkModeLight">밝게</system:String>
94-
<system:String x:Key="DarkModeDark">어둡게</system:String>
90+
<system:String x:Key="ColorScheme">앱 색상</system:String>
91+
<system:String x:Key="ColorSchemeSystem">시스템 기본</system:String>
92+
<system:String x:Key="ColorSchemeLight">밝게</system:String>
93+
<system:String x:Key="ColorSchemeDark">어둡게</system:String>
9594
<system:String x:Key="SoundEffect">소리 효과</system:String>
9695
<system:String x:Key="SoundEffectTip">검색창을 열 때 작은 소리를 재생합니다.</system:String>
9796
<system:String x:Key="Animation">애니메이션</system:String>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private void OnLoaded(object sender, RoutedEventArgs _)
6969
HideStartup();
7070
// show notify icon when flowlauncher is hidden
7171
InitializeNotifyIcon();
72-
InitializeDarkMode();
72+
InitializeColorScheme();
7373
WindowsInteropHelper.DisableControlBox(this);
7474
InitProgressbarAnimation();
7575
// since the default main window visibility is visible
@@ -495,13 +495,13 @@ private void MoveQueryTextToEnd()
495495
QueryTextBox.CaretIndex = QueryTextBox.Text.Length;
496496
}
497497

498-
public void InitializeDarkMode()
498+
public void InitializeColorScheme()
499499
{
500-
if (_settings.DarkMode == Constant.Light)
500+
if (_settings.ColorScheme == Constant.Light)
501501
{
502502
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Light;
503503
}
504-
else if (_settings.DarkMode == Constant.Dark)
504+
else if (_settings.ColorScheme == Constant.Dark)
505505
{
506506
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark;
507507
}

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ public void ShellRun(string cmd, string filename = "cmd.exe")
114114
var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: args, createNoWindow: true);
115115
ShellCommand.Execute(startInfo);
116116
}
117+
118+
public void CopyToClipboard(string text)
119+
{
120+
Clipboard.SetDataObject(text);
121+
}
117122

118123
public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible;
119124

@@ -222,4 +227,4 @@ private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, Spe
222227

223228
#endregion
224229
}
225-
}
230+
}

0 commit comments

Comments
 (0)