some refactor and cleaning

This commit is contained in:
ALEZ-DEV 2025-03-13 18:48:48 +01:00
parent 0a60f79daa
commit f793b18b2c
2 changed files with 5 additions and 17 deletions

View File

@ -145,6 +145,7 @@ impl Worker for HandleComponentInstallation {
if let Err(error) = GameManager::install_wine(game_dir.clone(), proton_release, Some(progress_bar.clone())).await { if let Err(error) = GameManager::install_wine(game_dir.clone(), proton_release, Some(progress_bar.clone())).await {
sender.output(download_components::DownloadComponentsMsg::ShowError(format!("Failed to install proton : {}", error))).unwrap(); sender.output(download_components::DownloadComponentsMsg::ShowError(format!("Failed to install proton : {}", error))).unwrap();
return;
} }
let _ = sender let _ = sender
@ -156,6 +157,7 @@ impl Worker for HandleComponentInstallation {
if let Err(error) = GameManager::install_dxvk(&get_proton().await, game_dir, dxvk_release, Some(progress_bar.clone())).await { if let Err(error) = GameManager::install_dxvk(&get_proton().await, game_dir, dxvk_release, Some(progress_bar.clone())).await {
sender.output(download_components::DownloadComponentsMsg::ShowError(format!("Failed to install DXVK : {}", error))).unwrap(); sender.output(download_components::DownloadComponentsMsg::ShowError(format!("Failed to install DXVK : {}", error))).unwrap();
return;
} }
let _ = sender let _ = sender
@ -167,6 +169,7 @@ impl Worker for HandleComponentInstallation {
if let Err(error) = GameManager::install_font(&get_proton().await, Some(progress_bar.clone())).await { if let Err(error) = GameManager::install_font(&get_proton().await, Some(progress_bar.clone())).await {
sender.output(download_components::DownloadComponentsMsg::ShowError(format!("Failed to install fonts : {}", error))).unwrap(); sender.output(download_components::DownloadComponentsMsg::ShowError(format!("Failed to install fonts : {}", error))).unwrap();
return;
} }
let _ = sender let _ = sender
@ -178,7 +181,7 @@ impl Worker for HandleComponentInstallation {
if let Err(error) = GameManager::install_dependencies(&get_proton().await).await { if let Err(error) = GameManager::install_dependencies(&get_proton().await).await {
sender.output(download_components::DownloadComponentsMsg::ShowError(format!("Failed to install dependencies : {}", error))).unwrap(); sender.output(download_components::DownloadComponentsMsg::ShowError(format!("Failed to install dependencies : {}", error))).unwrap();
return;
} }
debug!("Finished to installing the components!"); debug!("Finished to installing the components!");

View File

@ -141,16 +141,6 @@ impl SimpleAsyncComponent for DownloadComponentsPage {
connect_clicked => DownloadComponentsMsg::UpdateCurrentlyInstalling(CurrentlyInstalling::Proton), connect_clicked => DownloadComponentsMsg::UpdateCurrentlyInstalling(CurrentlyInstalling::Proton),
}, },
gtk::Button {
set_css_classes: &["suggested-action", "pill"],
set_label: "Test dialog",
set_hexpand: false,
set_width_request: 200,
connect_clicked => DownloadComponentsMsg::ShowError(String::from("Test dialog")),
},
}, },
}, },
@ -283,12 +273,7 @@ impl SimpleAsyncComponent for DownloadComponentsPage {
let model = DownloadComponentsPage { let model = DownloadComponentsPage {
proton_combo: adw::ComboRow::new(), proton_combo: adw::ComboRow::new(),
dxvk_combo: adw::ComboRow::new(), dxvk_combo: adw::ComboRow::new(),
//error_dialog: CopyDialog::builder()
// .transient_for(&root)
// .launch(())
// .forward(sender.input_sender(), move |msg| match msg {
// DialogOutput::Close => DownloadComponentsMsg::Quit,
// }),
proton_versions: proton_releases, proton_versions: proton_releases,
dxvk_versions: dxvk_releases, dxvk_versions: dxvk_releases,
selected_proton_version: None, selected_proton_version: None,