Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add re-installation prompt #14804

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Files.App/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ public static class GitHub
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";

// NOTE: This is a temporary constant variable
public const string ReinstallationNoticeDocsUrl = @"https://files.community/docs/install#:~:text=Steps%20required%20for%20the%20\“classic%20installer\”%20version%20after%203/21/2024";
}

public static class DocsPath
Expand Down
18 changes: 18 additions & 0 deletions src/Files.App/Dialogs/ReinstallPromptDialog.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<ContentDialog
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
x:Class="Files.App.Dialogs.ReinstallPromptDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Title="Re-installation is required"
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
PrimaryButtonText="More info"
SecondaryButtonText="OK"
Style="{StaticResource DefaultContentDialogStyle}"
mc:Ignorable="d">

<StackPanel Width="360" Spacing="12">
<TextBlock Text="Starting 3/21/2024, a reinstallation of Files is required in order to continue receiving automatic updates." />
<TextBlock Text="Please see our documentation for additional help and resources regarding this message." />
</StackPanel>
</ContentDialog>
30 changes: 30 additions & 0 deletions src/Files.App/Dialogs/ReinstallPromptDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Windows.System;

namespace Files.App.Dialogs
{
/// <summary>
/// Shows a dialog to notify user the importance of re-install temporarily.
/// </summary>
public sealed partial class ReinstallPromptDialog : ContentDialog
{
public ReinstallPromptDialog()
{
this.InitializeComponent();
}

private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
await Launcher.LaunchUriAsync(new Uri(Constants.GitHub.ReinstallationNoticeDocsUrl));
}
}
}
9 changes: 9 additions & 0 deletions src/Files.App/Files.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<DefineConstants>TRACE;RELEASE;NETFX_CORE;DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>
<ItemGroup>
<None Remove="Dialogs\ReinstallPromptDialog.xaml" />
</ItemGroup>
yaira2 marked this conversation as resolved.
Show resolved Hide resolved

<ItemGroup>
<Manifest Include="app.manifest" />
Expand Down Expand Up @@ -146,4 +149,10 @@
<TrimmerRootAssembly Include="CommunityToolkit.WinUI.UI.Controls.Primitives" />
</ItemGroup>

<ItemGroup>
<Page Update="Dialogs\ReinstallPromptDialog.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>

</Project>
34 changes: 34 additions & 0 deletions src/Files.App/UserControls/AddressToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@
<converters:NullToTrueConverter x:Key="NullToFalseConverter" Inverse="True" />
<converters1:BoolNegationConverter x:Key="BoolNegationConverter" />

<ResourceDictionary.ThemeDictionaries>
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
<ResourceDictionary x:Key="Light">
<LinearGradientBrush x:Key="WarningGradientBrush" StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0" Color="#FFA500" />
<GradientStop Offset="0.5" Color="#FF8C00" />
<GradientStop Offset="1" Color="#FF4500" />
</LinearGradientBrush>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<LinearGradientBrush x:Key="WarningGradientBrush" StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0" Color="#ffd153" />
<GradientStop Offset="0.5" Color="#f9ae41" />
<GradientStop Offset="1" Color="#f69e38" />
</LinearGradientBrush>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<SolidColorBrush x:Key="ButtonBorderBrushDisabled" Color="Transparent" />
Expand Down Expand Up @@ -508,6 +525,23 @@
Glyph="&#xF133;" />
</Button>

<!-- (TEMP) Re-install Prompt (Limited Time Only) -->
<Button
x:Name="ReInstallPromptButton"
Width="36"
Height="32"
Padding="0"
Click="ReInstallPromptButton_Click"
Style="{StaticResource AddressToolbarButtonStyle}">
<Grid>
<Viewbox Width="16">
<Image Source="ms-appx:///Assets/AppTiles/Dev/Logo.ico" />
</Viewbox>
<FontIcon Foreground="{ThemeResource WarningGradientBrush}" Glyph="&#xea82;" />
<FontIcon Foreground="Black" Glyph="&#xea84;" />
</Grid>
</Button>

<!-- Show The Files App Settings Dialog -->
<Button
x:Name="SettingsButton"
Expand Down
9 changes: 9 additions & 0 deletions src/Files.App/UserControls/AddressToolbar.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Dialogs;
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
Expand Down Expand Up @@ -135,5 +136,13 @@ private void OngoingTasksActions_ProgressBannerPosted(object? _, StatusCenterIte
userSettingsService.AppSettingsService.ShowStatusCenterTeachingTip = false;
}
}

private async void ReInstallPromptButton_Click(object sender, RoutedEventArgs e)
{
ReinstallPromptDialog dialog = new();
dialog.XamlRoot = MainWindow.Instance.Content.XamlRoot;

await dialog.ShowAsync();
}
}
}
Loading