view feedworm-gui.py @ 96:397688da3d28

when selecting a feed entry, mark the entire row as selected
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 28 Dec 2010 03:44:51 +0100
parents b8bfd1bd6c55
children 04a730f9d07d
line wrap: on
line source


import Database
from MainWindow import MainWindow
from Preferences import Preferences
from PyQt4 import QtGui
from PyQt4.QtNetwork import QNetworkProxy
import sys
import util

def setupProxy(preferences):
    if preferences.isProxyConfigured():
        proxyHost = preferences.proxyHost()
        proxyPort = preferences.proxyPort()
        proxy = QNetworkProxy(QNetworkProxy.HttpProxy, proxyHost, proxyPort)
        QNetworkProxy.setApplicationProxy(proxy)

if __name__ == '__main__':
    util.configureLogging()
    session = Database.createSession()
    preferences = Preferences(session)

    setupProxy(preferences)

    app = QtGui.QApplication(sys.argv)
    mainWindow = MainWindow(session)

    maximized = preferences.startMaximized()
    if maximized:
        mainWindow.showMaximized()
    else:
        mainWindow.show()

    sys.exit(app.exec_())