diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs index 30cba6f..6421560 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -19,6 +19,9 @@ pub mod components { pub mod signin; pub use signin::{SignIn, Output as SignInOutput}; + + pub mod preferences; + pub use preferences::Preferences; } use components::{post_editor::Post, PostEditorInput}; @@ -274,8 +277,17 @@ impl AsyncComponent for App { let about_action: RelmAction<AboutAction> = RelmAction::new_stateless(move |_| { App::about().present(weak_window.upgrade().as_ref()); }); + let weak_window = window.downgrade(); let preferences_action: RelmAction<PreferencesAction> = RelmAction::new_stateless(move |_| { - log::warn!("Ain't implemented yet!"); + // This could be built as an action that sends an input to open preferences. + // + // But I find this an acceptable alternative. + let mut prefs = components::Preferences::builder() + .launch(()) + .detach(); + + prefs.emit(weak_window.upgrade().map(|w| w.upcast())); + prefs.detach_runtime(); }); let sign_out_action: RelmAction<SignOutAction> = RelmAction::new_stateless(move |_| { input_sender.emit(Input::SignOut) |