Mercurial > hg > Feedworm
annotate 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 |
rev | line source |
---|---|
27 | 1 |
2 from PyQt4 import QtGui | |
3 from Ui_AddFeed import Ui_AddFeed | |
49
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
4 import FeedUpdater |
27 | 5 |
6 class AddFeed(QtGui.QDialog): | |
7 def __init__(self, session=None): | |
8 QtGui.QWidget.__init__(self, None) | |
9 self.session = session | |
10 self.ui = Ui_AddFeed() | |
11 self.ui.setupUi(self) | |
12 self.ui.url.setFocus() | |
13 | |
49
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
14 def accept(self): |
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
15 self.createFeed() |
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
16 QtGui.QDialog.accept(self) |
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
17 |
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
18 def createFeed(self): |
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
19 url = self.getUrl() |
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
20 # TODO get status from feedUpdater and display in status area of the main window |
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
21 FeedUpdater.createNewFeed(url, self.session) |
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
22 |
27 | 23 def getUrl(self): |
24 text = self.ui.url.text() | |
25 # the content of a QLineEdit is a QString, convert it to a Python string | |
26 return str(text) | |
49
6eba4168fd54
move the logic to add a feed into AddFeed
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
27
diff
changeset
|
27 |