Mercurial > hg > Feedworm
comparison AddFeed.py @ 49:6eba4168fd54
move the logic to add a feed into AddFeed
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Mon, 17 May 2010 03:52:13 +0200 |
parents | bdd1296a4b8c |
children | 4b0d686493fb |
comparison
equal
deleted
inserted
replaced
48:6e5219e05625 | 49:6eba4168fd54 |
---|---|
1 | 1 |
2 from PyQt4 import QtGui | 2 from PyQt4 import QtGui |
3 from Ui_AddFeed import Ui_AddFeed | 3 from Ui_AddFeed import Ui_AddFeed |
4 import FeedUpdater | |
4 | 5 |
5 class AddFeed(QtGui.QDialog): | 6 class AddFeed(QtGui.QDialog): |
6 def __init__(self, session=None): | 7 def __init__(self, session=None): |
7 QtGui.QWidget.__init__(self, None) | 8 QtGui.QWidget.__init__(self, None) |
8 self.session = session | 9 self.session = session |
9 self.ui = Ui_AddFeed() | 10 self.ui = Ui_AddFeed() |
10 self.ui.setupUi(self) | 11 self.ui.setupUi(self) |
11 self.ui.url.setFocus() | 12 self.ui.url.setFocus() |
12 | 13 |
14 def accept(self): | |
15 self.createFeed() | |
16 QtGui.QDialog.accept(self) | |
17 | |
18 def createFeed(self): | |
19 url = self.getUrl() | |
20 # TODO get status from feedUpdater and display in status area of the main window | |
21 FeedUpdater.createNewFeed(url, self.session) | |
22 | |
13 def getUrl(self): | 23 def getUrl(self): |
14 text = self.ui.url.text() | 24 text = self.ui.url.text() |
15 # the content of a QLineEdit is a QString, convert it to a Python string | 25 # the content of a QLineEdit is a QString, convert it to a Python string |
16 return str(text) | 26 return str(text) |
27 |