From ab24c482a1893639b0d0abce6c5d9fe8611dc5fa Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 11 Dec 2022 12:12:07 +0000 Subject: [PATCH] tw.prune.action: enable echo, clear screen after action --- mmgen/tw/prune.py | 9 ++++++++- mmgen/tw/view.py | 12 ++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/mmgen/tw/prune.py b/mmgen/tw/prune.py index ead98393..0c46ef17 100755 --- a/mmgen/tw/prune.py +++ b/mmgen/tw/prune.py @@ -12,10 +12,11 @@ tw.prune: Tracking wallet pruned listaddresses class for the MMGen suite """ -from ..util import msg,rmsg,ymsg +from ..util import msg,msg_r,rmsg,ymsg from ..color import red,green,gray,yellow from ..obj import ListItemAttr from .addresses import TwAddresses +from .view import CUR_HOME,ERASE_ALL class TwAddressesPrune(TwAddresses): @@ -156,10 +157,16 @@ class TwAddressesPrune(TwAddresses): else: e.tag = True + if parent.scroll: + msg_r(CUR_HOME + ERASE_ALL) + def a_unprune(self,parent): for addrnum in self.get_addrnums(parent,'unprune'): parent.disp_data[addrnum-1].tag = False + if parent.scroll: + msg_r(CUR_HOME + ERASE_ALL) + def a_clear_prune_list(self,parent): for d in parent.data: d.tag = False diff --git a/mmgen/tw/view.py b/mmgen/tw/view.py index aa3c67ff..a1d899b9 100755 --- a/mmgen/tw/view.py +++ b/mmgen/tw/view.py @@ -551,6 +551,9 @@ class TwView(MMGenObject,metaclass=AsyncInit): action = self.key_mappings[reply] + if scroll and action.startswith('a_'): # 'a_' actions may require line input + term.set('echo') + if hasattr(self.action,action): if action.startswith('m_'): # scrolling actions self.use_cached = True @@ -558,17 +561,14 @@ class TwView(MMGenObject,metaclass=AsyncInit): elif action.startswith('s_'): # put here to allow overriding by action method self.do_sort(action[2:]) elif hasattr(self.item_action,action): - if scroll: - term.set('echo') # item actions may require user input await self.item_action().run(self,action) - if scroll: - term.set('noecho') elif action == 'a_quit': msg('') - if scroll: - term.set('echo') return self.disp_data + if scroll and action.startswith('a_'): + term.set('noecho') + @property def blank_prompt(self): return CUR_HOME + CUR_DOWN(self.term_height - self.prompt_height) + ERASE_ALL