Skip to content

Commit

Permalink
Merge pull request #207 from Flow-Launcher/dev
Browse files Browse the repository at this point in the history
Release 1.5.0 | Plugin 1.3.0
  • Loading branch information
jjw24 authored Nov 22, 2020
2 parents b03dc8a + 69a5f29 commit 8d6915a
Show file tree
Hide file tree
Showing 39 changed files with 329 additions and 56 deletions.
2 changes: 1 addition & 1 deletion Flow.Launcher.Core/Resource/Theme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Theme
private ResourceDictionary _oldResource;
private string _oldTheme;
public Settings Settings { get; set; }
private const string Folder = "Themes";
private const string Folder = Constant.Themes;
private const string Extension = ".xaml";
private string DirectoryPath => Path.Combine(Constant.ProgramDirectory, Folder);
private string UserDirectoryPath => Path.Combine(DataLocation.DataDirectory(), Folder);
Expand Down
2 changes: 2 additions & 0 deletions Flow.Launcher.Infrastructure/Constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ public static class Constant
public static readonly string QueryTextBoxIconImagePath = $"{ProgramDirectory}\\Images\\mainsearch.png";

public const string DefaultTheme = "Darker";

public const string Themes = "Themes";
}
}
8 changes: 4 additions & 4 deletions Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</PropertyGroup>

