Example #1
0
def delete_character_weapon_with_conforming(master, character_weapon,
                                            callback):
    if tkMessageBox.askyesno(
            'Deleting',
            'Are you sure you want to delete character 「{0}」?'.format(
                character_weapon.nickname.encode('utf-8')),
            parent=master):
        CharacterWeaponModel.delete_character_weapon_from_db(character_weapon)
        callback()
    def __init__(self, master, **kwargs):
        MainFrameWithTable.__init__(self, master, **kwargs)
        # 滑鼠中鍵事件註冊,設定為更改角色詳細資訊,並選取該列
        self.table_view.bind("<Button-2>", lambda event: self.opening_character_update_window(event))
        self.set_table_place(6, 31)
        self.filter_manager = FilterRuleManager()
        self.table_model = TableModelAdvance()
        self.table_model.set_columns(CharacterWeapon.TABLE_VIEW_COLUMNS)
        self.table_view.setModel(self.table_model)

        self.characters = CharacterWeaponModel.select_character_weapon_list()
        self._init_upper_frame()
        self.update_table()
Example #3
0
    def __init__(self, master, **kwargs):
        MainFrameWithTable.__init__(self, master, **kwargs)
        # 滑鼠中鍵事件註冊,設定為更改角色詳細資訊,並選取該列
        self.table_view.bind(
            "<Button-2>",
            lambda event: self.opening_character_update_window(event))
        self.set_table_place(6, 31)
        self.filter_manager = FilterRuleManager()
        self.table_model = TableModelAdvance()
        self.table_model.set_columns(CharacterWeapon.TABLE_VIEW_COLUMNS)
        self.table_view.setModel(self.table_model)

        self.characters = CharacterWeaponModel.select_character_weapon_list()
        self._init_upper_frame()
        self.update_table()
def open_updating_character_weapon_window(master, character_weapon, callback):
    original_c_id = character_weapon.c_id
    popup = CharacterWeaponWindow(master, character_weapon, lambda: (
        CharacterWeaponModel.update_character_weapon_into_db(character_weapon, original_c_id), callback()))
    master.wait_window(popup)
def open_adding_new_character_weapon_window(master, callback):
    cw = CharacterWeapon.create_empty_character_weapon()
    popup = CharacterWeaponWindow(master, cw, lambda: (
        CharacterWeaponModel.insert_character_weapon_into_db(cw), callback(cw)))
    master.wait_window(popup)
def delete_character_weapon_with_conforming(master, character_weapon, callback):
    if tkMessageBox.askyesno('Deleting', 'Are you sure you want to delete character 「{0}」?'.format(
            character_weapon.nickname.encode('utf-8')), parent=master):
        CharacterWeaponModel.delete_character_weapon_from_db(character_weapon)
        callback()