Remove most of the on_watched_error() methods.

This is all the ones that just pop an ErrorDialog; that's the default thing anyway.
This commit is contained in:
Daniel Johnson 2023-12-15 19:40:59 -05:00 committed by Mathieu Comandon
parent 957eab1c17
commit ebc2f1ea4a
9 changed files with 1 additions and 32 deletions

View file

@ -157,9 +157,6 @@ class AddGamesWindow(ModelessDialog): # pylint: disable=too-many-public-methods
def on_cancel_clicked(self, _widget):
self.destroy()
def on_watched_error(self, error):
ErrorDialog(error, parent=self)
# Initial Page
def load_initial_page(self):

View file

@ -734,9 +734,6 @@ class GameDialogCommon(SavableModelessDialog, DialogInstallUIDelegate):
invalidate_media_caches()
self._set_image(image_type, self.image_buttons[image_type])
def on_watched_error(self, error):
dialogs.ErrorDialog(error, parent=self)
class RunnerMessageBox(UnderslungMessageBox):
def __init__(self):

View file

@ -6,7 +6,7 @@ from gi.repository import Gtk
from lutris.database import categories as categories_db
from lutris.database import games as games_db
from lutris.game import Game
from lutris.gui.dialogs import ErrorDialog, QuestionDialog, SavableModelessDialog
from lutris.gui.dialogs import QuestionDialog, SavableModelessDialog
class EditCategoryGamesDialog(SavableModelessDialog):
@ -129,6 +129,3 @@ class EditCategoryGamesDialog(SavableModelessDialog):
game.add_category(new_name)
self.destroy()
def on_watched_error(self, error):
ErrorDialog(error, parent=self)

View file

@ -5,7 +5,6 @@ from gettext import gettext as _
from gi.repository import Gtk
from lutris.database import categories as categories_db
from lutris.gui import dialogs
from lutris.gui.dialogs import SavableModelessDialog
@ -97,6 +96,3 @@ class EditGameCategoriesDialog(SavableModelessDialog):
self.game.update_game_categories(added_categories, removed_categories)
self.destroy()
def on_watched_error(self, error):
dialogs.ErrorDialog(error, parent=self)

View file

@ -138,6 +138,3 @@ class RunnerBox(Gtk.Box):
self.runner_label_box.set_sensitive(False)
self.action_alignment.get_children()[0].destroy()
self.action_alignment.add(self.get_action_button())
def on_watched_error(self, error):
ErrorDialog(error, parent=self.get_toplevel())

View file

@ -7,7 +7,6 @@ from gi.repository import Gtk
from lutris.database.games import get_games
from lutris.game import Game
from lutris.gui import dialogs
from lutris.gui.dialogs import QuestionDialog
from lutris.gui.widgets.gi_composites import GtkTemplate
from lutris.util import datapath
@ -331,6 +330,3 @@ class UninstallMultipleGamesDialog(Gtk.Dialog):
self.game.uninstall(delete_files=self.delete_files)
elif self.delete_game:
self.game.delete()
def on_watched_error(self, error: Exception) -> None:
dialogs.ErrorDialog(error, parent=self)

View file

@ -1154,6 +1154,3 @@ class LutrisWindow(Gtk.ApplicationWindow,
completion_function=completion_function,
error_function=error_function,
operation_names=operation_names)
def on_watched_error(self, error):
dialogs.ErrorDialog(error, parent=self)

View file

@ -7,7 +7,6 @@ from lutris import runners, services
from lutris.database.games import get_game_for_service
from lutris.game import Game
from lutris.game_actions import get_game_actions
from lutris.gui.dialogs import ErrorDialog
from lutris.gui.widgets.contextual_menu import update_action_widget_visibility
from lutris.util.strings import gtk_safe
@ -283,6 +282,3 @@ class GameBar(Gtk.Box):
self.clear_view()
self.update_view()
return True
def on_watched_error(self, error):
ErrorDialog(error, parent=self.get_toplevel())

View file

@ -9,7 +9,6 @@ from lutris.config import LutrisConfig
from lutris.database import categories as categories_db
from lutris.database import games as games_db
from lutris.game import Game
from lutris.gui import dialogs
from lutris.gui.config.edit_category_games import EditCategoryGamesDialog
from lutris.gui.config.runner import RunnerConfigDialog
from lutris.gui.config.runner_box import RunnerBox
@ -247,9 +246,6 @@ class RunnerSidebarRow(SidebarRow):
self.application.show_window(RunnerInstallDialog, title=dlg_title,
runner=self.runner, parent=self.get_toplevel())
def on_watched_error(self, error):
dialogs.ErrorDialog(error, parent=self.get_toplevel())
class CategorySidebarRow(SidebarRow):