Remove project reference in Sys plugin to Flow.Launcher.Infrastructure

This commit is contained in:
Jack251970 2025-07-20 09:58:30 +08:00
parent 96e6882ec1
commit b6ecfdcf63
4 changed files with 27 additions and 12 deletions

View file

@ -613,5 +613,17 @@ namespace Flow.Launcher.Plugin
/// Invoked when the actual theme of the application has changed. Currently, the plugin will continue to be subscribed even if it is turned off. /// Invoked when the actual theme of the application has changed. Currently, the plugin will continue to be subscribed even if it is turned off.
/// </summary> /// </summary>
event ActualApplicationThemeChangedEventHandler ActualApplicationThemeChanged; event ActualApplicationThemeChangedEventHandler ActualApplicationThemeChanged;
/// <summary>
/// Get the data directory of Flow Launcher.
/// </summary>
/// <returns></returns>
string GetDataDirectory();
/// <summary>
/// Get the log directory of Flow Launcher.
/// </summary>
/// <returns></returns>
string GetLogDirectory();
} }
} }

View file

@ -599,6 +599,10 @@ namespace Flow.Launcher
remove => _mainVM.ActualApplicationThemeChanged -= value; remove => _mainVM.ActualApplicationThemeChanged -= value;
} }
public string GetDataDirectory() => DataLocation.DataDirectory();
public string GetLogDirectory() => DataLocation.VersionLogDirectory;
#endregion #endregion
#region Private Methods #region Private Methods

View file

@ -37,7 +37,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Flow.Launcher.Infrastructure\Flow.Launcher.Infrastructure.csproj" />
<ProjectReference Include="..\..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" /> <ProjectReference Include="..\..\Flow.Launcher.Plugin\Flow.Launcher.Plugin.csproj" />
</ItemGroup> </ItemGroup>

View file

@ -5,8 +5,6 @@ using System.Globalization;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.UserSettings;
using Windows.Win32; using Windows.Win32;
using Windows.Win32.Foundation; using Windows.Win32.Foundation;
using Windows.Win32.Security; using Windows.Win32.Security;
@ -52,6 +50,8 @@ namespace Flow.Launcher.Plugin.Sys
private const SHUTDOWN_REASON REASON = SHUTDOWN_REASON.SHTDN_REASON_MAJOR_OTHER | private const SHUTDOWN_REASON REASON = SHUTDOWN_REASON.SHTDN_REASON_MAJOR_OTHER |
SHUTDOWN_REASON.SHTDN_REASON_FLAG_PLANNED; SHUTDOWN_REASON.SHTDN_REASON_FLAG_PLANNED;
private const string Documentation = "https://flowlauncher.com/docs/#/usage-tips";
private PluginInitContext _context; private PluginInitContext _context;
private Settings _settings; private Settings _settings;
private ThemeSelector _themeSelector; private ThemeSelector _themeSelector;
@ -445,11 +445,11 @@ namespace Flow.Launcher.Plugin.Sys
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xf12b"), Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xf12b"),
Title = "Open Log Location", Title = "Open Log Location",
IcoPath = "Images\\app.png", IcoPath = "Images\\app.png",
CopyText = DataLocation.VersionLogDirectory, CopyText = _context.API.GetLogDirectory(),
AutoCompleteText = DataLocation.VersionLogDirectory, AutoCompleteText = _context.API.GetLogDirectory(),
Action = c => Action = c =>
{ {
_context.API.OpenDirectory(DataLocation.VersionLogDirectory); _context.API.OpenDirectory(_context.API.GetLogDirectory());
return true; return true;
} }
}, },
@ -458,11 +458,11 @@ namespace Flow.Launcher.Plugin.Sys
Title = "Flow Launcher Tips", Title = "Flow Launcher Tips",
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe897"), Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xe897"),
IcoPath = "Images\\app.png", IcoPath = "Images\\app.png",
CopyText = Constant.Documentation, CopyText = Documentation,
AutoCompleteText = Constant.Documentation, AutoCompleteText = Documentation,
Action = c => Action = c =>
{ {
_context.API.OpenUrl(Constant.Documentation); _context.API.OpenUrl(Documentation);
return true; return true;
} }
}, },
@ -471,11 +471,11 @@ namespace Flow.Launcher.Plugin.Sys
Title = "Flow Launcher UserData Folder", Title = "Flow Launcher UserData Folder",
Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xf12b"), Glyph = new GlyphInfo (FontFamily:"/Resources/#Segoe Fluent Icons", Glyph:"\xf12b"),
IcoPath = "Images\\app.png", IcoPath = "Images\\app.png",
CopyText = DataLocation.DataDirectory(), CopyText = _context.API.GetDataDirectory(),
AutoCompleteText = DataLocation.DataDirectory(), AutoCompleteText = _context.API.GetDataDirectory(),
Action = c => Action = c =>
{ {
_context.API.OpenDirectory(DataLocation.DataDirectory()); _context.API.OpenDirectory(_context.API.GetDataDirectory());
return true; return true;
} }
}, },