BackOneUI -> NexusUI

This commit is contained in:
dsutanto committed 2026-01-07 14:23:45 +07:00
1 parent b8c5053858
commit 35a1050697
1 file changed
+13 -13
+13 -13
View File
@@ -77,7 +77,7 @@ pub(crate) const GLOBAL_SERVICE_HOME_V1: &'static str = "/var/db/backone";
pub(crate) const GLOBAL_SERVICE_HOME_V1: &'static str = "/var/lib/backone"; pub(crate) const GLOBAL_SERVICE_HOME_V1: &'static str = "/var/lib/backone";
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
pub(crate) const MAC_BUNDLE_ID: &'static str = "com.backone.BackOne-UI"; pub(crate) const MAC_BUNDLE_ID: &'static str = "com.backone.Nexus-UI";
/*******************************************************************************************************************/ /*******************************************************************************************************************/
/* OS-specific functions and C externs */ /* OS-specific functions and C externs */
@@ -195,7 +195,7 @@ fn refresh_windows_start_on_login() {
let hkcu = winreg::RegKey::predef(winreg::enums::HKEY_CURRENT_USER); let hkcu = winreg::RegKey::predef(winreg::enums::HKEY_CURRENT_USER);
let startup = hkcu.open_subkey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"); let startup = hkcu.open_subkey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
let enabled = startup.map_or(false, |startup| { let enabled = startup.map_or(false, |startup| {
startup.get_value::<String, &str>("BackOneUI").is_ok() startup.get_value::<String, &str>("NexusUI").is_ok()
}); });
unsafe { unsafe {
START_ON_LOGIN = enabled; START_ON_LOGIN = enabled;
@@ -274,7 +274,7 @@ fn notify(text: &str, _: Option<(String, String)>) {
let _ = notify_rust::Notification::new() let _ = notify_rust::Notification::new()
.icon(ico.as_str()) .icon(ico.as_str())
.body(text) .body(text)
.appname("BackOne") .appname("Nexus")
.show(); .show();
} }
@@ -282,7 +282,7 @@ fn notify(text: &str, _: Option<(String, String)>) {
fn notify(text: &str, _: Option<(String, String)>) { fn notify(text: &str, _: Option<(String, String)>) {
let _ = notify_rust::Notification::new() let _ = notify_rust::Notification::new()
.body(text) .body(text)
.appname("BackOne") .appname("Nexus")
.show(); .show();
} }
@@ -290,7 +290,7 @@ fn notify(text: &str, _: Option<(String, String)>) {
fn notify(text: &str, _: Option<(String, String)>) { fn notify(text: &str, _: Option<(String, String)>) {
let _ = mac_notification_sys::set_application(MAC_BUNDLE_ID); let _ = mac_notification_sys::set_application(MAC_BUNDLE_ID);
let mut n = mac_notification_sys::Notification::new(); let mut n = mac_notification_sys::Notification::new();
n.title("BackOne"); n.title("Nexus");
n.message(text); n.message(text);
n.asynchronous(true); n.asynchronous(true);
let _ = n.send(); let _ = n.send();
@@ -873,7 +873,7 @@ fn tray_main() {
let _ = out.map(|app_list| { let _ = out.map(|app_list| {
String::from_utf8(app_list.stdout).map(|app_list| { String::from_utf8(app_list.stdout).map(|app_list| {
app_list.split('\n').for_each(|app| { app_list.split('\n').for_each(|app| {
if app.to_ascii_lowercase().contains("backone") { if app.to_ascii_lowercase().contains("nexus") {
// osascript -e 'tell application "System Events" to delete login item "itemname"' // osascript -e 'tell application "System Events" to delete login item "itemname"'
let _ = Command::new("/usr/bin/osascript").arg("-e").arg(format!("tell application \"System Events\" to delete login item \"{}\"", app.trim())).output(); let _ = Command::new("/usr/bin/osascript").arg("-e").arg(format!("tell application \"System Events\" to delete login item \"{}\"", app.trim())).output();
} }
@@ -889,7 +889,7 @@ fn tray_main() {
break; break;
} else { } else {
// If toggling failed, re-request permission to send apple events as this is required to toggle. // If toggling failed, re-request permission to send apple events as this is required to toggle.
let _ = Command::new("/usr/bin/tccutil").arg("reset").arg("AppleEvents").arg("com.backone.BackOne-UI").output(); let _ = Command::new("/usr/bin/tccutil").arg("reset").arg("AppleEvents").arg("com.backone.Nexus-UI").output();
} }
} }
dirty_flag2.store(true, std::sync::atomic::Ordering::Relaxed); dirty_flag2.store(true, std::sync::atomic::Ordering::Relaxed);
@@ -912,12 +912,12 @@ fn tray_main() {
if startup.is_ok() { if startup.is_ok() {
let startup = startup.unwrap().0; let startup = startup.unwrap().0;
if unsafe { START_ON_LOGIN } { if unsafe { START_ON_LOGIN } {
let _ = startup.delete_value("BackOneUI"); let _ = startup.delete_value("NexusUI");
} else { } else {
let exe = String::from( let exe = String::from(
std::env::current_exe().unwrap().to_str().unwrap(), std::env::current_exe().unwrap().to_str().unwrap(),
); );
let _ = startup.set_value("BackOneUI", &exe); let _ = startup.set_value("NexusUI", &exe);
} }
} }
refresh_windows_start_on_login(); refresh_windows_start_on_login();
@@ -946,7 +946,7 @@ fn tray_main() {
}); });
} else { } else {
menu.push(TrayMenuItem::Text { menu.push(TrayMenuItem::Text {
text: "Waiting for BackOne system service...".into(), text: "Waiting for Nexus system service...".into(),
checked: false, checked: false,
disabled: true, disabled: true,
handler: None, handler: None,
@@ -986,7 +986,7 @@ fn tray_main() {
&& sso_notification_shown.lock().insert(nwid.clone()) && sso_notification_shown.lock().insert(nwid.clone())
{ {
notify( notify(
format!("BackOne network {} requires SSO authentication. Select 'Open SSL Login URL' to proceed.", nwid).as_str(), format!("Nexus network {} requires SSO authentication. Select 'Open SSL Login URL' to proceed.", nwid).as_str(),
Some(("Open SSL Login URL...".into(), auth_url.clone())) Some(("Open SSL Login URL...".into(), auth_url.clone()))
); );
} }
@@ -1064,10 +1064,10 @@ fn main() {
unsafe { unsafe {
let _ = std::env::var("HOME").map_or_else( let _ = std::env::var("HOME").map_or_else(
|_| { |_| {
APPLICATION_HOME = String::from("/tmp/backone_ui"); APPLICATION_HOME = String::from("/tmp/nexus_ui");
}, },
|home_dir| { |home_dir| {
APPLICATION_HOME = format!("{}/.backone_ui", home_dir); APPLICATION_HOME = format!("{}/.nexus_ui", home_dir);
}, },
); );
} }