Skip to content

Commit bb85677

Browse files
authored
Feature: Add re-installation prompt (#14804)
1 parent 4d87fad commit bb85677

File tree

6 files changed

+99
-0
lines changed

6 files changed

+99
-0
lines changed

src/Files.App/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ public static class GitHub
236236
public const string BugReportUrl = @"https://github.com/files-community/Files/issues/new?labels=bug&template=bug_report.yml";
237237
public const string PrivacyPolicyUrl = @"https://github.com/files-community/Files/blob/main/.github/PRIVACY.md";
238238
public const string SupportUsUrl = @"https://github.com/sponsors/yaira2";
239+
public const string ReinstallationNoticeDocsUrl = @"https://files.community/docs/install#:~:text=Steps%20required%20for%20the%20%E2%80%9Cclassic%20installer%E2%80%9D%20version%20after%203/21/2024";
239240
}
240241

241242
public static class DocsPath
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!-- Copyright (c) 2023 Files Community. Licensed under the MIT License. See the LICENSE. -->
2+
<ContentDialog
3+
x:Class="Files.App.Dialogs.ReinstallPromptDialog"
4+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
5+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
Title="Re-installation is required"
9+
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
10+
PrimaryButtonStyle="{StaticResource AccentButtonStyle}"
11+
PrimaryButtonText="More info"
12+
SecondaryButtonText="OK"
13+
Style="{StaticResource DefaultContentDialogStyle}"
14+
mc:Ignorable="d">
15+
16+
<StackPanel Width="360" Spacing="12">
17+
<TextBlock Text="Starting 3/21/2024, a reinstallation of Files is required in order to continue receiving automatic updates." />
18+
<TextBlock Text="Please see our documentation for additional help and resources regarding this message." />
19+
</StackPanel>
20+
</ContentDialog>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) 2023 Files Community
2+
// Licensed under the MIT License. See the LICENSE.
3+
4+
using Microsoft.UI.Xaml.Controls;
5+
using Windows.System;
6+
7+
namespace Files.App.Dialogs
8+
{
9+
/// <summary>
10+
/// Displays a dialog temporarily informing the user of the importance of reinstalling the app.
11+
/// </summary>
12+
public sealed partial class ReinstallPromptDialog : ContentDialog
13+
{
14+
public ReinstallPromptDialog()
15+
{
16+
this.InitializeComponent();
17+
}
18+
19+
private async void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
20+
{
21+
await Launcher.LaunchUriAsync(new Uri(Constants.GitHub.ReinstallationNoticeDocsUrl));
22+
}
23+
}
24+
}

src/Files.App/UserControls/AddressToolbar.xaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@
2727
<converters:NullToTrueConverter x:Key="NullToFalseConverter" Inverse="True" />
2828
<converters1:BoolNegationConverter x:Key="BoolNegationConverter" />
2929

30+
<ResourceDictionary.ThemeDictionaries>
31+
<ResourceDictionary x:Key="Light">
32+
<LinearGradientBrush x:Key="WarningGradientBrush" StartPoint="0,0" EndPoint="1,1">
33+
<GradientStop Offset="0" Color="#FFA500" />
34+
<GradientStop Offset="0.5" Color="#FF8C00" />
35+
<GradientStop Offset="1" Color="#FF4500" />
36+
</LinearGradientBrush>
37+
</ResourceDictionary>
38+
<ResourceDictionary x:Key="Dark">
39+
<LinearGradientBrush x:Key="WarningGradientBrush" StartPoint="0,0" EndPoint="1,1">
40+
<GradientStop Offset="0" Color="#ffd153" />
41+
<GradientStop Offset="0.5" Color="#f9ae41" />
42+
<GradientStop Offset="1" Color="#f69e38" />
43+
</LinearGradientBrush>
44+
</ResourceDictionary>
45+
</ResourceDictionary.ThemeDictionaries>
46+
3047
<ResourceDictionary.MergedDictionaries>
3148
<ResourceDictionary>
3249
<SolidColorBrush x:Key="ButtonBorderBrushDisabled" Color="Transparent" />
@@ -508,6 +525,24 @@
508525
Glyph="&#xF133;" />
509526
</Button>
510527

528+
<!-- (TEMP) Re-install Prompt (Limited Time Only) -->
529+
<Button
530+
x:Name="ReInstallPromptButton"
531+
Width="36"
532+
Height="32"
533+
Padding="0"
534+
x:Load="{x:Bind ViewModel.ShowReinstallationPrompt, Mode=OneWay}"
535+
Click="ReInstallPromptButton_Click"
536+
Style="{StaticResource AddressToolbarButtonStyle}">
537+
<Grid>
538+
<Viewbox Width="16">
539+
<Image Source="ms-appx:///Assets/AppTiles/Dev/Logo.ico" />
540+
</Viewbox>
541+
<FontIcon Foreground="{ThemeResource WarningGradientBrush}" Glyph="&#xea82;" />
542+
<FontIcon Foreground="Black" Glyph="&#xea84;" />
543+
</Grid>
544+
</Button>
545+
511546
<!-- Show The Files App Settings Dialog -->
512547
<Button
513548
x:Name="SettingsButton"

src/Files.App/UserControls/AddressToolbar.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) 2023 Files Community
22
// Licensed under the MIT License. See the LICENSE.
33

4+
using Files.App.Dialogs;
45
using Microsoft.UI.Input;
56
using Microsoft.UI.Xaml;
67
using Microsoft.UI.Xaml.Controls;
@@ -135,5 +136,13 @@ private void OngoingTasksActions_ProgressBannerPosted(object? _, StatusCenterIte
135136
userSettingsService.AppSettingsService.ShowStatusCenterTeachingTip = false;
136137
}
137138
}
139+
140+
private async void ReInstallPromptButton_Click(object sender, RoutedEventArgs e)
141+
{
142+
ReinstallPromptDialog dialog = new();
143+
dialog.XamlRoot = MainWindow.Instance.Content.XamlRoot;
144+
145+
await dialog.ShowAsync();
146+
}
138147
}
139148
}

src/Files.App/ViewModels/UserControls/ToolbarViewModel.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ public Style LayoutOpacityIcon
201201

202202
private PointerRoutedEventArgs? pointerRoutedEventArgs;
203203

204+
private bool _ShowReinstallationPrompt;
205+
public bool ShowReinstallationPrompt
206+
{
207+
get => _ShowReinstallationPrompt;
208+
set => SetProperty(ref _ShowReinstallationPrompt, value);
209+
}
210+
204211
public ToolbarViewModel()
205212
{
206213
RefreshClickCommand = new RelayCommand<RoutedEventArgs>(e => RefreshRequested?.Invoke(this, EventArgs.Empty));
@@ -212,6 +219,9 @@ public ToolbarViewModel()
212219
SearchBox.Escaped += SearchRegion_Escaped;
213220
UserSettingsService.OnSettingChangedEvent += UserSettingsService_OnSettingChangedEvent;
214221
UpdateService.PropertyChanged += UpdateService_OnPropertyChanged;
222+
223+
if (DateTime.Today >= new DateTime(2024, 3, 21))
224+
ShowReinstallationPrompt = true;
215225
}
216226

217227
private async void UpdateService_OnPropertyChanged(object? sender, PropertyChangedEventArgs e)

0 commit comments

Comments
 (0)