changeset 23:dcc8abff0694

All the wiring of slots is done through QtDesigner now, look how much code has just disappeared :-)
author Dirk Olmes <dirk@xanthippe.ping.de>
date Thu, 29 Apr 2010 05:41:52 +0200
parents cb9d8da0f307
children 6b5ceffabe49
files MainWindowController.py Ui_MainWindow.ui
diffstat 2 files changed, 62 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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 @@
     <string>Add ...</string>
    </property>
   </action>
+  <action name="actionXxx">
+   <property name="text">
+    <string>xxx</string>
+   </property>
+  </action>
  </widget>
  <customwidgets>
   <customwidget>
@@ -104,5 +109,58 @@
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>actionAdd</sender>
+   <signal>activated()</signal>
+   <receiver>MainWindow</receiver>
+   <slot>addFeed()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>-1</x>
+     <y>-1</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>495</x>
+     <y>374</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>feedList</sender>
+   <signal>clicked(QModelIndex)</signal>
+   <receiver>MainWindow</receiver>
+   <slot>feedSelected(QModelIndex)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>126</x>
+     <y>377</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>495</x>
+     <y>374</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>feedEntryList</sender>
+   <signal>clicked(QModelIndex)</signal>
+   <receiver>MainWindow</receiver>
+   <slot>feedEntrySelected(QModelIndex)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>616</x>
+     <y>117</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>495</x>
+     <y>374</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
+ <slots>
+  <slot>addFeed()</slot>
+  <slot>feedSelected(QModelIndex)</slot>
+  <slot>feedEntrySelected(QModelIndex)</slot>
+ </slots>
 </ui>