diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-09-27 13:14:16 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-09-27 13:40:02 +0300 |
commit | d44a68ec6950c533cf67ee2a34f9888a4ae569cc (patch) | |
tree | 53290428c5e295fcc6c0999dcbfd92fc54acfb13 /ui/src/state.rs | |
parent | 713c4f73b991544259301d87fd2c79007e96db8f (diff) |
ui: don't quit if editing a draft
Ask user to save draft or discard it.
Diffstat (limited to 'ui/src/state.rs')
-rw-r--r-- | ui/src/state.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/src/state.rs b/ui/src/state.rs index 326a906a..2764d6b1 100644 --- a/ui/src/state.rs +++ b/ui/src/state.rs @@ -514,6 +514,10 @@ impl State { } } + pub fn can_quit_cleanly(&mut self) -> bool { + self.components.iter_mut().all(|c| c.can_quit_cleanly()) + } + pub fn register_component(&mut self, component: Box<dyn Component>) { self.components.push(component); } |