mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Update buffer removal code. Should be able to remove user search buffers
This commit is contained in:
parent
48730ead63
commit
b7497791b4
@ -168,8 +168,8 @@ class BaseBuffer(base.Buffer):
|
|||||||
if self.kwargs.get("id") in self.session.settings["other_buffers"]["timelines"]:
|
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["other_buffers"]["timelines"].remove(self.kwargs.get("id"))
|
||||||
self.session.settings.write()
|
self.session.settings.write()
|
||||||
if self.name in self.session.db:
|
if self.name in self.session.db:
|
||||||
self.session.db.pop(self.name)
|
self.session.db.pop(self.name)
|
||||||
return True
|
return True
|
||||||
elif dlg == widgetUtils.NO:
|
elif dlg == widgetUtils.NO:
|
||||||
return False
|
return False
|
||||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user