From 3b82bb3ef2752ce9ce2edf9c6828a2980721fe79 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Tue, 26 Jan 2021 17:51:19 +0100 Subject: [PATCH] Add UI to import folders --- res/ui/source_selector.ui | 60 +++++++++++------------------------ src/import/source_selector.rs | 5 +-- 2 files changed, 22 insertions(+), 43 deletions(-) diff --git a/res/ui/source_selector.ui b/res/ui/source_selector.ui index 7de7e90..84f7a43 100644 --- a/res/ui/source_selector.ui +++ b/res/ui/source_selector.ui @@ -48,49 +48,27 @@ - - True - center - center - 18 - 18 - 18 - 18 - vertical - 18 + + true + folder-music-symbolic + Import music + Select the source which contains the new audio files below. - - 0.5019607843137255 - 80 - media-optical-cd-audio-symbolic - - - - - 0.5019607843137255 - Import from audio CD - - - - - - - - 0.5019607843137255 - Insert an audio compact disc into your drive and click the button below. The disc will be copied in the background while you set up the metadata. - center - True - 40 - - - - - Import - True + + horizontal + true + 6 center - + + + Select folder + + + + + Copy audio CD + + diff --git a/src/import/source_selector.rs b/src/import/source_selector.rs index 0dbde5e..836255e 100644 --- a/src/import/source_selector.rs +++ b/src/import/source_selector.rs @@ -28,7 +28,8 @@ impl SourceSelector { get_widget!(builder, gtk::Button, back_button); get_widget!(builder, gtk::Stack, stack); get_widget!(builder, gtk::InfoBar, info_bar); - get_widget!(builder, gtk::Button, import_button); + get_widget!(builder, gtk::Button, folder_button); + get_widget!(builder, gtk::Button, disc_button); let this = Rc::new(Self { backend, @@ -47,7 +48,7 @@ impl SourceSelector { } })); - import_button.connect_clicked(clone!(@strong this => move |_| { + disc_button.connect_clicked(clone!(@strong this => move |_| { this.stack.set_visible_child_name("loading"); let context = glib::MainContext::default();