diff --git a/Flow.Launcher.Core/Plugin/PythonPlugin.cs b/Flow.Launcher.Core/Plugin/PythonPlugin.cs index 5711ed6aa..855e5c901 100644 --- a/Flow.Launcher.Core/Plugin/PythonPlugin.cs +++ b/Flow.Launcher.Core/Plugin/PythonPlugin.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.IO; using System.Threading; @@ -28,6 +28,11 @@ namespace Flow.Launcher.Core.Plugin var path = Path.Combine(Constant.ProgramDirectory, JsonRPC); _startInfo.EnvironmentVariables["PYTHONPATH"] = path; + _startInfo.EnvironmentVariables["FLOW_VERSION"] = Constant.Version; + _startInfo.EnvironmentVariables["FLOW_PROGRAM_DIRECTORY"] = Constant.ProgramDirectory; + _startInfo.EnvironmentVariables["FLOW_APPLICATION_DIRECTORY"] = Constant.ApplicationDirectory; + + //Add -B flag to tell python don't write .py[co] files. Because .pyc contains location infos which will prevent python portable _startInfo.ArgumentList.Add("-B"); } @@ -57,4 +62,4 @@ namespace Flow.Launcher.Core.Plugin return Task.CompletedTask; } } -} \ No newline at end of file +} diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index 78e8c5cbf..374f7c71f 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -10,6 +10,7 @@ using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using System.Globalization; +using System.Threading.Tasks; namespace Flow.Launcher.Core.Resource { @@ -95,10 +96,13 @@ namespace Flow.Launcher.Core.Resource { LoadLanguage(language); } - UpdatePluginMetadataTranslations(); Settings.Language = language.LanguageCode; CultureInfo.CurrentCulture = new CultureInfo(language.LanguageCode); CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture; + Task.Run(() => + { + UpdatePluginMetadataTranslations(); + }); } public bool PromptShouldUsePinyin(string languageCodeToSet) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index b08f8568d..6bf9c2ff0 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -15,7 +15,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings private string language = "en"; public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}"; public string OpenResultModifiers { get; set; } = KeyConstant.Alt; - public string DarkMode { get; set; } = "System"; + public string ColorScheme { get; set; } = "System"; public bool ShowOpenResultHotkey { get; set; } = true; public double WindowSize { get; set; } = 580; @@ -39,6 +39,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public string ResultFontWeight { get; set; } public string ResultFontStretch { get; set; } public bool UseGlyphIcons { get; set; } = true; + public bool FirstLaunch { get; set; } = true; public int CustomExplorerIndex { get; set; } = 0; @@ -133,8 +134,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool DontPromptUpdateMsg { get; set; } public bool EnableUpdateLog { get; set; } - public bool StartFlowLauncherOnSystemStartup { get; set; } = true; - public bool HideOnStartup { get; set; } + public bool StartFlowLauncherOnSystemStartup { get; set; } = false; + public bool HideOnStartup { get; set; } = true; bool _hideNotifyIcon { get; set; } public bool HideNotifyIcon { @@ -167,7 +168,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings Preserved } - public enum DarkMode + public enum ColorSchemes { System, Light, diff --git a/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs b/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs index e332d450e..61662b671 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs @@ -1,4 +1,6 @@ -namespace Flow.Launcher.Plugin +using System.Globalization; + +namespace Flow.Launcher.Plugin { /// /// Represent plugins that support internationalization @@ -8,5 +10,13 @@ string GetTranslatedPluginTitle(); string GetTranslatedPluginDescription(); + + /// + /// The method will be invoked when language of flow changed + /// + void OnCultureInfoChanged(CultureInfo newCulture) + { + + } } } \ No newline at end of file diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index 613d78dd5..d1444d5db 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -37,6 +37,12 @@ namespace Flow.Launcher.Plugin /// Thrown when unable to find the file specified in the command /// Thrown when error occurs during the execution of the command void ShellRun(string cmd, string filename = "cmd.exe"); + + /// + /// Copy Text to clipboard + /// + /// Text to save on clipboard + public void CopyToClipboard(string text); /// /// Save everything, all of Flow Launcher and plugins' data and settings diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 833ada9cd..29f8198ab 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -29,6 +29,13 @@ namespace Flow.Launcher.Plugin /// public string ActionKeywordAssigned { get; set; } + /// + /// This holds the text which can be provided by plugin to help Flow autocomplete text + /// for user on the plugin result. If autocomplete action for example is tab, pressing tab will have + /// the default constructed autocomplete text (result's Title), or the text provided here if not empty. + /// + public string AutoCompleteText { get; set; } + public string IcoPath { get { return _icoPath; } diff --git a/Flow.Launcher.sln b/Flow.Launcher.sln index 21c3b47dc..b8deae553 100644 --- a/Flow.Launcher.sln +++ b/Flow.Launcher.sln @@ -13,7 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{3A73 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launcher\Flow.Launcher.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}" ProjectSection(ProjectDependencies) = postProject - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} {4792A74A-0CEA-4173-A8B2-30E6764C6217} = {4792A74A-0CEA-4173-A8B2-30E6764C6217} {FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {FDB3555B-58EF-4AE6-B5F1-904719637AB4} @@ -23,6 +22,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launc {9B130CC5-14FB-41FF-B310-0A95B6894C37} = {9B130CC5-14FB-41FF-B310-0A95B6894C37} {FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {FDED22C8-B637-42E8-824A-63B5B6E05A3A} {A3DCCBCA-ACC1-421D-B16E-210896234C26} = {A3DCCBCA-ACC1-421D-B16E-210896234C26} + {5043CECE-E6A7-4867-9CBE-02D27D83747A} = {5043CECE-E6A7-4867-9CBE-02D27D83747A} {403B57F2-1856-4FC7-8A24-36AB346B763E} = {403B57F2-1856-4FC7-8A24-36AB346B763E} {588088F4-3262-4F9F-9663-A05DE12534C3} = {588088F4-3262-4F9F-9663-A05DE12534C3} EndProjectSection @@ -35,8 +35,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Progra EndProject 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}" EndProject -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}" -EndProject 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}" EndProject 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 EndProject 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}" EndProject +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}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -162,18 +162,6 @@ Global {403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|x64.Build.0 = Release|Any CPU {403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|x86.ActiveCfg = Release|Any CPU {403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|x86.Build.0 = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x64.ActiveCfg = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x64.Build.0 = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x86.ActiveCfg = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x86.Build.0 = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|Any CPU.Build.0 = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x64.ActiveCfg = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x64.Build.0 = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x86.ActiveCfg = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x86.Build.0 = Release|Any CPU {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|Any CPU.Build.0 = Debug|Any CPU {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -283,6 +271,18 @@ Global {4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x64.Build.0 = Release|Any CPU {4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.ActiveCfg = Release|Any CPU {4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.Build.0 = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.ActiveCfg = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.Build.0 = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x86.ActiveCfg = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x86.Build.0 = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|Any CPU.Build.0 = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.ActiveCfg = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.Build.0 = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x86.ActiveCfg = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -290,7 +290,6 @@ Global GlobalSection(NestedProjects) = preSolution {FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {403B57F2-1856-4FC7-8A24-36AB346B763E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {A3DCCBCA-ACC1-421D-B16E-210896234C26} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} @@ -300,6 +299,7 @@ Global {F9C4C081-4CC3-4146-95F1-E102B4E10A5F} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {588088F4-3262-4F9F-9663-A05DE12534C3} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {4792A74A-0CEA-4173-A8B2-30E6764C6217} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {5043CECE-E6A7-4867-9CBE-02D27D83747A} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F26ACB50-3F6C-4907-B0C9-1ADACC1D0DED} diff --git a/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs b/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs index c70796a6d..08ee8571e 100644 --- a/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs +++ b/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs @@ -1,6 +1,8 @@ using System; using System.Globalization; +using System.Windows.Controls; using System.Windows.Data; +using System.Windows.Media; using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.ViewModel; @@ -10,13 +12,13 @@ namespace Flow.Launcher.Converters { public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { - if (values.Length != 2) + if (values.Length != 3) { return string.Empty; } + var QueryTextBox = values[0] as TextBox; - // first prop is the current query string - var queryText = (string)values[0]; + var queryText = (string)values[2]; if (string.IsNullOrEmpty(queryText)) return string.Empty; @@ -43,8 +45,20 @@ namespace Flow.Launcher.Converters if (!selectedResultPossibleSuggestion.StartsWith(queryText, StringComparison.CurrentCultureIgnoreCase)) return string.Empty; + + // For AutocompleteQueryCommand. // When user typed lower case and result title is uppercase, we still want to display suggestion - return queryText + selectedResultPossibleSuggestion.Substring(queryText.Length); + selectedItem.QuerySuggestionText = queryText + selectedResultPossibleSuggestion.Substring(queryText.Length); + + // Check if Text will be larger then our QueryTextBox + System.Windows.Media.Typeface typeface = new Typeface(QueryTextBox.FontFamily, QueryTextBox.FontStyle, QueryTextBox.FontWeight, QueryTextBox.FontStretch); + System.Windows.Media.FormattedText ft = new FormattedText(QueryTextBox.Text, System.Globalization.CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, typeface, QueryTextBox.FontSize, Brushes.Black); + if (ft.Width > QueryTextBox.ActualWidth || QueryTextBox.HorizontalOffset != 0) + { + return string.Empty; + }; + + return selectedItem.QuerySuggestionText; } catch (Exception e) { diff --git a/Flow.Launcher/HotkeyControl.xaml b/Flow.Launcher/HotkeyControl.xaml index 94cdc6703..9b5f671d8 100644 --- a/Flow.Launcher/HotkeyControl.xaml +++ b/Flow.Launcher/HotkeyControl.xaml @@ -50,6 +50,7 @@ VerticalContentAlignment="Center" input:InputMethod.IsInputMethodEnabled="False" PreviewKeyDown="TbHotkey_OnPreviewKeyDown" - TabIndex="100" /> + TabIndex="100" + LostFocus="tbHotkey_LostFocus"/> \ No newline at end of file diff --git a/Flow.Launcher/HotkeyControl.xaml.cs b/Flow.Launcher/HotkeyControl.xaml.cs index a20537e3a..bc437d862 100644 --- a/Flow.Launcher/HotkeyControl.xaml.cs +++ b/Flow.Launcher/HotkeyControl.xaml.cs @@ -8,11 +8,16 @@ using Flow.Launcher.Core.Resource; using Flow.Launcher.Helper; using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Plugin; +using System.Threading; namespace Flow.Launcher { public partial class HotkeyControl : UserControl { + private Brush tbMsgForegroundColorOriginal; + + private string tbMsgTextOriginal; + public HotkeyModel CurrentHotkey { get; private set; } public bool CurrentHotkeyAvailable { get; private set; } @@ -23,15 +28,22 @@ namespace Flow.Launcher public HotkeyControl() { InitializeComponent(); + tbMsgTextOriginal = tbMsg.Text; + tbMsgForegroundColorOriginal = tbMsg.Foreground; } - void TbHotkey_OnPreviewKeyDown(object sender, KeyEventArgs e) + private CancellationTokenSource hotkeyUpdateSource; + + private void TbHotkey_OnPreviewKeyDown(object sender, KeyEventArgs e) { + hotkeyUpdateSource?.Cancel(); + hotkeyUpdateSource?.Dispose(); + hotkeyUpdateSource = new(); + var token = hotkeyUpdateSource.Token; e.Handled = true; - tbMsg.Visibility = Visibility.Hidden; //when alt is pressed, the real key should be e.SystemKey - Key key = (e.Key == Key.System ? e.SystemKey : e.Key); + Key key = e.Key == Key.System ? e.SystemKey : e.Key; SpecialKeyState specialKeyState = GlobalHotkey.CheckModifiers(); @@ -49,14 +61,15 @@ namespace Flow.Launcher return; } - Dispatcher.InvokeAsync(async () => + _ = Dispatcher.InvokeAsync(async () => { - await Task.Delay(500); - SetHotkey(hotkeyModel); + await Task.Delay(500, token); + if (!token.IsCancellationRequested) + await SetHotkey(hotkeyModel); }); } - public void SetHotkey(HotkeyModel keyModel, bool triggerValidate = true) + public async Task SetHotkey(HotkeyModel keyModel, bool triggerValidate = true) { CurrentHotkey = keyModel; @@ -78,6 +91,13 @@ namespace Flow.Launcher } tbMsg.Visibility = Visibility.Visible; OnHotkeyChanged(); + + var token = hotkeyUpdateSource.Token; + await Task.Delay(500, token); + if (token.IsCancellationRequested) + return; + FocusManager.SetFocusedElement(FocusManager.GetFocusScope(this), null); + Keyboard.ClearFocus(); } } @@ -88,9 +108,12 @@ namespace Flow.Launcher private bool CheckHotkeyAvailability() => HotKeyMapper.CheckAvailability(CurrentHotkey); - public new bool IsFocused + public new bool IsFocused => tbHotkey.IsFocused; + + private void tbHotkey_LostFocus(object sender, RoutedEventArgs e) { - get { return tbHotkey.IsFocused; } + tbMsg.Text = tbMsgTextOriginal; + tbMsg.Foreground = tbMsgForegroundColorOriginal; } } -} +} \ No newline at end of file diff --git a/Flow.Launcher/Images/page_img01.png b/Flow.Launcher/Images/page_img01.png new file mode 100644 index 000000000..fdc411898 Binary files /dev/null and b/Flow.Launcher/Images/page_img01.png differ diff --git a/Flow.Launcher/Images/wizard.png b/Flow.Launcher/Images/wizard.png new file mode 100644 index 000000000..155de20bd Binary files /dev/null and b/Flow.Launcher/Images/wizard.png differ diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index c0458b06b..926ed558b 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -87,10 +87,10 @@ Fail to load theme {0}, fallback to default theme Theme Folder Open Theme Folder - Dark Mode - System Default - Light - Dark + Color Scheme + System Default + Light + Dark Sound Effect Play a small sound when the search window opens Animation @@ -152,6 +152,7 @@ DevTools Setting Folder Log Folder + Wizard Select File Manager @@ -178,7 +179,7 @@ This new Action Keyword is already assigned to another plugin, please choose a different one Success Completed successfully - 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. + 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. Custom Query Hotkey @@ -231,4 +232,40 @@ Update files Update description + + Skip + Welcome to Flow Launcher + Hello, this is the first time you are running Flow Launcher! + Before starting, this wizard will assist in setting up Flow Launcher. You can skip this if you wish. Please choose a language + Search and run all files and applications on your PC + Search everything from applications, files, bookmarks, YouTube, Twitter and more. All from the comfort of your keyboard without ever touching the mouse. + Flow Launcher starts with the hotkey below, go ahead and try it out now. To change it, click on the input and press the desired hotkey on the keyboard. + Hotkeys + Action Keyword and Commands + Search the web, launch applications or run various functions through Flow Launcher plugins. Certain functions start with an action keyword, and if necessary, they can be used without action keywords. Try the queries below in Flow Launcher. + Let's Start Flow Launcher + Finished. Enjoy Flow Launcher. Don't forget the hotkey to start :) + + + + Back / Context Menu + Item Navigation + Open Context Menu + Open Contaning Folder + Run as Admin + Query History + Back to Result in Context Menu + Open / Run Selected Item + Open Setting Window + Reload Plugin Data + + Weather + Weather in Google Result + > ping 8.8.8.8 + Shell Command + Bluetooth + Bluetooth in Windows Setting + sn + Sticky Notes + diff --git a/Flow.Launcher/Languages/ko.xaml b/Flow.Launcher/Languages/ko.xaml index adcb8fd3d..66d101a5a 100644 --- a/Flow.Launcher/Languages/ko.xaml +++ b/Flow.Launcher/Languages/ko.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib"> - 핫키 등록 실패: {0} + 단축키 등록 실패: {0} {0}을 실행할 수 없습니다. Flow Launcher 플러그인 파일 형식이 유효하지 않습니다. 이 쿼리의 최상위로 설정 @@ -16,7 +16,7 @@ 종료 닫기 게임 모드 - 핫키 사용을 일시중단합니다. + 단축키 사용을 일시중단합니다. Flow Launcher 설정 @@ -34,7 +34,7 @@ 직전 쿼리 내용 선택 직전 쿼리 지우기 표시할 결과 수 - 전체화면 모드에서는 핫키 무시 + 전체화면 모드에서는 단축키 무시 게이머라면 켜는 것을 추천합니다. 기본 파일관리자 폴더를 열 때 사용할 파일관리자를 선택하세요. @@ -87,31 +87,30 @@ {0} 테마 로드에 실패했습니다. 기본 테마로 변경합니다. 테마 폴더 테마 폴더 열기 - 다크 모드 - System settings will take effect from the next run - 시스템 기본 - 밝게 - 어둡게 + 앱 색상 + 시스템 기본 + 밝게 + 어둡게 소리 효과 검색창을 열 때 작은 소리를 재생합니다. 애니메이션 일부 UI에 애니메이션을 사용합니다. - 핫키 - Flow Launcher 핫키 + 단축키 + Flow Launcher 단축키 Flow Launcher를 열 때 사용할 단축키를 입력합니다. 결과 선택 단축키 결과 목록을 선택하는 단축키입니다. 단축키 표시 결과창에서 결과 선택 단축키를 표시합니다. - 사용자지정 쿼리 핫키 + 사용자지정 쿼리 단축키 쿼리 삭제 편집 추가 항목을 선택하세요. - {0} 플러그인 핫키를 삭제하시겠습니까? + {0} 플러그인 단축키를 삭제하시겠습니까? 그림자 효과 그림자 효과는 GPU를 사용합니다. 컴퓨터 퍼포먼스가 제한적인 경우 사용을 추천하지 않습니다. 창 넓이 @@ -153,6 +152,7 @@ 개발자도구 설정 폴더 로그 폴더 + 마법사 파일관리자 선택 @@ -181,15 +181,15 @@ 플러그인을 시작하는데 필요한 액션 키워드를 입력하세요. 액션 키워드를 지정하지 않으려면 *를 사용하세요. 이 경우 키워드를 입력하지 않아도 동작합니다. - 커스텀 플러그인 핫키 + 커스텀 플러그인 단축키 단축키를 지정하여 특정 쿼리를 자동으로 입력할 수 있습니다. 사용하고 싶은 단축키를 눌러 지정한 후, 사용할 쿼리를 입력하세요. 미리보기 - 핫키를 사용할 수 없습니다. 다른 핫키를 입력하세요. - 플러그인 핫키가 유효하지 않습니다. + 단축키를 사용할 수 없습니다. 다른 단축키를 입력하세요. + 플러그인 단축키가 유효하지 않습니다. 업데이트 - 핫키를 사용할 수 없습니다. + 단축키를 사용할 수 없습니다. 버전 @@ -230,4 +230,41 @@ 업데이트 파일 업데이트 설명 + + + 건너뛰기 + Flow Launcher에 오신 것을 환영합니다 + 안녕하세요, Flow Launcher를 처음 실행하시네요! + 시작하기전에 이 마법사가 간단한 설정을 도와드릴겁니다. 물론 건너 뛰셔도 됩니다. 사용하시는 언어를 선택해주세요. + PC에서 모든 파일과 프로그램을 검색하고 실행합니다 + 프로그램, 파일, 즐겨찾기, YouTube, Twitter 등 모든 것을 검색하세요. 마우스에 손대지 않고 키보드만으로 모든 것을 얻을 수 있습니다. + Flow는 아래의 단축키로 실행합니다. 변경하려면 입력창을 선택하고 키보드에서 원하는 단축키를 누릅니다. + 단축키 + 액션 키워드와 명령어 + Flow Launcher는 플러그인을 통해 웹 검색, 프로그램 실행, 다양한 기능을 실행합니다. 특정 기능은 액션 키워드로 시작하며, 필요한 경우 액션 키워드 없이 사용할 수 있습니다. Flow Launcher에서 아래 쿼리를 사용해 보세요. + Flow Launcher를 시작합시다 + 끝났습니다. Flow Launcher를 즐겨주세요. 시작하는 단축키를 잊지마세요 :) + + + + 뒤로/ 콘텍스트 메뉴 + 아이템 이동 + 콘텍스트 메뉴 열기 + 포함된 폴더 열기 + 관리자 권한으로 실행 + 검색 기록 + 콘텍스트 메뉴에서 뒤로 가기 + 선택한 아이템 열기 + 설정창 열기 + 플러그인 데이터 새로고침 + + 날씨 + 구글 날씨 검색 + > ping 8.8.8.8 + 쉘 명령어 + 블루투스 + 윈도우 블루투스 설정 + 스메 + 스티커 메모 + \ No newline at end of file diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index dd8979650..129ceeea5 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -41,10 +41,12 @@ - + - + + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 8afc07439..cf40c5ebf 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -65,10 +65,11 @@ namespace Flow.Launcher private void OnLoaded(object sender, RoutedEventArgs _) { + CheckFirstLaunch(); HideStartup(); // show notify icon when flowlauncher is hidden InitializeNotifyIcon(); - InitializeDarkMode(); + InitializeColorScheme(); WindowsInteropHelper.DisableControlBox(this); InitProgressbarAnimation(); // since the default main window visibility is visible @@ -232,6 +233,20 @@ namespace Flow.Launcher }; } + private void CheckFirstLaunch() + { + if (_settings.FirstLaunch) + { + _settings.FirstLaunch = false; + PluginManager.API.SaveAppAllSettings(); + OpenWelcomeWindow(); + } + } + private void OpenWelcomeWindow() + { + var WelcomeWindow = new WelcomeWindow(_settings); + WelcomeWindow.Show(); + } private void ToggleGameMode() { if (_viewModel.GameModeStatus) @@ -259,7 +274,6 @@ namespace Flow.Launcher _viewModel.ProgressBarVisibility = Visibility.Hidden; isProgressBarStoryboardPaused = true; } - public void WindowAnimator() { if (_animating) @@ -480,13 +494,13 @@ namespace Flow.Launcher QueryTextBox.CaretIndex = QueryTextBox.Text.Length; } - public void InitializeDarkMode() + public void InitializeColorScheme() { - if (_settings.DarkMode == Constant.Light) + if (_settings.ColorScheme == Constant.Light) { ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Light; } - else if (_settings.DarkMode == Constant.Dark) + else if (_settings.ColorScheme == Constant.Dark) { ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark; } diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index fa9e0194b..6713929d6 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -114,6 +114,11 @@ namespace Flow.Launcher var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: args, createNoWindow: true); ShellCommand.Execute(startInfo); } + + public void CopyToClipboard(string text) + { + Clipboard.SetDataObject(text); + } public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible; @@ -232,4 +237,4 @@ namespace Flow.Launcher #endregion } -} \ No newline at end of file +} diff --git a/Flow.Launcher/Resources/Pages/WelcomePage1.xaml b/Flow.Launcher/Resources/Pages/WelcomePage1.xaml new file mode 100644 index 000000000..1728195bd --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage1.xaml @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flow Launcher + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePage1.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage1.xaml.cs new file mode 100644 index 000000000..98fb47288 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage1.xaml.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Windows.Navigation; +using Flow.Launcher.Infrastructure.UserSettings; +using Flow.Launcher.Core.Resource; + +namespace Flow.Launcher.Resources.Pages +{ + public partial class WelcomePage1 + { + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if (e.ExtraData is Settings settings) + Settings = settings; + else + throw new ArgumentException("Unexpected Navigation Parameter for Settings"); + InitializeComponent(); + } + private Internationalization _translater => InternationalizationManager.Instance; + public List Languages => _translater.LoadAvailableLanguages(); + + public Settings Settings { get; set; } + + public string CustomLanguage + { + get + { + return Settings.Language; + } + set + { + InternationalizationManager.Instance.ChangeLanguage(value); + + if (InternationalizationManager.Instance.PromptShouldUsePinyin(value)) + Settings.ShouldUsePinyin = true; + } + } + + } +} \ No newline at end of file diff --git a/Flow.Launcher/Resources/Pages/WelcomePage2.xaml b/Flow.Launcher/Resources/Pages/WelcomePage2.xaml new file mode 100644 index 000000000..033f9fe66 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage2.xaml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePage2.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage2.xaml.cs new file mode 100644 index 000000000..a433611f6 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage2.xaml.cs @@ -0,0 +1,52 @@ +using Flow.Launcher.Helper; +using Flow.Launcher.Infrastructure.Hotkey; +using Flow.Launcher.Infrastructure.UserSettings; +using System; +using System.Windows; +using System.Windows.Media; +using System.Windows.Navigation; + +namespace Flow.Launcher.Resources.Pages +{ + public partial class WelcomePage2 + { + private Settings Settings { get; set; } + + private Brush tbMsgForegroundColorOriginal; + + private string tbMsgTextOriginal; + + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if (e.ExtraData is Settings settings) + Settings = settings; + else + throw new ArgumentException("Unexpected Parameter setting."); + + InitializeComponent(); + tbMsgTextOriginal = HotkeyControl.tbMsg.Text; + tbMsgForegroundColorOriginal = HotkeyControl.tbMsg.Foreground; + + HotkeyControl.SetHotkey(new Infrastructure.Hotkey.HotkeyModel(Settings.Hotkey), false); + } + private void HotkeyControl_OnGotFocus(object sender, RoutedEventArgs args) + { + HotKeyMapper.RemoveHotkey(Settings.Hotkey); + } + private void HotkeyControl_OnLostFocus(object sender, RoutedEventArgs args) + { + if (HotkeyControl.CurrentHotkeyAvailable) + { + HotKeyMapper.SetHotkey(HotkeyControl.CurrentHotkey, HotKeyMapper.OnToggleHotkey); + Settings.Hotkey = HotkeyControl.CurrentHotkey.ToString(); + } + else + { + HotKeyMapper.SetHotkey(new HotkeyModel(Settings.Hotkey), HotKeyMapper.OnToggleHotkey); + } + + HotkeyControl.tbMsg.Text = tbMsgTextOriginal; + HotkeyControl.tbMsg.Foreground = tbMsgForegroundColorOriginal; + } + } +} \ No newline at end of file diff --git a/Flow.Launcher/Resources/Pages/WelcomePage3.xaml b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml new file mode 100644 index 000000000..b424af3d8 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + + + + + + + + + + + + + , + + + + + + + + + + + + + + + Enter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs new file mode 100644 index 000000000..9051e7c27 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs @@ -0,0 +1,20 @@ +using System; +using System.Windows.Navigation; +using Flow.Launcher.Infrastructure.UserSettings; + +namespace Flow.Launcher.Resources.Pages +{ + public partial class WelcomePage3 + { + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if (e.ExtraData is Settings settings) + Settings = settings; + else if(Settings is null) + throw new ArgumentException("Unexpected Navigation Parameter for Settings"); + InitializeComponent(); + } + + public Settings Settings { get; set; } + } +} diff --git a/Flow.Launcher/Resources/Pages/WelcomePage4.xaml b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml new file mode 100644 index 000000000..13f003086 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs new file mode 100644 index 000000000..11bbcd6ed --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs @@ -0,0 +1,20 @@ +using Flow.Launcher.Infrastructure.UserSettings; +using System; +using System.Windows.Navigation; + +namespace Flow.Launcher.Resources.Pages +{ + public partial class WelcomePage4 + { + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if (e.ExtraData is Settings settings) + Settings = settings; + else + throw new ArgumentException("Unexpected Navigation Parameter for Settings"); + InitializeComponent(); + } + + public Settings Settings { get; set; } + } +} diff --git a/Flow.Launcher/Resources/Pages/WelcomePage5.xaml b/Flow.Launcher/Resources/Pages/WelcomePage5.xaml new file mode 100644 index 000000000..c898ac9a0 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage5.xaml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +