checkalive sulla finestra will
This commit is contained in:
42
qt.py
42
qt.py
@@ -406,7 +406,7 @@ class BalWindow(Logger):
|
|||||||
if self.window.wallet:
|
if self.window.wallet:
|
||||||
self.wallet = self.window.wallet
|
self.wallet = self.window.wallet
|
||||||
if not self.will_settings:
|
if not self.will_settings:
|
||||||
self.will_settings = self.wallet.db.get_dict("will_settings")
|
self.will_settings = self.bal_plugin.WILL_SETTINGS.get()
|
||||||
Util.fix_will_settings_tx_fees(self.will_settings)
|
Util.fix_will_settings_tx_fees(self.will_settings)
|
||||||
|
|
||||||
self.heirs_tab = self.create_heirs_tab()
|
self.heirs_tab = self.create_heirs_tab()
|
||||||
@@ -492,17 +492,17 @@ class BalWindow(Logger):
|
|||||||
self.close_wallet()
|
self.close_wallet()
|
||||||
return
|
return
|
||||||
|
|
||||||
if not self.will_settings:
|
#if not self.will_settings:
|
||||||
self.will_settings = self.wallet.db.get_dict("will_settings")
|
# self.will_settings = self.wallet.db.get_dict("will_settings")
|
||||||
Util.fix_will_settings_tx_fees(self.will_settings)
|
# Util.fix_will_settings_tx_fees(self.will_settings)
|
||||||
|
|
||||||
self.logger.info("will_settings: {}".format(self.will_settings))
|
# self.logger.info("will_settings: {}".format(self.will_settings))
|
||||||
if not self.will_settings:
|
# if not self.will_settings:
|
||||||
Util.copy(self.will_settings, self.bal_plugin.default_will_settings())
|
# Util.copy(self.will_settings, self.bal_plugin.default_will_settings())
|
||||||
self.logger.debug("not_will_settings {}".format(self.will_settings))
|
# self.logger.debug("not_will_settings {}".format(self.will_settings))
|
||||||
self.bal_plugin.validate_will_settings(self.will_settings)
|
# self.bal_plugin.validate_will_settings(self.will_settings)
|
||||||
self.heir_list_widget.update_will_settings()
|
# self.heir_list_widget.update_will_settings()
|
||||||
self.heir_list_widget.update()
|
# self.heir_list_widget.update()
|
||||||
|
|
||||||
def init_wizard(self):
|
def init_wizard(self):
|
||||||
wizard_dialog = BalWizardDialog(self)
|
wizard_dialog = BalWizardDialog(self)
|
||||||
@@ -746,12 +746,11 @@ class BalWindow(Logger):
|
|||||||
try:
|
try:
|
||||||
self.heir_list_widget.heir_locktime.set_locktime(locktime)
|
self.heir_list_widget.heir_locktime.set_locktime(locktime)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("error heir locktime",e)
|
|
||||||
pass
|
pass
|
||||||
#self.preview_list.heirs_locktime.set_locktim(will_settings['thershold'])
|
#self.preview_list.heirs_locktime.set_locktim(will_settings['thershold'])
|
||||||
|
|
||||||
def update_threshold_widgets(self,threshold):
|
def update_threshold_widgets(self,threshold):
|
||||||
threshold = self.will_settings["thershold"] = (
|
threshold = self.will_settings["threshold"] = (
|
||||||
threshold
|
threshold
|
||||||
if threshold
|
if threshold
|
||||||
else "1y"
|
else "1y"
|
||||||
@@ -760,12 +759,10 @@ class BalWindow(Logger):
|
|||||||
try:
|
try:
|
||||||
self.heir_list_widget.heir_threshold.set_locktime(threshold)
|
self.heir_list_widget.heir_threshold.set_locktime(threshold)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("error heir threshold",e)
|
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
self.will_list.heir_threshold.set_locktime(threshold)
|
self.will_list.heir_threshold.set_locktime(threshold)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("error will threshold",e)
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def init_heirs_to_locktime(self, multiverse=False):
|
def init_heirs_to_locktime(self, multiverse=False):
|
||||||
@@ -1354,8 +1351,8 @@ class HeirsLockTimeEdit(QWidget, _LockTimeEditor):
|
|||||||
w.setEnabled(False)
|
w.setEnabled(False)
|
||||||
prev_locktime = self.editor.get_locktime()
|
prev_locktime = self.editor.get_locktime()
|
||||||
self.editor = self.option_index_to_editor_map[i]
|
self.editor = self.option_index_to_editor_map[i]
|
||||||
if self.editor.is_acceptable_locktime(prev_locktime):
|
#if self.editor.is_acceptable_locktime(prev_locktime):
|
||||||
self.editor.set_locktime(prev_locktime, force=False)
|
# self.editor.set_locktime(prev_locktime, force=False)
|
||||||
self.editor.setVisible(True)
|
self.editor.setVisible(True)
|
||||||
self.editor.setEnabled(True)
|
self.editor.setEnabled(True)
|
||||||
|
|
||||||
@@ -1366,15 +1363,16 @@ class HeirsLockTimeEdit(QWidget, _LockTimeEditor):
|
|||||||
self.combo.setCurrentIndex(index)
|
self.combo.setCurrentIndex(index)
|
||||||
self.on_current_index_changed(index)
|
self.on_current_index_changed(index)
|
||||||
|
|
||||||
def set_locktime(self, x: Any, force=True) -> None:
|
def set_locktime(self, x: Any, force=None) -> None:
|
||||||
|
if force is None:
|
||||||
|
force=True
|
||||||
try:
|
try:
|
||||||
int(x)
|
int(x)
|
||||||
if not force:
|
|
||||||
self.set_index(1)
|
self.set_index(1)
|
||||||
except:
|
except:
|
||||||
if isinstance(x,str):
|
if isinstance(x,str):
|
||||||
self.set_index(0)
|
self.set_index(0)
|
||||||
self.editor.set_locktime(x, force)
|
self.editor.set_locktime(x, force=False)
|
||||||
|
|
||||||
|
|
||||||
class LockTimeRawEdit(QLineEdit, _LockTimeEditor):
|
class LockTimeRawEdit(QLineEdit, _LockTimeEditor):
|
||||||
@@ -1902,7 +1900,7 @@ class BalWizardLocktimeAndFeeWidget(BalWizardWidget):
|
|||||||
def get_content(self):
|
def get_content(self):
|
||||||
widget = QWidget()
|
widget = QWidget()
|
||||||
self.heir_locktime = HeirsLockTimeEdit(widget, 0)
|
self.heir_locktime = HeirsLockTimeEdit(widget, 0)
|
||||||
will_settings = self.bal_window.bal_plugin.WILL_SETTINGS.get()
|
#will_settings = self.bal_window.bal_plugin.WILL_SETTINGS.get()
|
||||||
will_settings = self.bal_window.will_settings
|
will_settings = self.bal_window.will_settings
|
||||||
self.heir_locktime.set_locktime(will_settings["locktime"])
|
self.heir_locktime.set_locktime(will_settings["locktime"])
|
||||||
|
|
||||||
@@ -2049,7 +2047,6 @@ class BalWaitingDialog(BalDialog):
|
|||||||
self.thread.stop()
|
self.thread.stop()
|
||||||
|
|
||||||
def update_message(self, msg):
|
def update_message(self, msg):
|
||||||
print(msg)
|
|
||||||
self.message_label.setText(msg)
|
self.message_label.setText(msg)
|
||||||
|
|
||||||
def update(self, msg):
|
def update(self, msg):
|
||||||
@@ -3115,7 +3112,6 @@ class PreviewList(MyTreeView):
|
|||||||
def on_heir_threshold():
|
def on_heir_threshold():
|
||||||
if not self.heir_threshold.get_locktime():
|
if not self.heir_threshold.get_locktime():
|
||||||
self.heir_threshold.set_locktime("180d")
|
self.heir_threshold.set_locktime("180d")
|
||||||
print("no threshold")
|
|
||||||
self.bal_window.update_threshold_widgets(self.heir_threshold.get_locktime())
|
self.bal_window.update_threshold_widgets(self.heir_threshold.get_locktime())
|
||||||
|
|
||||||
self.heir_threshold.valueEdited.connect(on_heir_threshold)
|
self.heir_threshold.valueEdited.connect(on_heir_threshold)
|
||||||
|
|||||||
Reference in New Issue
Block a user