-
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
Make Profile a WinRT object #7283
Conversation
This comment has been minimized.
This comment has been minimized.
07dfdb7
to
1fb018d
Compare
fde1189
to
5d5ab10
Compare
It will be important to retarget this PR before you merge and delete the destination branch (!) |
7d81387
to
105183d
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.
227172f
to
17648c7
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 at 24/29, and i bet you can guess which 5 I haven't been to yet
{ | ||
const auto profileGuid{ Microsoft::Console::Utils::CreateV5Uuid(TERMINAL_PROFILE_NAMESPACE_GUID, | ||
const winrt::guid profileGuid{ Microsoft::Console::Utils::CreateV5Uuid(TERMINAL_PROFILE_NAMESPACE_GUID, |
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 could still be auto
, right? There should be an magic GUID
->winrt::guid
conversion already
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 wish. I think that the compiler gets confused with the winrt::Windows::Foundation::IReference<winrt::guid>
. :(
1>D:\Terminal\src\cascadia\TerminalApp\DefaultProfileUtils.cpp(22,55): error C2440: 'initializing': cannot convert from 'initializer list' to 'winrt::TerminalApp::Profile'
1>D:\Terminal\src\cascadia\TerminalApp\DefaultProfileUtils.cpp(22,55): message : No constructor could take the source type, or constructor overload resolution was ambiguous
1>D:\Terminal\src\cascadia\TerminalApp\DefaultProfileUtils.cpp(24,32): error C2664: 'auto winrt::impl::consume_TerminalApp_IProfile<winrt::TerminalApp::IProfile>::Guid(const winrt::Windows::Foundation::IReference<winrt::guid> &) const': cannot convert argument 1 from 'const GUID' to 'const winrt::Windows::Foundation::IReference<winrt::guid> &'
1>D:\Terminal\src\cascadia\TerminalApp\DefaultProfileUtils.cpp(24,32): message : Reason: cannot convert from 'const GUID' to 'const winrt::Windows::Foundation::IReference<winrt::guid>'
1>D:\Terminal\src\cascadia\TerminalApp\DefaultProfileUtils.cpp(24,21): message : No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
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 actually seems to be the source of a lot of the comments you made. I've been getting around it by just using winrt::guid
instead of GUID
, but if you have a better idea in mind, go for it.
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.
oh that makes me unreasonably angry
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.
something something type covariance
Chatted offline. JsonUtils should be able to handle But it looks like
|
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.
re:
I was considering that for a bit, actually. If we go that route, I think it would make sense to break up
GETSET_PROPERTY(Windows::Foundation::IReference<guid>, Guid, nullptr);
into
// return/accept guid instead of IReference<guid> bool HasGuid(); guid Guid(); void Guid(guid);
Honestly, that feels better to me, but I know how much annoying work that is. IMO, it seems like external to the deserialization of the settings, a profile should always have a GUID. Kinda like how right now we just throw if a profile ever doesn't. That'll prevent the need for all the other classes to do the if (profile.Guid() != nullptr) { profile.Guid().Value(); }
dance.
b8f476b
to
1a20cb3
Compare
6051822
to
8396b2d
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.
Alright, these are all only nits, so I won't block over them.
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 feel confident enough in WinRT-isms to sign off here, but I didn't see a whole lot out of order. Just left a few small comments.
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.
NAK because of the null
discussion and change in behavior
I still want/need to double check if there is similar behavior with making the other settings null. Assigning to myself to do that. So this PR is not ready to go yet. |
The latest commit closes #7435 as well. |
@msftbot merge this in 1 minute |
Hello @DHowett! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
🎉 Handy links: |
Profile is now a WinRT object in the TerminalApp project.
As with ColorScheme, all of the serialization logic is not exposed via
the idl. TerminalSetingsModel will handle it when it's all moved over.
I removed the "Get" and "Set" prefixes from all of the Profile
functions. It just makes more sense to use the
GETSET_PROPERTY
macroto do most of the work for us.
CloseOnExitMode
is now an enum off of the Profile.idl.std::optional<wstring>
got converted tohstring
(as opposed toIReference<hstring>
).IReference<hstring>
is not valid to MIDL.References
#7141 - Profile is a settings object
#885 - this new settings object will be moved to a new TerminalSettingsModel project
Validation Steps Performed
Closes #7435