now the cancel button actually cancels 0u0;

This commit is contained in:
Lynne Megido 2020-08-23 21:52:02 +10:00
parent 0b93c4e3f9
commit 42bed9b175
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90
2 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ buyee.html
yahoo.html yahoo.html
exchange.json exchange.json
*.glade~ *.glade~
venv/

View File

@ -133,7 +133,7 @@ class BuypeebApp:
response = entrybox.run() response = entrybox.run()
text = entry.get_text() text = entry.get_text()
entrybox.destroy() entrybox.destroy()
if response: if response == Gtk.ResponseType.OK:
return text return text
else: else:
# user clicked cancel # user clicked cancel
@ -188,7 +188,7 @@ class BuypeebApp:
self.updateItems() self.updateItems()
def btnClearEndedClicked(self, widget): def btnClearEndedClicked(self, widget):
if self.msgBox("Clear ended?", "Are you sure you want to clear all ended items from the watchlist?", buttons = Gtk.ButtonsType.OK_CANCEL): if self.msgBox("Clear ended?", "Are you sure you want to clear all ended items from the watchlist?", buttons = Gtk.ButtonsType.OK_CANCEL) == Gtk.ResponseType.OK:
for id, item in self.settings.watchlist.items(): for id, item in self.settings.watchlist.items():
if not item.available: if not item.available:
del self.settings.watchlist[key] del self.settings.watchlist[key]
@ -196,7 +196,7 @@ class BuypeebApp:
self.renderList() self.renderList()
def btnClearAllClicked(self, widget): def btnClearAllClicked(self, widget):
if self.msgBox("Clear all?", "Are you sure you want to clear all watched items?", buttons = Gtk.ButtonsType.OK_CANCEL): if self.msgBox("Clear all?", "Are you sure you want to clear all watched items?", buttons = Gtk.ButtonsType.OK_CANCEL) == Gtk.ResponseType.OK:
self.settings.watchlist = {} self.settings.watchlist = {}
self.items.clear() self.items.clear()