mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-28 12:04:13 +00:00
use shared cancellable
This commit is contained in:
parent
2e8ee31cb0
commit
5c8aba30c5
@ -88,11 +88,12 @@ pub fn new(
|
||||
.build();
|
||||
|
||||
open.connect_clicked({
|
||||
let cancellable = cancellable.clone();
|
||||
let file_launcher = file_launcher.clone();
|
||||
let status = status.clone();
|
||||
move |this| {
|
||||
this.set_sensitive(false); // lock
|
||||
file_launcher.launch(Window::NONE, Cancellable::NONE, {
|
||||
file_launcher.launch(Window::NONE, Some(&cancellable), {
|
||||
let status = status.clone();
|
||||
let this = this.clone();
|
||||
move |result| {
|
||||
@ -117,6 +118,7 @@ pub fn new(
|
||||
|
||||
choose.connect_clicked({
|
||||
// init shared references
|
||||
let cancellable = cancellable.clone();
|
||||
let cancel = cancel.clone();
|
||||
let dialog = dialog.clone();
|
||||
let file_launcher = file_launcher.clone();
|
||||
@ -126,7 +128,7 @@ pub fn new(
|
||||
move |this| {
|
||||
// lock choose button to prevent double click
|
||||
this.set_sensitive(false);
|
||||
dialog.save(Window::NONE, Cancellable::NONE, {
|
||||
dialog.save(Window::NONE, Some(&cancellable), {
|
||||
// delegate shared references
|
||||
let cancel = cancel.clone();
|
||||
let file_launcher = file_launcher.clone();
|
||||
|
Loading…
x
Reference in New Issue
Block a user