mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
reorder asc
This commit is contained in:
parent
23c4832f9a
commit
df99760d0f
@ -31,11 +31,11 @@ pub fn new(
|
||||
let dialog = FileDialog::builder().initial_name(initial_filename).build();
|
||||
let file_launcher = FileLauncher::new(File::NONE);
|
||||
|
||||
let cancel = Rc::new(Cancel::new());
|
||||
let choose = Rc::new(Choose::new());
|
||||
let open = Rc::new(Open::new());
|
||||
let progress = Rc::new(Progress::new());
|
||||
let status = Rc::new(Status::new());
|
||||
let cancel = Rc::new(Cancel::new());
|
||||
let open = Rc::new(Open::new());
|
||||
let choose = Rc::new(Choose::new());
|
||||
|
||||
// Init events
|
||||
cancel.on_activate({
|
||||
@ -59,26 +59,6 @@ pub fn new(
|
||||
}
|
||||
});
|
||||
|
||||
open.on_activate({
|
||||
let cancellable = cancellable.clone();
|
||||
let file_launcher = file_launcher.clone();
|
||||
let status = status.clone();
|
||||
move |_, button| {
|
||||
button.set_sensitive(false); // lock
|
||||
file_launcher.launch(Window::NONE, Some(&cancellable), {
|
||||
let status = status.clone();
|
||||
let button = button.clone();
|
||||
move |result| {
|
||||
if let Err(ref e) = result {
|
||||
status.label.set_css_classes(&["error"]);
|
||||
status.label.set_label(e.message())
|
||||
}
|
||||
button.set_sensitive(true); // unlock
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
choose.on_activate({
|
||||
// init shared references
|
||||
let cancellable = cancellable.clone();
|
||||
@ -141,6 +121,26 @@ pub fn new(
|
||||
}
|
||||
});
|
||||
|
||||
open.on_activate({
|
||||
let cancellable = cancellable.clone();
|
||||
let file_launcher = file_launcher.clone();
|
||||
let status = status.clone();
|
||||
move |_, button| {
|
||||
button.set_sensitive(false); // lock
|
||||
file_launcher.launch(Window::NONE, Some(&cancellable), {
|
||||
let status = status.clone();
|
||||
let button = button.clone();
|
||||
move |result| {
|
||||
if let Err(ref e) = result {
|
||||
status.label.set_css_classes(&["error"]);
|
||||
status.label.set_label(e.message())
|
||||
}
|
||||
button.set_sensitive(true); // unlock
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
// Init `child` as the container for extra features
|
||||
let child = Box::builder().orientation(Orientation::Vertical).build();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user