Skip to content

Commit 8670461

Browse files
authored
Merge branch 'dev' into improve_update
2 parents 23a2f88 + 3abb2f0 commit 8670461

Some content is hidden

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

71 files changed

+403
-106
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
3+
name: New Release Deployments
4+
on:
5+
release:
6+
types: [published]
7+
workflow_dispatch:
8+
9+
jobs:
10+
deploy-website:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Trigger dispatch event for deploying website
14+
run: |
15+
http_status=$(curl -L -f -s -o /dev/null -w "%{http_code}" \
16+
-X POST \
17+
-H "Accept: application/vnd.github+json" \
18+
-H "Authorization: Bearer ${{ secrets.DEPLOY_FLOW_WEBSITE }}" \
19+
https://api.github.com/repos/Flow-Launcher/flow-launcher.github.io/dispatches \
20+
-d '{"event_type":"deploy"}')
21+
if [ "$http_status" -ne 204 ]; then echo "Error: Deploy website failed, HTTP status code is $http_status"; exit 1; fi
22+
23+
publish-chocolatey:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Trigger dispatch event for publishing to Chocolatey
27+
run: |
28+
http_status=$(curl -L -f -s -o /dev/null -w "%{http_code}" \
29+
-X POST \
30+
-H "Accept: application/vnd.github+json" \
31+
-H "Authorization: Bearer ${{ secrets.Publish_Chocolatey }}" \
32+
https://api.github.com/repos/Flow-Launcher/chocolatey-package/dispatches \
33+
-d '{"event_type":"publish"}')
34+
if [ "$http_status" -ne 204 ]; then echo "Error: Publish Chocolatey package failed, HTTP status code is $http_status"; exit 1; fi

.github/workflows/website_deploy.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,20 @@ public bool ShowHomePage
173173
}
174174
}
175175

176-
public bool ShowHistoryResultsForHomePage { get; set; } = false;
176+
private bool _showHistoryResultsForHomePage = false;
177+
public bool ShowHistoryResultsForHomePage
178+
{
179+
get => _showHistoryResultsForHomePage;
180+
set
181+
{
182+
if (_showHistoryResultsForHomePage != value)
183+
{
184+
_showHistoryResultsForHomePage = value;
185+
OnPropertyChanged();
186+
}
187+
}
188+
}
189+
177190
public int MaxHistoryResultsToShowForHomePage { get; set; } = 5;
178191

179192
public int CustomExplorerIndex { get; set; } = 0;
@@ -395,29 +408,29 @@ public List<RegisteredHotkeyData> RegisteredHotkeys
395408
var list = FixedHotkeys();
396409

397410
// Customizeable hotkeys
398-
if(!string.IsNullOrEmpty(Hotkey))
411+
if (!string.IsNullOrEmpty(Hotkey))
399412
list.Add(new(Hotkey, "flowlauncherHotkey", () => Hotkey = ""));
400-
if(!string.IsNullOrEmpty(PreviewHotkey))
413+
if (!string.IsNullOrEmpty(PreviewHotkey))
401414
list.Add(new(PreviewHotkey, "previewHotkey", () => PreviewHotkey = ""));
402-
if(!string.IsNullOrEmpty(AutoCompleteHotkey))
415+
if (!string.IsNullOrEmpty(AutoCompleteHotkey))
403416
list.Add(new(AutoCompleteHotkey, "autoCompleteHotkey", () => AutoCompleteHotkey = ""));
404-
if(!string.IsNullOrEmpty(AutoCompleteHotkey2))
417+
if (!string.IsNullOrEmpty(AutoCompleteHotkey2))
405418
list.Add(new(AutoCompleteHotkey2, "autoCompleteHotkey", () => AutoCompleteHotkey2 = ""));
406-
if(!string.IsNullOrEmpty(SelectNextItemHotkey))
419+
if (!string.IsNullOrEmpty(SelectNextItemHotkey))
407420
list.Add(new(SelectNextItemHotkey, "SelectNextItemHotkey", () => SelectNextItemHotkey = ""));
408-
if(!string.IsNullOrEmpty(SelectNextItemHotkey2))
421+
if (!string.IsNullOrEmpty(SelectNextItemHotkey2))
409422
list.Add(new(SelectNextItemHotkey2, "SelectNextItemHotkey", () => SelectNextItemHotkey2 = ""));
410-
if(!string.IsNullOrEmpty(SelectPrevItemHotkey))
423+
if (!string.IsNullOrEmpty(SelectPrevItemHotkey))
411424
list.Add(new(SelectPrevItemHotkey, "SelectPrevItemHotkey", () => SelectPrevItemHotkey = ""));
412-
if(!string.IsNullOrEmpty(SelectPrevItemHotkey2))
425+
if (!string.IsNullOrEmpty(SelectPrevItemHotkey2))
413426
list.Add(new(SelectPrevItemHotkey2, "SelectPrevItemHotkey", () => SelectPrevItemHotkey2 = ""));
414-
if(!string.IsNullOrEmpty(SettingWindowHotkey))
427+
if (!string.IsNullOrEmpty(SettingWindowHotkey))
415428
list.Add(new(SettingWindowHotkey, "SettingWindowHotkey", () => SettingWindowHotkey = ""));
416-
if(!string.IsNullOrEmpty(OpenContextMenuHotkey))
429+
if (!string.IsNullOrEmpty(OpenContextMenuHotkey))
417430
list.Add(new(OpenContextMenuHotkey, "OpenContextMenuHotkey", () => OpenContextMenuHotkey = ""));
418-
if(!string.IsNullOrEmpty(SelectNextPageHotkey))
431+
if (!string.IsNullOrEmpty(SelectNextPageHotkey))
419432
list.Add(new(SelectNextPageHotkey, "SelectNextPageHotkey", () => SelectNextPageHotkey = ""));
420-
if(!string.IsNullOrEmpty(SelectPrevPageHotkey))
433+
if (!string.IsNullOrEmpty(SelectPrevPageHotkey))
421434
list.Add(new(SelectPrevPageHotkey, "SelectPrevPageHotkey", () => SelectPrevPageHotkey = ""));
422435
if (!string.IsNullOrEmpty(CycleHistoryUpHotkey))
423436
list.Add(new(CycleHistoryUpHotkey, "CycleHistoryUpHotkey", () => CycleHistoryUpHotkey = ""));

