Exemplo n.º 1
0
class RemoveFeedDialog(QDialog):
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.ui=Ui_removeFeed()
        self.ui.setupUi(self)
        self.feedList = []
        self.displayFeeds()
        self.parent = parent
        self.connect(self.ui.btnCancel, SIGNAL('clicked()'), SLOT('close()'))
        self.connect(self.ui.btnRemove, SIGNAL("clicked()"), self.removeFeed)


    def displayFeeds(self):
        """
        function to display the subscribed feeds list in the combo box.
        """
        self.feedList = fm.listFeeds()
        feedTitles = [feed.title for feed in self.feedList]
        self.ui.feedList.clear()
        self.ui.feedList.addItems(feedTitles)


    def removeFeed(self):
        selectedIndex = self.ui.feedList.currentIndex()
        selectedFeed = self.feedList[selectedIndex]

        classifier.removefromScoreTable(selectedFeed)
        fm.removeFeed(selectedFeed)
#        self.parent.displayFeeds()
        #Set the refreshDisplay status to true.
        self.parent.parent.refreshDisplay = True
        self.close()
Exemplo n.º 2
0
class RemoveFeedDialog(QDialog):
    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.ui = Ui_removeFeed()
        self.ui.setupUi(self)
        self.feedList = []
        self.displayFeeds()
        self.parent = parent
        self.connect(self.ui.btnCancel, SIGNAL('clicked()'), SLOT('close()'))
        self.connect(self.ui.btnRemove, SIGNAL("clicked()"), self.removeFeed)

    def displayFeeds(self):
        """
        function to display the subscribed feeds list in the combo box.
        """
        self.feedList = fm.listFeeds()
        feedTitles = [feed.title for feed in self.feedList]
        self.ui.feedList.clear()
        self.ui.feedList.addItems(feedTitles)

    def removeFeed(self):
        selectedIndex = self.ui.feedList.currentIndex()
        selectedFeed = self.feedList[selectedIndex]

        classifier.removefromScoreTable(selectedFeed)
        fm.removeFeed(selectedFeed)
        #        self.parent.displayFeeds()
        #Set the refreshDisplay status to true.
        self.parent.parent.refreshDisplay = True
        self.close()
Exemplo n.º 3
0
 def __init__(self, parent):
     QDialog.__init__(self, parent)
     self.ui = Ui_removeFeed()
     self.ui.setupUi(self)
     self.feedList = []
     self.displayFeeds()
     self.parent = parent
     self.connect(self.ui.btnCancel, SIGNAL('clicked()'), SLOT('close()'))
     self.connect(self.ui.btnRemove, SIGNAL("clicked()"), self.removeFeed)
Exemplo n.º 4
0
 def __init__(self, parent):
     QDialog.__init__(self, parent)
     self.ui=Ui_removeFeed()
     self.ui.setupUi(self)
     self.feedList = []
     self.displayFeeds()
     self.parent = parent
     self.connect(self.ui.btnCancel, SIGNAL('clicked()'), SLOT('close()'))
     self.connect(self.ui.btnRemove, SIGNAL("clicked()"), self.removeFeed)