diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp index 327495d9d9..5ace5a5ffc 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.cpp @@ -811,32 +811,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation DeleteProfileRequested.raise(*this, *deleteProfileArgs); } - void ProfileViewModel::ResetSettings() - { - // Clear every projected profile setting. Each Clear##name() notifies the bound - // properties and cascades to derived previews via our PropertyChanged handler. -#define PROFILE_VIEW_MODEL_CLEAR_SETTING(target, name) Clear##name(); - PROFILE_VIEW_MODEL_PROJECTED_SETTINGS(PROFILE_VIEW_MODEL_CLEAR_SETTING) -#undef PROFILE_VIEW_MODEL_CLEAR_SETTING - _lastStartingDirectoryPath.clear(); - - // Not exposed to SUI - _profile.ClearEnvironmentVariables(); - _profile.ClearAllowKeypadMode(); - - // Clear complex child objects - _profile.DefaultAppearance().ClearAllSettings(); - _profile.FontInfo().ClearAllSettings(); - - if (HasUnfocusedAppearance()) - { - DeleteUnfocusedAppearance(); - } - - _RefreshDefaultAppearanceViewModel(); - _NotifyChanges(L"DefaultAppearance", L"TabThemeColorPreview", L"TabColorPreview"); - } - void ProfileViewModel::SetupAppearances(Windows::Foundation::Collections::IObservableVector schemesList) { DefaultAppearance().SchemesList(schemesList); diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h index 9c4b3c08be..5ac434c46d 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h @@ -39,7 +39,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void DeleteProfile(); void SetupAppearances(Windows::Foundation::Collections::IObservableVector schemesList); - void ResetSettings(); // bell style bits hstring BellStylePreview() const; @@ -114,50 +113,41 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation PERMANENT_OBSERVABLE_PROJECTED_SETTING(_profile, Guid); PERMANENT_OBSERVABLE_PROJECTED_SETTING(_profile, ConnectionType); - -// The clearable settings this view model projects from the underlying profile model. -// This is the single source of truth for both the declarations below and the -// ClearX() calls in ResetSettings() -#define PROFILE_VIEW_MODEL_PROJECTED_SETTINGS(X) \ - X(_profile, Name) \ - X(_profile, Source) \ - X(_profile, Hidden) \ - X(_profile, Icon) \ - X(_profile, CloseOnExit) \ - X(_profile, TabTitle) \ - X(_profile, TabColor) \ - X(_profile, SuppressApplicationTitle) \ - X(_profile, ScrollState) \ - X(_profile, Padding) \ - X(_profile, Commandline) \ - X(_profile, StartingDirectory) \ - X(_profile, AntialiasingMode) \ - X(_profile.DefaultAppearance(), Opacity) \ - X(_profile.DefaultAppearance(), UseAcrylic) \ - X(_profile, HistorySize) \ - X(_profile, SnapOnInput) \ - X(_profile, AltGrAliasing) \ - X(_profile, BellStyle) \ - X(_profile, BellSound) \ - X(_profile, Elevate) \ - X(_profile, ReloadEnvironmentVariables) \ - X(_profile, RightClickContextMenu) \ - X(_profile, ShowMarks) \ - X(_profile, AutoMarkPrompts) \ - X(_profile, RepositionCursorWithMouse) \ - X(_profile, ForceVTInput) \ - X(_profile, AllowKittyKeyboardMode) \ - X(_profile, AllowVtChecksumReport) \ - X(_profile, AllowVtClipboardWrite) \ - X(_profile, AllowOscNotifications) \ - X(_profile, AnswerbackMessage) \ - X(_profile, RainbowSuggestions) \ - X(_profile, PathTranslationStyle) \ - X(_profile, DragDropDelimiter) - -#define PROFILE_VIEW_MODEL_DECLARE_SETTING(target, name) OBSERVABLE_PROJECTED_SETTING(target, name); - PROFILE_VIEW_MODEL_PROJECTED_SETTINGS(PROFILE_VIEW_MODEL_DECLARE_SETTING) -#undef PROFILE_VIEW_MODEL_DECLARE_SETTING + OBSERVABLE_PROJECTED_SETTING(_profile, Name); + OBSERVABLE_PROJECTED_SETTING(_profile, Source); + OBSERVABLE_PROJECTED_SETTING(_profile, Hidden); + OBSERVABLE_PROJECTED_SETTING(_profile, Icon); + OBSERVABLE_PROJECTED_SETTING(_profile, CloseOnExit); + OBSERVABLE_PROJECTED_SETTING(_profile, TabTitle); + OBSERVABLE_PROJECTED_SETTING(_profile, TabColor); + OBSERVABLE_PROJECTED_SETTING(_profile, SuppressApplicationTitle); + OBSERVABLE_PROJECTED_SETTING(_profile, ScrollState); + OBSERVABLE_PROJECTED_SETTING(_profile, Padding); + OBSERVABLE_PROJECTED_SETTING(_profile, Commandline); + OBSERVABLE_PROJECTED_SETTING(_profile, StartingDirectory); + OBSERVABLE_PROJECTED_SETTING(_profile, AntialiasingMode); + OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), Opacity); + OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), UseAcrylic); + OBSERVABLE_PROJECTED_SETTING(_profile, HistorySize); + OBSERVABLE_PROJECTED_SETTING(_profile, SnapOnInput); + OBSERVABLE_PROJECTED_SETTING(_profile, AltGrAliasing); + OBSERVABLE_PROJECTED_SETTING(_profile, BellStyle); + OBSERVABLE_PROJECTED_SETTING(_profile, BellSound); + OBSERVABLE_PROJECTED_SETTING(_profile, Elevate); + OBSERVABLE_PROJECTED_SETTING(_profile, ReloadEnvironmentVariables); + OBSERVABLE_PROJECTED_SETTING(_profile, RightClickContextMenu); + OBSERVABLE_PROJECTED_SETTING(_profile, ShowMarks); + OBSERVABLE_PROJECTED_SETTING(_profile, AutoMarkPrompts); + OBSERVABLE_PROJECTED_SETTING(_profile, RepositionCursorWithMouse); + OBSERVABLE_PROJECTED_SETTING(_profile, ForceVTInput); + OBSERVABLE_PROJECTED_SETTING(_profile, AllowKittyKeyboardMode); + OBSERVABLE_PROJECTED_SETTING(_profile, AllowVtChecksumReport); + OBSERVABLE_PROJECTED_SETTING(_profile, AllowVtClipboardWrite); + OBSERVABLE_PROJECTED_SETTING(_profile, AllowOscNotifications); + OBSERVABLE_PROJECTED_SETTING(_profile, AnswerbackMessage); + OBSERVABLE_PROJECTED_SETTING(_profile, RainbowSuggestions); + OBSERVABLE_PROJECTED_SETTING(_profile, PathTranslationStyle); + OBSERVABLE_PROJECTED_SETTING(_profile, DragDropDelimiter); WINRT_PROPERTY(bool, IsBaseLayer, false); WINRT_PROPERTY(bool, FocusDeleteButton, false); diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl index 2bb15241dd..2d3c5c5d7b 100644 --- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl +++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.idl @@ -41,7 +41,6 @@ namespace Microsoft.Terminal.Settings.Editor event Windows.Foundation.TypedEventHandler DeleteProfileRequested; void SetupAppearances(Windows.Foundation.Collections.IObservableVector schemesList); - void ResetSettings(); void SetAcrylicOpacityPercentageValue(Double value); diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp b/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp index 514c2f1255..e74ff90ba5 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Base.cpp @@ -87,11 +87,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation _Profile.CurrentPage(ProfileSubPage::Advanced); } - void Profiles_Base::ResetProfileConfirmation_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/) - { - Profile().ResetSettings(); - } - void Profiles_Base::DeleteConfirmation_Click(const IInspectable& /*sender*/, const RoutedEventArgs& /*e*/) { TraceLoggingWrite( diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Base.h b/src/cascadia/TerminalSettingsEditor/Profiles_Base.h index 8b8594c6b9..2fa4ab7225 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Base.h +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Base.h @@ -22,7 +22,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation void Appearance_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); void Terminal_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); void Advanced_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); - void ResetProfileConfirmation_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); void DeleteConfirmation_Click(const Windows::Foundation::IInspectable& sender, const Windows::UI::Xaml::RoutedEventArgs& e); til::property_changed_event PropertyChanged; diff --git a/src/cascadia/TerminalSettingsEditor/Profiles_Base.xaml b/src/cascadia/TerminalSettingsEditor/Profiles_Base.xaml index aef8175165..b035df6dd5 100644 --- a/src/cascadia/TerminalSettingsEditor/Profiles_Base.xaml +++ b/src/cascadia/TerminalSettingsEditor/Profiles_Base.xaml @@ -151,25 +151,6 @@ Style="{StaticResource ToggleSwitchInExpanderStyle}" /> - - - - - Are you sure you want to delete this profile? A confirmation message displayed when the user intends to delete a profile. - - Reset this profile to default settings - Header for a settings card that resets the profile to inherited defaults. - - - Clears all customizations and restores inherited defaults from the Defaults profile - Description for the reset profile settings card. - - - Reset - Button label to reset a profile's settings. - - - Are you sure you want to reset all settings for this profile? This cannot be undone. - A confirmation message displayed when the user intends to reset a profile. - - - Reset profile - Button label for positive confirmation of resetting a profile. - Delete this profile Header for a settings card that deletes the profile.