comparison MainWindow.py @ 56:c82f5538733c

add a menu item to mark all entries in a feed as read
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 23 Jul 2010 04:06:10 +0200
parents 0f9b3e57cff0
children daa2731967fe
comparison
equal deleted inserted replaced
55:0f9b3e57cff0 56:c82f5538733c
33 33
34 def feedSelected(self, index): 34 def feedSelected(self, index):
35 self.selectedFeed = self.allFeeds[index.row()] 35 self.selectedFeed = self.allFeeds[index.row()]
36 36
37 self.ui.actionFeedSettings.setEnabled(True) 37 self.ui.actionFeedSettings.setEnabled(True)
38 self.ui.actionMarkFeedRead.setEnabled(True)
38 39
39 self.sortedEntries = self.selectedFeed.entriesSortedByUpdateDate() 40 self.sortedEntries = self.selectedFeed.entriesSortedByUpdateDate()
40 model = DisplayModel(self, self.sortedEntries, FeedEntry.userPresentableString) 41 model = DisplayModel(self, self.sortedEntries, FeedEntry.userPresentableString)
41 self.ui.feedEntryList.setModel(model) 42 self.ui.feedEntryList.setModel(model)
42 self.ui.feedEntryList.itemDelegate().entries = self.sortedEntries 43 self.ui.feedEntryList.itemDelegate().entries = self.sortedEntries
65 66
66 def toggleReadOnSelectedEntry(self): 67 def toggleReadOnSelectedEntry(self):
67 self.selectedEntry.toggleRead() 68 self.selectedEntry.toggleRead()
68 self.session.commit() 69 self.session.commit()
69 self.ui.feedList.update() 70 self.ui.feedList.update()
71
72 def toggleReadOnSelectedFeed(self):
73 self.selectedFeed.toggleRead()
74 self.session.commit()
75 self.ui.feedEntryList.update()
70 76
71 def addFeed(self): 77 def addFeed(self):
72 addFeed = AddFeed(self.session) 78 addFeed = AddFeed(self.session)
73 success = addFeed.exec_() 79 success = addFeed.exec_()
74 if not success: 80 if not success: