mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Fix no ui download images (#195)
This commit is contained in:
@@ -107,7 +107,7 @@ impl MyEguiApp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_sync(&mut self) {
|
pub fn run_sync(&mut self, wait: bool ) {
|
||||||
let (sender, reciever) = watch::channel(SyncProgress::NotStarted);
|
let (sender, reciever) = watch::channel(SyncProgress::NotStarted);
|
||||||
let settings = self.settings.clone();
|
let settings = self.settings.clone();
|
||||||
if settings.steam.stop_steam {
|
if settings.steam.stop_steam {
|
||||||
@@ -115,7 +115,7 @@ impl MyEguiApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.status_reciever = reciever;
|
self.status_reciever = reciever;
|
||||||
self.rt.spawn_blocking(move || {
|
let handle = self.rt.spawn_blocking(move || {
|
||||||
MyEguiApp::save_settings_to_file(&settings);
|
MyEguiApp::save_settings_to_file(&settings);
|
||||||
let mut some_sender = Some(sender);
|
let mut some_sender = Some(sender);
|
||||||
backup_shortcuts(&settings.steam);
|
backup_shortcuts(&settings.steam);
|
||||||
@@ -133,6 +133,9 @@ impl MyEguiApp {
|
|||||||
crate::steam::ensure_steam_started(&settings.steam);
|
crate::steam::ensure_steam_started(&settings.steam);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if wait {
|
||||||
|
self.rt.block_on(handle).unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn save_settings_to_file(settings: &Settings) {
|
pub fn save_settings_to_file(settings: &Settings) {
|
||||||
|
|||||||
+2
-2
@@ -181,7 +181,7 @@ impl App for MyEguiApp {
|
|||||||
.clicked()
|
.clicked()
|
||||||
&& !syncing
|
&& !syncing
|
||||||
{
|
{
|
||||||
self.run_sync();
|
self.run_sync(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -272,7 +272,7 @@ fn setup(ctx: &egui::Context) {
|
|||||||
}
|
}
|
||||||
pub fn run_sync() {
|
pub fn run_sync() {
|
||||||
let mut app = MyEguiApp::new();
|
let mut app = MyEguiApp::new();
|
||||||
app.run_sync();
|
app.run_sync(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run_ui(args: Vec<String>) -> Result<(), Box<dyn Error>> {
|
pub fn run_ui(args: Vec<String>) -> Result<(), Box<dyn Error>> {
|
||||||
|
|||||||
Reference in New Issue
Block a user