Delete functions on client.

This commit is contained in:
luxick
2018-05-05 15:52:12 +02:00
parent b3eca219ac
commit cb8646bae2
14 changed files with 311 additions and 100 deletions

View File

@@ -1,5 +1,5 @@
from gi.repository import Gtk
from dsst_gtk3 import dialogs, gtk_ui
from dsst_gtk3 import dialogs, gtk_ui, util
class DeathHandlers:
@@ -13,7 +13,18 @@ class DeathHandlers:
return
death = dialogs.create_death(self.app)
if death:
self.app.save_death(death)
self.app.data_client.save_death(death)
def on_penalty_drink_changed(self, _, path, text):
self.app.ui.get_object('player_penalties_store')[path][2] = text
def death_tree_clicked(self, widget, event):
if event.button == 3: # right click
popup = self.app.ui.get_object('p_death')
util.show_context_menu(widget, event, popup)
return True
def do_delete_death(self, *_):
death_id = util.get_tree_selection_value(self.app.ui.get_object('episode_deaths_tree_view'), 0)
self.app.data_client.delete_death(death_id)