Add option to add victory events.
This commit is contained in:
@@ -5,10 +5,11 @@ from dsst_gtk3.handlers.season_handlers import SeasonHandlers
|
||||
from dsst_gtk3.handlers.base_data_handlers import BaseDataHandlers
|
||||
from dsst_gtk3.handlers.dialog_handlers import DialogHandlers
|
||||
from dsst_gtk3.handlers.death_handlers import DeathHandlers
|
||||
from dsst_gtk3.handlers.victory_handlers import VictoryHandlers
|
||||
from dsst_sql import sql_func
|
||||
|
||||
|
||||
class Handlers(SeasonHandlers, BaseDataHandlers, DialogHandlers, DeathHandlers):
|
||||
class Handlers(SeasonHandlers, BaseDataHandlers, DialogHandlers, DeathHandlers, VictoryHandlers):
|
||||
"""Single callback handler class derived from specialized handler classes"""
|
||||
def __init__(self, app):
|
||||
""" Initialize handler class
|
||||
@@ -20,6 +21,7 @@ class Handlers(SeasonHandlers, BaseDataHandlers, DialogHandlers, DeathHandlers):
|
||||
BaseDataHandlers.__init__(self, app)
|
||||
DialogHandlers.__init__(self, app)
|
||||
DeathHandlers.__init__(self, app)
|
||||
VictoryHandlers.__init__(self, app)
|
||||
|
||||
@staticmethod
|
||||
def do_delete_event(*args):
|
||||
|
||||
17
dsst/dsst_gtk3/handlers/victory_handlers.py
Normal file
17
dsst/dsst_gtk3/handlers/victory_handlers.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from gi.repository import Gtk
|
||||
from dsst_gtk3 import dialogs, gtk_ui
|
||||
|
||||
|
||||
class VictoryHandlers:
|
||||
"""Callback handlers for signals related to managing victory events"""
|
||||
def __init__(self, app: 'gtk_ui.GtkUi'):
|
||||
self.app = app
|
||||
|
||||
def do_add_victory(self, *_):
|
||||
ep_id = self.app.get_selected_episode_id()
|
||||
if not ep_id:
|
||||
return
|
||||
result = dialogs.show_edit_victory_dialog(self.app.ui, ep_id)
|
||||
if result == Gtk.ResponseType.OK:
|
||||
self.app.reload_for_season()
|
||||
self.app.reload_for_episode()
|
||||
Reference in New Issue
Block a user