feat: implement closure for GettingStartedPage's "Open File" button
parent
82841a1271
commit
d022ed7bc1
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue