annotate FeedSettings.py @ 48:6e5219e05625

GUI for feed settings
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sun, 16 May 2010 08:26:46 +0200
parents
children 6bc6899f3330
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
48
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
1
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
2 from PyQt4 import QtGui
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
3 from Ui_FeedSettings import Ui_FeedSettings
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
4
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
5 class FeedSettings(QtGui.QDialog):
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
6 def __init__(self, session, feed):
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
7 QtGui.QWidget.__init__(self, None)
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
8 self.session = session
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
9 self.feed = feed
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
10 self.ui = Ui_FeedSettings()
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
11 self.ui.setupUi(self)
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
12 self.initUi()
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
13
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
14 def initUi(self):
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
15 self.ui.autoLoadArticle.setChecked(self.feed.auto_load_entry_link)
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
16
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
17 def autoLoadArticleChanged(self, change):
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
18 if change:
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
19 self.feed.auto_load_entry_link = True
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
20 else:
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
21 self.feed.auto_load_entry_link = False
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
22
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
23 def accept(self):
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
24 self.session.commit()
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
25 QtGui.QDialog.accept(self)
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
26
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
27 def reject(self):
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
28 self.session.rollback()
6e5219e05625 GUI for feed settings
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
29 QtGui.QDialog.reject(self)