diff --git a/Cargo.lock b/Cargo.lock index aa04ba2..ee2e19e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -132,7 +132,7 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "blue-recorder" -version = "0.1.4" +version = "0.1.5" dependencies = [ "chrono", "gdk", diff --git a/src/main.rs b/src/main.rs index b15d963..3fa0a65 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,23 +33,8 @@ fn main() { println!("Failed to initialize GTK."); return; } - let builder: Builder; - let user_interface_path_abs = { - let mut current_exec_dir = std::env::current_exe().unwrap(); - current_exec_dir.pop(); - current_exec_dir - } - .join(Path::new("interfaces/main.ui")); - - if user_interface_path_abs.exists() { - builder = Builder::from_file(user_interface_path_abs); - } else { - builder = Builder::from_file( - std::env::var("INTERFACES_DIR") - .unwrap_or(String::from("interfaces/")) - .add("main.ui"), - ); - } + let ui_src = include_str!("../interfaces/main.ui").to_string(); + let builder: Builder = Builder::from_string(ui_src.as_str()); // translate let mut po_path_abs = {