Add settings for cache of changes

This commit is contained in:
Petr Mironychev
2024-09-11 01:59:25 +02:00
parent 2fb876ff00
commit 8e052ff45c
7 changed files with 32 additions and 10 deletions

View File

@ -74,6 +74,15 @@ ContextSettings::ContextSettings()
resetToDefaults.m_buttonText = Tr::tr("Reset Page to Defaults");
useProjectChangesCache.setSettingsKey(Constants::USE_PROJECT_CHANGES_CACHE);
useProjectChangesCache.setDefaultValue(true);
useProjectChangesCache.setLabelText(Tr::tr("Use Project Changes Cache"));
maxChangesCacheSize.setSettingsKey(Constants::MAX_CHANGES_CACHE_SIZE);
maxChangesCacheSize.setLabelText(Tr::tr("Max Changes Cache Size"));
maxChangesCacheSize.setRange(2, 1000);
maxChangesCacheSize.setDefaultValue(20);
readSettings();
readStringsAfterCursor.setEnabled(!readFullFile());
@ -90,6 +99,8 @@ ContextSettings::ContextSettings()
useFilePathInContext,
useSpecificInstructions,
specificInstractions,
useProjectChangesCache,
Row{maxChangesCacheSize, Stretch{1}},
Stretch{1}};
});
}

View File

@ -37,6 +37,8 @@ public:
Utils::StringAspect specificInstractions{this};
Utils::BoolAspect useSpecificInstructions{this};
Utils::BoolAspect useFilePathInContext{this};
Utils::BoolAspect useProjectChangesCache{this};
Utils::IntegerAspect maxChangesCacheSize{this};
ButtonAspect resetToDefaults{this};