make the app remember the last selected input and playback devices

This commit is contained in:
Andrew Ward
2025-03-22 10:23:52 +00:00
parent 8d0431ca20
commit 41d69f9f95
2 changed files with 17 additions and 14 deletions

View File

@@ -1456,19 +1456,22 @@ Please also make sure you read the Terms of use and licence statement before usi
# Otherwise, submit text as before # Otherwise, submit text as before
self.submit_text() self.submit_text()
def on_input_device_change(self, event): def on_input_device_change(self, device_name):
"""Handle changes to the input device dropdown.""" """Save the selected input device in settings."""
selected_device = event.widget.cget("value") settings = self.load_settings()
self.input_device_index.set(selected_device) settings["input_device"] = device_name
self.save_settings_to_JSON(settings)
def on_primary_device_change(self, event):
"""Handle changes to the primary device dropdown.""" def on_primary_device_change(self, device_name):
selected_device = event.widget.cget("value") """Save the selected primary output device in settings."""
self.device_index.set(selected_device) settings = self.load_settings()
settings["primary_device"] = device_name
def on_secondary_device_change(self, event): self.save_settings_to_JSON(settings)
"""Handle changes to the secondary device dropdown."""
selected_device = event.widget.cget("value") def on_secondary_device_change(self, device_name):
self.device_index_2.set(selected_device) """Save the selected secondary output device in settings."""
settings = self.load_settings()
settings["secondary_device"] = device_name
self.save_settings_to_JSON(settings)