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