mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-27 04:07:25 +01:00
Impleme library downloads
This commit is contained in:
parent
a21a63e4b8
commit
bf1ffef05a
13 changed files with 1231 additions and 46 deletions
|
|
@ -24,6 +24,8 @@ mod imp {
|
|||
#[template_child]
|
||||
pub description_label: TemplateChild<gtk::Label>,
|
||||
#[template_child]
|
||||
pub message_label: TemplateChild<gtk::Label>,
|
||||
#[template_child]
|
||||
pub success_label: TemplateChild<gtk::Label>,
|
||||
#[template_child]
|
||||
pub error_label: TemplateChild<gtk::Label>,
|
||||
|
|
@ -69,6 +71,11 @@ mod imp {
|
|||
.bind_property("progress", &*self.progress_bar, "fraction")
|
||||
.build();
|
||||
|
||||
let obj = self.obj().to_owned();
|
||||
self.obj().process().connect_message_notify(move |_| {
|
||||
obj.update();
|
||||
});
|
||||
|
||||
let obj = self.obj().to_owned();
|
||||
self.obj().process().connect_finished_notify(move |_| {
|
||||
obj.update();
|
||||
|
|
@ -107,6 +114,16 @@ impl ProcessRow {
|
|||
}
|
||||
|
||||
fn update(&self) {
|
||||
match self.process().message() {
|
||||
Some(message) => {
|
||||
self.imp().message_label.set_visible(true);
|
||||
self.imp().message_label.set_label(&message);
|
||||
}
|
||||
None => {
|
||||
self.imp().message_label.set_visible(false);
|
||||
}
|
||||
}
|
||||
|
||||
if !self.process().finished() {
|
||||
self.imp()
|
||||
.progress_bar
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue