aboutsummaryrefslogtreecommitdiff
path: root/src-tauri
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-05-22 08:11:59 +0200
committerGitHub <noreply@github.com>2023-05-22 08:11:59 +0200
commit84cb421f13cf1a1f1b47cff6866c378972270c37 (patch)
treea21f203888272be15f9356d6c4919ab5baee0d05 /src-tauri
parent576dd0a9d2152ffcc15d746a6c537e2d68d0d5eb (diff)
downloadFlightCore-84cb421f13cf1a1f1b47cff6866c378972270c37.tar.gz
FlightCore-84cb421f13cf1a1f1b47cff6866c378972270c37.zip
refactor: Change error messages and function names to EA App (#362)
* refactor: Change error message to mention EA App instead of Origin * refactor: Rename function to refer to EA App * refactor: Rename function to mention EA and Origin * style: Fix formatting * refactor: Update translation text to EA App * refactor: Change emit name to EA App instead of Origin * docs: Update comment to mention EA App
Diffstat (limited to 'src-tauri')
-rw-r--r--src-tauri/src/main.rs5
-rw-r--r--src-tauri/src/northstar/mod.rs10
-rw-r--r--src-tauri/src/util.rs2
3 files changed, 10 insertions, 7 deletions
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index b27233b7..6004531a 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -93,7 +93,10 @@ fn main() {
loop {
sleep(Duration::from_millis(2000)).await;
app_handle
- .emit_all("origin-running-ping", util::check_origin_running())
+ .emit_all(
+ "ea-app-running-ping",
+ util::check_ea_app_or_origin_running(),
+ )
.unwrap();
}
});
diff --git a/src-tauri/src/northstar/mod.rs b/src-tauri/src/northstar/mod.rs
index 7477f6aa..47510dbd 100644
--- a/src-tauri/src/northstar/mod.rs
+++ b/src-tauri/src/northstar/mod.rs
@@ -2,7 +2,7 @@
//! - getting version number
pub mod install;
-use crate::util::check_origin_running;
+use crate::util::check_ea_app_or_origin_running;
use crate::{constants::CORE_MODS, get_host_os, GameInstall, InstallType};
use anyhow::anyhow;
@@ -86,11 +86,11 @@ pub fn launch_northstar(
return Err(anyhow!("Not all checks were met").to_string());
}
- // Require Origin to be running to launch Northstar
- let origin_is_running = check_origin_running();
- if !origin_is_running {
+ // Require EA App or Origin to be running to launch Northstar
+ let ea_app_is_running = check_ea_app_or_origin_running();
+ if !ea_app_is_running {
return Err(
- anyhow!("Origin not running, start Origin before launching Northstar").to_string(),
+ anyhow!("EA App not running, start EA App before launching Northstar").to_string(),
);
}
}
diff --git a/src-tauri/src/util.rs b/src-tauri/src/util.rs
index c5433fcd..0f32ecb5 100644
--- a/src-tauri/src/util.rs
+++ b/src-tauri/src/util.rs
@@ -105,7 +105,7 @@ pub fn extract(zip_file: std::fs::File, target: &std::path::Path) -> Result<()>
Ok(())
}
-pub fn check_origin_running() -> bool {
+pub fn check_ea_app_or_origin_running() -> bool {
let s = sysinfo::System::new_all();
let x = s.processes_by_name("Origin.exe").next().is_some()
|| s.processes_by_name("EADesktop.exe").next().is_some();