mirror of
https://github.com/djibux/BoilR.git
synced 2026-09-01 05:53:41 +02:00
Add Lutris settings to UI
This commit is contained in:
+13
-3
@@ -8,7 +8,7 @@ class UserInterface {open
|
||||
} {
|
||||
Fl_Window win {
|
||||
label {BoilR} open
|
||||
xywh {1 1 500 475} type Double visible
|
||||
xywh {1 1 500 525} type Double visible
|
||||
} {
|
||||
|
||||
# ----- Steam -----
|
||||
@@ -95,17 +95,27 @@ class UserInterface {open
|
||||
label Uplay
|
||||
xywh {25 375 155 25} down_box DOWN_BOX
|
||||
}
|
||||
|
||||
# ----- Lutris -----
|
||||
Fl_Check_Button enable_lutris_checkbox {
|
||||
label Lutris
|
||||
xywh {25 425 155 25} down_box DOWN_BOX
|
||||
}
|
||||
Fl_Input lutris_executable_input {
|
||||
label {Lutris Executable}
|
||||
xywh {175 425 300 25} align 5
|
||||
}
|
||||
|
||||
|
||||
# ----- Buttons -----
|
||||
|
||||
Fl_Button save_settings_button {
|
||||
label {Save Settings}
|
||||
xywh {25 425 125 25}
|
||||
xywh {25 475 125 25}
|
||||
}
|
||||
Fl_Button synchronize_button {
|
||||
label {Synchronize Games}
|
||||
xywh {175 425 300 25}
|
||||
xywh {175 475 300 25}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
-2
@@ -1,9 +1,8 @@
|
||||
use crate::sync::run_sync;
|
||||
use crate::ui::UserInterface;
|
||||
use crate::{egs::get_default_location, settings::Settings};
|
||||
use fltk::enums::Color;
|
||||
use fltk::{app, prelude::*};
|
||||
use fltk_theme::{ColorTheme, WidgetTheme, color_themes, ThemeType};
|
||||
use fltk_theme::{WidgetTheme, ThemeType};
|
||||
use futures::executor::block_on;
|
||||
use std::error::Error;
|
||||
use std::{cell::RefCell, rc::Rc};
|
||||
@@ -90,6 +89,10 @@ fn update_settings_with_ui_values(settings: &mut Settings, ui: &UserInterface) {
|
||||
|
||||
// Uplay
|
||||
settings.uplay.enabled = ui.enable_uplay_checkbox.value();
|
||||
|
||||
// Lutris
|
||||
settings.lutris.enabled = ui.enable_lutris_checkbox.value();
|
||||
settings.lutris.executable = empty_or_whitespace(ui.lutris_executable_input.value());
|
||||
}
|
||||
|
||||
fn save_settings_to_file(settings: &Settings) {
|
||||
@@ -195,4 +198,15 @@ fn update_ui_with_settings(ui: &mut UserInterface, settings: &Settings) {
|
||||
}
|
||||
|
||||
ui.enable_uplay_checkbox.set_value(settings.uplay.enabled);
|
||||
|
||||
|
||||
ui.enable_lutris_checkbox.set_value(settings.lutris.enabled);
|
||||
ui.lutris_executable_input.set_value(
|
||||
settings
|
||||
.lutris
|
||||
.executable
|
||||
.clone()
|
||||
.unwrap_or(String::from("lutris"))
|
||||
.as_str(),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user