コード例 #1
0
ファイル: manager.py プロジェクト: solbirn/pyRSSDownloader
class GuiRSSAddFeedDialog(QtGui.QDialog):
    def __init__(self, managers, tab):
        QtGui.QDialog.__init__(self)
        from gui.rssaddui import Ui_RSSAddFeedDialog
        self.ui = Ui_RSSAddFeedDialog()
        self.ui.setupUi(self)
        self.ui.tabs.setCurrentIndex(tab)
        self.managers = managers

        self.rsseasyaddurlstring = "http://invalideasyaddurl/%s"

    def RSSAddFeedByName(self):
        RSSUrlString = str(self.ui.functions_findrss_easy_input.text())
        RSSUrlItem = QtGui.QListWidgetItem()
        RSSUrlItem.setText(
            QtGui.QApplication.translate(
                "RSSAddFeedDialog", self.rsseasyaddurlstring %
                RSSUrlString.lower().strip().replace(" ", "-"), None,
                QtGui.QApplication.UnicodeUTF8))
        self.ui.tab_easy_list.addItem(RSSUrlItem)

    def RSSAddFeedByURL(self):
        RSSUrlString = str(self.ui.functions_findrss_adv_input.text())
        RSSUrlItem = QtGui.QListWidgetItem()
        RSSUrlItem.setText(
            QtGui.QApplication.translate("RSSAddFeedDialog", RSSUrlString,
                                         None, QtGui.QApplication.UnicodeUTF8))
        self.ui.tab_adv_list.addItem(RSSUrlItem)

    def RSSAddFeedByURLBatch(self):
        return

    def RSSAddFeedGatherUiInfoList(self):
        index = self.ui.tabs.currentIndex()
        if index == 0:
            items = self.ui.tab_easy_list.findItems(
                QtCore.QString("*"),
                QtCore.Qt.MatchWrap | QtCore.Qt.MatchWildcard)
        elif index == 1:
            items = self.ui.tab_adv_list.findItems(
                QtCore.QString("*"),
                QtCore.Qt.MatchWrap | QtCore.Qt.MatchWildcard)
        else:
            raise NotImplementedError
        links = []
        for item in items:
            links.append(str(item.text()))
        #helper = guihelpers(self.managers)
        #helper.GuiInfoDialog(links)
        return links

    def RegisterEasyAddURLString(self, urlstring):
        self.rsseasyaddurlstring = urlstring

    def save(self):
        self.hide()
        self.managers.ThreadManagerInst.dispatch(
            "RSSAddFeed", self.RSSAddFeedGatherUiInfoList())
        self.accept()
コード例 #2
0
ファイル: manager.py プロジェクト: solbirn/pyRSSDownloader
    def __init__(self, managers, tab):
        QtGui.QDialog.__init__(self)
        from gui.rssaddui import Ui_RSSAddFeedDialog
        self.ui = Ui_RSSAddFeedDialog()
        self.ui.setupUi(self)
        self.ui.tabs.setCurrentIndex(tab)
        self.managers = managers

        self.rsseasyaddurlstring = "http://invalideasyaddurl/%s"
コード例 #3
0
ファイル: manager.py プロジェクト: solbirn/pyRSSDownloader
    def __init__(self, managers, tab):
        QtGui.QDialog.__init__(self)
        from gui.rssaddui import Ui_RSSAddFeedDialog
        self.ui=Ui_RSSAddFeedDialog()
        self.ui.setupUi(self)
        self.ui.tabs.setCurrentIndex(tab)
        self.managers = managers

        self.rsseasyaddurlstring = "http://invalideasyaddurl/%s"
コード例 #4
0
ファイル: manager.py プロジェクト: solbirn/pyRSSDownloader
class GuiRSSAddFeedDialog(QtGui.QDialog):
    def __init__(self, managers, tab):
        QtGui.QDialog.__init__(self)
        from gui.rssaddui import Ui_RSSAddFeedDialog
        self.ui=Ui_RSSAddFeedDialog()
        self.ui.setupUi(self)
        self.ui.tabs.setCurrentIndex(tab)
        self.managers = managers

        self.rsseasyaddurlstring = "http://invalideasyaddurl/%s"

    def RSSAddFeedByName(self):
        RSSUrlString = str(self.ui.functions_findrss_easy_input.text())
        RSSUrlItem = QtGui.QListWidgetItem()
        RSSUrlItem.setText(QtGui.QApplication.translate("RSSAddFeedDialog", self.rsseasyaddurlstring % RSSUrlString.lower().strip().replace(" ","-"), None, QtGui.QApplication.UnicodeUTF8))
        self.ui.tab_easy_list.addItem(RSSUrlItem)
    def RSSAddFeedByURL(self):
        RSSUrlString = str(self.ui.functions_findrss_adv_input.text())
        RSSUrlItem = QtGui.QListWidgetItem()
        RSSUrlItem.setText(QtGui.QApplication.translate("RSSAddFeedDialog", RSSUrlString, None, QtGui.QApplication.UnicodeUTF8))
        self.ui.tab_adv_list.addItem(RSSUrlItem)
    def RSSAddFeedByURLBatch(self):
        return
    def RSSAddFeedGatherUiInfoList(self):
        index = self.ui.tabs.currentIndex()
        if index == 0:
            items = self.ui.tab_easy_list.findItems(QtCore.QString("*"),QtCore.Qt.MatchWrap|QtCore.Qt.MatchWildcard)
        elif index == 1:
            items = self.ui.tab_adv_list.findItems(QtCore.QString("*"),QtCore.Qt.MatchWrap|QtCore.Qt.MatchWildcard)
        else:
            raise NotImplementedError
        links = []
        for item in items:
            links.append(str(item.text()))
        #helper = guihelpers(self.managers)
        #helper.GuiInfoDialog(links)
        return links
    def RegisterEasyAddURLString(self, urlstring):
        self.rsseasyaddurlstring = urlstring
    def save(self):
        self.hide()
        self.managers.ThreadManagerInst.dispatch("RSSAddFeed", self.RSSAddFeedGatherUiInfoList())
        self.accept()