diff --git a/src/Files.Uwp/Strings/en-US/Resources.resw b/src/Files.Uwp/Strings/en-US/Resources.resw index b07d60aee60a..38f94ffde38f 100644 --- a/src/Files.Uwp/Strings/en-US/Resources.resw +++ b/src/Files.Uwp/Strings/en-US/Resources.resw @@ -2795,8 +2795,8 @@ We use App Center to track which settings are being used, find bugs, and fix cra Set as default - - Default Folder preferences + + Folder preferences Display Date column @@ -2813,6 +2813,15 @@ We use App Center to track which settings are being used, find bugs, and fix cra Display Type column + + Reset + + + This action will reset all directories back to your default preferences. + + + Are you sure? + Lockscreen diff --git a/src/Files.Uwp/ViewModels/SettingsViewModels/PreferencesViewModel.cs b/src/Files.Uwp/ViewModels/SettingsViewModels/PreferencesViewModel.cs index 5cfc51717cca..e80d46930c39 100644 --- a/src/Files.Uwp/ViewModels/SettingsViewModels/PreferencesViewModel.cs +++ b/src/Files.Uwp/ViewModels/SettingsViewModels/PreferencesViewModel.cs @@ -23,6 +23,7 @@ using Windows.Storage.AccessCache; using Windows.Storage.Pickers; using Windows.System; +using Windows.UI.Xaml.Controls; using static Files.Uwp.Helpers.MenuFlyoutHelper; namespace Files.Uwp.ViewModels.SettingsViewModels @@ -46,11 +47,16 @@ public class PreferencesViewModel : ObservableObject, IDisposable public ICommand OpenFilesAtStartupCommand { get; } + public ICommand ResetLayoutPreferencesCommand { get; } + public ICommand ShowResetLayoutPreferencesTipCommand { get; } + public PreferencesViewModel() { ChangePageCommand = new AsyncRelayCommand(ChangePage); RemovePageCommand = new RelayCommand(RemovePage); AddPageCommand = new RelayCommand(async (path) => await AddPage(path)); + ResetLayoutPreferencesCommand = new RelayCommand(ResetLayoutPreferences); + ShowResetLayoutPreferencesTipCommand = new RelayCommand(() => IsResetLayoutPreferencesTipOpen = true); DefaultLanguages = App.AppSettings.DefaultLanguages; Terminals = App.TerminalController.Model.Terminals; @@ -716,6 +722,27 @@ public bool ShowDateColumn } } + private bool isLayoutResetCheckmarkVisible; + public bool IsLayoutResetCheckmarkVisible + { + get => isLayoutResetCheckmarkVisible; + set => SetProperty(ref isLayoutResetCheckmarkVisible, value); + } + + private bool isResetLayoutPreferencesTipOpen; + public bool IsResetLayoutPreferencesTipOpen + { + get => isResetLayoutPreferencesTipOpen; + set => SetProperty(ref isResetLayoutPreferencesTipOpen, value); + } + + public void ResetLayoutPreferences() + { + FolderSettingsViewModel.DbInstance.ResetAll(); + IsResetLayoutPreferencesTipOpen = false; + IsLayoutResetCheckmarkVisible = true; + } + public void Dispose() { if (!disposed) diff --git a/src/Files.Uwp/Views/SettingsPages/Preferences.xaml b/src/Files.Uwp/Views/SettingsPages/Preferences.xaml index aef21174a6f3..542336249205 100644 --- a/src/Files.Uwp/Views/SettingsPages/Preferences.xaml +++ b/src/Files.Uwp/Views/SettingsPages/Preferences.xaml @@ -1,455 +1,481 @@  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + x:Class="Files.Uwp.SettingsPages.Preferences" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:UserControls="using:Files.Uwp.UserControls" + xmlns:contract13NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,13)" + xmlns:contract13Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,13)" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:datamodels="using:Files.Uwp.DataModels" + xmlns:helpers="using:Files.Uwp.Helpers" + xmlns:i="using:Microsoft.Xaml.Interactivity" + xmlns:icore="using:Microsoft.Xaml.Interactions.Core" + xmlns:local="using:Files.Uwp.UserControls.Settings" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:settingsviewmodels="using:Files.Uwp.ViewModels.SettingsViewModels" + mc:Ignorable="d"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +