Update buffer removal code. Should be able to remove user search buffers

This commit is contained in:
Manuel Cortez 2022-11-21 22:09:40 -06:00
parent 48730ead63
commit b7497791b4
No known key found for this signature in database
GPG Key ID: 9E0735CA15EFE790
2 changed files with 14 additions and 3 deletions

View File

@ -172,7 +172,7 @@ class UserBuffer(BaseBuffer):
return True return True
elif dlg == widgetUtils.NO: elif dlg == widgetUtils.NO:
return False return False
if "-following" in self.name: elif "-following" in self.name:
if force == False: if force == False:
dlg = commonMessageDialogs.remove_buffer() dlg = commonMessageDialogs.remove_buffer()
else: else:
@ -186,6 +186,17 @@ class UserBuffer(BaseBuffer):
return True return True
elif dlg == widgetUtils.NO: elif dlg == widgetUtils.NO:
return False return False
elif "-searchUser" in self.name:
if force == False:
dlg = commonMessageDialogs.remove_buffer()
else:
dlg = widgetUtils.YES
if dlg == widgetUtils.YES:
if self.name in self.session.db:
self.session.db.pop(self.name)
return True
elif dlg == widgetUtils.NO:
return False
else: else:
output.speak(_(u"This buffer is not a timeline; it can't be deleted."), True) output.speak(_(u"This buffer is not a timeline; it can't be deleted."), True)
return False return False