diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b86a7e5..b353a96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,11 @@ jobs: toolchain: stable override: true + - name: Install musl-gcc + run: | + sudo apt-get update + sudo apt-get install -y musl-tools + - name: Install target run: rustup target add ${{ matrix.target }} diff --git a/Cargo.toml b/Cargo.toml index 080687a..90e50f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,12 +2,13 @@ name = "calcifer" version = "1.4.0" edition = "2021" -#build = "build/build.rs" +build = "build/build.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] eframe = "0.25.0" +tinyfiledialogs = "3.0" egui_extras = "0.25.0" image = "0.24.8" serde = { version = "1.0.195", features = ["derive"] } diff --git a/calcifer.project b/calcifer.project index e55f2ed..77c0510 100644 --- a/calcifer.project +++ b/calcifer.project @@ -1 +1 @@ -{"categories":[{"name":"to do","content":[{"name":"update workflow .yml","description":"make a workflow compiling the calcifer and put the linux in calcifer-{version}\nand the windows in calcifer_windows_{version}\n\nupdate nix\nupdate jiji","id":5}]},{"name":"in progress","content":[{"name":"export copy paste fix","description":"// Hello there","id":1}]},{"name":"done","content":[{"name":"move .project file","description":"// Hello there","id":4},{"name":"move config","description":"config from .calcifer/save.json\nto .config/calcifer/state.json","id":1},{"name":"add id to textarea per tab","description":"to improve undo, make each code area of each tab have a unique id (no more undo into another tab)","id":1},{"name":"file tree id ?","description":"// Hello there","id":1},{"name":"open dir in tree ?","description":"// Hello there","id":2},{"name":"fix tab title","description":"// Hello there","id":2}]},{"name":"+","content":[]}]} \ No newline at end of file +{"categories":[{"name":"to do","content":[{"name":"update workflow .yml","description":"make a workflow compiling the calcifer and put the linux in calcifer-{version}\nand the windows in calcifer_windows_{version}\n\nupdate nix\nupdate jiji","id":5},{"name":"repair build.rs","description":"// Hello there","id":1},{"name":"repair tinyfiledialog","description":"// Hello there","id":2}]},{"name":"in progress","content":[{"name":"export copy paste fix","description":"// Hello there","id":1}]},{"name":"done","content":[{"name":"move .project file","description":"// Hello there","id":4},{"name":"move config","description":"config from .calcifer/save.json\nto .config/calcifer/state.json","id":1},{"name":"add id to textarea per tab","description":"to improve undo, make each code area of each tab have a unique id (no more undo into another tab)","id":1},{"name":"file tree id ?","description":"// Hello there","id":1},{"name":"open dir in tree ?","description":"// Hello there","id":2},{"name":"fix tab title","description":"// Hello there","id":2}]},{"name":"+","content":[]}]} \ No newline at end of file diff --git a/src/core/app.rs b/src/core/app.rs index 5c779f0..74ec492 100644 --- a/src/core/app.rs +++ b/src/core/app.rs @@ -51,16 +51,15 @@ impl Calcifer { } else { self.tabs[self.selected_tab].path.to_string_lossy() }; - println!("app : tried to open dialog at {}", save_path); -// if let Some(path_string) = tinyfiledialogs::save_file_dialog("Save as", &save_path) -// { -// let path = PathBuf::from(path_string); -// if let Err(err) = fs::write(&path, &self.tabs[self.selected_tab].code) { -// eprintln!("Error writing file: {}", err); -// return None; -// } -// return Some(path); -// } + if let Some(path_string) = tinyfiledialogs::save_file_dialog("Save as", &save_path) + { + let path = PathBuf::from(path_string); + if let Err(err) = fs::write(&path, &self.tabs[self.selected_tab].code) { + eprintln!("Error writing file: {}", err); + return None; + } + return Some(path); + } None } diff --git a/src/core/ui.rs b/src/core/ui.rs index 0626301..ad05556 100644 --- a/src/core/ui.rs +++ b/src/core/ui.rs @@ -22,11 +22,10 @@ impl Calcifer { .show(ctx, |ui| { ui.vertical(|ui| { if ui.add(egui::Button::new("📁")).clicked() { - println!("ui : open file, wip"); -// if let Some(path_string) = tinyfiledialogs::open_file_dialog("Open File", &self.home.to_string_lossy(), None) -// { -// self.open_file(Some(&Path::new(&path_string))); -// } + if let Some(path_string) = tinyfiledialogs::open_file_dialog("Open File", &self.home.to_string_lossy(), None) + { + self.open_file(Some(&Path::new(&path_string))); + } } ui.separator(); self.tree_visible = self.toggle(ui, self.tree_visible, "📦");