Mercurial > hg > Feedworm
comparison MainWindow.py @ 103:063581d8594e
implement deleting a feed from the GUI
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 16 Feb 2011 06:57:06 +0100 |
parents | 11036eabbc46 |
children | 4f87be5399ff |
comparison
equal
deleted
inserted
replaced
102:25fef7c29c5b | 103:063581d8594e |
---|---|
46 self.setupFeedEntries() | 46 self.setupFeedEntries() |
47 | 47 |
48 def enableFeedRelatedWidgets(self): | 48 def enableFeedRelatedWidgets(self): |
49 self.ui.actionFeedSettings.setEnabled(True) | 49 self.ui.actionFeedSettings.setEnabled(True) |
50 self.ui.actionMarkFeedRead.setEnabled(True) | 50 self.ui.actionMarkFeedRead.setEnabled(True) |
51 self.ui.actionDeleteFeed.setEnabled(True) | |
51 | 52 |
52 def setupFeedEntries(self): | 53 def setupFeedEntries(self): |
53 hideReadEntries = self.preferences.hideReadFeedEntries() | 54 hideReadEntries = self.preferences.hideReadFeedEntries() |
54 self.feedEntries = self.selectedFeed.entriesSortedByUpdateDate(hideReadEntries) | 55 self.feedEntries = self.selectedFeed.entriesSortedByUpdateDate(hideReadEntries) |
55 self.initFeedDisplayModel() | 56 self.initFeedDisplayModel() |
133 self._updateStatusBar(message) | 134 self._updateStatusBar(message) |
134 else: | 135 else: |
135 self.session.commit() | 136 self.session.commit() |
136 self.updateFeedList() | 137 self.updateFeedList() |
137 | 138 |
139 def deleteFeed(self): | |
140 try: | |
141 self.session.delete(self.selectedFeed) | |
142 self.session.commit() | |
143 self.updateFeedList() | |
144 except Exception as exception: | |
145 message = "Error while deleting feed: " + str(exception) | |
146 self._updateStatusBar(message) | |
147 | |
138 def showPreferences(self): | 148 def showPreferences(self): |
139 preferences = PreferencesDialog(self.session) | 149 preferences = PreferencesDialog(self.session) |
140 preferences.exec_() | 150 preferences.exec_() |
141 | 151 |
142 def showFeedSettings(self): | 152 def showFeedSettings(self): |