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

Introduce setting override tracking and update SettingContainer #9079

Merged
22 commits merged into from Feb 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
dd764a8
TSM: add getter for source object
carlos-zamora Feb 8, 2021
4c2f59a
TSM: implement tagging mechanism for profiles
carlos-zamora Feb 8, 2021
309746b
fix TSM
carlos-zamora Feb 9, 2021
576a3f0
TSE: implement message generation
carlos-zamora Feb 9, 2021
64c776e
working prototype
carlos-zamora Feb 9, 2021
ac9b549
polish; ready for review
carlos-zamora Feb 9, 2021
4f3ca9a
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 9, 2021
a99afb6
fix build; update TerminalSettings
carlos-zamora Feb 9, 2021
1ba476e
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 9, 2021
08e1050
code format
carlos-zamora Feb 9, 2021
40d8742
redesign: remove text; update reset btn
carlos-zamora Feb 16, 2021
f8c4081
PROJECTED_SETTING --> INHERITABLE_SETTING
carlos-zamora Feb 17, 2021
500c38e
polish more now that we don't need hyperlinks
carlos-zamora Feb 17, 2021
73e708d
address PR feedback
carlos-zamora Feb 19, 2021
5e02669
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 19, 2021
db21da6
tag proto-extension profiles as generated
carlos-zamora Feb 19, 2021
f49cdbf
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 19, 2021
7e094c6
include the reset button when we're overriding proto-extension
carlos-zamora Feb 19, 2021
9edceb2
introduce fragment origin tag
carlos-zamora Feb 19, 2021
f1cd288
Prefer {} construction
carlos-zamora Feb 19, 2021
f1a8b35
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 19, 2021
f396b16
Merge branch 'main' into dev/cazamor/sui/inheritance-hyperlinks
carlos-zamora Feb 19, 2021
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
Expand Up @@ -830,7 +830,7 @@
<data name="ColorScheme_SystemColorsHeader.Text" xml:space="preserve">
<value>System colors</value>
</data>
<data name="SettingContainer_OverrideMessageProtoExtension" xml:space="preserve">
<data name="SettingContainer_OverrideMessageFragmentExtension" xml:space="preserve">
<value>Reset to value from: {}</value>
<comment>{} is replaced by the name of another profile or generator.</comment>
</data>
Expand Down
21 changes: 7 additions & 14 deletions src/cascadia/TerminalSettingsEditor/SettingContainer.cpp
Expand Up @@ -5,7 +5,6 @@
#include "SettingContainer.h"
#include "SettingContainer.g.cpp"
#include "LibraryResources.h"
#include "../TerminalSettingsModel/LegacyProfileGeneratorNamespaces.h"

using namespace winrt::Windows::UI::Xaml;

Expand Down Expand Up @@ -189,19 +188,13 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
}
else if (originTag == Model::OriginTag::Generated)
{
const auto profileSource{ profile.Source() };
if (profileSource == WslGeneratorNamespace ||
profileSource == AzureGeneratorNamespace ||
profileSource == PowershellCoreGeneratorNamespace)
{
// from a dynamic profile generator
return {};
}
else
{
// proto-extensions
return hstring{ fmt::format(std::wstring_view(RS_(L"SettingContainer_OverrideMessageProtoExtension")), profileSource) };
}
// from a dynamic profile generator
return {};
}
else if (originTag == Model::OriginTag::Fragment)
{
// from a fragment extension
return hstring{ fmt::format(std::wstring_view(RS_(L"SettingContainer_OverrideMessageFragmentExtension")), profile.Source()) };
carlos-zamora marked this conversation as resolved.
Show resolved Hide resolved
}
else
{
Expand Down
Expand Up @@ -597,7 +597,7 @@ void CascadiaSettings::_ParseAndLayerFragmentFiles(const std::unordered_set<std:
// (we add a new inheritance layer)
auto childImpl{ matchingProfile->CreateChild() };
childImpl->LayerJson(profileStub);
childImpl->Origin(OriginTag::Generated);
childImpl->Origin(OriginTag::Fragment);
childImpl->Source(source);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this call in #9293, @carlos-zamora do we need it?


// replace parent in _profiles with child
Expand All @@ -615,7 +615,7 @@ void CascadiaSettings::_ParseAndLayerFragmentFiles(const std::unordered_set<std:
// We don't make modifications to the user's settings file yet, that will happen when
// _AppendDynamicProfilesToUserSettings() is called later
newProfile->Source(source);
newProfile->Origin(OriginTag::Generated);
newProfile->Origin(OriginTag::Fragment);
_allProfiles.Append(*newProfile);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/cascadia/TerminalSettingsModel/Profile.idl
Expand Up @@ -14,7 +14,8 @@ namespace Microsoft.Terminal.Settings.Model
{
Custom = 0,
InBox,
Generated
Generated,
Fragment
};

enum CloseOnExitMode
Expand Down