comparison MainWindow.py @ 105:d372b3ee7bd8

add marking the entire current selection as read
author Dirk Olmes <dirk@xanthippe.ping.de>
date Mon, 07 Mar 2011 07:08:12 +0100
parents 4f87be5399ff
children 863599e84269
comparison
equal deleted inserted replaced
104:4f87be5399ff 105:d372b3ee7bd8
125 def markSelectedFeedRead(self): 125 def markSelectedFeedRead(self):
126 self.selectedFeed.markAllEntriesRead() 126 self.selectedFeed.markAllEntriesRead()
127 self.session.commit() 127 self.session.commit()
128 self.ui.feedEntryList.doItemsLayout() 128 self.ui.feedEntryList.doItemsLayout()
129 129
130 def markSelectedEntriesRead(self):
131 selectedIndexes = self.ui.feedEntryList.selectedIndexes()
132 for index in selectedIndexes:
133 # selectedIndexes returns one QModelIndex instance per row/column combo.
134 # We are only interested in the rows here so just operate on the first
135 # column
136 if index.column() == 0:
137 row = index.row()
138 # use selectedEntry here to ensure it has a valid state after all
139 # selected entries are marked read
140 self.selectedEntry = self.feedEntries[row]
141 self.selectedEntry.toggleRead()
142 self.session.commit()
143 self.ui.feedEntryList.doItemsLayout()
144
130 def addFeed(self): 145 def addFeed(self):
131 addFeed = AddFeed(self.session) 146 addFeed = AddFeed(self.session)
132 success = addFeed.exec_() 147 success = addFeed.exec_()
133 if not success: 148 if not success:
134 return 149 return