Mercurial > hg > Feedworm
comparison MainWindow.py @ 82:2dd6e6894772
update the status bar when opening a feed's rss url via WebView or external browser
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 19 Aug 2010 07:03:32 +0200 |
parents | d292ab61ed6f |
children | bacf42da9e36 |
comparison
equal
deleted
inserted
replaced
80:faca24809ffd | 82:2dd6e6894772 |
---|---|
76 self.openSelectedEntryInBrowser() | 76 self.openSelectedEntryInBrowser() |
77 else: | 77 else: |
78 self.openSelectedEntryInWebView() | 78 self.openSelectedEntryInWebView() |
79 | 79 |
80 def openSelectedEntryInWebView(self): | 80 def openSelectedEntryInWebView(self): |
81 message = "Open %s ..." % (self.selectedEntry.title) | |
82 self._updateStatusBar(message) | |
81 url = QUrl(self.selectedEntry.link) | 83 url = QUrl(self.selectedEntry.link) |
82 self.ui.webView.load(url) | 84 self.ui.webView.load(url) |
83 self.ui.webView.show() | 85 self.ui.webView.show() |
84 | 86 |
85 def openSelectedEntryInBrowser(self): | 87 def openSelectedEntryInBrowser(self): |
88 message = "Open %s in external browser", (self.selectedEntry.title) | |
89 self._updateStatusBar(message) | |
86 # TODO make browser configurable | 90 # TODO make browser configurable |
87 browser = "/usr/local/bin/opera" | 91 browser = "/usr/local/bin/opera" |
88 subprocess.Popen([browser, self.selectedEntry.link]) | 92 subprocess.Popen([browser, self.selectedEntry.link]) |
89 | 93 |
90 def toggleReadOnSelectedEntry(self): | 94 def toggleReadOnSelectedEntry(self): |
103 if not success: | 107 if not success: |
104 return | 108 return |
105 | 109 |
106 if addFeed.exception is not None: | 110 if addFeed.exception is not None: |
107 message = "Error while adding feed: " + str(addFeed.exception) | 111 message = "Error while adding feed: " + str(addFeed.exception) |
108 self.ui.statusbar.showMessage(message, STATUS_MESSAGE_DISPLAY_MILLIS) | 112 self._updateStatusBar(message) |
109 else: | 113 else: |
110 self.session.commit() | 114 self.session.commit() |
111 self.updateFeedList() | 115 self.updateFeedList() |
112 | 116 |
113 def showPreferences(self): | 117 def showPreferences(self): |
116 | 120 |
117 def showFeedSettings(self): | 121 def showFeedSettings(self): |
118 feedSettings = FeedSettings(self.session, self.selectedFeed) | 122 feedSettings = FeedSettings(self.session, self.selectedFeed) |
119 feedSettings.exec_() | 123 feedSettings.exec_() |
120 | 124 |
125 def _updateStatusBar(self, message): | |
126 self.ui.statusbar.showMessage(message, STATUS_MESSAGE_DISPLAY_MILLIS) | |
121 | 127 |