Fix for WarningMessageDialog

This commit is contained in:
Mathieu Comandon 2023-06-13 20:33:25 -07:00
parent 345023f776
commit 129f2c9142
3 changed files with 11 additions and 13 deletions

View file

@ -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</a> to "
"install Wine."
),
parent=parent,
cancellable=cancellable
parent=parent
)

View file

@ -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 "

View file

@ -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 "