Re-implement file opening
This commit is contained in:
@@ -21,15 +21,16 @@ pub enum SheetListingInput {
|
||||
ListBoxRowClicked(i32),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct SheetModelSelected {
|
||||
sheet_model_type: SheetModelType,
|
||||
pub sheet_model_type: SheetModelType,
|
||||
}
|
||||
|
||||
#[relm4::component(pub)]
|
||||
impl SimpleComponent for SheetListingModel {
|
||||
type Init = Vec<SheetModelType>;
|
||||
type Input = SheetListingInput;
|
||||
type Output = ();
|
||||
type Output = SheetModelSelected;
|
||||
|
||||
view! {
|
||||
#[root]
|
||||
@@ -63,7 +64,7 @@ impl SimpleComponent for SheetListingModel {
|
||||
ComponentParts { model, widgets }
|
||||
}
|
||||
|
||||
fn update(&mut self, message: Self::Input, _sender: ComponentSender<Self>) {
|
||||
fn update(&mut self, message: Self::Input, sender: ComponentSender<Self>) {
|
||||
match message {
|
||||
SheetListingInput::Query(query) => {
|
||||
self.sheets.broadcast(OnQueryUpdate { query });
|
||||
@@ -71,6 +72,11 @@ impl SimpleComponent for SheetListingModel {
|
||||
SheetListingInput::ListBoxRowClicked(index) => {
|
||||
let x = self.sheets.get(index as usize).unwrap();
|
||||
debug!("clicked: {}!!!!!", x.label);
|
||||
sender
|
||||
.output(SheetModelSelected {
|
||||
sheet_model_type: x.sheet_model_type.clone(),
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user