Skip to content

Commit 0edc7f1

Browse files
Move WMP check to app startup
1 parent 490bf59 commit 0edc7f1

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ public bool HideNotifyIcon
271271
public AnimationSpeeds AnimationSpeed { get; set; } = AnimationSpeeds.Medium;
272272
public int CustomAnimationLength { get; set; } = 360;
273273

274+
[JsonIgnore]
275+
public bool WMPInstalled { get; set; } = true;
276+
274277

275278
// This needs to be loaded last by staying at the bottom
276279
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();

Flow.Launcher/App.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
6262

6363
_settingsVM = new SettingWindowViewModel(_updater, _portable);
6464
_settings = _settingsVM.Settings;
65+
_settings.WMPInstalled = WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled();
6566

6667
AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate(_settings);
6768

@@ -80,6 +81,7 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>
8081

8182
await PluginManager.InitializePluginsAsync(API);
8283
await imageLoadertask;
84+
8385

8486
var window = new MainWindow(_settings, _mainVM);
8587

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,7 @@ public void WindowAnimator()
509509

510510
private void InitSoundEffects()
511511
{
512-
isWMPInstalled = WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled();
513-
if (isWMPInstalled)
512+
if (_settings.WMPInstalled)
514513
{
515514
animationSoundWMP = new MediaPlayer();
516515
animationSoundWMP.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"));

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private void OnLoaded(object sender, RoutedEventArgs e)
6767

6868
private void CheckMediaPlayer()
6969
{
70-
if (!WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled())
70+
if (settings.WMPInstalled)
7171
{
7272
WMPWarning.Visibility = Visibility.Visible;
7373
VolumeAdjustCard.Visibility = Visibility.Collapsed;

0 commit comments

Comments
 (0)