-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 TerminalSettingsModel project #7667
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.cpp
but wasn't quite sure how it's linking the resource file, could you briefly explain? - What if
TerminalSettingsEditor
also 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i hope this is unique.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to be TerminalSettings' guid. Is that a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
96/102
src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp
Outdated
Show resolved
Hide resolved
14f405c
to
99b126c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm done with all 133 in this PR, and my only concern is over the same utils.cpp
thing Dustin brought up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
ApplicationDisplayName
andApplicationVersion
wasmoved to
CascadiaSettings
AppLogic::Current()
is nullptr.enum LaunchMode
was moved from TerminalApp to TSMAzureConnectionType
andTelnetConnectionType
were moved from theprofile generators to their respective TerminalConnections
SettingsPath
andDefaultSettingsPath
areexposed as
hstring
instead ofstd::filesystem::path
Command::ExpandCommands()
was exposed via the IDLIVector
instead of
std::vector
, among some other small changes.StaticResourceLoader.
ActionArgs
cascadia/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