<PropertyGroup>
<Version>1.2.2</Version>
<PackageVersion>1.2.2</PackageVersion>
<AssemblyVersion>1.2.2</AssemblyVersion>
<FileVersion>1.2.2</FileVersion>
<Version>1.3.0</Version>
<PackageVersion>1.3.0</PackageVersion>
<AssemblyVersion>1.3.0</AssemblyVersion>
<FileVersion>1.3.0</FileVersion>
<PackageId>Flow.Launcher.Plugin</PackageId>
<Authors>Flow-Launcher</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
30 changes: 29 additions & 1 deletion Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Microsoft.Win32;
using System;
using System.Diagnostics;
using System.IO;
Expand All @@ -7,12 +8,37 @@ namespace Flow.Launcher.Plugin.SharedCommands
{
public static class SearchWeb
{
private static string GetDefaultBrowserPath()
{
string name = string.Empty;
try
{
using var regDefault = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice", false);
var stringDefault = regDefault.GetValue("ProgId");

using var regKey = Registry.ClassesRoot.OpenSubKey(stringDefault + "\\shell\\open\\command", false);
name = regKey.GetValue(null).ToString().ToLower().Replace("\"", "");

if (!name.EndsWith("exe"))
name = name.Substring(0, name.LastIndexOf(".exe") + 4);

}
catch
{
return string.Empty;
}

return name;
}

/// <summary>
/// Opens search in a new browser. If no browser path is passed in then Chrome is used.
/// Leave browser path blank to use Chrome.
/// </summary>
public static void NewBrowserWindow(this string url, string browserPath = "")
{
browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath;

var browserExecutableName = browserPath?
.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.None)
.Last();
Expand Down Expand Up @@ -44,7 +70,9 @@ public static void NewBrowserWindow(this string url, string browserPath = "")
/// </summary>
public static void NewTabInBrowser(this string url, string browserPath = "")
{
var psi = new ProcessStartInfo() { UseShellExecute = true};
browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath;

var psi = new ProcessStartInfo() { UseShellExecute = true };
try
{
if (!string.IsNullOrEmpty(browserPath))
Expand Down
44 changes: 27 additions & 17 deletions Flow.Launcher/Languages/sk.xaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<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-->
<system:String x:Key="registerHotkeyFailed">Nepodarilo sa registrovať klávesovú skratku {0}</system:String>
<system:String x:Key="couldnotStartCmd">Nepodarilo sa spustiť {0}</system:String>
<system:String x:Key="invalidFlowLauncherPluginFileFormat">Neplatný formát súboru pre plugin Flow Launcher</system:String>
<system:String x:Key="invalidFlowLauncherPluginFileFormat">Neplatný formát súboru pre plugin Flow Launchera</system:String>
<system:String x:Key="setAsTopMostInThisQuery">Pri tomto dopyte umiestniť navrchu</system:String>
<system:String x:Key="cancelTopMostInThisQuery">Zrušiť umiestnenie navrchu pri tomto dopyte</system:String>
<system:String x:Key="executeQuery">Spustiť dopyt: {0}</system:String>
Expand All @@ -15,7 +15,7 @@
<system:String x:Key="iconTrayExit">Ukončiť</system:String>

<!--Setting General-->
<system:String x:Key="flowlauncher_settings">Nastavenia Flow Launcher</system:String>
<system:String x:Key="flowlauncher_settings">Nastavenia Flow Launchera</system:String>
<system:String x:Key="general">Všeobecné</system:String>
<system:String x:Key="startFlowLauncherOnSystemStartup">Spustiť Flow Launcher po štarte systému</system:String>
<system:String x:Key="hideFlowLauncherWhenLoseFocus">Schovať Flow Launcher po strate fokusu</system:String>
Expand All @@ -24,52 +24,62 @@
<system:String x:Key="language">Jazyk</system:String>
<system:String x:Key="lastQueryMode">Posledný dopyt</system:String>
<system:String x:Key="LastQueryPreserved">Ponechať</system:String>
<system:String x:Key="LastQuerySelected">Označiť posledný dopyt</system:String>
<system:String x:Key="LastQueryEmpty">Prázdne</system:String>
<system:String x:Key="LastQuerySelected">Označiť</system:String>
<system:String x:Key="LastQueryEmpty">Vymazať</system:String>
<system:String x:Key="maxShowResults">Max. výsledkov</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreen">Ignorovať klávesové skraty v režime na celú obrazovku</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreen">Ignorovať klávesové skratky v režime na celú obrazovku</system:String>
<system:String x:Key="pythonDirectory">Priečinok s Pythonom</system:String>
<system:String x:Key="autoUpdates">Automatická aktualizácia</system:String>
<system:String x:Key="selectPythonDirectory">Vybrať</system:String>
<system:String x:Key="hideOnStartup">Schovať Flow Launcher po spustení</system:String>
<system:String x:Key="hideNotifyIcon">Schovať ikonu v oblasti oznámení</system:String>
<system:String x:Key="hideNotifyIcon">Schovať ikonu z oblasti oznámení</system:String>
<system:String x:Key="querySearchPrecision">Presnosť vyhľadávania</system:String>
<system:String x:Key="ShouldUsePinyin">Dá sa použiť Pinyin</system:String>

<!--Setting Plugin-->
<system:String x:Key="plugin">Plugin</system:String>
<system:String x:Key="browserMorePlugins">Nájsť ďalšie pluginy</system:String>
<system:String x:Key="disable">Zakázať</system:String>
<system:String x:Key="actionKeywords">Skratka akcie</system:String>
<system:String x:Key="pluginDirectory">Priečinok s pluginmy</system:String>
<system:String x:Key="currentActionKeywords">Aktuálna akcia skratky:</system:String>
<system:String x:Key="newActionKeyword">Nová akcia skratky:</system:String>
<system:String x:Key="pluginDirectory">Priečinok s pluginmi</system:String>
<system:String x:Key="author">Autor</system:String>
<system:String x:Key="plugin_init_time">Čas inic.:</system:String>
<system:String x:Key="plugin_query_time">Čas dopytu:</system:String>
<system:String x:Key="plugin_init_time">Príprava: {0}ms</system:String>
<system:String x:Key="plugin_query_time">Čas dopytu: {0}ms</system:String>

<!--Setting Theme-->
<system:String x:Key="theme">Motív</system:String>
<system:String x:Key="browserMoreThemes">Prehliadať viac motívov</system:String>
<system:String x:Key="queryBoxFont">Písmo poľa pre dopyt</system:String>
<system:String x:Key="hiThere">Ahojte</system:String>
<system:String x:Key="queryBoxFont">Písmo vyhľadávacieho poľa</system:String>
<system:String x:Key="resultItemFont">Písmo výsledkov</system:String>
<system:String x:Key="windowMode">Režim okno</system:String>
<system:String x:Key="opacity">Nepriehľadnosť</system:String>
<system:String x:Key="theme_load_failure_path_not_exists">Motív {0} neexistuje, návrat na predvolený motív</system:String>
<system:String x:Key="theme_load_failure_parse_error">Nepodarilo sa nečítať motív {0}, návrat na predvolený motív</system:String>

<!--Setting Hotkey-->
<system:String x:Key="hotkey">Klávesová skratka</system:String>
<system:String x:Key="hotkey">Klávesové skratky</system:String>
<system:String x:Key="flowlauncherHotkey">Klávesová skratka pre Flow Launcher</system:String>
<system:String x:Key="openResultModifiers">Otvorte modifikátory výsledkov</system:String>
<system:String x:Key="customQueryHotkey">Vlastná klávesová skratka pre dopyt</system:String>
<system:String x:Key="openResultModifiers">Modifikáčné klávesy na otvorenie výsledkov</system:String>
<system:String x:Key="showOpenResultHotkey">Zobraziť klávesovú skratku</system:String>
<system:String x:Key="customQueryHotkey">Vlastná klávesová skratka na vyhľadávanie</system:String>
<system:String x:Key="delete">Odstrániť</system:String>
<system:String x:Key="edit">Upraviť</system:String>
<system:String x:Key="add">Pridať</system:String>
<system:String x:Key="pleaseSelectAnItem">Vyberte položku, prosím</system:String>
<system:String x:Key="deleteCustomHotkeyWarning">Ste si istý, že chcete odstrániť klávesovú skratku {0} pre plugin?</system:String>
<system:String x:Key="queryWindowShadowEffect">Tieňový efekt v poli vyhľadávania</system:String>
<system:String x:Key="shadowEffectCPUUsage">Tieňový efekt významne využíva GPU.</system:String>
<system:String x:Key="shadowEffectPerformance">Neodporúča sa, ak je výkon počítača obmedzený.</system:String>

<!--Setting Proxy-->
<system:String x:Key="proxy">HTTP Proxy</system:String>
<system:String x:Key="enableProxy">Povoliť HTTP Proxy</system:String>
<system:String x:Key="server">HTTP Server</system:String>
<system:String x:Key="port">Port</system:String>
<system:String x:Key="userName">Používateľské meno</system:String>
<system:String x:Key="userName">Použív. meno</system:String>
<system:String x:Key="password">Heslo</system:String>
<system:String x:Key="testProxy">Test Proxy</system:String>
<system:String x:Key="save">Uložiť</system:String>
Expand All @@ -92,7 +102,7 @@
Sťahovanie aktualizácií zlyhalo, skontrolujte pripojenie na internet a nastavenie proxy k github-cloud.s3.amazonaws.com,
alebo prejdite na https://github.com/Flow-Launcher/Flow.Launcher/releases pre manuálne stiahnutie aktualizácií.
</system:String>
<system:String x:Key="releaseNotes">Poznámky k vydaniu:</system:String>
<system:String x:Key="releaseNotes">Poznámky k vydaniu</system:String>

<!--Action Keyword Setting Dialog-->
<system:String x:Key="oldActionKeywords">Stará skratka akcie</system:String>
Expand Down Expand Up @@ -131,7 +141,7 @@
<system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher zaznamenal chybu</system:String>

<!--update-->
<system:String x:Key="update_flowlauncher_update_new_version_available">Je dostupné nové vydanie Flow Launcher {0}</system:String>
<system:String x:Key="update_flowlauncher_update_new_version_available">Je dostupná nová verzia Flow Launcher {0}</system:String>
<system:String x:Key="update_flowlauncher_update_error">Počas inštalácie aktualizácií došlo k chybe</system:String>
<system:String x:Key="update_flowlauncher_update">Aktualizovať</system:String>
<system:String x:Key="update_flowlauncher_update_cancel">Zrušiť</system:String>
Expand Down
4 changes: 2 additions & 2 deletions Flow.Launcher/ReportWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ private Paragraph Hyperlink(string textBeforeUrl, string url)
var link = new Hyperlink { IsEnabled = true };
link.Inlines.Add(url);
link.NavigateUri = new Uri(url);
link.RequestNavigate += (s, e) => SearchWeb.NewBrowserWindow(e.Uri.ToString());
link.Click += (s, e) => SearchWeb.NewBrowserWindow(url);
link.RequestNavigate += (s, e) => SearchWeb.NewTabInBrowser(e.Uri.ToString());
link.Click += (s, e) => SearchWeb.NewTabInBrowser(url);

paragraph.Inlines.Add(textBeforeUrl);
paragraph.Inlines.Add(link);
Expand Down
8 changes: 4 additions & 4 deletions Flow.Launcher/SettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
<TextBlock Text="{Binding PluginPair.Metadata.Description}"
Grid.Row="1" Opacity="0.5" />
<DockPanel Grid.Row="2" Margin="0 10 0 8" HorizontalAlignment="Right">

<TextBlock Text="{DynamicResource actionKeywords}"
Visibility="{Binding ActionKeywordsVisibility}"
Margin="20 0 0 0"/>
Expand Down Expand Up @@ -211,10 +211,10 @@
<Run Text="{DynamicResource browserMoreThemes}" />
</Hyperlink>
</TextBlock>
<Button DockPanel.Dock="Top" Margin="0,10,0,0" Width="180" HorizontalAlignment="Center" Click="OpenPluginFolder">Open Theme Folder</Button>
<ListBox DockPanel.Dock="Top" SelectedItem="{Binding SelectedTheme}" ItemsSource="{Binding Themes}"
Margin="10, 0, 10, 10" Width="180" Height="394" />

<ListBox SelectedItem="{Binding SelectedTheme}" ItemsSource="{Binding Themes}"
Margin="10, 0, 10, 10" Width="180"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</DockPanel>
<Grid Margin="0" Grid.Column="1">
<Grid.RowDefinitions>
Expand Down
10 changes: 8 additions & 2 deletions Flow.Launcher/SettingWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using NHotkey.Wpf;
using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Core.Resource;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Hotkey;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
Expand Down Expand Up @@ -228,7 +229,7 @@ private void OnPluginNameClick(object sender, MouseButtonEventArgs e)
var uri = new Uri(website);
if (Uri.CheckSchemeName(uri.Scheme))
{
SearchWeb.NewBrowserWindow(website);
SearchWeb.NewTabInBrowser(website);
}
}
}
Expand Down Expand Up @@ -262,7 +263,7 @@ private async void OnCheckUpdates(object sender, RoutedEventArgs e)

private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
SearchWeb.NewBrowserWindow(e.Uri.AbsoluteUri);
SearchWeb.NewTabInBrowser(e.Uri.AbsoluteUri);
e.Handled = true;
}

Expand All @@ -275,5 +276,10 @@ private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)
{
Close();
}

