I think this works ALMOST as I want
* [x] delete all state, open terminal elevated - generated profiles go to the correct place, approved commandlines go to the elevated one. * [x] delete some dynamic profiles, open the terminal - they don't resurrect in either IL * [ ] GAH saving a window layout unelevated, then trying to save one elevated will blow away the unelevated one
This commit is contained in:
parent
b2796019f8
commit
94c4cca176
|
@ -138,8 +138,15 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||||
{
|
{
|
||||||
Json::StreamWriterBuilder wbuilder;
|
Json::StreamWriterBuilder wbuilder;
|
||||||
|
|
||||||
_writeSharedContents(Json::writeString(wbuilder, ToJson(FileSource::Shared)));
|
if (::Microsoft::Console::Utils::IsElevated())
|
||||||
_writeElevatedContents(Json::writeString(wbuilder, ToJson(FileSource::Local)));
|
{
|
||||||
|
_writeSharedContents(Json::writeString(wbuilder, ToJson(FileSource::Shared)));
|
||||||
|
_writeElevatedContents(Json::writeString(wbuilder, ToJson(FileSource::Local)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_writeSharedContents(Json::writeString(wbuilder, ToJson(FileSource::Shared | FileSource::Local)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
CATCH_LOG()
|
CATCH_LOG()
|
||||||
|
|
||||||
|
@ -174,7 +181,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||||
{
|
{
|
||||||
auto state = _state.lock_shared();
|
auto state = _state.lock_shared();
|
||||||
#define MTSM_APPLICATION_STATE_GEN(source, type, name, key, ...) \
|
#define MTSM_APPLICATION_STATE_GEN(source, type, name, key, ...) \
|
||||||
if (parseSource == source) \
|
if (WI_IsFlagSet(parseSource, source)) \
|
||||||
JsonUtils::SetValueForKey(root, key, state->name);
|
JsonUtils::SetValueForKey(root, key, state->name);
|
||||||
|
|
||||||
MTSM_APPLICATION_STATE_FIELDS(MTSM_APPLICATION_STATE_GEN)
|
MTSM_APPLICATION_STATE_FIELDS(MTSM_APPLICATION_STATE_GEN)
|
||||||
|
|
|
@ -23,12 +23,13 @@ Abstract:
|
||||||
// (type, function name, JSON key, ...variadic construction arguments)
|
// (type, function name, JSON key, ...variadic construction arguments)
|
||||||
namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
namespace winrt::Microsoft::Terminal::Settings::Model::implementation
|
||||||
{
|
{
|
||||||
enum FileSource
|
enum FileSource : int
|
||||||
{
|
{
|
||||||
Shared,
|
Shared = 0x1,
|
||||||
Local,
|
Local = 0x2,
|
||||||
// ElevatedOnly
|
// ElevatedOnly
|
||||||
};
|
};
|
||||||
|
DEFINE_ENUM_FLAG_OPERATORS(FileSource);
|
||||||
|
|
||||||
#define MTSM_APPLICATION_STATE_FIELDS(X) \
|
#define MTSM_APPLICATION_STATE_FIELDS(X) \
|
||||||
X(FileSource::Shared, std::unordered_set<winrt::guid>, GeneratedProfiles, "generatedProfiles") \
|
X(FileSource::Shared, std::unordered_set<winrt::guid>, GeneratedProfiles, "generatedProfiles") \
|
||||||
|
|
Loading…
Reference in a new issue