Mercurial > hg > Feedworm
diff MainWindow.py @ 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.
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Sat, 14 Aug 2010 02:53:49 +0200 |
parents | a8a4cf131a02 |
children | 2dd6e6894772 |
line wrap: on
line diff
--- a/MainWindow.py Wed Aug 11 03:59:33 2010 +0200 +++ b/MainWindow.py Sat Aug 14 02:53:49 2010 +0200 @@ -72,10 +72,21 @@ self.ui.webView.setHtml(self.selectedEntry.summary, baseUrl) def openLinkFromSelectedEntry(self): + if self.selectedEntry.feed.always_open_in_browser: + self.openSelectedEntryInBrowser() + else: + self.openSelectedEntryInWebView() + + def openSelectedEntryInWebView(self): url = QUrl(self.selectedEntry.link) self.ui.webView.load(url) self.ui.webView.show() - + + def openSelectedEntryInBrowser(self): + # TODO make browser configurable + browser = "/usr/local/bin/opera" + subprocess.Popen([browser, self.selectedEntry.link]) + def toggleReadOnSelectedEntry(self): self.selectedEntry.toggleRead() self.session.commit() @@ -98,11 +109,6 @@ else: self.session.commit() self.updateFeedList() - - def openSelectedEntryInBrowser(self): - # TODO make browser configurable - browser = "/usr/local/bin/opera" - subprocess.Popen([browser, self.selectedEntry.link]) def showPreferences(self): preferences = PreferencesDialog(self.session)