Flow.Launcher/Languages/pl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ Jeśli dodasz prefiks '@' podczas wprowadzania skrótu, będzie on pasował do d
488488
<system:String x:Key="update_flowlauncher_update_cancel">Anuluj</system:String>
489489
<system:String x:Key="update_flowlauncher_fail">Aktualizacja nie powiodła się</system:String>
490490
<system:String x:Key="update_flowlauncher_check_connection">Sprawdź połączenie i spróbuj zaktualizować ustawienia proxy do github-cloud.s3.amazonaws.com.</system:String>
491-
<system:String x:Key="update_flowlauncher_update_restart_flowlauncher_tip">Aby dokończyć proces aktualizacji Flow Launcher musi zostać zresetowany</system:String>
491+
<system:String x:Key="update_flowlauncher_update_restart_flowlauncher_tip">Aby dokończyć proces aktualizacji Flow Launcher musi zostać zrestartowany</system:String>
492492
<system:String x:Key="update_flowlauncher_update_update_files">Następujące pliki zostaną zaktualizowane</system:String>
493493
<system:String x:Key="update_flowlauncher_update_files">Aktualizuj pliki</system:String>
494494
<system:String x:Key="update_flowlauncher_update_update_description">Opis aktualizacji</system:String>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ private void OnLoaded(object sender, RoutedEventArgs _)
283283
InitializeContextMenu();
284284
break;
285285
case nameof(Settings.ShowHomePage):
286+
case nameof(Settings.ShowHistoryResultsForHomePage):
286287
if (_viewModel.QueryResultsSelected() && string.IsNullOrEmpty(_viewModel.QueryText))
287288
{
288289
_viewModel.QueryResults();

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -318,19 +318,37 @@ public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null
318318
{
319319
using var explorer = new Process();
320320
var explorerInfo = _settings.CustomExplorer;
321-
322-
explorer.StartInfo = new ProcessStartInfo
321+
var explorerPath = explorerInfo.Path.Trim().ToLowerInvariant();
322+
var targetPath = FileNameOrFilePath is null
323+
? DirectoryPath
324+
: Path.IsPathRooted(FileNameOrFilePath)
325+
? FileNameOrFilePath
326+
: Path.Combine(DirectoryPath, FileNameOrFilePath);
327+
328+
if (Path.GetFileNameWithoutExtension(explorerPath) == "explorer")
323329
{
324-
FileName = explorerInfo.Path.Replace("%d", DirectoryPath),
325-
UseShellExecute = true,
326-
Arguments = FileNameOrFilePath is null
327-
? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath)
328-
: explorerInfo.FileArgument
329-
.Replace("%d", DirectoryPath)
330-
.Replace("%f",
331-
Path.IsPathRooted(FileNameOrFilePath) ? FileNameOrFilePath : Path.Combine(DirectoryPath, FileNameOrFilePath)
332-
)
333-
};
330+
// Windows File Manager
331+
// We should ignore and pass only the path to Shell to prevent zombie explorer.exe processes
332+
explorer.StartInfo = new ProcessStartInfo
333+
{
334+
FileName = targetPath, // Not explorer, Only path.
335+
UseShellExecute = true // Must be true to open folder
336+
};
337+
}
338+
else
339+
{
340+
// Custom File Manager
341+
explorer.StartInfo = new ProcessStartInfo
342+
{
343+
FileName = explorerInfo.Path.Replace("%d", DirectoryPath),
344+
UseShellExecute = true,
345+
Arguments = FileNameOrFilePath is null
346+
? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath)
347+
: explorerInfo.FileArgument
348+
.Replace("%d", DirectoryPath)
349+
.Replace("%f", targetPath)
350+
};
351+
}
334352
explorer.Start();
335353
}
336354

