mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Add UI to import folders
This commit is contained in:
parent
0eacd255e8
commit
3b82bb3ef2
2 changed files with 22 additions and 43 deletions
|
|
@ -48,49 +48,27 @@
|
|||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="vexpand">True</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-top">18</property>
|
||||
<property name="margin-bottom">18</property>
|
||||
<property name="margin-start">18</property>
|
||||
<property name="margin-end">18</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">18</property>
|
||||
<object class="HdyStatusPage">
|
||||
<property name="vexpand">true</property>
|
||||
<property name="icon-name">folder-music-symbolic</property>
|
||||
<property name="title" translatable="yes">Import music</property>
|
||||
<property name="description" translatable="yes">Select the source which contains the new audio files below.</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="opacity">0.5019607843137255</property>
|
||||
<property name="pixel-size">80</property>
|
||||
<property name="icon-name">media-optical-cd-audio-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="opacity">0.5019607843137255</property>
|
||||
<property name="label" translatable="yes">Import from audio CD</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="16384"/>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="opacity">0.5019607843137255</property>
|
||||
<property name="label" translatable="yes">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.</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="max-width-chars">40</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="import_button">
|
||||
<property name="label" translatable="yes">Import</property>
|
||||
<property name="receives-default">True</property>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="homogeneous">true</property>
|
||||
<property name="spacing">6</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
<class name="suggested-action"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton" id="folder_button">
|
||||
<property name="label" translatable="true">Select folder</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="disc_button">
|
||||
<property name="label" translatable="true">Copy audio CD</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue