Skip to content

Commit

Permalink
Update target language in settings & new project settings
Browse files Browse the repository at this point in the history
  • Loading branch information
machinewrapped committed May 7, 2024
1 parent c9f73dd commit 2df0e15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GUI/NewProjectSettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def accept(self):
self.settings['prompt'] = instructions.prompt
self.settings['instructions'] = instructions.instructions
self.settings['retry_instructions'] = instructions.retry_instructions
if instructions.target_language:
self.settings['target_language'] = instructions.target_language

logging.debug(f"Prompt: {instructions.prompt}")
logging.debug(f"Instructions: {instructions.instructions}")
Expand Down Expand Up @@ -155,5 +157,7 @@ def _update_instruction_file(self):
try:
instructions = LoadInstructionsResource(instruction_file)
self.fields['prompt'].SetValue(instructions.prompt)
if instructions.target_language:
self.fields['target_language'].SetValue(instructions.target_language)
except Exception as e:
logging.error(f"Unable to load instructions from {instruction_file}: {e}")
3 changes: 3 additions & 0 deletions GUI/SettingsDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ def _update_instruction_file(self):
try:
instructions = LoadInstructionsResource(instruction_file)
self.widgets['prompt'].SetValue(instructions.prompt)
if instructions.target_language:
self.widgets['target_language'].SetValue(instructions.target_language)

except Exception as e:
logging.error(f"Unable to load instructions from {instruction_file}: {e}")

Expand Down

0 comments on commit 2df0e15

Please sign in to comment.