Flow.Launcher/Resources/Pages/WelcomePage1.xaml.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,19 @@ namespace Flow.Launcher.Resources.Pages
99
{
1010
public partial class WelcomePage1
1111
{
12-
public Settings Settings { get; private set; }
13-
private WelcomeViewModel _viewModel;
12+
public Settings Settings { get; } = Ioc.Default.GetRequiredService<Settings>();
13+
private readonly WelcomeViewModel _viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
1414

1515
protected override void OnNavigatedTo(NavigationEventArgs e)
1616
{
17+
// Sometimes the navigation is not triggered by button click,
18+
// so we need to reset the page number
19+
_viewModel.PageNum = 1;
20+
1721
if (!IsInitialized)
1822
{
19-
Settings = Ioc.Default.GetRequiredService<Settings>();
20-
_viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
2123
InitializeComponent();
2224
}
23-
// Sometimes the navigation is not triggered by button click,
24-
// so we need to reset the page number
25-
_viewModel.PageNum = 1;
2625
base.OnNavigatedTo(e);
2726
}
2827

Flow.Launcher/Resources/Pages/WelcomePage2.xaml.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@ namespace Flow.Launcher.Resources.Pages
1111
{
1212
public partial class WelcomePage2
1313
{
14-
public Settings Settings { get; private set; }
15-
private WelcomeViewModel _viewModel;
14+
public Settings Settings { get; } = Ioc.Default.GetRequiredService<Settings>();
15+
private readonly WelcomeViewModel _viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
1616

1717
protected override void OnNavigatedTo(NavigationEventArgs e)
1818
{
19+
// Sometimes the navigation is not triggered by button click,
20+
// so we need to reset the page number
21+
_viewModel.PageNum = 2;
22+
1923
if (!IsInitialized)
2024
{
21-
Settings = Ioc.Default.GetRequiredService<Settings>();
22-
_viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
2325
InitializeComponent();
2426
}
25-
// Sometimes the navigation is not triggered by button click,
26-
// so we need to reset the page number
27-
_viewModel.PageNum = 2;
2827
base.OnNavigatedTo(e);
2928
}
3029

Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,19 @@ namespace Flow.Launcher.Resources.Pages
77
{
88
public partial class WelcomePage3
99
{
10-
public Settings Settings { get; private set; }
11-
private WelcomeViewModel _viewModel;
10+
public Settings Settings { get; } = Ioc.Default.GetRequiredService<Settings>();
11+
private readonly WelcomeViewModel _viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
1212

1313
protected override void OnNavigatedTo(NavigationEventArgs e)
1414
{
15+
// Sometimes the navigation is not triggered by button click,
16+
// so we need to reset the page number
17+
_viewModel.PageNum = 3;
18+
1519
if (!IsInitialized)
1620
{
17-
Settings = Ioc.Default.GetRequiredService<Settings>();
18-
_viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
1921
InitializeComponent();
2022
}
21-
// Sometimes the navigation is not triggered by button click,
22-
// so we need to reset the page number
23-
_viewModel.PageNum = 3;
2423
base.OnNavigatedTo(e);
2524
}
2625
}

Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,19 @@ namespace Flow.Launcher.Resources.Pages
77
{
88
public partial class WelcomePage4
99
{
10-
public Settings Settings { get; private set; }
11-
private WelcomeViewModel _viewModel;
10+
public Settings Settings { get; } = Ioc.Default.GetRequiredService<Settings>();
11+
private readonly WelcomeViewModel _viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
1212

1313
protected override void OnNavigatedTo(NavigationEventArgs e)
1414
{
15+
// Sometimes the navigation is not triggered by button click,
16+
// so we need to reset the page number
17+
_viewModel.PageNum = 4;
18+
1519
if (!IsInitialized)
1620
{
17-
Settings = Ioc.Default.GetRequiredService<Settings>();
18-
_viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
1921
InitializeComponent();
2022
}
21-
// Sometimes the navigation is not triggered by button click,
22-
// so we need to reset the page number
23-
_viewModel.PageNum = 4;
2423
base.OnNavigatedTo(e);
2524
}
2625
}

0 commit comments

Comments
 (0)