mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-11-12 21:12:44 -05:00
feat: Add settings for read files only from current project
This commit is contained in:
@ -226,6 +226,12 @@ GeneralSettings::GeneralSettings()
|
||||
Tr::tr("Allow tools to write and modify files on disk (WARNING: Use with caution!)"));
|
||||
allowFileSystemWrite.setDefaultValue(false);
|
||||
|
||||
allowReadOutsideProject.setSettingsKey(Constants::CA_ALLOW_READ_OUTSIDE_PROJECT);
|
||||
allowReadOutsideProject.setLabelText(Tr::tr("Allow reading files outside project"));
|
||||
allowReadOutsideProject.setToolTip(
|
||||
Tr::tr("Allow tools to read files outside the project scope (system headers, Qt files, external libraries)"));
|
||||
allowReadOutsideProject.setDefaultValue(true);
|
||||
|
||||
autoApplyFileEdits.setSettingsKey(Constants::CA_AUTO_APPLY_FILE_EDITS);
|
||||
autoApplyFileEdits.setLabelText(Tr::tr("Automatically apply file edits"));
|
||||
autoApplyFileEdits.setToolTip(
|
||||
@ -279,7 +285,7 @@ GeneralSettings::GeneralSettings()
|
||||
auto caGroup = Group{
|
||||
title(TrConstants::CHAT_ASSISTANT),
|
||||
Column{caGrid,
|
||||
Column{useTools, allowFileSystemRead, allowFileSystemWrite, autoApplyFileEdits},
|
||||
Column{useTools, allowFileSystemRead, allowFileSystemWrite, allowReadOutsideProject, autoApplyFileEdits},
|
||||
caTemplateDescription}};
|
||||
|
||||
auto rootLayout = Column{
|
||||
@ -527,6 +533,7 @@ void GeneralSettings::resetPageToDefaults()
|
||||
resetAspect(useTools);
|
||||
resetAspect(allowFileSystemRead);
|
||||
resetAspect(allowFileSystemWrite);
|
||||
resetAspect(allowReadOutsideProject);
|
||||
resetAspect(autoApplyFileEdits);
|
||||
writeSettings();
|
||||
}
|
||||
|
||||
@ -103,6 +103,7 @@ public:
|
||||
Utils::BoolAspect useTools{this};
|
||||
Utils::BoolAspect allowFileSystemRead{this};
|
||||
Utils::BoolAspect allowFileSystemWrite{this};
|
||||
Utils::BoolAspect allowReadOutsideProject{this};
|
||||
Utils::BoolAspect autoApplyFileEdits{this};
|
||||
|
||||
Utils::StringAspect caTemplateDescription{this};
|
||||
|
||||
@ -88,6 +88,7 @@ const char CA_ENABLE_CHAT_IN_NAVIGATION_PANEL[] = "QodeAssist.caEnableChatInNavi
|
||||
const char CA_USE_TOOLS[] = "QodeAssist.caUseTools";
|
||||
const char CA_ALLOW_FILE_SYSTEM_READ[] = "QodeAssist.caAllowFileSystemRead";
|
||||
const char CA_ALLOW_FILE_SYSTEM_WRITE[] = "QodeAssist.caAllowFileSystemWrite";
|
||||
const char CA_ALLOW_READ_OUTSIDE_PROJECT[] = "QodeAssist.caAllowReadOutsideProject";
|
||||
|
||||
const char QODE_ASSIST_GENERAL_OPTIONS_ID[] = "QodeAssist.GeneralOptions";
|
||||
const char QODE_ASSIST_GENERAL_SETTINGS_PAGE_ID[] = "QodeAssist.1GeneralSettingsPageId";
|
||||
|
||||
Reference in New Issue
Block a user