icon button

This commit is contained in:
2026-05-09 23:01:08 -04:00
parent fff00eae7b
commit f83f1b707b
2 changed files with 26 additions and 22 deletions

44
qt.py
View File

@@ -83,7 +83,6 @@ class Plugin(BalPlugin):
title=_("Success"), title=_("Success"),
) )
return return
Util.print_var(window)
top_level_window= window.top_level_window top_level_window= window.top_level_window
w = BalWindow(self, top_level_window) w = BalWindow(self, top_level_window)
self.bal_windows[top_level_window.winId] = w self.bal_windows[top_level_window.winId] = w
@@ -1163,12 +1162,8 @@ class BalWindow:
def download_list(self, willexecutors, fn_on_success, fn_on_failure=None): def download_list(self, willexecutors, fn_on_success, fn_on_failure=None):
print("self.bal_window.download_list")
def on_success(result): def on_success(result):
# self.willexecutors.update(result) # self.willexecutors.update(result)
print("ddownload list success")
print(fn_on_success)
print(result)
fn_on_success(result) fn_on_success(result)
def on_failure(exec_info): def on_failure(exec_info):
@@ -1287,9 +1282,13 @@ class BalTxFeesWidget(QWidget):
"baltx_fees" "baltx_fees"
] ]
self.txfee_widget.valueChanged.connect(self.on_heir_tx_fees) self.txfee_widget.valueChanged.connect(self.on_heir_tx_fees)
label = ClickableLabel("Tx Fees:") #label = ClickableLabel("")
label.doubleClicked.connect(self.doubleclick) #label.doubleClicked.connect(self.doubleclick)
layout.addWidget(label) #layout.addWidget(label)
button = HelpButton(_("fees/vbyte to be used in the transaction.\nHigher value ensure your transaction will be confirmed"))
button.setText("")
button.setStyleSheet("font-size: 16px;");
layout.addWidget(button)
layout.addWidget(self.txfee_widget) layout.addWidget(self.txfee_widget)
def doubleclick(self, event=None): def doubleclick(self, event=None):
@@ -1407,8 +1406,11 @@ class BalTimeEditWidget(QWidget, _LockTimeEditor):
default_index = 1 default_index = 1
except Exception: except Exception:
default_index = 0 default_index = 0
hbox.addWidget(QLabel(self.label_text)) #hbox.addWidget(QLabel(self.label_text))
hbox.addWidget(HelpButton(self.help_text)) help_button=HelpButton(self.help_text)
help_button.setText(self.label_text)
help_button.setStyleSheet("font-size: 17px;");
hbox.addWidget(help_button)
self.combo.currentIndexChanged.connect(self.on_current_index_changed) self.combo.currentIndexChanged.connect(self.on_current_index_changed)
for w in self.editors: for w in self.editors:
@@ -1639,7 +1641,7 @@ class ThresholdTimeWidget(BalTimeEditWidget):
"If you fail to invalidate during this time, your transactions will be delivered to your heirs.\n\n" "If you fail to invalidate during this time, your transactions will be delivered to your heirs.\n\n"
f"{BalTimeEditWidget.help_text}" f"{BalTimeEditWidget.help_text}"
) )
label_text = "Check Alive:" label_text = "🚨"
base_field = "threshold" base_field = "threshold"
def __init__(self, bal_window, parent, init_value=None): def __init__(self, bal_window, parent, init_value=None):
@@ -1657,7 +1659,7 @@ class LockTimeWidget(BalTimeEditWidget):
"Any time is needed transaction will be anticipated by 1day\n" "Any time is needed transaction will be anticipated by 1day\n"
f"{BalTimeEditWidget.help_text}" f"{BalTimeEditWidget.help_text}"
) )
label_text = "Delivery Time:" label_text = "🚛"
base_field = "locktime" base_field = "locktime"
def __init__(self, bal_window, parent, init_value=None): def __init__(self, bal_window, parent, init_value=None):
@@ -3241,12 +3243,22 @@ class PreviewList(MyTreeView, MessageBoxMixin):
menu.addAction(_("Check"), self.check) menu.addAction(_("Check"), self.check)
menu.addAction(_("Invalidate"), self.invalidate_will) menu.addAction(_("Invalidate"), self.invalidate_will)
wizard = QPushButton(_("Setup Wizard")) wizard = QPushButton()
wizard.setIcon(
read_QIcon_from_bytes(
self.bal_window.bal_plugin.read_file("icons/wizard.png")
)
)
wizard.clicked.connect(self.bal_window.init_wizard) wizard.clicked.connect(self.bal_window.init_wizard)
# display = QPushButton(_("Display")) # display = QPushButton(_("Display"))
# display.clicked.connect(self.bal_window.preview_modal_dialog) # display.clicked.connect(self.bal_window.preview_modal_dialog)
refresh = QPushButton(_("Refresh")) refresh = QPushButton()
refresh.setIcon(
read_QIcon_from_bytes(
self.bal_window.bal_plugin.read_file("icons/reload.png")
)
)
refresh.clicked.connect(self.check) refresh.clicked.connect(self.check)
widget = QWidget(self) widget = QWidget(self)
@@ -3882,7 +3894,6 @@ class WillExecutorWidget(QWidget, MessageBoxMixin):
self.will_executor_list_widget.update() self.will_executor_list_widget.update()
def download_list(self, wes=None): def download_list(self, wes=None):
print("download_list")
if not wes: if not wes:
wes = self.willexecutors_list wes = self.willexecutors_list
self.bal_window.download_list(wes, self.save_willexecutors) self.bal_window.download_list(wes, self.save_willexecutors)
@@ -3920,10 +3931,7 @@ class WillExecutorWidget(QWidget, MessageBoxMixin):
return data return data
def save_willexecutors(self, wes=None): def save_willexecutors(self, wes=None):
print("save willexecutors",wes)
if not wes: if not wes:
print("not wes",self.willexecutors_list)
wes = self.willexecutors_list wes = self.willexecutors_list
self.willexecutors_list.update(wes) self.willexecutors_list.update(wes)
self.will_executor_list_widget.update() self.will_executor_list_widget.update()

View File

@@ -274,7 +274,6 @@ class Willexecutors:
@staticmethod @staticmethod
def download_list(old_willexecutors,welist_server): def download_list(old_willexecutors,welist_server):
print("willexecutor download list")
try: try:
welist_server = welist_server if welist_server[-1] == '/' else welist_server+'/' welist_server = welist_server if welist_server[-1] == '/' else welist_server+'/'
willexecutors = Willexecutors.send_request( willexecutors = Willexecutors.send_request(
@@ -282,14 +281,11 @@ class Willexecutors:
f"{welist_server}data/{chainname}?page=0&limit=100", f"{welist_server}data/{chainname}?page=0&limit=100",
) )
# del willexecutors["status"] # del willexecutors["status"]
print("willexecutors",willexecutors)
for w in willexecutors: for w in willexecutors:
print(w)
if w not in ("status", "url"): if w not in ("status", "url"):
Willexecutors.initialize_willexecutor( Willexecutors.initialize_willexecutor(
willexecutors[w], w, None, old_willexecutors.get(w,{}) willexecutors[w], w, None, old_willexecutors.get(w,{})
) )
print("success")
# bal_plugin.WILLEXECUTORS.set(l) # bal_plugin.WILLEXECUTORS.set(l)
# bal_plugin.config.set_key(bal_plugin.WILLEXECUTORS,l,save=True) # bal_plugin.config.set_key(bal_plugin.WILLEXECUTORS,l,save=True)
return willexecutors return willexecutors