48
|
1
|
|
2 from PyQt4 import QtGui
|
|
3 from Ui_FeedSettings import Ui_FeedSettings
|
|
4
|
|
5 class FeedSettings(QtGui.QDialog):
|
|
6 def __init__(self, session, feed):
|
|
7 QtGui.QWidget.__init__(self, None)
|
|
8 self.session = session
|
|
9 self.feed = feed
|
|
10 self.ui = Ui_FeedSettings()
|
|
11 self.ui.setupUi(self)
|
|
12 self.initUi()
|
|
13
|
|
14 def initUi(self):
|
|
15 self.ui.autoLoadArticle.setChecked(self.feed.auto_load_entry_link)
|
|
16
|
|
17 def autoLoadArticleChanged(self, change):
|
|
18 if change:
|
|
19 self.feed.auto_load_entry_link = True
|
|
20 else:
|
|
21 self.feed.auto_load_entry_link = False
|
|
22
|
|
23 def accept(self):
|
|
24 self.session.commit()
|
|
25 QtGui.QDialog.accept(self)
|
|
26
|
|
27 def reject(self):
|
|
28 self.session.rollback()
|
|
29 QtGui.QDialog.reject(self)
|