From 129f2c91424f2dfd9889fef05804d7243c5d9301 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Tue, 13 Jun 2023 20:33:25 -0700 Subject: [PATCH] Fix for WarningMessageDialog --- lutris/gui/dialogs/__init__.py | 10 ++++------ lutris/startup.py | 6 +++--- lutris/util/wine/wine.py | 8 ++++---- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/lutris/gui/dialogs/__init__.py b/lutris/gui/dialogs/__init__.py index 6e6850cfd..f742ad2cf 100644 --- a/lutris/gui/dialogs/__init__.py +++ b/lutris/gui/dialogs/__init__.py @@ -513,8 +513,8 @@ class InstallerSourceDialog(ModelessDialog): self.destroy() -class MessageDialog(Gtk.MessageDialog): - def init(self, message, secondary_message, parent): +class WarningMessageDialog(Gtk.MessageDialog): + def __init__(self, message, secondary_message="", parent=None): super().__init__(type=Gtk.MessageType.WARNING, buttons=Gtk.ButtonsType.OK, parent=parent) self.set_default_response(Gtk.ResponseType.OK) @@ -526,12 +526,11 @@ class MessageDialog(Gtk.MessageDialog): self.destroy() -class WineNotInstalledWarning(MessageDialog): +class WineNotInstalledWarning(WarningMessageDialog): """Display a warning if Wine is not detected on the system""" def __init__(self, parent=None, cancellable=False): super().__init__( - "hide-wine-systemwide-install-warning", _("Wine is not installed on your system."), secondary_message=_( "Having Wine installed on your system guarantees that " @@ -540,8 +539,7 @@ class WineNotInstalledWarning(MessageDialog): "href='https://github.com/lutris/docs/blob/master/WineDependencies.md'>Lutris Wiki to " "install Wine." ), - parent=parent, - cancellable=cancellable + parent=parent ) diff --git a/lutris/startup.py b/lutris/startup.py index 5a2119c9c..e09ae7706 100644 --- a/lutris/startup.py +++ b/lutris/startup.py @@ -14,7 +14,7 @@ from lutris import runners, settings from lutris.database.games import delete_game, get_games, get_games_where from lutris.database.schema import syncdb from lutris.game import Game -from lutris.gui.dialogs import MessageDialog +from lutris.gui.dialogs import WarningMessageDialog from lutris.runners.json import load_json_runners from lutris.runtime import RuntimeUpdater from lutris.scanners.lutris import build_path_cache @@ -87,7 +87,7 @@ def check_driver(): logger.error("Unable to get GPU information from '%s'", card) if drivers.is_outdated(): - MessageDialog( + WarningMessageDialog( _("Your NVIDIA driver is outdated."), secondary_message=_( "You are currently running driver %s which does not " @@ -117,7 +117,7 @@ def check_libs(all_components=False): logger.error("%s %s missing (needed by %s)", arch, lib, req.lower()) if missing_vulkan_libs: - MessageDialog( + WarningMessageDialog( _("Missing Vulkan libraries"), secondary_message=_( "Lutris was unable to detect Vulkan support for " diff --git a/lutris/util/wine/wine.py b/lutris/util/wine/wine.py index d5efe7a4d..f88e0043f 100644 --- a/lutris/util/wine/wine.py +++ b/lutris/util/wine/wine.py @@ -6,7 +6,7 @@ from gettext import gettext as _ from lutris import runtime, settings from lutris.exceptions import UnavailableRunnerError -from lutris.gui.dialogs import ErrorDialog, MessageDialog +from lutris.gui.dialogs import ErrorDialog, WarningMessageDialog from lutris.runners.steam import steam from lutris.util import linux, system from lutris.util.log import logger @@ -379,7 +379,7 @@ def get_real_executable(windows_executable, working_dir=None): def display_vulkan_error(): - MessageDialog( + WarningMessageDialog( _("Vulkan is not installed or is not supported by your system"), secondary_message=_( "If you have compatible hardware, please follow " @@ -408,7 +408,7 @@ def fsync_display_support_warning(): def esync_display_version_warning(): - MessageDialog( + WarningMessageDialog( _("Incompatible Wine version detected"), secondary_message=_( "The Wine build you have selected " @@ -420,7 +420,7 @@ def esync_display_version_warning(): def fsync_display_version_warning(): - MessageDialog( + WarningMessageDialog( _("Incompatible Wine version detected"), secondary_message=_( "The Wine build you have selected "