icon button
This commit is contained in:
44
qt.py
44
qt.py
@@ -83,7 +83,6 @@ class Plugin(BalPlugin):
|
||||
title=_("Success"),
|
||||
)
|
||||
return
|
||||
Util.print_var(window)
|
||||
top_level_window= window.top_level_window
|
||||
w = BalWindow(self, top_level_window)
|
||||
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):
|
||||
|
||||
print("self.bal_window.download_list")
|
||||
def on_success(result):
|
||||
# self.willexecutors.update(result)
|
||||
print("ddownload list success")
|
||||
print(fn_on_success)
|
||||
print(result)
|
||||
fn_on_success(result)
|
||||
|
||||
def on_failure(exec_info):
|
||||
@@ -1287,9 +1282,13 @@ class BalTxFeesWidget(QWidget):
|
||||
"baltx_fees"
|
||||
]
|
||||
self.txfee_widget.valueChanged.connect(self.on_heir_tx_fees)
|
||||
label = ClickableLabel("Tx Fees:")
|
||||
label.doubleClicked.connect(self.doubleclick)
|
||||
layout.addWidget(label)
|
||||
#label = ClickableLabel("$")
|
||||
#label.doubleClicked.connect(self.doubleclick)
|
||||
#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)
|
||||
|
||||
def doubleclick(self, event=None):
|
||||
@@ -1407,8 +1406,11 @@ class BalTimeEditWidget(QWidget, _LockTimeEditor):
|
||||
default_index = 1
|
||||
except Exception:
|
||||
default_index = 0
|
||||
hbox.addWidget(QLabel(self.label_text))
|
||||
hbox.addWidget(HelpButton(self.help_text))
|
||||
#hbox.addWidget(QLabel(self.label_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)
|
||||
|
||||
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"
|
||||
f"{BalTimeEditWidget.help_text}"
|
||||
)
|
||||
label_text = "Check Alive:"
|
||||
label_text = "🚨"
|
||||
base_field = "threshold"
|
||||
|
||||
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"
|
||||
f"{BalTimeEditWidget.help_text}"
|
||||
)
|
||||
label_text = "Delivery Time:"
|
||||
label_text = "🚛"
|
||||
base_field = "locktime"
|
||||
|
||||
def __init__(self, bal_window, parent, init_value=None):
|
||||
@@ -3241,12 +3243,22 @@ class PreviewList(MyTreeView, MessageBoxMixin):
|
||||
menu.addAction(_("Check"), self.check)
|
||||
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)
|
||||
# display = QPushButton(_("Display"))
|
||||
# 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)
|
||||
|
||||
widget = QWidget(self)
|
||||
@@ -3882,7 +3894,6 @@ class WillExecutorWidget(QWidget, MessageBoxMixin):
|
||||
self.will_executor_list_widget.update()
|
||||
|
||||
def download_list(self, wes=None):
|
||||
print("download_list")
|
||||
if not wes:
|
||||
wes = self.willexecutors_list
|
||||
self.bal_window.download_list(wes, self.save_willexecutors)
|
||||
@@ -3920,10 +3931,7 @@ class WillExecutorWidget(QWidget, MessageBoxMixin):
|
||||
return data
|
||||
|
||||
def save_willexecutors(self, wes=None):
|
||||
print("save willexecutors",wes)
|
||||
|
||||
if not wes:
|
||||
print("not wes",self.willexecutors_list)
|
||||
wes = self.willexecutors_list
|
||||
self.willexecutors_list.update(wes)
|
||||
self.will_executor_list_widget.update()
|
||||
|
||||
@@ -274,7 +274,6 @@ class Willexecutors:
|
||||
|
||||
@staticmethod
|
||||
def download_list(old_willexecutors,welist_server):
|
||||
print("willexecutor download list")
|
||||
try:
|
||||
welist_server = welist_server if welist_server[-1] == '/' else welist_server+'/'
|
||||
willexecutors = Willexecutors.send_request(
|
||||
@@ -282,14 +281,11 @@ class Willexecutors:
|
||||
f"{welist_server}data/{chainname}?page=0&limit=100",
|
||||
)
|
||||
# del willexecutors["status"]
|
||||
print("willexecutors",willexecutors)
|
||||
for w in willexecutors:
|
||||
print(w)
|
||||
if w not in ("status", "url"):
|
||||
Willexecutors.initialize_willexecutor(
|
||||
willexecutors[w], w, None, old_willexecutors.get(w,{})
|
||||
)
|
||||
print("success")
|
||||
# bal_plugin.WILLEXECUTORS.set(l)
|
||||
# bal_plugin.config.set_key(bal_plugin.WILLEXECUTORS,l,save=True)
|
||||
return willexecutors
|
||||
|
||||
Reference in New Issue
Block a user