Updated modules; fixed thread issues when calling MainApp::update_state
This commit is contained in:
parent
8a62ed5674
commit
79d63a174e
3 changed files with 26 additions and 23 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 50e612c865eef41076ba70d153051b63ff4ecc1e
|
Subproject commit 2206e00a963a3e1421a9d45d8f71f32a5c9b7acb
|
|
@ -1 +1 @@
|
||||||
Subproject commit e87f17c4085ca3617c9673b1139f622b88f8ab20
|
Subproject commit 9f2247a8200add10b7da738c257bd824832fa3c6
|
|
@ -880,17 +880,19 @@ impl App {
|
||||||
self.widgets.status_page.show();
|
self.widgets.status_page.show();
|
||||||
self.widgets.launcher_content.hide();
|
self.widgets.launcher_content.hide();
|
||||||
|
|
||||||
let (sender, receiver) = glib::MainContext::channel::<String>(glib::PRIORITY_DEFAULT);
|
|
||||||
let (send, recv) = std::sync::mpsc::channel();
|
let (send, recv) = std::sync::mpsc::channel();
|
||||||
|
|
||||||
receiver.attach(None, clone!(@strong self.widgets.status_page as status_page => move |description| {
|
let this = self.clone();
|
||||||
|
|
||||||
|
glib::MainContext::default().invoke(move || {
|
||||||
|
let (sender, receiver) = glib::MainContext::channel::<String>(glib::PRIORITY_DEFAULT);
|
||||||
|
|
||||||
|
receiver.attach(None, clone!(@strong this.widgets.status_page as status_page => move |description| {
|
||||||
status_page.set_description(Some(&description));
|
status_page.set_description(Some(&description));
|
||||||
|
|
||||||
glib::Continue(true)
|
glib::Continue(true)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
let this = self.clone();
|
|
||||||
|
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
match LauncherState::get(move |status| sender.send(status.to_string()).unwrap()) {
|
match LauncherState::get(move |status| sender.send(status.to_string()).unwrap()) {
|
||||||
Ok(state) => {
|
Ok(state) => {
|
||||||
|
@ -910,6 +912,7 @@ impl App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
Await::new(move || {
|
Await::new(move || {
|
||||||
recv.recv().unwrap()
|
recv.recv().unwrap()
|
||||||
|
|
Loading…
Reference in a new issue