BackOneUI -> NexusUI
This commit is contained in:
1 parent
b8c5053858
commit
35a1050697
1 file changed
+13
-13
+13
-13
@@ -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";
|
||||
|
||||
#[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 */
|
||||
@@ -195,7 +195,7 @@ fn refresh_windows_start_on_login() {
|
||||
let hkcu = winreg::RegKey::predef(winreg::enums::HKEY_CURRENT_USER);
|
||||
let startup = hkcu.open_subkey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");
|
||||
let enabled = startup.map_or(false, |startup| {
|
||||
startup.get_value::<String, &str>("BackOneUI").is_ok()
|
||||
startup.get_value::<String, &str>("NexusUI").is_ok()
|
||||
});
|
||||
unsafe {
|
||||
START_ON_LOGIN = enabled;
|
||||
@@ -274,7 +274,7 @@ fn notify(text: &str, _: Option<(String, String)>) {
|
||||
let _ = notify_rust::Notification::new()
|
||||
.icon(ico.as_str())
|
||||
.body(text)
|
||||
.appname("BackOne")
|
||||
.appname("Nexus")
|
||||
.show();
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ fn notify(text: &str, _: Option<(String, String)>) {
|
||||
fn notify(text: &str, _: Option<(String, String)>) {
|
||||
let _ = notify_rust::Notification::new()
|
||||
.body(text)
|
||||
.appname("BackOne")
|
||||
.appname("Nexus")
|
||||
.show();
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ fn notify(text: &str, _: Option<(String, String)>) {
|
||||
fn notify(text: &str, _: Option<(String, String)>) {
|
||||
let _ = mac_notification_sys::set_application(MAC_BUNDLE_ID);
|
||||
let mut n = mac_notification_sys::Notification::new();
|
||||
n.title("BackOne");
|
||||
n.title("Nexus");
|
||||
n.message(text);
|
||||
n.asynchronous(true);
|
||||
let _ = n.send();
|
||||
@@ -873,7 +873,7 @@ fn tray_main() {
|
||||
let _ = out.map(|app_list| {
|
||||
String::from_utf8(app_list.stdout).map(|app_list| {
|
||||
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"'
|
||||
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;
|
||||
} else {
|
||||
// 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);
|
||||
@@ -912,12 +912,12 @@ fn tray_main() {
|
||||
if startup.is_ok() {
|
||||
let startup = startup.unwrap().0;
|
||||
if unsafe { START_ON_LOGIN } {
|
||||
let _ = startup.delete_value("BackOneUI");
|
||||
let _ = startup.delete_value("NexusUI");
|
||||
} else {
|
||||
let exe = String::from(
|
||||
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();
|
||||
@@ -946,7 +946,7 @@ fn tray_main() {
|
||||
});
|
||||
} else {
|
||||
menu.push(TrayMenuItem::Text {
|
||||
text: "Waiting for BackOne system service...".into(),
|
||||
text: "Waiting for Nexus system service...".into(),
|
||||
checked: false,
|
||||
disabled: true,
|
||||
handler: None,
|
||||
@@ -986,7 +986,7 @@ fn tray_main() {
|
||||
&& sso_notification_shown.lock().insert(nwid.clone())
|
||||
{
|
||||
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()))
|
||||
);
|
||||
}
|
||||
@@ -1064,10 +1064,10 @@ fn main() {
|
||||
unsafe {
|
||||
let _ = std::env::var("HOME").map_or_else(
|
||||
|_| {
|
||||
APPLICATION_HOME = String::from("/tmp/backone_ui");
|
||||
APPLICATION_HOME = String::from("/tmp/nexus_ui");
|
||||
},
|
||||
|home_dir| {
|
||||
APPLICATION_HOME = format!("{}/.backone_ui", home_dir);
|
||||
APPLICATION_HOME = format!("{}/.nexus_ui", home_dir);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user