# HG changeset patch # User Dirk Olmes # Date 1273991206 -7200 # Node ID 6e5219e056254c10af72bf833068d07c7bf33d9b # Parent a8442c3487b56901eb36c573af3206122ecc6171 GUI for feed settings diff -r a8442c3487b5 -r 6e5219e05625 .settings/org.eclipse.core.resources.prefs --- 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 diff -r a8442c3487b5 -r 6e5219e05625 FeedSettings.py --- /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) diff -r a8442c3487b5 -r 6e5219e05625 MainWindow.py --- 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): diff -r a8442c3487b5 -r 6e5219e05625 Ui_FeedSettings.ui --- /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 @@ + + + FeedSettings + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + 30 + 240 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 10 + 331 + 22 + + + + load article's url instead of displaying summary + + + + + + + buttonBox + accepted() + FeedSettings + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + FeedSettings + reject() + + + 316 + 260 + + + 286 + 274 + + + + + autoLoadArticle + stateChanged(int) + FeedSettings + autoLoadArticleChanged() + + + 175 + 20 + + + 199 + 149 + + + + + + autoLoadArticleChanged() + + diff -r a8442c3487b5 -r 6e5219e05625 Ui_MainWindow.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 @@ - false + true Settings ... @@ -293,6 +293,22 @@ + + actionFeedSettings + activated() + MainWindow + showFeedSettings() + + + -1 + -1 + + + 495 + 374 + + + addFeed() @@ -302,5 +318,6 @@ openSelectedEntryInBrowser() openLinkFromSelectedEntry() showPreferences() + showFeedSettings()