forked from bitcoinafterlife/bal-electrum-plugin
qt thread panic
heirs import wizard
This commit is contained in:
79
qt.py
79
qt.py
@@ -327,27 +327,27 @@ class Plugin(BalPlugin, Logger):
|
||||
2,
|
||||
"Hide invalidated transactions from will detail and list",
|
||||
)
|
||||
add_widget(
|
||||
grid,
|
||||
"Ping Willexecutors",
|
||||
heir_ping_willexecutors,
|
||||
3,
|
||||
"Ping willexecutors to get payment info before compiling will",
|
||||
)
|
||||
add_widget(
|
||||
grid,
|
||||
" - Ask before",
|
||||
heir_ask_ping_willexecutors,
|
||||
4,
|
||||
"Ask before to ping willexecutor",
|
||||
)
|
||||
add_widget(
|
||||
grid,
|
||||
"Backup Transaction",
|
||||
heir_no_willexecutor,
|
||||
5,
|
||||
"Add transactions without willexecutor",
|
||||
)
|
||||
#add_widget(
|
||||
# grid,
|
||||
# "Ping Willexecutors",
|
||||
# heir_ping_willexecutors,
|
||||
# 3,
|
||||
# "Ping willexecutors to get payment info before compiling will",
|
||||
#)
|
||||
#add_widget(
|
||||
# grid,
|
||||
# " - Ask before",
|
||||
# heir_ask_ping_willexecutors,
|
||||
# 4,
|
||||
# "Ask before to ping willexecutor",
|
||||
#)
|
||||
#add_widget(
|
||||
# grid,
|
||||
# "Backup Transaction",
|
||||
# heir_no_willexecutor,
|
||||
# 5,
|
||||
# "Add transactions without willexecutor",
|
||||
#)
|
||||
# add_widget(grid,"Enable Multiverse(EXPERIMENTAL/BROKEN)",heir_enable_multiverse,6,"enable multiple locktimes, will import.... ")
|
||||
grid.addWidget(heir_repush, 7, 0)
|
||||
grid.addWidget(
|
||||
@@ -656,16 +656,17 @@ class BalWindow(Logger):
|
||||
Will.normalize_will(self.willitems, self.wallet)
|
||||
|
||||
def build_will(self, ignore_duplicate=True, keep_original=True):
|
||||
|
||||
print("aa")
|
||||
will = {}
|
||||
willtodelete = []
|
||||
willtoappend = {}
|
||||
try:
|
||||
self.init_class_variables()
|
||||
print("bb")
|
||||
self.willexecutors = Willexecutors.get_willexecutors(
|
||||
self.bal_plugin, update=False, bal_window=self
|
||||
)
|
||||
|
||||
print("cc")
|
||||
if not self.no_willexecutor:
|
||||
|
||||
f = False
|
||||
@@ -1578,9 +1579,13 @@ class BalWizardDialog(BalDialog):
|
||||
)
|
||||
|
||||
def on_next_we(self):
|
||||
close_window = BalBuildWillDialog(self.bal_window, self)
|
||||
print("a")
|
||||
close_window = BalBuildWillDialog(self.bal_window)
|
||||
print("b")
|
||||
close_window.build_will_task()
|
||||
print("c")
|
||||
self.close()
|
||||
print("d")
|
||||
# self.next_widget(BalWizardLocktimeAndFeeWidget(self.bal_window,self,self.on_next_locktimeandfee,self.on_next_wedonwload,self.on_next_wedonwload.on_cancel_heir))
|
||||
|
||||
def on_next_locktimeandfee(self):
|
||||
@@ -1688,7 +1693,7 @@ class BalWizardHeirsWidget(BalWizardWidget):
|
||||
button_import = QPushButton(_("Import"))
|
||||
button_import.clicked.connect(self.import_from_file)
|
||||
button_export = QPushButton(_("Export"))
|
||||
button_import.clicked.connect(self.export_to_file)
|
||||
button_export.clicked.connect(self.export_to_file)
|
||||
widget = QWidget()
|
||||
vbox = QVBoxLayout(widget)
|
||||
vbox.addWidget(self.heirs_list)
|
||||
@@ -1760,7 +1765,7 @@ class BalWizardWEDownloadWidget(BalWizardWidget):
|
||||
|
||||
def on_success(willexecutors):
|
||||
self.bal_window.willexecutors.update(willexecutors)
|
||||
self.bal_window.ping_willexecutors(self.bal_window.willexecutors,self)
|
||||
self.bal_window.ping_willexecutors(self.bal_window.willexecutors,False)
|
||||
if index < 1:
|
||||
for we in self.bal_window.willexecutors:
|
||||
if self.bal_window.willexecutors[we]["status"] == 200:
|
||||
@@ -2029,6 +2034,7 @@ class BalBuildWillDialog(BalDialog):
|
||||
if not parent:
|
||||
parent = bal_window.window
|
||||
BalDialog.__init__(self, parent, bal_window.bal_plugin, "Building Will")
|
||||
self.parent=parent
|
||||
self.updatemessage.connect(self.update)
|
||||
self.bal_window = bal_window
|
||||
self.message_label = QLabel("Building Will:")
|
||||
@@ -2051,15 +2057,21 @@ class BalBuildWillDialog(BalDialog):
|
||||
pass
|
||||
|
||||
def build_will_task(self):
|
||||
print("1")
|
||||
_logger.debug("build will task to be started")
|
||||
print("2")
|
||||
self.thread.add(
|
||||
self.task_phase1,
|
||||
on_success=self.on_success_phase1,
|
||||
on_done=self.on_accept,
|
||||
on_error=self.on_error_phase1,
|
||||
)
|
||||
print(self.parent)
|
||||
print("3")
|
||||
self.show()
|
||||
print("4")
|
||||
self.exec()
|
||||
print("5")
|
||||
|
||||
def task_phase1(self):
|
||||
_logger.debug("close plugin phase 1 started")
|
||||
@@ -3275,8 +3287,13 @@ class WillExecutorList(MyTreeView):
|
||||
self.Columns.INFO,
|
||||
],
|
||||
)
|
||||
self.parent = parent
|
||||
self.setModel(QStandardItemModel(self))
|
||||
self.parent=parent
|
||||
try:
|
||||
self.setModel(QStandardItemModel(self))
|
||||
self.sortByColumn(self.Columns.SELECTED, Qt.SortOrder.AscendingOrder)
|
||||
self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||
except Exception:
|
||||
pass
|
||||
self.setSortingEnabled(True)
|
||||
self.std_model = self.model()
|
||||
self.config = parent.bal_plugin.config
|
||||
@@ -3490,9 +3507,9 @@ class WillExecutorWidget(QWidget, MessageBoxMixin):
|
||||
b.clicked.connect(self.export_file)
|
||||
buttonbox.addWidget(b)
|
||||
|
||||
b = QPushButton(_("Ping All"))
|
||||
b.clicked.connect(self.update_willexecutors)
|
||||
buttonbox.addWidget(b)
|
||||
#b = QPushButton(_("Ping All"))
|
||||
#b.clicked.connect(self.update_willexecutors)
|
||||
#buttonbox.addWidget(b)
|
||||
|
||||
vbox.addLayout(buttonbox)
|
||||
self.willexecutor_list.update()
|
||||
|
||||
Reference in New Issue
Block a user