diff --git a/gui/mainview.fl b/gui/mainview.fl index 4644091..c10d815 100644 --- a/gui/mainview.fl +++ b/gui/mainview.fl @@ -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} } } } diff --git a/src/ui/ui.rs b/src/ui/ui.rs index 45be4a8..f793e99 100644 --- a/src/ui/ui.rs +++ b/src/ui/ui.rs @@ -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(), + ); }