44 lines
1.4 KiB
Python
44 lines
1.4 KiB
Python
# SPDX-License-Identifier: WTFPL
|
|
|
|
import os
|
|
import gi
|
|
gi.require_version("Gtk", "3.0")
|
|
from gi.repository import GLib, Gtk, Gdk
|
|
|
|
from yms import gtkutils, combobox, treeview
|
|
|
|
class EquipmentView:
|
|
|
|
def __init__(self, context):
|
|
self.title = _("Equipment")
|
|
builder = Gtk.Builder()
|
|
builder.set_translation_domain(context.textdomain)
|
|
builder.add_from_file(os.path.join(context.ui_path, "equipment.ui"))
|
|
builder.connect_signals(self)
|
|
self.topwidget = builder.get_object("stk_equipment")
|
|
gtkutils.init_named_controls(self, builder)
|
|
|
|
def on_but_new_clicked(self, widget):
|
|
self.topwidget.set_visible_child(self.box['equip_edit'])
|
|
|
|
def on_but_detail_clicked(self, widget):
|
|
self.topwidget.set_visible_child(self.box['equip_detail'])
|
|
|
|
def on_but_edit_clicked(self, widget):
|
|
self.topwidget.set_visible_child(self.box['equip_edit'])
|
|
|
|
def on_but_edit2_clicked(self, widget):
|
|
self.topwidget.set_visible_child(self.box['equip_edit'])
|
|
|
|
def on_but_close_clicked(self, widget):
|
|
self.topwidget.set_visible_child(self.box['equip_detail'])
|
|
|
|
def on_but_save_clicked(self, widget):
|
|
pass
|
|
|
|
def on_but_delete_clicked(self, widget):
|
|
self.topwidget.set_visible_child(self.box['equipment'])
|
|
|
|
def on_but_cancel_clicked(self, widget):
|
|
self.topwidget.set_visible_child(self.box['equipment'])
|