2 Commits

Author SHA1 Message Date
1836cdd892 version 2026-02-03 22:12:30 -04:00
2416d0ce8d fix willexecutor list edit 2026-02-03 22:11:33 -04:00
3 changed files with 26 additions and 29 deletions

View File

@@ -1 +1 @@
0.2.3 0.2.4

View File

@@ -1,7 +1,7 @@
{ {
"name": "BAL", "name": "BAL",
"fullname": "Bitcoin After Life", "fullname": "Bitcoin After Life",
"description": "Provides free and decentralized inheritance support<br> Version: 0.2.3", "description": "Provides free and decentralized inheritance support<br> Version: 0.2.4",
"author":"Svatantrya", "author":"Svatantrya",
"available_for": ["qt"], "available_for": ["qt"],
"icon":"icons/bal32x32.png" "icon":"icons/bal32x32.png"

43
qt.py
View File

@@ -2592,10 +2592,10 @@ class HeirList(MyTreeView, MessageBoxMixin):
pass pass
def get_edit_key_from_coordinate(self, row, col): def get_edit_key_from_coordinate(self, row, col):
return self.get_role_data_from_coordinate( a= self.get_role_data_from_coordinate(
row, col, role=self.ROLE_HEIR_KEY + col + 1 row, col, role=self.ROLE_HEIR_KEY + col + 1
) )
return a
def create_toolbar(self, config): def create_toolbar(self, config):
toolbar, menu = self.create_toolbar_with_menu("") toolbar, menu = self.create_toolbar_with_menu("")
menu.addAction(_("&New Heir"), self.bal_window.new_heir_dialog) menu.addAction(_("&New Heir"), self.bal_window.new_heir_dialog)
@@ -3260,10 +3260,13 @@ class WillExecutorList(MyTreeView):
Columns.ADDRESS: _("Default Address"), Columns.ADDRESS: _("Default Address"),
} }
ROLE_HEIR_KEY = Qt.ItemDataRole.UserRole + 2000 filter_columns = [Columns.URL]
ROLE_SORT_ORDER = Qt.ItemDataRole.UserRole + 3000
ROLE_HEIR_KEY = Qt.ItemDataRole.UserRole + 3001
key_role = ROLE_HEIR_KEY key_role = ROLE_HEIR_KEY
def __init__(self, parent: "WillExecutorDialog"): def __init__(self, parent: "WillExecutorWidget"):
super().__init__( super().__init__(
parent=parent, parent=parent,
stretch_column=self.Columns.ADDRESS, stretch_column=self.Columns.ADDRESS,
@@ -3340,7 +3343,8 @@ class WillExecutorList(MyTreeView):
self.update() self.update()
def get_edit_key_from_coordinate(self, row, col): def get_edit_key_from_coordinate(self, row, col):
a = self.get_role_data_from_coordinate(row, col, role=self.ROLE_HEIR_KEY + col) role=self.ROLE_HEIR_KEY+col
a = self.get_role_data_from_coordinate(row, col, role=role)
return a return a
def delete(self, selected_keys): def delete(self, selected_keys):
@@ -3428,17 +3432,17 @@ class WillExecutorList(MyTreeView):
items[self.Columns.BASE_FEE].setEditable(True) items[self.Columns.BASE_FEE].setEditable(True)
items[self.Columns.STATUS].setEditable(False) items[self.Columns.STATUS].setEditable(False)
items[self.Columns.URL].setData(url, self.ROLE_HEIR_KEY + 1) items[self.Columns.URL].setData(url, self.ROLE_HEIR_KEY + self.Columns.URL)
items[self.Columns.BASE_FEE].setData(url, self.ROLE_HEIR_KEY + 2) items[self.Columns.BASE_FEE].setData(url, self.ROLE_HEIR_KEY + self.Columns.BASE_FEE)
items[self.Columns.INFO].setData(url, self.ROLE_HEIR_KEY + 3) items[self.Columns.INFO].setData(url, self.ROLE_HEIR_KEY + self.Columns.INFO)
items[self.Columns.ADDRESS].setData(url, self.ROLE_HEIR_KEY + 4) items[self.Columns.ADDRESS].setData(url, self.ROLE_HEIR_KEY + self.Columns.ADDRESS)
row_count = self.model().rowCount() row_count = self.model().rowCount()
self.model().insertRow(row_count, items) self.model().insertRow(row_count, items)
if url == current_key: if url == current_key:
idx = self.model().index(row_count, self.Columns.NAME) idx = self.model().index(row_count, self.Columns.URL)
set_current = QPersistentModelIndex(idx) set_current = QPersistentModelIndex(idx)
self.set_current_idx(set_current) self.set_current_idx(set_current)
self.filter()
self.parent.save_willexecutors() self.parent.save_willexecutors()
except Exception as e: except Exception as e:
@@ -3494,12 +3498,12 @@ class WillExecutorWidget(QWidget, MessageBoxMixin):
b.clicked.connect(self.export_file) b.clicked.connect(self.export_file)
buttonbox.addWidget(b) buttonbox.addWidget(b)
#b = QPushButton(_("Ping All")) b = QPushButton(_("Ping All"))
#b.clicked.connect(self.update_willexecutors) b.clicked.connect(self.update_willexecutors)
#buttonbox.addWidget(b) buttonbox.addWidget(b)
vbox.addLayout(buttonbox) vbox.addLayout(buttonbox)
self.willexecutor_list.update() #self.willexecutor_list.update()
def add(self): def add(self):
self.willexecutors_list["http://localhost:8080"] = { self.willexecutors_list["http://localhost:8080"] = {
@@ -3531,14 +3535,7 @@ class WillExecutorWidget(QWidget, MessageBoxMixin):
def update_willexecutors(self, wes=None): def update_willexecutors(self, wes=None):
if not wes: if not wes:
self.willexecutors_list = Willexecutors.get_willexecutors( wes=self.willexecutors_list
self.bal_plugin,
update=True,
bal_window=self.bal_window,
force=True,
task=self,
)
else:
self.bal_window.ping_willexecutors(wes, self.parent) self.bal_window.ping_willexecutors(wes, self.parent)
self.willexecutors_list.update(wes) self.willexecutors_list.update(wes)
self.willexecutor_list.update() self.willexecutor_list.update()