diff --git a/infur/src/gui.rs b/infur/src/gui.rs index fc88827..5e4b69a 100644 --- a/infur/src/gui.rs +++ b/infur/src/gui.rs @@ -356,6 +356,7 @@ impl eframe::App for InFur { self.allow_closing } + #[cfg(feature = "persistence")] fn save(&mut self, storage: &mut dyn eframe::Storage) { eframe::set_value(storage, eframe::APP_KEY, &self.config); } diff --git a/infur/src/main.rs b/infur/src/main.rs index 1c187d0..df99c91 100644 --- a/infur/src/main.rs +++ b/infur/src/main.rs @@ -118,15 +118,16 @@ fn main() -> Result<()> { "InFur", window_opts, Box::new(|cc| { - let config = match cc.storage { + let mut config = match cc.storage { + #[cfg(feature = "persistence")] Some(storage) => eframe::get_value(storage, eframe::APP_KEY).unwrap_or_default(), - None => todo!(), + _ => gui::ProcConfig::default(), }; - let mut app_gui = gui::InFur::new(config, ctrl_tx_gui, frame_rx, ctrl_result_rx); // still override video from args if !args.is_empty() { - app_gui.config.video_input = args; + config.video_input = args; } + let app_gui = gui::InFur::new(config, ctrl_tx_gui, frame_rx, ctrl_result_rx); Box::new(app_gui) }), );