mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 12:11:09 +01:00
* Add variable support - initial version without UI * Add variable in template filename support in New+ * Fix XAML style * Addressed code review feedback
49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "pch.h"
|
|
|
|
class NewSettings
|
|
{
|
|
public:
|
|
NewSettings();
|
|
|
|
bool GetEnabled();
|
|
bool GetHideFileExtension() const;
|
|
void SetHideFileExtension(const bool hide_file_extension);
|
|
bool GetHideStartingDigits() const;
|
|
void SetHideStartingDigits(const bool hide_starting_digits);
|
|
bool GetReplaceVariables() const;
|
|
void SetReplaceVariables(const bool resolve_variables);
|
|
std::wstring GetTemplateLocation() const;
|
|
void SetTemplateLocation(const std::wstring template_location);
|
|
|
|
void Save();
|
|
void Load();
|
|
|
|
private:
|
|
struct Settings
|
|
{
|
|
// These values are not used
|
|
bool enabled{ false };
|
|
bool hide_file_extension{ true };
|
|
bool hide_starting_digits{ true };
|
|
bool replace_variables{ true };
|
|
std::wstring template_location;
|
|
};
|
|
|
|
void RefreshEnabledState();
|
|
void InitializeWithDefaultSettings();
|
|
std::wstring GetTemplateLocationDefaultPath() const;
|
|
|
|
void Reload();
|
|
void ParseJson();
|
|
|
|
Settings new_settings;
|
|
std::wstring general_settings_json_file_path;
|
|
std::wstring new_settings_json_file_path;
|
|
FILETIME general_settings_last_loaded_timestamp{};
|
|
FILETIME new_settings_last_loaded_timestamp{};
|
|
};
|
|
|
|
NewSettings& NewSettingsInstance();
|