diff options
Diffstat (limited to 'src/file_registry.rs')
| -rw-r--r-- | src/file_registry.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/file_registry.rs b/src/file_registry.rs index 25aba3f..6ebf986 100644 --- a/src/file_registry.rs +++ b/src/file_registry.rs @@ -5,6 +5,7 @@ use std::cell::RefCell; use std::path::PathBuf; +use relm4::ComponentController; use relm4::component::Controller; use relm4::gtk; @@ -50,3 +51,12 @@ pub fn unregister_file(path: &PathBuf) { files.retain(|(file_path, _)| file_path != path); }); } + +/// Broadcasts a message to all windows. +pub fn broadcast_to_all_windows(message: crate::actions::Action) { + WINDOW_CONTROLLERS.with_borrow(|controllers| { + for controller in controllers { + controller.sender().emit(message.clone()); + } + }); +} |