diff --git a/bottles/frontend/views/bottle_preferences.py b/bottles/frontend/views/bottle_preferences.py index c6f96da035..e09ff04629 100644 --- a/bottles/frontend/views/bottle_preferences.py +++ b/bottles/frontend/views/bottle_preferences.py @@ -140,19 +140,19 @@ def __init__(self, details, config, **kwargs): self.details = details # region signals + self.row_overrides.connect("activated", self.__show_dll_overrides_view) + self.row_env_variables.connect("activated", self.__show_environment_variables) + self.row_drives.connect("activated", self.__show_drives) self.row_manage_display.connect("activated", self.__show_display_settings) - self.row_overrides.connect("activated", self.__show_feature_dialog, DLLOverridesDialog) - self.row_env_variables.connect("activated", self.__show_feature_dialog, EnvVarsDialog) - self.row_drives.connect("activated", self.__show_feature_dialog, DrivesDialog) - self.btn_manage_gamescope.connect("clicked", self.__show_feature_dialog, GamescopeDialog) - self.btn_manage_vkbasalt.connect("clicked", self.__show_feature_dialog, VkBasaltDialog) - self.btn_manage_fsr.connect("clicked", self.__show_feature_dialog, FsrDialog) - self.btn_manage_mangohud.connect("clicked", self.__show_feature_dialog, MangoHudDialog) - self.btn_manage_sandbox.connect("clicked", self.__show_feature_dialog, SandboxDialog) - self.btn_manage_vmtouch.connect("clicked", self.__show_feature_dialog, VmtouchDialog) + self.btn_manage_gamescope.connect("clicked", self.__show_gamescope_settings) + self.btn_manage_vkbasalt.connect("clicked", self.__show_vkbasalt_settings) + self.btn_manage_fsr.connect("clicked", self.__show_fsr_settings) + self.btn_manage_mangohud.connect("clicked", self.__show_mangohud_settings) + self.btn_manage_sandbox.connect("clicked", self.__show_sandbox_settings) self.btn_manage_versioning_patterns.connect( - "clicked", self.__show_feature_dialog, ExclusionPatternsDialog + "clicked", self.__show_exclusionpatterns_settings ) + self.btn_manage_vmtouch.connect("clicked", self.__show_vmtouch_settings) self.btn_cwd.connect("clicked", self.choose_cwd) self.btn_cwd_reset.connect("clicked", self.reset_cwd, True) self.switch_mangohud.connect("state-set", self.__toggle_mangohud) @@ -582,6 +582,22 @@ def set_config(self, config: BottleConfig): self.__set_steam_rules() + def __show_gamescope_settings(self, widget): + new_window = GamescopeDialog(window=self.window, config=self.config) + new_window.present() + + def __show_vkbasalt_settings(self, widget): + new_window = VkBasaltDialog(parent_window=self.window, config=self.config) + new_window.present() + + def __show_fsr_settings(self, widget): + new_window = FsrDialog(parent_window=self.window, config=self.config) + new_window.present() + + def __show_mangohud_settings(self, widget): + new_window = MangoHudDialog(parent_window=self.window, config=self.config) + new_window.present() + def __show_display_settings(self, widget): new_window = DisplayDialog( parent_window=self.window, @@ -593,10 +609,26 @@ def __show_display_settings(self, widget): ) new_window.present() - def __show_feature_dialog(self, _widget: Gtk.Widget, dialog: Adw.Window) -> None: - """Present dialog of a specific feature.""" - window = dialog(window=self.window, config=self.config) - window.present() + def __show_exclusionpatterns_settings(self, widget): + new_window = ExclusionPatternsDialog(window=self.window, config=self.config) + new_window.present() + + def __show_sandbox_settings(self, widget): + new_window = SandboxDialog(window=self.window, config=self.config) + new_window.present() + + def __show_drives(self, widget): + new_window = DrivesDialog(window=self.window, config=self.config) + new_window.present() + + def __show_environment_variables(self, widget=False): + """Show the environment variables dialog""" + new_window = EnvVarsDialog(window=self.window, config=self.config) + new_window.present() + + def __show_vmtouch_settings(self, widget): + new_window = VmtouchDialog(window=self.window, config=self.config) + new_window.present() def __set_sync_type(self, *_args): """ @@ -999,6 +1031,11 @@ def __set_language(self, *_args): value=language[0], ).data["config"] + def __show_dll_overrides_view(self, widget=False): + """Show the DLL overrides view""" + new_window = DLLOverridesDialog(window=self.window, config=self.config) + new_window.present() + @GtkUtils.run_in_main_loop def set_dxvk_status(self, status=None, error=None, pending=False): """Set the dxvk status""" diff --git a/bottles/frontend/windows/fsr.py b/bottles/frontend/windows/fsr.py index 02261e991a..1d863be916 100644 --- a/bottles/frontend/windows/fsr.py +++ b/bottles/frontend/windows/fsr.py @@ -31,13 +31,13 @@ class FsrDialog(Adw.Window): str_list_quality_mode = Gtk.Template.Child() spin_sharpening_strength = Gtk.Template.Child() - def __init__(self, window, config, **kwargs): + def __init__(self, parent_window, config, **kwargs): super().__init__(**kwargs) - self.set_transient_for(window) + self.set_transient_for(parent_window) # Common variables and references - self.window = window - self.manager = window.manager + self.window = parent_window + self.manager = parent_window.manager self.config = config self.quality_mode = { "none": _("None"), diff --git a/bottles/frontend/windows/mangohud.py b/bottles/frontend/windows/mangohud.py index 77e47df06e..241b180511 100644 --- a/bottles/frontend/windows/mangohud.py +++ b/bottles/frontend/windows/mangohud.py @@ -29,13 +29,13 @@ class MangoHudDialog(Adw.Window): btn_save = Gtk.Template.Child() display_on_game_start = Gtk.Template.Child() - def __init__(self, window, config, **kwargs): + def __init__(self, parent_window, config, **kwargs): super().__init__(**kwargs) - self.set_transient_for(window) + self.set_transient_for(parent_window) # Common variables and references - self.window = window - self.manager = window.manager + self.window = parent_window + self.manager = parent_window.manager self.config = config # Connect signals diff --git a/bottles/frontend/windows/vkbasalt.py b/bottles/frontend/windows/vkbasalt.py index 509bce6d8a..c6d2407c1c 100644 --- a/bottles/frontend/windows/vkbasalt.py +++ b/bottles/frontend/windows/vkbasalt.py @@ -80,13 +80,13 @@ class VkBasaltDialog(Adw.Window): spin_smaa_corner_rounding = Gtk.Template.Child() btn_save = Gtk.Template.Child() - def __init__(self, window, config, **kwargs): + def __init__(self, parent_window, config, **kwargs): super().__init__(**kwargs) - self.set_transient_for(window) + self.set_transient_for(parent_window) # Common variables and references - self.window = window - self.manager = window.manager + self.window = parent_window + self.manager = parent_window.manager self.config = config conf = os.path.join( ManagerUtils.get_bottle_path(self.config), "vkBasalt.conf"