# HG changeset patch # User Dirk Olmes # Date 1297835826 -3600 # Node ID 063581d8594e540d4c46df4f9a42fb13959b7370 # Parent 25fef7c29c5b988738601b099021d5258bbfaaa3 implement deleting a feed from the GUI diff -r 25fef7c29c5b -r 063581d8594e MainWindow.py --- 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_() diff -r 25fef7c29c5b -r 063581d8594e Ui_MainWindow.ui --- a/Ui_MainWindow.ui Wed Feb 16 06:18:40 2011 +0100 +++ b/Ui_MainWindow.ui Wed Feb 16 06:57:06 2011 +0100 @@ -81,6 +81,7 @@ + @@ -211,6 +212,14 @@ Ctrl+Shift+U + + + false + + + Delete + + @@ -383,6 +392,22 @@ + + actionDeleteFeed + activated() + MainWindow + deleteFeed() + + + -1 + -1 + + + 495 + 374 + + + addFeed() @@ -394,5 +419,6 @@ showPreferences() showFeedSettings() markSelectedFeedRead() + deleteFeed()