Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/addiswebb/automate
Browse files Browse the repository at this point in the history
  • Loading branch information
addiswebb committed Jul 24, 2024
2 parents a3a5147 + ebdf525 commit ec8ddb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rfd::FileDialog;
use std::{
fs::File,
io::{BufReader, Read, Write},
path::PathBuf,
path::{Path, PathBuf},
sync::atomic::Ordering,
time::Instant,
};
Expand Down Expand Up @@ -157,7 +157,7 @@ impl App {
state.read_to_end(&mut bytes).unwrap();
if let Ok(data) = bincode::deserialize::<SequencerState>(bytes.as_slice()) {
self.sequencer.load_from_state(data);
self.file = path.file_name().unwrap().to_str().unwrap().to_string();
self.file = path.to_str().unwrap().to_string();
self.sequencer.loaded_file = self.file.clone();
self.file_uptodate = true;
std::mem::drop(state);
Expand Down Expand Up @@ -199,7 +199,7 @@ impl App {
};
ctx.send_viewport_cmd(egui::ViewportCommand::Title(format!(
"{}{} - Automate",
self.file, //.replace(".auto", ""),
Path::new(&self.file).file_name().unwrap().to_str().unwrap().to_string(), //.replace(".auto", ""),
saved,
)));
}
Expand Down Expand Up @@ -356,7 +356,7 @@ impl eframe::App for App {
.movable(true)
.collapsible(false)
.show(ctx, |ui| {
ui.label(format!("Do you want to save changes to {:?}", self.file));
ui.label(format!("Do you want to save changes to {:?}", Path::new(&self.file).file_name().unwrap().to_str().unwrap().to_string()));
ui.horizontal(|ui| {
if ui.button("Save").clicked() {
self.save_file();
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() -> eframe::Result<()> {
..Default::default()
};
eframe::run_native(
"untitled - Automate",
"Automate",
native_options,
Box::new(|cc| Ok(Box::new(automate::App::new(cc)))),
)
Expand Down

0 comments on commit ec8ddb4

Please sign in to comment.