Skip to content

Commit

Permalink
fix(#25): do changes suggest by Rafał Mikrut (@qarmin)
Browse files Browse the repository at this point in the history
  • Loading branch information
xlmnxp committed Jan 14, 2022
1 parent 58585c3 commit b365de8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 2 additions & 17 deletions src/main.rs
Expand Up @@ -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 = {
Expand Down

0 comments on commit b365de8

Please sign in to comment.