diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2023-04-10 21:17:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-10 21:17:00 +0200 |
commit | 2be2ef6ce5232ea859ae814c401cd99e87f57af9 (patch) | |
tree | b364b9ddf492f02d02f1fdb02fd9191a57a39d27 /src-tauri/src/main.rs | |
parent | 6d58e6793d40df4fec518f37351868803a02a033 (diff) | |
download | FlightCore-2be2ef6ce5232ea859ae814c401cd99e87f57af9.tar.gz FlightCore-2be2ef6ce5232ea859ae814c401cd99e87f57af9.zip |
feat: Show download progress for installing Northstar (#200)
* chore: Bump libthermite to 0.5.3
This adds a change needed for making progressbar work on dowload
* wip: First attempt at showing download progress
Simply prints it to JavaScript console for now
* feat: Emit download progress at most every 250ms
If we spam emit too much we use a lot of extra resources, slowing down
the actual download
* feat: Initial messages for extracting
* feat: Add install state enum
* refactor: Change payload to current + total size
downloaded
* fix: Remove extra emit
* fix: Remove extra emit
* refactor: Rename struct
* refactor: Move struct to top of file
* feat: Add TypeScript bindings
* feat: Add console logs for printing state for now
* fix: Remove duplicate identifier
* feat: Initial progressbar in frontend
* fix: Remove event listener added for debugging
* feat: Display status and downloaded bytes
* feat: Set loading bar to indeterminate on extract
* fix: Phrasing in comment
* feat: Add i18n for progress state
* refactor: Adjust control flow
do not show downloaded size anymore during extraction
* fix: Manually specify progressbar size
* fix: Update download progress every 100ms
instead of 250ms
Gives impression of faster / more fluent download.
* feat: layout does not move when progress bar is hidden
* feat: fix progress bar width to 200px
* refactor: put services container in a flex container, for it not to overlap play button
* refactor: export progress bar to dedicated component file
* refactor: Update status first outside of branch
* fix: Proper typing of event payload
* fix: Do not assign to unused variable
---------
Co-authored-by: Rémy Raes <contact@remyraes.com>
Diffstat (limited to 'src-tauri/src/main.rs')
-rw-r--r-- | src-tauri/src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 16b951ec..76e8833e 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -284,11 +284,12 @@ async fn get_host_os_caller() -> String { #[tauri::command] /// Installs Northstar to the given path async fn install_northstar_caller( + window: tauri::Window, game_path: String, northstar_package_name: Option<String>, ) -> Result<bool, String> { log::info!("Running"); - match install_northstar(&game_path, northstar_package_name).await { + match install_northstar(window, &game_path, northstar_package_name).await { Ok(_) => Ok(true), Err(err) => { log::error!("{}", err); @@ -300,13 +301,14 @@ async fn install_northstar_caller( #[tauri::command] /// Update Northstar install in the given path async fn update_northstar_caller( + window: tauri::Window, game_path: String, northstar_package_name: Option<String>, ) -> Result<bool, String> { log::info!("Updating Northstar"); // Simply re-run install with up-to-date version for upate - match install_northstar(&game_path, northstar_package_name).await { + match install_northstar(window, &game_path, northstar_package_name).await { Ok(_) => Ok(true), Err(err) => { log::error!("{}", err); |