tw.prune.action: enable echo, clear screen after action

This commit is contained in:
The MMGen Project 2022-12-11 12:12:07 +00:00
commit ab24c482a1
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 14 additions and 7 deletions

View file

@ -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

View file

@ -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