Skip to content

Commit 8d6915a

Browse files
authored
Merge pull request #207 from Flow-Launcher/dev
Release 1.5.0 | Plugin 1.3.0
2 parents b03dc8a + 69a5f29 commit 8d6915a

File tree

39 files changed

+329
-56
lines changed

39 files changed

+329
-56
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class Theme
2121
private ResourceDictionary _oldResource;
2222
private string _oldTheme;
2323
public Settings Settings { get; set; }
24-
private const string Folder = "Themes";
24+
private const string Folder = Constant.Themes;
2525
private const string Extension = ".xaml";
2626
private string DirectoryPath => Path.Combine(Constant.ProgramDirectory, Folder);
2727
private string UserDirectoryPath => Path.Combine(DataLocation.DataDirectory(), Folder);

Flow.Launcher.Infrastructure/Constant.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,7 @@ public static class Constant
3333
public static readonly string QueryTextBoxIconImagePath = $"{ProgramDirectory}\\Images\\mainsearch.png";
3434

3535
public const string DefaultTheme = "Darker";
36+
37+
public const string Themes = "Themes";
3638
}
3739
}

Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup>
17-
<Version>1.2.2</Version>
18-
<PackageVersion>1.2.2</PackageVersion>
19-
<AssemblyVersion>1.2.2</AssemblyVersion>
20-
<FileVersion>1.2.2</FileVersion>
17+
<Version>1.3.0</Version>
18+
<PackageVersion>1.3.0</PackageVersion>
19+
<AssemblyVersion>1.3.0</AssemblyVersion>
20+
<FileVersion>1.3.0</FileVersion>
2121
<PackageId>Flow.Launcher.Plugin</PackageId>
2222
<Authors>Flow-Launcher</Authors>
2323
<PackageLicenseExpression>MIT</PackageLicenseExpression>

Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Microsoft.Win32;
12
using System;
23
using System.Diagnostics;
34
using System.IO;
@@ -7,12 +8,37 @@ namespace Flow.Launcher.Plugin.SharedCommands
78
{
89
public static class SearchWeb
910
{
11+
private static string GetDefaultBrowserPath()
12+
{
13+
string name = string.Empty;
14+
try
15+
{
16+
using var regDefault = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice", false);
17+
var stringDefault = regDefault.GetValue("ProgId");
18+
19+
using var regKey = Registry.ClassesRoot.OpenSubKey(stringDefault + "\\shell\\open\\command", false);
20+
name = regKey.GetValue(null).ToString().ToLower().Replace("\"", "");
21+
22+
if (!name.EndsWith("exe"))
23+
name = name.Substring(0, name.LastIndexOf(".exe") + 4);
24+
25+
}
26+
catch
27+
{
28+
return string.Empty;
29+
}
30+
31+
return name;
32+
}
33+
1034
/// <summary>
1135
/// Opens search in a new browser. If no browser path is passed in then Chrome is used.
1236
/// Leave browser path blank to use Chrome.
1337
/// </summary>
1438
public static void NewBrowserWindow(this string url, string browserPath = "")
1539
{
40+
browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath;
41+
1642
var browserExecutableName = browserPath?
1743
.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.None)
1844
.Last();
@@ -44,7 +70,9 @@ public static void NewBrowserWindow(this string url, string browserPath = "")
4470
/// </summary>
4571
public static void NewTabInBrowser(this string url, string browserPath = "")
4672
{
47-
var psi = new ProcessStartInfo() { UseShellExecute = true};
73+
browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath;
74+
75+
var psi = new ProcessStartInfo() { UseShellExecute = true };
4876
try
4977
{
5078
if (!string.IsNullOrEmpty(browserPath))

Flow.Launcher/Languages/sk.xaml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:system="clr-namespace:System;assembly=mscorlib">
44
<!--MainWindow-->
55
<system:String x:Key="registerHotkeyFailed">Nepodarilo sa registrovať klávesovú skratku {0}</system:String>
66
<system:String x:Key="couldnotStartCmd">Nepodarilo sa spustiť {0}</system:String>
7-
<system:String x:Key="invalidFlowLauncherPluginFileFormat">Neplatný formát súboru pre plugin Flow Launcher</system:String>
7+
<system:String x:Key="invalidFlowLauncherPluginFileFormat">Neplatný formát súboru pre plugin Flow Launchera</system:String>
88
<system:String x:Key="setAsTopMostInThisQuery">Pri tomto dopyte umiestniť navrchu</system:String>
99
<system:String x:Key="cancelTopMostInThisQuery">Zrušiť umiestnenie navrchu pri tomto dopyte</system:String>
1010
<system:String x:Key="executeQuery">Spustiť dopyt: {0}</system:String>
@@ -15,7 +15,7 @@
1515
<system:String x:Key="iconTrayExit">Ukončiť</system:String>
1616

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

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

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

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

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

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

133143
<!--update-->
134-
<system:String x:Key="update_flowlauncher_update_new_version_available">Je dostupné nové vydanie Flow Launcher {0}</system:String>
144+
<system:String x:Key="update_flowlauncher_update_new_version_available">Je dostupná nová verzia Flow Launcher {0}</system:String>
135145
<system:String x:Key="update_flowlauncher_update_error">Počas inštalácie aktualizácií došlo k chybe</system:String>
136146
<system:String x:Key="update_flowlauncher_update">Aktualizovať</system:String>
137147
<system:String x:Key="update_flowlauncher_update_cancel">Zrušiť</system:String>

Flow.Launcher/ReportWindow.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ private Paragraph Hyperlink(string textBeforeUrl, string url)
5252
var link = new Hyperlink { IsEnabled = true };
5353
link.Inlines.Add(url);
5454
link.NavigateUri = new Uri(url);
55-
link.RequestNavigate += (s, e) => SearchWeb.NewBrowserWindow(e.Uri.ToString());
56-
link.Click += (s, e) => SearchWeb.NewBrowserWindow(url);
55+
link.RequestNavigate += (s, e) => SearchWeb.NewTabInBrowser(e.Uri.ToString());
56+
link.Click += (s, e) => SearchWeb.NewTabInBrowser(url);
5757

5858
paragraph.Inlines.Add(textBeforeUrl);
5959
paragraph.Inlines.Add(link);

Flow.Launcher/SettingWindow.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
<TextBlock Text="{Binding PluginPair.Metadata.Description}"
173173
Grid.Row="1" Opacity="0.5" />
174174
<DockPanel Grid.Row="2" Margin="0 10 0 8" HorizontalAlignment="Right">
175-
175+
176176
<TextBlock Text="{DynamicResource actionKeywords}"
177177
Visibility="{Binding ActionKeywordsVisibility}"
178178
Margin="20 0 0 0"/>
@@ -211,10 +211,10 @@
211211
<Run Text="{DynamicResource browserMoreThemes}" />
212212
</Hyperlink>
213213
</TextBlock>
214+
<Button DockPanel.Dock="Top" Margin="0,10,0,0" Width="180" HorizontalAlignment="Center" Click="OpenPluginFolder">Open Theme Folder</Button>
215+
<ListBox DockPanel.Dock="Top" SelectedItem="{Binding SelectedTheme}" ItemsSource="{Binding Themes}"
216+
Margin="10, 0, 10, 10" Width="180" Height="394" />
214217

215-
<ListBox SelectedItem="{Binding SelectedTheme}" ItemsSource="{Binding Themes}"
216-
Margin="10, 0, 10, 10" Width="180"
217-
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
218218
</DockPanel>
219219
<Grid Margin="0" Grid.Column="1">
220220
<Grid.RowDefinitions>

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using NHotkey.Wpf;
99
using Flow.Launcher.Core.Plugin;
1010
using Flow.Launcher.Core.Resource;
11+
using Flow.Launcher.Infrastructure;
1112
using Flow.Launcher.Infrastructure.Hotkey;
1213
using Flow.Launcher.Infrastructure.UserSettings;
1314
using Flow.Launcher.Plugin;
@@ -228,7 +229,7 @@ private void OnPluginNameClick(object sender, MouseButtonEventArgs e)
228229
var uri = new Uri(website);
229230
if (Uri.CheckSchemeName(uri.Scheme))
230231
{
231-
SearchWeb.NewBrowserWindow(website);
232+
SearchWeb.NewTabInBrowser(website);
232233
}
233234
}
234235
}
@@ -262,7 +263,7 @@ private async void OnCheckUpdates(object sender, RoutedEventArgs e)
262263

263264
private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
264265
{
265-
SearchWeb.NewBrowserWindow(e.Uri.AbsoluteUri);
266+
SearchWeb.NewTabInBrowser(e.Uri.AbsoluteUri);
266267
e.Handled = true;
267268
}
268269

@@ -275,5 +276,10 @@ private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)
275276
{
276277
Close();
277278
}
279+
280+
private void OpenPluginFolder(object sender, RoutedEventArgs e)
281+
{
282+
FilesFolders.OpenPath(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
283+
}
278284
}
279285
}

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private void InitializeKeyCommands()
136136

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

142142
OpenResultCommand = new RelayCommand(index =>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:system="clr-namespace:System;assembly=mscorlib">
4+
5+
<!--Plugin Info-->
6+
<system:String x:Key="flowlauncher_plugin_browserbookmark_plugin_name">Prehliadač záložiek</system:String>
7+
<system:String x:Key="flowlauncher_plugin_browserbookmark_plugin_description">Vyhľadáva záložky prehliadača</system:String>
8+
9+
<!--Settings-->
10+
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_openBookmarks">Otvoriť záložky v:</system:String>
11+
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_newWindow">Nové okno</system:String>
12+
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_newTab">Nová karta</system:String>
13+
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_setBrowserFromPath">Nastaviť cestu k prehliadaču:</system:String>
14+
<system:String x:Key="flowlauncher_plugin_browserbookmark_settings_choose">Prehliadať</system:String>
15+
</ResourceDictionary>

0 commit comments

Comments
 (0)