feat: implement closure for GettingStartedPage's "Open File" button

feat/getting-started
Nefo Fortressia 2021-11-13 21:08:32 +07:00
parent 82841a1271
commit d022ed7bc1
Signed by: fortressia
GPG Key ID: 6D7972CC76174995
1 changed files with 12 additions and 5 deletions

View File

@ -19,10 +19,17 @@ impl GettingStartedPage {
glib::Object::new(&[]).expect("Failed to create 'GettingStartedPage' component.") glib::Object::new(&[]).expect("Failed to create 'GettingStartedPage' component.")
} }
pub fn setup_actions<P: glib::IsA<crate::components::EchidnaWindow>>(&self, window: &P) pub fn to_imp(&self) -> &imp::GettingStartedPage {
where imp::GettingStartedPage::from_instance(self)
P: FileImplementedEditor, }
{ pub fn setup_actions(&self, window: &crate::components::EchidnaWindow) -> &Self {
let imp_class = imp::GettingStartedPage::from_instance(self); let imp_class = self.to_imp();
imp_class
.link_open_file
.connect_clicked(clone!(@weak window =>
move |_| {
window.action_open_file();
}));
self
} }
} }