def plugin_dialog(self, name, label, dt): from checkbox_dialog import CheckBoxDialog def callback(status): self.plugins.enable(name) if status else self.plugins.disable(name) label.status = 'ON' if status else 'OFF' status = bool(self.plugins.get(name)) dd = self.plugins.descriptions.get(name) descr = dd.get('description') fullname = dd.get('fullname') d = CheckBoxDialog(fullname, descr, status, callback) d.open()
def rbf_dialog(self, label, dt): if self._rbf_dialog is None: from checkbox_dialog import CheckBoxDialog def cb(x): self.config.set_key('use_rbf', x, True) label.status = self.rbf_status() msg = [_('If you check this box, your transactions will be marked as non-final,'), _('and you will have the possiblity, while they are unconfirmed, to replace them with transactions that pays higher fees.'), _('Note that some merchants do not accept non-final transactions until they are confirmed.')] fullname = _('Replace by fee') self._rbf_dialog = CheckBoxDialog(fullname, ' '.join(msg), self.config.get('use_rbf', False), cb) self._rbf_dialog.open()
def boolean_dialog(self, name, title, message, dt): from checkbox_dialog import CheckBoxDialog CheckBoxDialog(title, message, getattr(self.app, name), lambda x: setattr(self.app, name, x)).open()