# HG changeset patch # User Dirk Olmes # Date 1272512512 -7200 # Node ID dcc8abff06943801fd4fd03cb3f46ed6fbbf5371 # Parent cb9d8da0f307cea713354102b540d0d6caa09546 All the wiring of slots is done through QtDesigner now, look how much code has just disappeared :-) diff -r cb9d8da0f307 -r dcc8abff0694 MainWindowController.py --- a/MainWindowController.py Thu Apr 29 05:22:59 2010 +0200 +++ b/MainWindowController.py Thu Apr 29 05:41:52 2010 +0200 @@ -2,7 +2,7 @@ from DisplayModel import DisplayModel from Feed import Feed from FeedEntry import FeedEntry -from PyQt4 import QtCore, QtGui +from PyQt4 import QtGui from PyQt4.QtCore import QUrl from Ui_MainWindow import Ui_MainWindow @@ -12,24 +12,12 @@ self.session = session self.ui = Ui_MainWindow() self.ui.setupUi(self) - self.setupWidgets() + self.setupFeedList() - def setupWidgets(self): - self.setupAddFeedMenuEntry() - self.setupFeedList() - self.setupFeedEntryList() - - def setupAddFeedMenuEntry(self): - self.connect(self.ui.actionAdd, QtCore.SIGNAL("activated(int)"), self.addFeed) - def setupFeedList(self): self.allFeeds = Feed.all(self.session) feedModel = DisplayModel(self, self.allFeeds, Feed.userPresentableString) self.ui.feedList.setModel(feedModel) - self.connect(self.ui.feedList, QtCore.SIGNAL("clicked(QModelIndex)"), self.feedSelected) - - def setupFeedEntryList(self): - self.connect(self.ui.feedEntryList, QtCore.SIGNAL("clicked(QModelIndex)"), self.feedEntrySelected) def feedSelected(self, index): self.selectedFeed = self.allFeeds[index.row()] @@ -44,4 +32,5 @@ self.ui.webView.setHtml(entry.summary, baseUrl) def addFeed(self): - pass \ No newline at end of file + print("Add Feed!") + \ No newline at end of file diff -r cb9d8da0f307 -r dcc8abff0694 Ui_MainWindow.ui --- a/Ui_MainWindow.ui Thu Apr 29 05:22:59 2010 +0200 +++ b/Ui_MainWindow.ui Thu Apr 29 05:41:52 2010 +0200 @@ -78,6 +78,11 @@ Add ... + + + xxx + + @@ -104,5 +109,58 @@ + + actionAdd + activated() + MainWindow + addFeed() + + + -1 + -1 + + + 495 + 374 + + + + + feedList + clicked(QModelIndex) + MainWindow + feedSelected(QModelIndex) + + + 126 + 377 + + + 495 + 374 + + + + + feedEntryList + clicked(QModelIndex) + MainWindow + feedEntrySelected(QModelIndex) + + + 616 + 117 + + + 495 + 374 + + + + + addFeed() + feedSelected(QModelIndex) + feedEntrySelected(QModelIndex) +