Skip to content

Commit 7ed1de6

Browse files
authored
Improved settings model code regions (#2825)
1 parent 4f603f3 commit 7ed1de6

File tree

1 file changed

+55
-40
lines changed

1 file changed

+55
-40
lines changed

Files/ViewModels/SettingsViewModel.cs

Lines changed: 55 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public async void DetectQuickLook()
101101
catch (Exception ex)
102102
{
103103
NLog.LogManager.GetCurrentClassLogger().Warn(ex, ex.Message);
104-
}
104+
}
105105
}
106106

107107
private void DetectRecycleBinPreference()
@@ -229,23 +229,7 @@ public TimeStyle DisplayedTimeStyle
229229
}
230230
}
231231

232-
public string OneDriveCommercialPath { get; set; } = Environment.GetEnvironmentVariable("OneDriveCommercial");
233-
public string OneDrivePath { get; set; } = Environment.GetEnvironmentVariable("OneDriveConsumer");
234-
235-
public bool ShowFileOwner
236-
{
237-
get => Get(false);
238-
set => Set(value);
239-
}
240-
241-
/// <summary>
242-
/// Gets or sets a value indicating whether or not to cache files and folders.
243-
/// </summary>
244-
public bool UseFileListCache
245-
{
246-
get => Get(false);
247-
set => Set(value);
248-
}
232+
#region DetailsView Column Settings
249233

250234
/// <summary>
251235
/// Gets or sets a value indicating whether or not the date column should be visible.
@@ -274,10 +258,12 @@ public bool ShowSizeColumn
274258
set => Set(value);
275259
}
276260

277-
#region CommonPaths
261+
#endregion
278262

279-
// Any distinguishable path here is fine
263+
#region CommonPaths
280264

265+
public string OneDriveCommercialPath { get; set; } = Environment.GetEnvironmentVariable("OneDriveCommercial");
266+
public string OneDrivePath { get; set; } = Environment.GetEnvironmentVariable("OneDriveConsumer");
281267
public string DesktopPath { get; set; } = UserDataPaths.GetDefault().Desktop;
282268
public string DocumentsPath { get; set; } = UserDataPaths.GetDefault().Documents;
283269
public string DownloadsPath { get; set; } = UserDataPaths.GetDefault().Downloads;
@@ -601,30 +587,30 @@ public bool ShowOpenInNewTabMenuItem
601587

602588
#endregion Appearance
603589

590+
#region Experimental
591+
604592
/// <summary>
605-
/// Gets or sets a value indicating whether or not WSL is supported.
593+
/// Gets or sets a value indicating whether or not to show the item owner in the properties window.
606594
/// </summary>
607-
public bool AreLinuxFilesSupported
595+
public bool ShowFileOwner
608596
{
609597
get => Get(false);
610598
set => Set(value);
611599
}
612600

613-
public bool OpenNewTabPageOnStartup
614-
{
615-
get => Get(true);
616-
set => Set(value);
617-
}
618-
619601
/// <summary>
620-
/// Gets or sets a value indicating whether or not to show a teaching tip informing the user about the status center.
602+
/// Gets or sets a value indicating whether or not to cache files and folders.
621603
/// </summary>
622-
public bool ShowStatusCenterTeachingTip
604+
public bool UseFileListCache
623605
{
624606
get => Get(true);
625607
set => Set(value);
626608
}
627609

610+
#endregion Experimental
611+
612+
#region Startup
613+
628614
/// <summary>
629615
/// Gets or sets a value indicating whether or not to navigate to a specific location when launching the app.
630616
/// </summary>
@@ -635,29 +621,29 @@ public bool OpenASpecificPageOnStartup
635621
}
636622

637623
/// <summary>
638-
/// Gets or sets a value indicating whether or not continue the last session whenever the app is launched.
624+
/// Gets or sets a value indicating the default startup location.
639625
/// </summary>
640-
public bool ContinueLastSessionOnStartUp
626+
public string OpenASpecificPageOnStartupPath
641627
{
642-
get => Get(false);
628+
get => Get("");
643629
set => Set(value);
644630
}
645631

646632
/// <summary>
647-
/// Gets or sets a value indicating whether or not to restore tabs after restarting the app.
633+
/// Gets or sets a value indicating whether or not continue the last session whenever the app is launched.
648634
/// </summary>
649-
public bool ResumeAfterRestart
635+
public bool ContinueLastSessionOnStartUp
650636
{
651637
get => Get(false);
652638
set => Set(value);
653639
}
654640

655641
/// <summary>
656-
/// Gets or sets a value indicating the default startup location.
642+
/// Gets or sets a value indicating whether or not to open a page when the app is launched.
657643
/// </summary>
658-
public string OpenASpecificPageOnStartupPath
644+
public bool OpenNewTabPageOnStartup
659645
{
660-
get => Get("");
646+
get => Get(true);
661647
set => Set(value);
662648
}
663649

@@ -669,7 +655,7 @@ public bool AlwaysOpenANewInstance
669655
get => Get(false);
670656
set => Set(value);
671657
}
672-
658+
673659
public string[] PagesOnStartupList
674660
{
675661
get => Get<string[]>(null);
@@ -682,6 +668,35 @@ public string[] LastSessionPages
682668
set => Set(value);
683669
}
684670

671+
#endregion Startup
672+
673+
/// <summary>
674+
/// Gets or sets a value indicating whether or not WSL is supported.
675+
/// </summary>
676+
public bool AreLinuxFilesSupported
677+
{
678+
get => Get(false);
679+
set => Set(value);
680+
}
681+
682+
/// <summary>
683+
/// Gets or sets a value indicating whether or not to show a teaching tip informing the user about the status center.
684+
/// </summary>
685+
public bool ShowStatusCenterTeachingTip
686+
{
687+
get => Get(true);
688+
set => Set(value);
689+
}
690+
691+
/// <summary>
692+
/// Gets or sets a value indicating whether or not to restore tabs after restarting the app.
693+
/// </summary>
694+
public bool ResumeAfterRestart
695+
{
696+
get => Get(false);
697+
set => Set(value);
698+
}
699+
685700
public event EventHandler ThemeModeChanged;
686701

687702
public RelayCommand UpdateThemeElements => new RelayCommand(() =>
@@ -801,4 +816,4 @@ public void Dispose()
801816
DrivesManager?.Dispose();
802817
}
803818
}
804-
}
819+
}

0 commit comments

Comments
 (0)