Compare commits
2 Commits
8e4e401d1b
...
1836cdd892
| Author | SHA1 | Date | |
|---|---|---|---|
|
1836cdd892
|
|||
|
2416d0ce8d
|
@@ -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"
|
||||||
|
|||||||
51
qt.py
51
qt.py
@@ -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,8 +3343,9 @@ 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
|
||||||
return a
|
a = self.get_role_data_from_coordinate(row, col, role=role)
|
||||||
|
return a
|
||||||
|
|
||||||
def delete(self, selected_keys):
|
def delete(self, selected_keys):
|
||||||
for key in selected_keys:
|
for key in 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,17 +3535,10 @@ 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,
|
self.bal_window.ping_willexecutors(wes, self.parent)
|
||||||
update=True,
|
self.willexecutors_list.update(wes)
|
||||||
bal_window=self.bal_window,
|
self.willexecutor_list.update()
|
||||||
force=True,
|
|
||||||
task=self,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
self.bal_window.ping_willexecutors(wes, self.parent)
|
|
||||||
self.willexecutors_list.update(wes)
|
|
||||||
self.willexecutor_list.update()
|
|
||||||
|
|
||||||
def import_json_file(self, path):
|
def import_json_file(self, path):
|
||||||
data = read_json_file(path)
|
data = read_json_file(path)
|
||||||
|
|||||||
Reference in New Issue
Block a user