Skip to content

Commit

Permalink
update current device name
Browse files Browse the repository at this point in the history
  • Loading branch information
damonhayhurst committed May 11, 2022
1 parent c3208ee commit 3f9d6f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/gui/main_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ pub fn gui_main(recording: bool, input_file: Option<&str>, enable_mpris: bool) -
if let Some(old_enable_notifications) = old_preferences.enable_notifications {
notification_enable_checkbox.set_active(old_enable_notifications);
}
let old_device_name = old_preferences.device_name;
let old_device_name = old_preferences.current_device_name;

// Handle selecting a microphone input devices in the appropriate combo box
// (the combo box will be filed with device names when a "DevicesList"
Expand All @@ -313,7 +313,7 @@ pub fn gui_main(recording: bool, input_file: Option<&str>, enable_mpris: bool) -

let mut preferences_interface = PreferencesInterface::new();
let mut new_preferences = preferences_interface.preferences.clone();
new_preferences.device_name = Some(device_name_str.to_string());
new_preferences.current_device_name = Some(device_name_str.to_string());
preferences_interface.update(new_preferences);

if microphone_stop_button.is_visible() {
Expand Down
4 changes: 2 additions & 2 deletions src/gui/preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ use crate::utils::filesystem_reader::obtain_preferences_file_path;
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Preferences{
pub enable_notifications: Option<bool>,
pub device_name: Option<String>
pub current_device_name: Option<String>
}


impl Preferences {
pub fn default() -> Self {
Preferences {
enable_notifications: Some(true),
device_name: None
current_device_name: None
}
}
}
Expand Down

0 comments on commit 3f9d6f1

Please sign in to comment.