Skip to content

Commit 71d76a6

Browse files
Prevent lines selection for non-relevant updates
1 parent 33bcc75 commit 71d76a6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

frames/bid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def checkQueue(self):
330330
elif msg[1] == EventType.SOLD:
331331
self.auctionStatus.update_status(msg[0], time.strftime('%Y-%m-%d %H:%M:%S'), msg[0].currentBid, tag='sold')
332332
elif msg[1] == EventType.UPDATE:
333-
self.auctionStatus.update_status(msg[0], time.strftime('%Y-%m-%d %H:%M:%S'), msg[0].currentBid)
333+
self.auctionStatus.update_status(msg[0], time.strftime('%Y-%m-%d %H:%M:%S'), msg[0].currentBid, highlight=False)
334334
self.controller.status.set_credits(msg[2])
335335
else:
336336
# Auction Results

frames/misc/auctions.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, frame):
5656
def get_view(self):
5757
return self.view
5858

59-
def update_status(self, card, timestamp, currbid, tag=''):
59+
def update_status(self, card, timestamp, currbid, tag='', highlight=True):
6060
if not card.cardid in self.cards:
6161
self.tree.insert("", 'end', card.cardid, text=card.cardname, values=(timestamp, card.startingBid,
6262
currbid, card.buyNowPrice,
@@ -69,10 +69,16 @@ def update_status(self, card, timestamp, currbid, tag=''):
6969
if tag:
7070
options['tags'] = (tag,)
7171
self.tree.item(card.cardid, text=options['text'], values=options['values'], tags=options['tags'])
72-
self.tree.see(card.cardid)
73-
self.tree.selection_set([card.cardid])
72+
73+
# Highlight the row and make sure it is visible
74+
if highlight:
75+
self.tree.see(card.cardid)
76+
self.tree.selection_set([card.cardid])
77+
78+
# Update the cards dictionary with the new entry
7479
self.cards[card.cardid] = card
7580

81+
7682
def decreaseExpires(self):
7783
for cardid in self.cards:
7884
card = self.cards[cardid]

0 commit comments

Comments
 (0)