Introduce TerminalSettingsModel project#7667
Conversation
183cff4 to
99d3d4c
Compare
Note for ReviewersThis PR is still in draft because I need to fix all of the tests. That shouldn't be too difficult. Aside from that, this PR is ready to go! EDIT: Since the tests need access to the implementation types, I'll have to break up TSM into 2 projects: TSM and TSMLib. |
leonMSFT
left a comment
There was a problem hiding this comment.
I'm curious about what you said about how the "localization resources had to be split into two halves".
- I took a look at
init.cppbut wasn't quite sure how it's linking the resource file, could you briefly explain? - What if
TerminalSettingsEditoralso needed to have its own localization resources, would it have to do something similar?
src/cascadia/TerminalSettingsModel/TerminalSettingsModel.vcxproj
Outdated
Show resolved
Hide resolved
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup Label="Globals"> | ||
| <ProjectGuid>{CA5CAD1A-d7ec-4107-b7c6-79cb77ae2907}</ProjectGuid> |
There was a problem hiding this comment.
This used to be TerminalSettings' guid. Is that a problem?
src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp
Outdated
Show resolved
Hide resolved
14f405c to
99b126c
Compare
zadjii-msft
left a comment
There was a problem hiding this comment.
Okay, I'm done with all 133 in this PR, and my only concern is over the same utils.cpp thing Dustin brought up
DHowett
left a comment
There was a problem hiding this comment.
hitting submit b/c queued comments?
|
Changes for the next commit(s):
|
Oh...I already had it in
Moved and added a test. Had to remove a
CommandPalette data binds itself to the IconSource of EDIT: yeah, that needs to happen. Just a bit big for this PR. Filed #7784 as a follow-up. |
| { | ||
| struct KeyChordSerialization | ||
| { | ||
| KeyChordSerialization() = default; |
There was a problem hiding this comment.
I don't recall this conversation coming to a close. Did you try it without both the factory and the default ctor? There must be a way to do this.,
src/cascadia/TerminalSettingsModel/dll/Microsoft.Terminal.Settings.Model.vcxproj
Show resolved
Hide resolved
|
Urgh. Technically, y'all should be reading/merging #6904 first. So go read that * grumble * |
## Summary of the Pull Request Introduce the `IconPathConverter` to `TerminalApp`. `Command` and `Profile` now both return the unexpanded icon path. `IconPathConverter` is responsible for expanding the icon path and retrieving the appropriate icon source. This also removes `Profile`'s expanded icon path and uses the `IconPathConverter` when necessary. This allows users to set profile icons to emoji as well. However, emoji do not appear in the jumplist. ## References Based on #7667 ## PR Checklist * [X] Closes #7784 * [x] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [x] Schema updated. ## Validation Steps Performed Deploy succeeded.
microsoft#7796 and microsoft#7667 were being implemented concurrently. As a part of microsoft#7667, Command was moved from TermApp to TSM. This just applies that change to a line we missed in microsoft#7796 and fixes the build break.
## Summary of the Pull Request Introduce the `IconPathConverter` to `TerminalApp`. `Command` and `Profile` now both return the unexpanded icon path. `IconPathConverter` is responsible for expanding the icon path and retrieving the appropriate icon source. This also removes `Profile`'s expanded icon path and uses the `IconPathConverter` when necessary. This allows users to set profile icons to emoji as well. However, emoji do not appear in the jumplist. ## References Based on microsoft#7667 ## PR Checklist * [X] Closes microsoft#7784 * [x] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx * [x] Schema updated. ## Validation Steps Performed Deploy succeeded.
## Summary of the Pull Request This implements the `Copy` function for `CascadiaSettings`. Copy performs a deep copy of a `CascadiaSettings` object. This is needed for data binding in the Terminal Settings Editor. The `Copy` function was basically implemented in every settings model object. This was mostly just repetitive work. ## References #7667 - TSM #1564 - Settings UI ## PR Checklist * [X] Tests added/passed
|
🎉 Handy links: |
Introduces a new TerminalSettingsModel (TSM) project. This project is
responsible for (de)serializing and exposing Windows Terminal's settings
as WinRT objects.
References
#885: TSM epic
#1564: Settings UI is dependent on this for data binding and settings access
#6904: TSM Spec
In the process of ripping out TSM from TerminalApp, a few other changes
were made to make this possible:
ApplicationDisplayNameandApplicationVersionwasmoved to
CascadiaSettingsAppLogic::Current()is nullptr.enum LaunchModewas moved from TerminalApp to TSMAzureConnectionTypeandTelnetConnectionTypewere moved from theprofile generators to their respective TerminalConnections
SettingsPathandDefaultSettingsPathareexposed as
hstringinstead ofstd::filesystem::pathCommand::ExpandCommands()was exposed via the IDLIVectorinstead of
std::vector, among some other small changes.StaticResourceLoader.
ActionArgscascadia/inc.JsonKey()was moved toJsonUtils. Both TermApp and TSM need access to Utils.h/cpp.A large amount of work includes moving to the new namespace
(
TerminalApp-->Microsoft::Terminal::Settings::Model).Fixing the tests had its own complications. Testing required us to split
up TSM into a DLL and LIB, similar to TermApp. Discussion on creating a
non-local test variant can be found in #7743.
Closes #885