mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Add preferences dialog
This commit is contained in:
parent
b8911eafaa
commit
cf96792029
7 changed files with 117 additions and 29 deletions
|
|
@ -24,10 +24,14 @@ impl Window {
|
|||
|
||||
get_widget!(builder, libhandy::ApplicationWindow, window);
|
||||
get_widget!(builder, libhandy::Leaflet, leaflet);
|
||||
get_widget!(builder, gtk::Button, add_button);
|
||||
get_widget!(builder, gtk::Box, sidebar_box);
|
||||
get_widget!(builder, gtk::Box, empty_screen);
|
||||
|
||||
let backend = Rc::new(Backend::new("test.sqlite", std::env::current_dir().unwrap()));
|
||||
let backend = Rc::new(Backend::new(
|
||||
"test.sqlite",
|
||||
std::env::current_dir().unwrap(),
|
||||
));
|
||||
let poe_list = PoeList::new(backend.clone());
|
||||
let navigator = Navigator::new(&empty_screen);
|
||||
|
||||
|
|
@ -60,6 +64,20 @@ impl Window {
|
|||
.pack_start(&result.poe_list.widget, true, true, 0);
|
||||
result.window.set_application(Some(app));
|
||||
|
||||
add_button.connect_clicked(clone!(@strong result => move |_| {
|
||||
TracksEditor::new(result.backend.clone(), &result.window, clone!(@strong result => move || {
|
||||
result.reload();
|
||||
})).show();
|
||||
}));
|
||||
|
||||
action!(
|
||||
result.window,
|
||||
"preferences",
|
||||
clone!(@strong result => move |_, _| {
|
||||
Preferences::new(result.backend.clone(), &result.window).show();
|
||||
})
|
||||
);
|
||||
|
||||
action!(
|
||||
result.window,
|
||||
"add-person",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue