mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 11:47:25 +01:00
Show file dialog for library selection
This commit is contained in:
parent
3df4e8e3f4
commit
8c56e90994
7 changed files with 160 additions and 17 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use crate::welcome_page::MusicusWelcomePage;
|
||||
|
||||
use adw::subclass::prelude::*;
|
||||
use gtk::{gio, glib};
|
||||
use gtk::{gio, glib, prelude::*};
|
||||
|
||||
mod imp {
|
||||
use super::*;
|
||||
|
|
@ -20,7 +20,9 @@ mod imp {
|
|||
type ParentType = adw::ApplicationWindow;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
||||
MusicusWelcomePage::static_type();
|
||||
klass.bind_template();
|
||||
klass.bind_template_instance_callbacks();
|
||||
}
|
||||
|
||||
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
|
||||
|
|
@ -31,8 +33,6 @@ mod imp {
|
|||
impl ObjectImpl for MusicusWindow {
|
||||
fn constructed(&self) {
|
||||
self.parent_constructed();
|
||||
|
||||
self.navigation_view.add(&MusicusWelcomePage::new());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -48,10 +48,17 @@ glib::wrapper! {
|
|||
@implements gio::ActionGroup, gio::ActionMap;
|
||||
}
|
||||
|
||||
#[gtk::template_callbacks]
|
||||
impl MusicusWindow {
|
||||
pub fn new<P: glib::IsA<gtk::Application>>(application: &P) -> Self {
|
||||
glib::Object::builder()
|
||||
.property("application", application)
|
||||
.build()
|
||||
}
|
||||
|
||||
#[template_callback]
|
||||
async fn set_library_folder(&self, folder: &gio::File) {
|
||||
let path = folder.path();
|
||||
log::info!("{path:?}");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue