Mercurial > hg > Feedworm
annotate FeedSettings.py @ 70:842727971796
have the DB URL as parameter when creating a session and fall back to commandline arguments if no DB URL was passed in
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 11 Aug 2010 02:30:47 +0200 |
parents | 6bc6899f3330 |
children | d292ab61ed6f |
rev | line source |
---|---|
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): | |
52
6bc6899f3330
allow changing a feed's title
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
15 self.ui.feedTitle.setText(self.feed.title) |
48 | 16 self.ui.autoLoadArticle.setChecked(self.feed.auto_load_entry_link) |
17 | |
18 def autoLoadArticleChanged(self, change): | |
19 if change: | |
20 self.feed.auto_load_entry_link = True | |
21 else: | |
22 self.feed.auto_load_entry_link = False | |
23 | |
24 def accept(self): | |
25 self.session.commit() | |
26 QtGui.QDialog.accept(self) | |
27 | |
28 def reject(self): | |
29 self.session.rollback() | |
30 QtGui.QDialog.reject(self) | |
52
6bc6899f3330
allow changing a feed's title
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
31 |
6bc6899f3330
allow changing a feed's title
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
32 def editingTitleFinished(self): |
6bc6899f3330
allow changing a feed's title
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
33 title = str(self.ui.feedTitle.text()) |
6bc6899f3330
allow changing a feed's title
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
48
diff
changeset
|
34 self.feed.title = title |