annotate feedworm-gui.py @ 135:b2ef673607e3

added a TODO item
author Dirk Olmes <dirk@xanthippe.ping.de>
date Tue, 23 Aug 2011 03:51:15 +0200
parents 9e1e6b96d8b0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14
42a225be7e56 first version of the GUI
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
1
24
6b5ceffabe49 MainWindowController -> MainWindow
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 14
diff changeset
2 from MainWindow import MainWindow
14
42a225be7e56 first version of the GUI
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
3 from PyQt4 import QtGui
87
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
4 from PyQt4.QtNetwork import QNetworkProxy
119
04a730f9d07d move all sqlalchemy related classes to the respective sub-package. use a backend to abstract from access to the data
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 87
diff changeset
5 from backend.sqlalchemy.SqlAlchemyBackend import SqlAlchemyBackend
133
9e1e6b96d8b0 implement proxyHost/proxyPort in Preferences
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 119
diff changeset
6 from backend.couchdb.CouchDbBackend import CouchDbBackend
119
04a730f9d07d move all sqlalchemy related classes to the respective sub-package. use a backend to abstract from access to the data
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 87
diff changeset
7 import logging
14
42a225be7e56 first version of the GUI
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
8 import sys
42a225be7e56 first version of the GUI
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
9
87
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
10 def setupProxy(preferences):
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
11 if preferences.isProxyConfigured():
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
12 proxyHost = preferences.proxyHost()
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
13 proxyPort = preferences.proxyPort()
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
14 proxy = QNetworkProxy(QNetworkProxy.HttpProxy, proxyHost, proxyPort)
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
15 QNetworkProxy.setApplicationProxy(proxy)
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
16
14
42a225be7e56 first version of the GUI
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
17 if __name__ == '__main__':
119
04a730f9d07d move all sqlalchemy related classes to the respective sub-package. use a backend to abstract from access to the data
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 87
diff changeset
18 logging.basicConfig(level=logging.DEBUG)
133
9e1e6b96d8b0 implement proxyHost/proxyPort in Preferences
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 119
diff changeset
19 # backend = SqlAlchemyBackend()
9e1e6b96d8b0 implement proxyHost/proxyPort in Preferences
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 119
diff changeset
20 backend = CouchDbBackend()
119
04a730f9d07d move all sqlalchemy related classes to the respective sub-package. use a backend to abstract from access to the data
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 87
diff changeset
21 preferences = backend.preferences()
87
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
22
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
23 setupProxy(preferences)
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
24
14
42a225be7e56 first version of the GUI
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
25 app = QtGui.QApplication(sys.argv)
119
04a730f9d07d move all sqlalchemy related classes to the respective sub-package. use a backend to abstract from access to the data
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 87
diff changeset
26 mainWindow = MainWindow(backend)
87
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
27
b8bfd1bd6c55 use a proxy if one is configured. TODO: GUI for configuring the proxy server
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 43
diff changeset
28 maximized = preferences.startMaximized()
43
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 38
diff changeset
29 if maximized:
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 38
diff changeset
30 mainWindow.showMaximized()
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 38
diff changeset
31 else:
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 38
diff changeset
32 mainWindow.show()
12ed8b5fa08c first system preference: configure app to stat maximized.
Dirk Olmes <dirk@xanthippe.ping.de>
parents: 38
diff changeset
33
14
42a225be7e56 first version of the GUI
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff changeset
34 sys.exit(app.exec_())