diff 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
line wrap: on
line diff
--- a/MainWindow.py	Wed Feb 16 06:18:40 2011 +0100
+++ b/MainWindow.py	Wed Feb 16 06:57:06 2011 +0100
@@ -48,6 +48,7 @@
     def enableFeedRelatedWidgets(self):
         self.ui.actionFeedSettings.setEnabled(True)
         self.ui.actionMarkFeedRead.setEnabled(True)
+        self.ui.actionDeleteFeed.setEnabled(True)
 
     def setupFeedEntries(self):
         hideReadEntries = self.preferences.hideReadFeedEntries()
@@ -135,6 +136,15 @@
             self.session.commit()
             self.updateFeedList()
 
+    def deleteFeed(self):
+        try:
+            self.session.delete(self.selectedFeed)
+            self.session.commit()
+            self.updateFeedList()
+        except Exception as exception:
+            message = "Error while deleting feed: " + str(exception)
+            self._updateStatusBar(message)
+
     def showPreferences(self):
         preferences = PreferencesDialog(self.session)
         preferences.exec_()