preferences: Add settings for library URL

This commit is contained in:
Elias Projahn 2025-03-23 10:25:28 +01:00
parent d12e6a02a4
commit a21a63e4b8
3 changed files with 47 additions and 0 deletions

View file

@ -19,6 +19,10 @@ mod imp {
pub avoid_repeated_instruments_adjustment: TemplateChild<gtk::Adjustment>,
#[template_child]
pub play_full_recordings_row: TemplateChild<adw::SwitchRow>,
#[template_child]
pub use_custom_url_row: TemplateChild<adw::SwitchRow>,
#[template_child]
pub custom_url_row: TemplateChild<adw::EntryRow>,
}
#[glib::object_subclass]
@ -83,6 +87,23 @@ mod imp {
"active",
)
.build();
settings
.bind(
"use-custom-library-url",
&*self.use_custom_url_row,
"active",
)
.build();
settings
.bind("custom-library-url", &*self.custom_url_row, "text")
.build();
self.use_custom_url_row
.bind_property("active", &*self.custom_url_row, "sensitive")
.sync_create()
.build();
}
}