mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-12 21:12:44 -05:00
feat: Add settings for auto apply changes
This commit is contained in:
@ -226,6 +226,13 @@ GeneralSettings::GeneralSettings()
|
||||
Tr::tr("Allow tools to write and modify files on disk (WARNING: Use with caution!)"));
|
||||
allowFileSystemWrite.setDefaultValue(false);
|
||||
|
||||
autoApplyFileEdits.setSettingsKey(Constants::CA_AUTO_APPLY_FILE_EDITS);
|
||||
autoApplyFileEdits.setLabelText(Tr::tr("Automatically apply file edits"));
|
||||
autoApplyFileEdits.setToolTip(
|
||||
Tr::tr("When enabled, file edits suggested by AI will be applied automatically. "
|
||||
"When disabled, you will need to manually approve each edit."));
|
||||
autoApplyFileEdits.setDefaultValue(false);
|
||||
|
||||
readSettings();
|
||||
|
||||
Logger::instance().setLoggingEnabled(enableLogging());
|
||||
@ -272,7 +279,7 @@ GeneralSettings::GeneralSettings()
|
||||
auto caGroup = Group{
|
||||
title(TrConstants::CHAT_ASSISTANT),
|
||||
Column{caGrid,
|
||||
Column{useTools, allowFileSystemRead, allowFileSystemWrite},
|
||||
Column{useTools, allowFileSystemRead, allowFileSystemWrite, autoApplyFileEdits},
|
||||
caTemplateDescription}};
|
||||
|
||||
auto rootLayout = Column{
|
||||
@ -520,6 +527,7 @@ void GeneralSettings::resetPageToDefaults()
|
||||
resetAspect(useTools);
|
||||
resetAspect(allowFileSystemRead);
|
||||
resetAspect(allowFileSystemWrite);
|
||||
resetAspect(autoApplyFileEdits);
|
||||
writeSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,6 +103,7 @@ public:
|
||||
Utils::BoolAspect useTools{this};
|
||||
Utils::BoolAspect allowFileSystemRead{this};
|
||||
Utils::BoolAspect allowFileSystemWrite{this};
|
||||
Utils::BoolAspect autoApplyFileEdits{this};
|
||||
|
||||
Utils::StringAspect caTemplateDescription{this};
|
||||
|
||||
|
||||
@ -77,6 +77,7 @@ const char MAX_FILE_THRESHOLD[] = "QodeAssist.maxFileThreshold";
|
||||
const char CC_MULTILINE_COMPLETION[] = "QodeAssist.ccMultilineCompletion";
|
||||
const char CC_MODEL_OUTPUT_HANDLER[] = "QodeAssist.ccModelOutputHandler";
|
||||
const char CUSTOM_JSON_TEMPLATE[] = "QodeAssist.customJsonTemplate";
|
||||
const char CA_AUTO_APPLY_FILE_EDITS[] = "QodeAssist.caAutoApplyFileEdits";
|
||||
const char CA_TOKENS_THRESHOLD[] = "QodeAssist.caTokensThreshold";
|
||||
const char CA_LINK_OPEN_FILES[] = "QodeAssist.caLinkOpenFiles";
|
||||
const char CA_AUTOSAVE[] = "QodeAssist.caAutosave";
|
||||
|
||||
Reference in New Issue
Block a user