private void OpenPluginFolder(object sender, RoutedEventArgs e)
{
FilesFolders.OpenPath(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
}
}
}
2 changes: 1 addition & 1 deletion Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private void InitializeKeyCommands()

StartHelpCommand = new RelayCommand(_ =>
{
SearchWeb.NewBrowserWindow("https://github.com/Flow-Launcher/Flow.Launcher/wiki/Flow-Launcher/");
SearchWeb.NewTabInBrowser("https://github.com/Flow-Launcher/Flow.Launcher/wiki/Flow-Launcher/");
});

OpenResultCommand = new RelayCommand(index =>
Expand Down
15 changes: 15 additions & 0 deletions Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/sk.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<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">

<!--Plugin Info-->
<system:String x:Key="flowlauncher_plugin_browserbookmark_plugin_name">Prehliadač záložiek</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_plugin_description">Vyhľadáva záložky prehliadača</system:String>

<!--Settings-->
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_openBookmarks">Otvoriť záložky v:</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_newWindow">Nové okno</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_newTab">Nová karta</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_setBrowserFromPath">Nastaviť cestu k prehliadaču:</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_choose">Prehliadať</system:String>
</ResourceDictionary>
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name": "Browser Bookmarks",
"Description": "Search your browser bookmarks",
"Author": "qianlifeng, Ioannis G.",
"Version": "1.2.1",
"Version": "1.3.1",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.BrowserBookmark.dll",
Expand Down
16 changes: 16 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<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">

<system:String x:Key="flowlauncher_plugin_caculator_plugin_name">Kalkulačka</system:String>
<system:String x:Key="flowlauncher_plugin_caculator_plugin_description">Spracúva matematické operácie.(Skúste 5*3-2 vo flowlauncheri)</system:String>
<system:String x:Key="flowlauncher_plugin_calculator_not_a_number">Nie je číslo (NaN)</system:String>
<system:String x:Key="flowlauncher_plugin_calculator_expression_not_complete">Nesprávny alebo neúplný výraz (Nezabudli ste na zátvorky?)</system:String>
<system:String x:Key="flowlauncher_plugin_calculator_copy_number_to_clipboard">Kopírovať toto číslo do schránky</system:String>
<system:String x:Key="flowlauncher_plugin_calculator_output_decimal_seperator">Oddeľovač des. miest</system:String>
<system:String x:Key="flowlauncher_plugin_calculator_output_decimal_seperator_help">Oddeľovač desatinných miest použitý vo výsledku.</system:String>
<system:String x:Key="flowlauncher_plugin_calculator_decimal_seperator_use_system_locale">Použiť podľa systému</system:String>
<system:String x:Key="flowlauncher_plugin_calculator_decimal_seperator_comma">Čiarka (,)</system:String>
<system:String x:Key="flowlauncher_plugin_calculator_decimal_seperator_dot">Bodka (.)</system:String>
<system:String x:Key="flowlauncher_plugin_calculator_max_decimal_places">Max. desatinných miest</system:String>
</ResourceDictionary>
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Calculator/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name": "Calculator",
"Description": "Provide mathematical calculations.(Try 5*3-2 in Flow Launcher)",
"Author": "cxfksword",
"Version": "1.0.2",
"Version": "1.1.2",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Caculator.dll",
Expand Down
8 changes: 8 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Color/Languages/sk.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<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">

<system:String x:Key="flowlauncher_plugin_color_plugin_name">Farby</system:String>
<system:String x:Key="flowlauncher_plugin_color_plugin_description">Zobrazuje náhľad farieb v HEX formáte. (Skúste #000 vo Flow Launcheri)</system:String>

</ResourceDictionary>
Loading

0 comments on commit 8d6915a

Please sign in to comment.