Mercurial > hg > Feedworm
annotate FeedSettings.py @ 78:a728bbc7171e
add some todo items
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Sat, 14 Aug 2010 02:54:01 +0200 |
parents | d292ab61ed6f |
children | d11c3f71ac40 |
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) |
77
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
17 self.ui.alwaysOpenInBrowser.setChecked(self.feed.always_open_in_browser) |
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
18 |
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
19 def editingTitleFinished(self): |
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
20 title = str(self.ui.feedTitle.text()) |
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
21 self.feed.title = title |
48 | 22 |
23 def autoLoadArticleChanged(self, change): | |
24 if change: | |
25 self.feed.auto_load_entry_link = True | |
26 else: | |
27 self.feed.auto_load_entry_link = False | |
28 | |
77
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
29 def alwaysOpenInExternalBrowser(self, change): |
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
30 if change: |
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
31 self.feed.always_open_in_browser = True |
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
32 else: |
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
33 self.feed.always_open_in_browser = False |
d292ab61ed6f
Add another setting to feed: when opening a feed entry in browser, you can force opening it in an external browser now. This is because some sites just crash the QWebView.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
52
diff
changeset
|
34 |
48 | 35 def accept(self): |
36 self.session.commit() | |
37 QtGui.QDialog.accept(self) | |
38 | |
39 def reject(self): | |
40 self.session.rollback() | |
41 QtGui.QDialog.reject(self) |