Mercurial > hg > Feedworm
changeset 48:6e5219e05625
GUI for feed settings
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Sun, 16 May 2010 08:26:46 +0200 |
parents | a8442c3487b5 |
children | 6eba4168fd54 |
files | .settings/org.eclipse.core.resources.prefs FeedSettings.py MainWindow.py Ui_FeedSettings.ui Ui_MainWindow.ui |
diffstat | 5 files changed, 154 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/.settings/org.eclipse.core.resources.prefs Sun May 16 08:13:07 2010 +0200 +++ b/.settings/org.eclipse.core.resources.prefs Sun May 16 08:26:46 2010 +0200 @@ -1,4 +1,5 @@ -#Fri May 14 07:19:36 CEST 2010 +#Sun May 16 08:17:30 CEST 2010 eclipse.preferences.version=1 encoding/Ui_AddFeed.py=utf-8 +encoding/Ui_FeedSettings.py=utf-8 encoding/Ui_MainWindow.py=utf-8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FeedSettings.py Sun May 16 08:26:46 2010 +0200 @@ -0,0 +1,29 @@ + +from PyQt4 import QtGui +from Ui_FeedSettings import Ui_FeedSettings + +class FeedSettings(QtGui.QDialog): + def __init__(self, session, feed): + QtGui.QWidget.__init__(self, None) + self.session = session + self.feed = feed + self.ui = Ui_FeedSettings() + self.ui.setupUi(self) + self.initUi() + + def initUi(self): + self.ui.autoLoadArticle.setChecked(self.feed.auto_load_entry_link) + + def autoLoadArticleChanged(self, change): + if change: + self.feed.auto_load_entry_link = True + else: + self.feed.auto_load_entry_link = False + + def accept(self): + self.session.commit() + QtGui.QDialog.accept(self) + + def reject(self): + self.session.rollback() + QtGui.QDialog.reject(self)
--- a/MainWindow.py Sun May 16 08:13:07 2010 +0200 +++ b/MainWindow.py Sun May 16 08:26:46 2010 +0200 @@ -3,6 +3,7 @@ from DisplayModel import DisplayModel from Feed import Feed from FeedEntry import FeedEntry +from FeedSettings import FeedSettings from PreferencesDialog import PreferencesDialog from PyQt4 import QtGui from PyQt4.QtCore import QUrl @@ -81,6 +82,10 @@ preferences = PreferencesDialog(self.session) preferences.exec_() + def showFeedSettings(self): + feedSettings = FeedSettings(self.session, self.selectedFeed) + feedSettings.exec_() + class FeedEntryItemDelegate(QtGui.QStyledItemDelegate): def __init__(self):
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Ui_FeedSettings.ui Sun May 16 08:26:46 2010 +0200 @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>FeedSettings</class> + <widget class="QDialog" name="FeedSettings"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Dialog</string> + </property> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="geometry"> + <rect> + <x>30</x> + <y>240</y> + <width>341</width> + <height>32</height> + </rect> + </property> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + <widget class="QCheckBox" name="autoLoadArticle"> + <property name="geometry"> + <rect> + <x>10</x> + <y>10</y> + <width>331</width> + <height>22</height> + </rect> + </property> + <property name="text"> + <string>load article's url instead of displaying summary</string> + </property> + </widget> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>FeedSettings</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>FeedSettings</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>autoLoadArticle</sender> + <signal>stateChanged(int)</signal> + <receiver>FeedSettings</receiver> + <slot>autoLoadArticleChanged()</slot> + <hints> + <hint type="sourcelabel"> + <x>175</x> + <y>20</y> + </hint> + <hint type="destinationlabel"> + <x>199</x> + <y>149</y> + </hint> + </hints> + </connection> + </connections> + <slots> + <slot>autoLoadArticleChanged()</slot> + </slots> +</ui>
--- a/Ui_MainWindow.ui Sun May 16 08:13:07 2010 +0200 +++ b/Ui_MainWindow.ui Sun May 16 08:26:46 2010 +0200 @@ -147,7 +147,7 @@ </action> <action name="actionFeedSettings"> <property name="enabled"> - <bool>false</bool> + <bool>true</bool> </property> <property name="text"> <string>Settings ...</string> @@ -293,6 +293,22 @@ </hint> </hints> </connection> + <connection> + <sender>actionFeedSettings</sender> + <signal>activated()</signal> + <receiver>MainWindow</receiver> + <slot>showFeedSettings()</slot> + <hints> + <hint type="sourcelabel"> + <x>-1</x> + <y>-1</y> + </hint> + <hint type="destinationlabel"> + <x>495</x> + <y>374</y> + </hint> + </hints> + </connection> </connections> <slots> <slot>addFeed()</slot> @@ -302,5 +318,6 @@ <slot>openSelectedEntryInBrowser()</slot> <slot>openLinkFromSelectedEntry()</slot> <slot>showPreferences()</slot> + <slot>showFeedSettings()</slot> </slots> </ui>