do a better job of not inserting null where gtk expects a string
This commit is contained in:
parent
af70fd779d
commit
798c2ef365
1 changed files with 4 additions and 4 deletions
|
@ -174,7 +174,7 @@ class BuypeebApp:
|
||||||
# print(self.settings.watchlist)
|
# print(self.settings.watchlist)
|
||||||
for id, item in self.settings.watchlist.items():
|
for id, item in self.settings.watchlist.items():
|
||||||
if item.ready:
|
if item.ready:
|
||||||
self.items.append([item.name, item.price_jpy(), item.price_aud(self.rate), "...", id])
|
self.items.append([item.name if item.name is not None else "", item.price_jpy(), item.price_aud(self.rate), "...", id])
|
||||||
else:
|
else:
|
||||||
name = item.name
|
name = item.name
|
||||||
if name == None:
|
if name == None:
|
||||||
|
@ -191,9 +191,9 @@ class BuypeebApp:
|
||||||
treeIter = Gtk.TreeModel.get_iter(self.items, listing.path)
|
treeIter = Gtk.TreeModel.get_iter(self.items, listing.path)
|
||||||
if item_list != None:
|
if item_list != None:
|
||||||
for i in range(0, 4):
|
for i in range(0, 4):
|
||||||
self.items.set(treeIter, i, item_list[i])
|
self.items.set(treeIter, i, item_list[i] if item_list[0] is not None else "")
|
||||||
else:
|
else:
|
||||||
self.items.set(treeIter, 0, item.name)
|
self.items.set(treeIter, 0, item.name if item.name is not None else "")
|
||||||
if item.ready:
|
if item.ready:
|
||||||
self.items.set(treeIter, 1, item.price_jpy())
|
self.items.set(treeIter, 1, item.price_jpy())
|
||||||
self.items.set(treeIter, 2, item.price_aud())
|
self.items.set(treeIter, 2, item.price_aud())
|
||||||
|
@ -279,7 +279,7 @@ class BuypeebApp:
|
||||||
def btnSelectedRenameClicked(self, widget):
|
def btnSelectedRenameClicked(self, widget):
|
||||||
item = self.settings.watchlist[self.selected]
|
item = self.settings.watchlist[self.selected]
|
||||||
name = self.entryBox("Rename", f"Enter a new name for \"{item.name}\".", True, item.name)
|
name = self.entryBox("Rename", f"Enter a new name for \"{item.name}\".", True, item.name)
|
||||||
if name:
|
if name and item.name != name:
|
||||||
item.name = name
|
item.name = name
|
||||||
self.updateListItem(item.id)
|
self.updateListItem(item.id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue