Compare commits
4 Commits
v0.2.3
...
8e4e401d1b
| Author | SHA1 | Date | |
|---|---|---|---|
|
8e4e401d1b
|
|||
|
b8859ee5c1
|
|||
|
faeff1ff3c
|
|||
|
437105477d
|
8
bal.py
8
bal.py
@@ -96,10 +96,10 @@ class BalPlugin(BasePlugin):
|
|||||||
self.PREVIEW = BalConfig(config, "bal_preview", True)
|
self.PREVIEW = BalConfig(config, "bal_preview", True)
|
||||||
self.SAVE_TXS = BalConfig(config, "bal_save_txs", True)
|
self.SAVE_TXS = BalConfig(config, "bal_save_txs", True)
|
||||||
self.WILLEXECUTORS = BalConfig(config, "bal_willexecutors", True)
|
self.WILLEXECUTORS = BalConfig(config, "bal_willexecutors", True)
|
||||||
self.PING_WILLEXECUTORS = BalConfig(config, "bal_ping_willexecutors", True)
|
#self.PING_WILLEXECUTORS = BalConfig(config, "bal_ping_willexecutors", True)
|
||||||
self.ASK_PING_WILLEXECUTORS = BalConfig(
|
#self.ASK_PING_WILLEXECUTORS = BalConfig(
|
||||||
config, "bal_ask_ping_willexecutors", True
|
# config, "bal_ask_ping_willexecutors", True
|
||||||
)
|
#)
|
||||||
self.NO_WILLEXECUTOR = BalConfig(config, "bal_no_willexecutor", True)
|
self.NO_WILLEXECUTOR = BalConfig(config, "bal_no_willexecutor", True)
|
||||||
self.HIDE_REPLACED = BalConfig(config, "bal_hide_replaced", True)
|
self.HIDE_REPLACED = BalConfig(config, "bal_hide_replaced", True)
|
||||||
self.HIDE_INVALIDATED = BalConfig(config, "bal_hide_invalidated", True)
|
self.HIDE_INVALIDATED = BalConfig(config, "bal_hide_invalidated", True)
|
||||||
|
|||||||
BIN
icons/confirmed.png
Normal file
BIN
icons/confirmed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
BIN
icons/status_connected.png
Normal file
BIN
icons/status_connected.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
BIN
icons/unconfirmed.png
Normal file
BIN
icons/unconfirmed.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
77
qt.py
77
qt.py
@@ -295,8 +295,8 @@ class Plugin(BalPlugin, Logger):
|
|||||||
lbl_logo = QLabel()
|
lbl_logo = QLabel()
|
||||||
lbl_logo.setPixmap(qicon)
|
lbl_logo.setPixmap(qicon)
|
||||||
|
|
||||||
heir_ping_willexecutors = bal_checkbox(self.PING_WILLEXECUTORS)
|
#heir_ping_willexecutors = bal_checkbox(self.PING_WILLEXECUTORS)
|
||||||
heir_ask_ping_willexecutors = bal_checkbox(self.ASK_PING_WILLEXECUTORS)
|
#heir_ask_ping_willexecutors = bal_checkbox(self.ASK_PING_WILLEXECUTORS)
|
||||||
heir_no_willexecutor = bal_checkbox(self.NO_WILLEXECUTOR)
|
heir_no_willexecutor = bal_checkbox(self.NO_WILLEXECUTOR)
|
||||||
|
|
||||||
def on_multiverse_change():
|
def on_multiverse_change():
|
||||||
@@ -327,27 +327,27 @@ class Plugin(BalPlugin, Logger):
|
|||||||
2,
|
2,
|
||||||
"Hide invalidated transactions from will detail and list",
|
"Hide invalidated transactions from will detail and list",
|
||||||
)
|
)
|
||||||
add_widget(
|
#add_widget(
|
||||||
grid,
|
# grid,
|
||||||
"Ping Willexecutors",
|
# "Ping Willexecutors",
|
||||||
heir_ping_willexecutors,
|
# heir_ping_willexecutors,
|
||||||
3,
|
# 3,
|
||||||
"Ping willexecutors to get payment info before compiling will",
|
# "Ping willexecutors to get payment info before compiling will",
|
||||||
)
|
#)
|
||||||
add_widget(
|
#add_widget(
|
||||||
grid,
|
# grid,
|
||||||
" - Ask before",
|
# " - Ask before",
|
||||||
heir_ask_ping_willexecutors,
|
# heir_ask_ping_willexecutors,
|
||||||
4,
|
# 4,
|
||||||
"Ask before to ping willexecutor",
|
# "Ask before to ping willexecutor",
|
||||||
)
|
#)
|
||||||
add_widget(
|
#add_widget(
|
||||||
grid,
|
# grid,
|
||||||
"Backup Transaction",
|
# "Backup Transaction",
|
||||||
heir_no_willexecutor,
|
# heir_no_willexecutor,
|
||||||
5,
|
# 5,
|
||||||
"Add transactions without willexecutor",
|
# "Add transactions without willexecutor",
|
||||||
)
|
#)
|
||||||
# add_widget(grid,"Enable Multiverse(EXPERIMENTAL/BROKEN)",heir_enable_multiverse,6,"enable multiple locktimes, will import.... ")
|
# add_widget(grid,"Enable Multiverse(EXPERIMENTAL/BROKEN)",heir_enable_multiverse,6,"enable multiple locktimes, will import.... ")
|
||||||
grid.addWidget(heir_repush, 7, 0)
|
grid.addWidget(heir_repush, 7, 0)
|
||||||
grid.addWidget(
|
grid.addWidget(
|
||||||
@@ -419,7 +419,7 @@ class BalWindow(Logger):
|
|||||||
tab.tab_icon = icon
|
tab.tab_icon = icon
|
||||||
tab.tab_description = description
|
tab.tab_description = description
|
||||||
tab.tab_pos = len(tabs)
|
tab.tab_pos = len(tabs)
|
||||||
if tab.is_shown_cv:
|
if tab.is_shown_cv.get():
|
||||||
tabs.addTab(tab, icon, description.replace("&", ""))
|
tabs.addTab(tab, icon, description.replace("&", ""))
|
||||||
|
|
||||||
def add_toggle_action(tab):
|
def add_toggle_action(tab):
|
||||||
@@ -514,7 +514,7 @@ class BalWindow(Logger):
|
|||||||
self.heir_list = l = HeirList(self, self.window)
|
self.heir_list = l = HeirList(self, self.window)
|
||||||
|
|
||||||
tab = self.window.create_list_tab(l)
|
tab = self.window.create_list_tab(l)
|
||||||
tab.is_shown_cv = shown_cv(True)
|
tab.is_shown_cv = shown_cv(False)
|
||||||
return tab
|
return tab
|
||||||
|
|
||||||
def create_will_tab(self):
|
def create_will_tab(self):
|
||||||
@@ -523,6 +523,7 @@ class BalWindow(Logger):
|
|||||||
tab.is_shown_cv = shown_cv(True)
|
tab.is_shown_cv = shown_cv(True)
|
||||||
return tab
|
return tab
|
||||||
|
|
||||||
|
|
||||||
def new_heir_dialog(self, heir_key=None):
|
def new_heir_dialog(self, heir_key=None):
|
||||||
heir = self.heirs.get(heir_key)
|
heir = self.heirs.get(heir_key)
|
||||||
title = "New heir"
|
title = "New heir"
|
||||||
@@ -655,7 +656,6 @@ class BalWindow(Logger):
|
|||||||
Will.normalize_will(self.willitems, self.wallet)
|
Will.normalize_will(self.willitems, self.wallet)
|
||||||
|
|
||||||
def build_will(self, ignore_duplicate=True, keep_original=True):
|
def build_will(self, ignore_duplicate=True, keep_original=True):
|
||||||
|
|
||||||
will = {}
|
will = {}
|
||||||
willtodelete = []
|
willtodelete = []
|
||||||
willtoappend = {}
|
willtoappend = {}
|
||||||
@@ -664,7 +664,6 @@ class BalWindow(Logger):
|
|||||||
self.willexecutors = Willexecutors.get_willexecutors(
|
self.willexecutors = Willexecutors.get_willexecutors(
|
||||||
self.bal_plugin, update=False, bal_window=self
|
self.bal_plugin, update=False, bal_window=self
|
||||||
)
|
)
|
||||||
|
|
||||||
if not self.no_willexecutor:
|
if not self.no_willexecutor:
|
||||||
|
|
||||||
f = False
|
f = False
|
||||||
@@ -1577,7 +1576,7 @@ class BalWizardDialog(BalDialog):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def on_next_we(self):
|
def on_next_we(self):
|
||||||
close_window = BalBuildWillDialog(self.bal_window, self)
|
close_window = BalBuildWillDialog(self.bal_window)
|
||||||
close_window.build_will_task()
|
close_window.build_will_task()
|
||||||
self.close()
|
self.close()
|
||||||
# self.next_widget(BalWizardLocktimeAndFeeWidget(self.bal_window,self,self.on_next_locktimeandfee,self.on_next_wedonwload,self.on_next_wedonwload.on_cancel_heir))
|
# self.next_widget(BalWizardLocktimeAndFeeWidget(self.bal_window,self,self.on_next_locktimeandfee,self.on_next_wedonwload,self.on_next_wedonwload.on_cancel_heir))
|
||||||
@@ -1687,7 +1686,7 @@ class BalWizardHeirsWidget(BalWizardWidget):
|
|||||||
button_import = QPushButton(_("Import"))
|
button_import = QPushButton(_("Import"))
|
||||||
button_import.clicked.connect(self.import_from_file)
|
button_import.clicked.connect(self.import_from_file)
|
||||||
button_export = QPushButton(_("Export"))
|
button_export = QPushButton(_("Export"))
|
||||||
button_import.clicked.connect(self.export_to_file)
|
button_export.clicked.connect(self.export_to_file)
|
||||||
widget = QWidget()
|
widget = QWidget()
|
||||||
vbox = QVBoxLayout(widget)
|
vbox = QVBoxLayout(widget)
|
||||||
vbox.addWidget(self.heirs_list)
|
vbox.addWidget(self.heirs_list)
|
||||||
@@ -1759,7 +1758,7 @@ class BalWizardWEDownloadWidget(BalWizardWidget):
|
|||||||
|
|
||||||
def on_success(willexecutors):
|
def on_success(willexecutors):
|
||||||
self.bal_window.willexecutors.update(willexecutors)
|
self.bal_window.willexecutors.update(willexecutors)
|
||||||
self.bal_window.ping_willexecutors(self.bal_window.willexecutors)
|
self.bal_window.ping_willexecutors(self.bal_window.willexecutors,False)
|
||||||
if index < 1:
|
if index < 1:
|
||||||
for we in self.bal_window.willexecutors:
|
for we in self.bal_window.willexecutors:
|
||||||
if self.bal_window.willexecutors[we]["status"] == 200:
|
if self.bal_window.willexecutors[we]["status"] == 200:
|
||||||
@@ -2028,6 +2027,7 @@ class BalBuildWillDialog(BalDialog):
|
|||||||
if not parent:
|
if not parent:
|
||||||
parent = bal_window.window
|
parent = bal_window.window
|
||||||
BalDialog.__init__(self, parent, bal_window.bal_plugin, "Building Will")
|
BalDialog.__init__(self, parent, bal_window.bal_plugin, "Building Will")
|
||||||
|
self.parent=parent
|
||||||
self.updatemessage.connect(self.update)
|
self.updatemessage.connect(self.update)
|
||||||
self.bal_window = bal_window
|
self.bal_window = bal_window
|
||||||
self.message_label = QLabel("Building Will:")
|
self.message_label = QLabel("Building Will:")
|
||||||
@@ -3246,18 +3246,18 @@ class WillExecutorList(MyTreeView):
|
|||||||
class Columns(MyTreeView.BaseColumnsEnum):
|
class Columns(MyTreeView.BaseColumnsEnum):
|
||||||
SELECTED = enum.auto()
|
SELECTED = enum.auto()
|
||||||
URL = enum.auto()
|
URL = enum.auto()
|
||||||
|
STATUS = enum.auto()
|
||||||
BASE_FEE = enum.auto()
|
BASE_FEE = enum.auto()
|
||||||
INFO = enum.auto()
|
INFO = enum.auto()
|
||||||
ADDRESS = enum.auto()
|
ADDRESS = enum.auto()
|
||||||
STATUS = enum.auto()
|
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
Columns.SELECTED: _(""),
|
Columns.SELECTED: _(""),
|
||||||
Columns.URL: _("Url"),
|
Columns.URL: _("Url"),
|
||||||
|
Columns.STATUS: _("S"),
|
||||||
Columns.BASE_FEE: _("Base fee"),
|
Columns.BASE_FEE: _("Base fee"),
|
||||||
Columns.INFO: _("Info"),
|
Columns.INFO: _("Info"),
|
||||||
Columns.ADDRESS: _("Default Address"),
|
Columns.ADDRESS: _("Default Address"),
|
||||||
Columns.STATUS: _("S"),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ROLE_HEIR_KEY = Qt.ItemDataRole.UserRole + 2000
|
ROLE_HEIR_KEY = Qt.ItemDataRole.UserRole + 2000
|
||||||
@@ -3274,8 +3274,13 @@ class WillExecutorList(MyTreeView):
|
|||||||
self.Columns.INFO,
|
self.Columns.INFO,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
self.parent = parent
|
self.parent=parent
|
||||||
|
try:
|
||||||
self.setModel(QStandardItemModel(self))
|
self.setModel(QStandardItemModel(self))
|
||||||
|
self.sortByColumn(self.Columns.SELECTED, Qt.SortOrder.AscendingOrder)
|
||||||
|
self.setSelectionMode(QAbstractItemView.SelectionMode.ExtendedSelection)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
self.setSortingEnabled(True)
|
self.setSortingEnabled(True)
|
||||||
self.std_model = self.model()
|
self.std_model = self.model()
|
||||||
self.config = parent.bal_plugin.config
|
self.config = parent.bal_plugin.config
|
||||||
@@ -3489,9 +3494,9 @@ 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()
|
||||||
|
|||||||
@@ -42,27 +42,27 @@ class Willexecutors:
|
|||||||
if not bal_url in willexecutors:
|
if not bal_url in willexecutors:
|
||||||
_logger.debug(f"force add {bal_url} willexecutor")
|
_logger.debug(f"force add {bal_url} willexecutor")
|
||||||
willexecutors[bal_url] = bal_executor
|
willexecutors[bal_url] = bal_executor
|
||||||
if update:
|
#if update:
|
||||||
found = False
|
# found = False
|
||||||
for url, we in willexecutors.items():
|
# for url, we in willexecutors.items():
|
||||||
if Willexecutors.is_selected(we):
|
# if Willexecutors.is_selected(we):
|
||||||
found = True
|
# found = True
|
||||||
if found or force:
|
# if found or force:
|
||||||
if bal_plugin.PING_WILLEXECUTORS.get() or force:
|
# if bal_plugin.PING_WILLEXECUTORS.get() or force:
|
||||||
ping_willexecutors = True
|
# ping_willexecutors = True
|
||||||
if bal_plugin.ASK_PING_WILLEXECUTORS.get() and not force:
|
# if bal_plugin.ASK_PING_WILLEXECUTORS.get() and not force:
|
||||||
if bal_window:
|
# if bal_window:
|
||||||
ping_willexecutors = bal_window.window.question(
|
# ping_willexecutors = bal_window.window.question(
|
||||||
_(
|
# _(
|
||||||
"Contact willexecutors servers to update payment informations?"
|
# "Contact willexecutors servers to update payment informations?"
|
||||||
)
|
# )
|
||||||
)
|
# )
|
||||||
|
|
||||||
if ping_willexecutors:
|
# if ping_willexecutors:
|
||||||
if task:
|
# if task:
|
||||||
bal_window.ping_willexecutors(willexecutors, task)
|
# bal_window.ping_willexecutors(willexecutors, task)
|
||||||
else:
|
# else:
|
||||||
bal_window.ping_willexecutors_task(willexecutors)
|
# bal_window.ping_willexecutors_task(willexecutors)
|
||||||
w_sorted = dict(
|
w_sorted = dict(
|
||||||
sorted(
|
sorted(
|
||||||
willexecutors.items(), key=lambda w: w[1].get("sort", 0), reverse=True
|
willexecutors.items(), key=lambda w: w[1].get("sort", 0), reverse=True
|
||||||
|
|||||||
Reference in New Issue
Block a user