mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
Non localized module name (#7170)
* Added get_key to powertoysmodule interface * Replace get_name with get_key * Implement get_key function in modules * Make key global constant in each module * Update settings v1 to use key to load and save files * Fixed fancyzones and preview pane unit tests * Removed setings unit test as the case is not covered anymore * Add constant files for modules and use it to reference module key * Add constant string files to colorpicker, launcher and shortcut guide * correct sunction signature in settings helper * Fix powerpreview merge conflicts * nit fix with include statement location * add check for fields in from_json_string * Updated preview pane tests with correct from_json_string signature * Correct Image resizer naming * Roll back changes for adding check for property and version * Fix image resizer not working
This commit is contained in:
committed by
GitHub
parent
8b759094f7
commit
280d1907d8
@@ -43,9 +43,10 @@ namespace NonLocalizable
|
||||
struct FancyZonesSettings : winrt::implements<FancyZonesSettings, IFancyZonesSettings>
|
||||
{
|
||||
public:
|
||||
FancyZonesSettings(HINSTANCE hinstance, PCWSTR name)
|
||||
: m_hinstance(hinstance)
|
||||
, m_moduleName(name)
|
||||
FancyZonesSettings(HINSTANCE hinstance, PCWSTR name, PCWSTR key)
|
||||
: m_hinstance(hinstance),
|
||||
m_moduleName(name),
|
||||
m_moduleKey(key)
|
||||
{
|
||||
LoadSettings(name, true);
|
||||
}
|
||||
@@ -64,6 +65,7 @@ private:
|
||||
IFancyZonesCallback* m_callback{};
|
||||
const HINSTANCE m_hinstance;
|
||||
PCWSTR m_moduleName{};
|
||||
PCWSTR m_moduleKey{};
|
||||
|
||||
Settings m_settings;
|
||||
|
||||
@@ -171,8 +173,8 @@ void FancyZonesSettings::LoadSettings(PCWSTR config, bool fromFile) noexcept
|
||||
try
|
||||
{
|
||||
PowerToysSettings::PowerToyValues values = fromFile ?
|
||||
PowerToysSettings::PowerToyValues::load_from_settings_file(m_moduleName) :
|
||||
PowerToysSettings::PowerToyValues::from_json_string(config);
|
||||
PowerToysSettings::PowerToyValues::load_from_settings_file(m_moduleKey) :
|
||||
PowerToysSettings::PowerToyValues::from_json_string(config, m_moduleKey);
|
||||
|
||||
for (auto const& setting : m_configBools)
|
||||
{
|
||||
@@ -244,7 +246,7 @@ void FancyZonesSettings::SaveSettings() noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
PowerToysSettings::PowerToyValues values(m_moduleName);
|
||||
PowerToysSettings::PowerToyValues values(m_moduleName, m_moduleKey);
|
||||
|
||||
for (auto const& setting : m_configBools)
|
||||
{
|
||||
@@ -271,7 +273,7 @@ void FancyZonesSettings::SaveSettings() noexcept
|
||||
}
|
||||
}
|
||||
|
||||
winrt::com_ptr<IFancyZonesSettings> MakeFancyZonesSettings(HINSTANCE hinstance, PCWSTR name) noexcept
|
||||
winrt::com_ptr<IFancyZonesSettings> MakeFancyZonesSettings(HINSTANCE hinstance, PCWSTR name, PCWSTR key) noexcept
|
||||
{
|
||||
return winrt::make_self<FancyZonesSettings>(hinstance, name);
|
||||
return winrt::make_self<FancyZonesSettings>(hinstance, name, key);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user