-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #381 from Sidekick-Poe/feature/about
Add About section
- Loading branch information
Showing
15 changed files
with
197 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 1 addition & 10 deletions
11
src/Sidekick.Common.Blazor/Initialization/InitializationResources.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
using Microsoft.Extensions.Localization; | ||
|
||
namespace Sidekick.Common.Blazor.Initialization; | ||
|
||
public class InitializationResources(IStringLocalizer<InitializationResources> localizer) | ||
public class InitializationResources() | ||
{ | ||
public string Close => localizer["Close"]; | ||
public string Error => localizer["Error"]; | ||
public string Exit => localizer["Exit"]; | ||
public string Notification => localizer["Notification"]; | ||
public string Ready => localizer["Ready"]; | ||
|
||
public string Title(int completed, int count) => localizer["Title", completed, count]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@page "/settings/about" | ||
@layout SettingsLayout | ||
@inherits Sidekick.Common.Ui.Views.SidekickView | ||
@using Sidekick.Common.Browser | ||
@using Sidekick.Common.Folder | ||
|
||
<AppTitle Title="@Resources["About"]" /> | ||
|
||
<AppContainer> | ||
<Fieldset Legend="@($"{Resources["Sidekick"]} - {Title}")"> | ||
<div class="mb-3"><span class="text-lg underline text-blue-500 cursor-pointer" onclick="@(() => BrowserProvider.OpenSidekickWebsite())">@Resources["Official_Website"]</span></div> | ||
<div class="mb-3"><span class="text-lg underline text-blue-500 cursor-pointer" onclick="@(() => BrowserProvider.OpenGitHubRepository())">@Resources["GitHub_Repository"]</span></div> | ||
|
||
<LayoutDivider/> | ||
|
||
<div class="mb-3"><ButtonPrimary OnClick="@(() => FolderProvider.OpenDataFolderPath())">@Resources["Open_Settings_Folder"]</ButtonPrimary></div> | ||
<i>@FolderProvider.GetDataFolderPath()</i> | ||
</Fieldset> | ||
</AppContainer> | ||
|
||
@inject IStringLocalizer<SettingsResources> Resources | ||
@inject IBrowserProvider BrowserProvider | ||
@inject IFolderProvider FolderProvider | ||
|
||
@code | ||
{ | ||
private string? Title { get; set; } = string.Empty; | ||
|
||
protected override void OnInitialized() | ||
{ | ||
Title = AppDomain.CurrentDomain.GetAssemblies().Select(x => x.GetName()).FirstOrDefault(x => x.Name == "Sidekick")?.Version?.ToString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Diagnostics; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Sidekick.Common.Folder; | ||
|
||
public class FolderProvider(ILogger<FolderProvider> logger) : IFolderProvider | ||
{ | ||
public void OpenDataFolderPath() | ||
{ | ||
try | ||
{ | ||
var process = new Process(); | ||
process.StartInfo = new ProcessStartInfo | ||
{ | ||
FileName = SidekickPaths.GetDataFilePath(), | ||
UseShellExecute = true, | ||
Verb = "open" | ||
}; | ||
process.Start(); | ||
} | ||
catch | ||
{ | ||
logger.LogError("[Folder] Failed to open data file path."); | ||
} | ||
} | ||
|
||
public string GetDataFolderPath() | ||
{ | ||
return SidekickPaths.GetDataFilePath(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Sidekick.Common.Folder; | ||
|
||
public interface IFolderProvider | ||
{ | ||
/// <summary> | ||
/// Opens the folder where the data files are stored. | ||
/// | ||
/// <para>Windows: C:\Users\___\AppData\Roaming</para> | ||
/// <para>Linux: /home/___/.config</para> | ||
/// <para>OSX: /Users/___/.config</para> | ||
/// </summary> | ||
void OpenDataFolderPath(); | ||
|
||
/// <summary> | ||
/// Gets the folder path where the data files are stored. | ||
/// </summary> | ||
public string GetDataFolderPath(); | ||
} |
Oops, something went wrong.