Skip to content

Commit

Permalink
Feature: Added Discord link to About page (#14821)
Browse files Browse the repository at this point in the history
  • Loading branch information
hishitetsu authored Feb 23, 2024
1 parent 3a3a718 commit 8600d3d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Files.App/Actions/Global/OpenHelpAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public HotKey HotKey

public Task ExecuteAsync()
{
var url = new Uri(Constants.GitHub.DocumentationUrl);
var url = new Uri(Constants.ExternalUrl.DocumentationUrl);
return Launcher.LaunchUriAsync(url).AsTask();
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/Files.App/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,16 @@ public static class Filesystem
public const string CachedEmptyItemName = "fileicon_cache";
}

public static class GitHub
public static class ExternalUrl
{
public const string GitHubRepoUrl = @"https://github.com/files-community/Files";
public const string DocumentationUrl = @"https://files.community/docs";
public const string DiscordUrl = @"https://discord.gg/files";
public const string FeatureRequestUrl = @"https://github.com/files-community/Files/issues/new?labels=feature+request&template=feature_request.yml";
public const string BugReportUrl = @"https://github.com/files-community/Files/issues/new?labels=bug&template=bug_report.yml";
public const string PrivacyPolicyUrl = @"https://github.com/files-community/Files/blob/main/.github/PRIVACY.md";
public const string SupportUsUrl = @"https://github.com/sponsors/yaira2";
public const string CrowdinUrl = @"https://crowdin.com/project/files-app";
}

public static class DocsPath
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Helpers/Application/AppLifecycleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public static void HandleAppUnhandledException(Exception? ex, bool showToastNoti
{
Buttons =
{
new ToastButton("ExceptionNotificationReportButton".GetLocalizedResource(), Constants.GitHub.BugReportUrl)
new ToastButton("ExceptionNotificationReportButton".GetLocalizedResource(), Constants.ExternalUrl.BugReportUrl)
{
ActivationType = ToastActivationType.Protocol
}
Expand Down
3 changes: 3 additions & 0 deletions src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -3667,4 +3667,7 @@
<data name="BackgroundRunningNotificationHeader" xml:space="preserve">
<value>Where did Files go?</value>
</data>
<data name="QuestionsAndDiscussions" xml:space="preserve">
<value>Questions &amp; discussions</value>
</data>
</root>
2 changes: 1 addition & 1 deletion src/Files.App/Utils/Taskbar/SystemTrayIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private void OnLeftClicked()

private void OnDocumentationClicked()
{
Launcher.LaunchUriAsync(new Uri(Constants.GitHub.DocumentationUrl)).AsTask();
Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.DocumentationUrl)).AsTask();
}

private void OnRestartClicked()
Expand Down
21 changes: 14 additions & 7 deletions src/Files.App/ViewModels/Settings/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class AboutViewModel : ObservableObject
public ICommand SupportUsCommand { get; }
public ICommand OpenLogLocationCommand { get; }
public ICommand OpenDocumentationCommand { get; }
public ICommand OpenDiscordCommand { get; }
public ICommand SubmitFeatureRequestCommand { get; }
public ICommand SubmitBugReportCommand { get; }
public ICommand OpenGitHubRepoCommand { get; }
Expand All @@ -38,6 +39,7 @@ public AboutViewModel()
CopyWindowsVersionCommand = new RelayCommand(CopyWindowsVersion);
SupportUsCommand = new AsyncRelayCommand(SupportUs);
OpenDocumentationCommand = new AsyncRelayCommand(DoOpenDocumentation);
OpenDiscordCommand = new AsyncRelayCommand(DoOpenDiscord);
SubmitFeatureRequestCommand = new AsyncRelayCommand(DoSubmitFeatureRequest);
SubmitBugReportCommand = new AsyncRelayCommand(DoSubmitBugReport);
OpenGitHubRepoCommand = new AsyncRelayCommand(DoOpenGitHubRepo);
Expand All @@ -53,33 +55,38 @@ private Task OpenLogLocation()

public Task DoOpenDocumentation()
{
return Launcher.LaunchUriAsync(new Uri(Constants.GitHub.DocumentationUrl)).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.DocumentationUrl)).AsTask();
}

public Task DoOpenDiscord()
{
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.DiscordUrl)).AsTask();
}

public Task DoSubmitFeatureRequest()
{
return Launcher.LaunchUriAsync(new Uri($"{Constants.GitHub.FeatureRequestUrl}&{GetVersionsQueryString()}")).AsTask();
return Launcher.LaunchUriAsync(new Uri($"{Constants.ExternalUrl.FeatureRequestUrl}&{GetVersionsQueryString()}")).AsTask();
}

public Task DoSubmitBugReport()
{
return Launcher.LaunchUriAsync(new Uri($"{Constants.GitHub.BugReportUrl}&{GetVersionsQueryString()}")).AsTask();
return Launcher.LaunchUriAsync(new Uri($"{Constants.ExternalUrl.BugReportUrl}&{GetVersionsQueryString()}")).AsTask();
}

public Task DoOpenGitHubRepo()
{
return Launcher.LaunchUriAsync(new Uri(Constants.GitHub.GitHubRepoUrl)).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.GitHubRepoUrl)).AsTask();
}

public Task DoOpenPrivacyPolicy()
{
return Launcher.LaunchUriAsync(new Uri(Constants.GitHub.PrivacyPolicyUrl)).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.PrivacyPolicyUrl)).AsTask();
}


public Task DoOpenCrowdin()
{
return Launcher.LaunchUriAsync(new Uri("https://crowdin.com/project/files-app")).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.CrowdinUrl)).AsTask();
}

public void CopyAppVersion()
Expand All @@ -106,7 +113,7 @@ public void CopyWindowsVersion()

public Task SupportUs()
{
return Launcher.LaunchUriAsync(new Uri(Constants.GitHub.SupportUsUrl)).AsTask();
return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
}

public async Task LoadThirdPartyNoticesAsync()
Expand Down
16 changes: 16 additions & 0 deletions src/Files.App/Views/Settings/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@
Glyph="&#xE8A7;" />
</local:SettingsBlockControl>

<!-- Questions & discussions -->
<local:SettingsBlockControl
Title="{helpers:ResourceString Name=QuestionsAndDiscussions}"
HorizontalAlignment="Stretch"
ButtonCommand="{x:Bind ViewModel.OpenDiscordCommand}"
IsClickable="True">
<local:SettingsBlockControl.Icon>
<FontIcon Glyph="&#xE8F2;" />
</local:SettingsBlockControl.Icon>

<FontIcon
FontSize="14"
Foreground="{ThemeResource TextFillColorPrimaryBrush}"
Glyph="&#xE8A7;" />
</local:SettingsBlockControl>

<!-- Feedback -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=Feedback}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
Expand Down

0 comments on commit 8600d3d

Please sign in to comment.