save state depend on build mode
This commit is contained in:
parent
030be79192
commit
6dcd9ed7df
|
@ -7,10 +7,6 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
eframe = "0.25.0"
|
||||
# env_logger = { version = "0.10.1", default-features = false, features = [
|
||||
# "auto-color",
|
||||
# "humantime",
|
||||
# ] }
|
||||
rfd = "0.12.1"
|
||||
egui_extras = "0.25.0"
|
||||
image = "0.24.8"
|
||||
|
|
|
@ -36,3 +36,4 @@ Max framerate => 30 fps (less cpu usage)
|
|||
|
||||
# 1.0.4 :
|
||||
Added close tab and refresh confirm prompt
|
||||
Async terminal !
|
||||
|
|
|
@ -7,9 +7,14 @@ use std::{path::Path, sync::Arc, time, thread};
|
|||
|
||||
use calcifer::code_editor::themes::DEFAULT_THEMES;
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
const SAVE_PATH : &str = "/home/penwing/Documents/.saves/debug/calcifer_save.json";
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
const SAVE_PATH : &str = "/home/penwing/Documents/.saves/calcifer_save.json";
|
||||
|
||||
const TERMINAL_HEIGHT : f32 = 200.0;
|
||||
const RED : egui::Color32 = egui::Color32::from_rgb(235, 108, 99);
|
||||
const SAVE_PATH : &str = "/home/penwing/Documents/.saves/calcifer_save.json";
|
||||
const TIME_LABELS : [&str; 5] = ["settings", "tree", "terminal", "tabs", "content"];
|
||||
const MAX_FPS : f32 = 30.0;
|
||||
const PATH_ROOT : &str = "/home/penwing/Documents/";
|
||||
|
@ -19,8 +24,6 @@ const MAX_TABS : usize = 20;
|
|||
|
||||
fn main() -> Result<(), eframe::Error> {
|
||||
let icon_data = tools::load_icon();
|
||||
|
||||
//env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
|
||||
let options = eframe::NativeOptions {
|
||||
viewport: egui::ViewportBuilder::default()
|
||||
.with_inner_size([1200.0, 800.0])
|
||||
|
|
|
@ -36,6 +36,8 @@ pub fn save_state(state: &AppState, file_path: &str) -> Result<(), std::io::Erro
|
|||
.open(file_path)?;
|
||||
|
||||
file.write_all(serialized_state.as_bytes())?;
|
||||
|
||||
println!("Saved state at {}", file_path);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue