Mercurial > hg > Feedworm
comparison MainWindow.py @ 37:22214d79ed41
database URL must be given as commandline argument now, no need for creating complicated config files. Add a menu entry for opening the selected article in browser.
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Fri, 14 May 2010 06:16:05 +0200 |
parents | f371d02fa09d |
children | 0c2578196643 |
comparison
equal
deleted
inserted
replaced
36:74b8c9a9d5de | 37:22214d79ed41 |
---|---|
6 from PyQt4 import QtGui | 6 from PyQt4 import QtGui |
7 from PyQt4.QtCore import QUrl | 7 from PyQt4.QtCore import QUrl |
8 from PyQt4.QtGui import QFont | 8 from PyQt4.QtGui import QFont |
9 from Ui_MainWindow import Ui_MainWindow | 9 from Ui_MainWindow import Ui_MainWindow |
10 import FeedUpdater | 10 import FeedUpdater |
11 import subprocess | |
11 | 12 |
12 class MainWindow(QtGui.QMainWindow): | 13 class MainWindow(QtGui.QMainWindow): |
13 def __init__(self, session=None): | 14 def __init__(self, session=None): |
14 QtGui.QWidget.__init__(self, None) | 15 QtGui.QWidget.__init__(self, None) |
15 self.session = session | 16 self.session = session |
53 url = addFeed.getUrl() | 54 url = addFeed.getUrl() |
54 FeedUpdater.createNewFeed(url, self.session) | 55 FeedUpdater.createNewFeed(url, self.session) |
55 # TODO get status from feedUpdater and display in status area of the main window | 56 # TODO get status from feedUpdater and display in status area of the main window |
56 self.updateFeedList() | 57 self.updateFeedList() |
57 | 58 |
59 def openSelectedEntry(self): | |
60 # TODO make browser configurable | |
61 browser = "/usr/local/bin/opera" | |
62 subprocess.Popen([browser, self.selectedEntry.link]) | |
63 | |
58 class FeedEntryItemDelegate(QtGui.QStyledItemDelegate): | 64 class FeedEntryItemDelegate(QtGui.QStyledItemDelegate): |
59 def __init__(self): | 65 def __init__(self): |
60 QtGui.QStyledItemDelegate.__init__(self, None) | 66 QtGui.QStyledItemDelegate.__init__(self, None) |
61 | 67 |
62 def paint(self, painter, style, index): | 68 def paint(self, painter, style, index): |