Mercurial > hg > Feedworm
annotate FeedSettings.py @ 81:050748b596a8
add another idea that has been going round in my head for some time
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 19 Aug 2010 16:06:18 +0200 |
parents | d11c3f71ac40 |
children | a4b2077c9603 |
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) |
79
d11c3f71ac40
Make update interval editable via the feed's settings dialog.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
77
diff
changeset
|
16 self.ui.updateInterval.setText(str(self.feed.update_interval)) |
48 | 17 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
|
18 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
|
19 |
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 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
|
21 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
|
22 self.feed.title = title |
79
d11c3f71ac40
Make update interval editable via the feed's settings dialog.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
77
diff
changeset
|
23 |
d11c3f71ac40
Make update interval editable via the feed's settings dialog.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
77
diff
changeset
|
24 def editingUpdateIntervalFinished(self): |
d11c3f71ac40
Make update interval editable via the feed's settings dialog.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
77
diff
changeset
|
25 updateInterval = int(str(self.ui.updateInterval.text())) |
d11c3f71ac40
Make update interval editable via the feed's settings dialog.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
77
diff
changeset
|
26 self.feed.update_interval = updateInterval |
d11c3f71ac40
Make update interval editable via the feed's settings dialog.
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
77
diff
changeset
|
27 self.feed.incrementNextUpdateDate() |
48 | 28 |
29 def autoLoadArticleChanged(self, change): | |
30 if change: | |
31 self.feed.auto_load_entry_link = True | |
32 else: | |
33 self.feed.auto_load_entry_link = False | |
34 | |
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
|
35 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
|
36 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
|
37 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
|
38 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
|
39 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
|
40 |
48 | 41 def accept(self): |
42 self.session.commit() | |
43 QtGui.QDialog.accept(self) | |
44 | |
45 def reject(self): | |
46 self.session.rollback() | |
47 QtGui.QDialog.reject(self) |