# HG changeset patch # User Dirk Olmes # Date 1273812528 -7200 # Node ID 0c2578196643201d4b8e3e521d5c27f0fb7759ad # Parent 11bac653edfde3639f957ece886a5b0e4eac258a Disable the article menu by default, enable it when the first article is selected diff -r 11bac653edfd -r 0c2578196643 MainWindow.py --- a/MainWindow.py Fri May 14 06:40:12 2010 +0200 +++ b/MainWindow.py Fri May 14 06:48:48 2010 +0200 @@ -37,6 +37,7 @@ self.ui.feedEntryList.update() def feedEntrySelected(self, index): + self.ui.menuArticle.setEnabled(True) row = index.row() self.selectedEntry = self.sortedEntries[row] baseUrl = QUrl(self.selectedEntry.link) # TODO this is the wrong base url, figure out the correct one @@ -56,10 +57,15 @@ # TODO get status from feedUpdater and display in status area of the main window self.updateFeedList() - def openSelectedEntry(self): + def openSelectedEntryInBrowser(self): # TODO make browser configurable browser = "/usr/local/bin/opera" subprocess.Popen([browser, self.selectedEntry.link]) + + def openLinkFromSelectedEntry(self): + url = QUrl(self.selectedEntry.link) + self.ui.webView.load(url) + self.ui.webView.show() class FeedEntryItemDelegate(QtGui.QStyledItemDelegate): def __init__(self): diff -r 11bac653edfd -r 0c2578196643 Ui_MainWindow.ui --- a/Ui_MainWindow.ui Fri May 14 06:40:12 2010 +0200 +++ b/Ui_MainWindow.ui Fri May 14 06:48:48 2010 +0200 @@ -62,17 +62,29 @@ Feed - - - + + + + false + Article + + + + Feedworm + + + + + + @@ -85,7 +97,7 @@ Ctrl+Q - + Add ... @@ -114,6 +126,30 @@ Ctrl+O + + + Open link + + + L + + + + + false + + + Preferences + + + + + false + + + Settings ... + + @@ -141,7 +177,7 @@ - actionAdd + actionAddFeed activated() MainWindow addFeed() @@ -205,10 +241,26 @@ + actionOpenLink + activated() + MainWindow + openLinkFromSelectedEntry() + + + -1 + -1 + + + 495 + 374 + + + + actionOpenInBrowser activated() MainWindow - openSelectedEntry() + openSelectedEntryInBrowser() -1 @@ -226,6 +278,7 @@ feedSelected(QModelIndex) feedEntrySelected(QModelIndex) toggleReadOnSelectedEntry() - openSelectedEntry() + openSelectedEntryInBrowser() + openLinkFromSelectedEntry()