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: Renamed Preferences to General #12086

Merged
merged 5 commits into from Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Files.App/App.xaml.cs
Expand Up @@ -187,7 +187,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
services
.AddSingleton<IUserSettingsService, UserSettingsService>()
.AddSingleton<IAppearanceSettingsService, AppearanceSettingsService>((sp) => new AppearanceSettingsService((sp.GetService<IUserSettingsService>() as UserSettingsService).GetSharingContext()))
.AddSingleton<IPreferencesSettingsService, PreferencesSettingsService>((sp) => new PreferencesSettingsService((sp.GetService<IUserSettingsService>() as UserSettingsService).GetSharingContext()))
.AddSingleton<IGeneralSettingsService, GeneralSettingsService>((sp) => new GeneralSettingsService((sp.GetService<IUserSettingsService>() as UserSettingsService).GetSharingContext()))
.AddSingleton<IFoldersSettingsService, FoldersSettingsService>((sp) => new FoldersSettingsService((sp.GetService<IUserSettingsService>() as UserSettingsService).GetSharingContext()))
.AddSingleton<IApplicationSettingsService, ApplicationSettingsService>((sp) => new ApplicationSettingsService((sp.GetService<IUserSettingsService>() as UserSettingsService).GetSharingContext()))
.AddSingleton<IPreviewPaneSettingsService, PreviewPaneSettingsService>((sp) => new PreviewPaneSettingsService((sp.GetService<IUserSettingsService>() as UserSettingsService).GetSharingContext()))
Expand Down
16 changes: 8 additions & 8 deletions src/Files.App/Dialogs/SettingsDialog.xaml
Expand Up @@ -72,22 +72,22 @@
<!-- Menu Items -->
<NavigationView.MenuItems>
<NavigationViewItem
AccessKey="A"
AutomationProperties.AutomationId="SettingsItemAppearance"
Content="{helpers:ResourceString Name=Appearance}"
AccessKey="P"
AutomationProperties.AutomationId="SettingsItemPreferences"
Content="{helpers:ResourceString Name=General}"
IsSelected="True"
Tag="0">
<NavigationViewItem.Icon>
<FontIcon HorizontalAlignment="Left" Glyph="&#xE790;" />
<FontIcon Glyph="&#xE9E9;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem
AccessKey="P"
AutomationProperties.AutomationId="SettingsItemPreferences"
Content="{helpers:ResourceString Name=SettingsNavPreferences/Content}"
AccessKey="A"
AutomationProperties.AutomationId="SettingsItemAppearance"
Content="{helpers:ResourceString Name=Appearance}"
Tag="1">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xE9E9;" />
<FontIcon HorizontalAlignment="Left" Glyph="&#xE790;" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<NavigationViewItem
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Dialogs/SettingsDialog.xaml.cs
Expand Up @@ -45,8 +45,8 @@ private void MainSettingsNavigationView_SelectionChanged(NavigationView sender,

_ = selectedItemTag switch
{
0 => SettingsContentFrame.Navigate(typeof(AppearancePage)),
1 => SettingsContentFrame.Navigate(typeof(PreferencesPage)),
0 => SettingsContentFrame.Navigate(typeof(GeneralPage)),
1 => SettingsContentFrame.Navigate(typeof(AppearancePage)),
2 => SettingsContentFrame.Navigate(typeof(FoldersPage)),
3 => SettingsContentFrame.Navigate(typeof(TagsPage)),
4 => SettingsContentFrame.Navigate(typeof(AdvancedPage)),
Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Helpers/WidgetsHelpers.cs
Expand Up @@ -7,7 +7,7 @@ namespace Files.App.Helpers
{
public static class WidgetsHelpers
{
public static TWidget? TryGetWidget<TWidget>(IPreferencesSettingsService preferencesSettingsService, WidgetsListControlViewModel widgetsViewModel, out bool shouldReload, TWidget? defaultValue = default) where TWidget : IWidgetItemModel, new()
public static TWidget? TryGetWidget<TWidget>(IGeneralSettingsService preferencesSettingsService, WidgetsListControlViewModel widgetsViewModel, out bool shouldReload, TWidget? defaultValue = default) where TWidget : IWidgetItemModel, new()
{
bool canAddWidget = widgetsViewModel.CanAddWidget(typeof(TWidget).Name);
bool isWidgetSettingEnabled = TryGetIsWidgetSettingEnabled<TWidget>(preferencesSettingsService);
Expand Down Expand Up @@ -35,7 +35,7 @@ public static class WidgetsHelpers
return (defaultValue);
}

public static bool TryGetIsWidgetSettingEnabled<TWidget>(IPreferencesSettingsService preferencesSettingsService) where TWidget : IWidgetItemModel
public static bool TryGetIsWidgetSettingEnabled<TWidget>(IGeneralSettingsService preferencesSettingsService) where TWidget : IWidgetItemModel
{
if (typeof(TWidget) == typeof(QuickAccessWidget))
{
Expand Down
Expand Up @@ -7,9 +7,9 @@

namespace Files.App.ServicesImplementation.Settings
{
internal sealed class PreferencesSettingsService : BaseObservableJsonSettings, IPreferencesSettingsService
internal sealed class GeneralSettingsService : BaseObservableJsonSettings, IGeneralSettingsService
{
public PreferencesSettingsService(ISettingsSharingContext settingsSharingContext)
public GeneralSettingsService(ISettingsSharingContext settingsSharingContext)
{
// Register root
RegisterSettingsContext(settingsSharingContext);
Expand Down
Expand Up @@ -12,8 +12,8 @@ namespace Files.App.ServicesImplementation.Settings
{
internal sealed class UserSettingsService : BaseJsonSettings, IUserSettingsService
{
private IPreferencesSettingsService _PreferencesSettingsService;
public IPreferencesSettingsService PreferencesSettingsService
private IGeneralSettingsService _PreferencesSettingsService;
public IGeneralSettingsService PreferencesSettingsService
{
get => GetSettingsService(ref _PreferencesSettingsService);
}
Expand Down
3 changes: 0 additions & 3 deletions src/Files.App/Strings/en-US/Resources.resw
Expand Up @@ -216,9 +216,6 @@
<data name="Advanced" xml:space="preserve">
<value>Advanced</value>
</data>
<data name="SettingsNavPreferences.Content" xml:space="preserve">
<value>Preferences</value>
</data>
<data name="SettingsOnStartupContinueWhereYouLeftOff.Content" xml:space="preserve">
<value>Continue where you left off</value>
</data>
Expand Down
Expand Up @@ -15,7 +15,7 @@ namespace Files.App.ViewModels.Previews
{
public class FolderPreviewViewModel
{
private readonly IPreferencesSettingsService preferencesSettingsService = Ioc.Default.GetService<IPreferencesSettingsService>();
private readonly IGeneralSettingsService preferencesSettingsService = Ioc.Default.GetService<IGeneralSettingsService>();

private static readonly IDateTimeFormatter dateTimeFormatter = Ioc.Default.GetService<IDateTimeFormatter>();

Expand Down
Expand Up @@ -23,7 +23,7 @@

namespace Files.App.ViewModels.Settings
{
public class PreferencesViewModel : ObservableObject, IDisposable
public class GeneralViewModel : ObservableObject, IDisposable
{
private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService<IUserSettingsService>();

Expand Down Expand Up @@ -97,7 +97,7 @@ public int SelectedAppLanguageIndex

public ObservableCollection<AppLanguageItem> AppLanguages { get; set; }

public PreferencesViewModel()
public GeneralViewModel()
{
OpenFilesAtStartupCommand = new AsyncRelayCommand(OpenFilesAtStartup);
ChangePageCommand = new AsyncRelayCommand(ChangePage);
Expand Down Expand Up @@ -590,7 +590,7 @@ public void Dispose()
}
}

~PreferencesViewModel()
~GeneralViewModel()
{
Dispose();
}
Expand Down
@@ -1,5 +1,5 @@
<Page
x:Class="Files.App.Views.Settings.PreferencesPage"
x:Class="Files.App.Views.Settings.GeneralPage"
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"
Expand All @@ -17,7 +17,7 @@
</Page.Resources>

<Page.DataContext>
<vm:PreferencesViewModel x:Name="ViewModel" />
<vm:GeneralViewModel x:Name="ViewModel" />
</Page.DataContext>

<Grid>
Expand Down
Expand Up @@ -2,9 +2,9 @@

namespace Files.App.Views.Settings
{
public sealed partial class PreferencesPage : Page
public sealed partial class GeneralPage : Page
{
public PreferencesPage()
public GeneralPage()
{
InitializeComponent();
}
Expand Down
Expand Up @@ -4,7 +4,7 @@

namespace Files.Backend.Services.Settings
{
public interface IPreferencesSettingsService : IBaseSettingsService, INotifyPropertyChanged
public interface IGeneralSettingsService : IBaseSettingsService, INotifyPropertyChanged
{
/// <summary>
/// Gets or sets a value indicating whether or not to search unindexed items.
Expand Down
Expand Up @@ -11,7 +11,7 @@ public interface IUserSettingsService : IBaseSettingsService

object ExportSettings();

IPreferencesSettingsService PreferencesSettingsService { get; }
IGeneralSettingsService PreferencesSettingsService { get; }
yaira2 marked this conversation as resolved.
Show resolved Hide resolved

IFoldersSettingsService FoldersSettingsService { get; }

Expand Down