fix: update selected profile debug view after saving a profile (ie: after duplicating)

This commit is contained in:
Gabriele Musco 2024-08-09 22:21:15 +02:00
commit 5494306ac2
2 changed files with 6 additions and 3 deletions

View file

@ -51,14 +51,14 @@ impl XRServiceType {
pub fn libopenxr_path(&self) -> &'static str { pub fn libopenxr_path(&self) -> &'static str {
match self { match self {
Self::Monado => "libopenxr_monado.so", Self::Monado => "libopenxr_monado.so",
Self::Wivrn => "wivrn/libopenxr_wivrn.so" Self::Wivrn => "wivrn/libopenxr_wivrn.so",
} }
} }
pub fn libmonado_path(&self) -> &'static str { pub fn libmonado_path(&self) -> &'static str {
match self { match self {
Self::Monado => "libmonado.so", Self::Monado => "libmonado.so",
Self::Wivrn => "wivrn/libmonado.so" Self::Wivrn => "wivrn/libmonado.so",
} }
} }
} }

View file

@ -589,12 +589,15 @@ impl SimpleComponent for App {
self.profiles.push(prof.clone()); self.profiles.push(prof.clone());
self.profiles.sort_unstable_by(|a, b| a.name.cmp(&b.name)); self.profiles.sort_unstable_by(|a, b| a.name.cmp(&b.name));
self.config.set_profiles(&self.profiles); self.config.set_profiles(&self.profiles);
self.config.selected_profile_uuid = prof.uuid; self.config.selected_profile_uuid = prof.uuid.clone();
self.config.save(); self.config.save();
self.main_view.sender().emit(MainViewMsg::UpdateProfiles( self.main_view.sender().emit(MainViewMsg::UpdateProfiles(
self.profiles.clone(), self.profiles.clone(),
self.config.clone(), self.config.clone(),
)); ));
self.debug_view
.sender()
.emit(DebugViewMsg::UpdateSelectedProfile(prof.clone()));
} }
Msg::RunSetCap => { Msg::RunSetCap => {
if !dep_pkexec().check() { if !dep_pkexec().check() {