# HG changeset patch # User Dirk Olmes # Date 1274061133 -7200 # Node ID 6eba4168fd548c9aea97909aa05c4543e03b1cef # Parent 6e5219e056254c10af72bf833068d07c7bf33d9b move the logic to add a feed into AddFeed diff -r 6e5219e05625 -r 6eba4168fd54 AddFeed.py --- a/AddFeed.py Sun May 16 08:26:46 2010 +0200 +++ b/AddFeed.py Mon May 17 03:52:13 2010 +0200 @@ -1,6 +1,7 @@ from PyQt4 import QtGui from Ui_AddFeed import Ui_AddFeed +import FeedUpdater class AddFeed(QtGui.QDialog): def __init__(self, session=None): @@ -10,7 +11,17 @@ self.ui.setupUi(self) self.ui.url.setFocus() + def accept(self): + self.createFeed() + QtGui.QDialog.accept(self) + + def createFeed(self): + url = self.getUrl() + # TODO get status from feedUpdater and display in status area of the main window + FeedUpdater.createNewFeed(url, self.session) + def getUrl(self): text = self.ui.url.text() # the content of a QLineEdit is a QString, convert it to a Python string return str(text) + \ No newline at end of file diff -r 6e5219e05625 -r 6eba4168fd54 MainWindow.py --- a/MainWindow.py Sun May 16 08:26:46 2010 +0200 +++ b/MainWindow.py Mon May 17 03:52:13 2010 +0200 @@ -9,7 +9,6 @@ from PyQt4.QtCore import QUrl from PyQt4.QtGui import QFont from Ui_MainWindow import Ui_MainWindow -import FeedUpdater import subprocess class MainWindow(QtGui.QMainWindow): @@ -68,9 +67,6 @@ addFeed = AddFeed(self.session) success = addFeed.exec_() if success: - url = addFeed.getUrl() - FeedUpdater.createNewFeed(url, self.session) - # TODO get status from feedUpdater and display in status area of the main window self.updateFeedList() def openSelectedEntryInBrowser(self):