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

@ -168,8 +168,8 @@ class BaseBuffer(base.Buffer):
if self.kwargs.get("id") in self.session.settings["other_buffers"]["timelines"]:
self.session.settings["other_buffers"]["timelines"].remove(self.kwargs.get("id"))
self.session.settings.write()
if self.name in self.session.db:
self.session.db.pop(self.name)
if self.name in self.session.db:
self.session.db.pop(self.name)
return True
elif dlg == widgetUtils.NO:
return False

View File

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