-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
33 lines (27 loc) · 1021 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from PySide.QtCore import QUrl
from PySide.QtGui import QApplication
from PySide.QtDeclarative import QDeclarativeView
from Server import Server
from TorrentModel import TorrentModel
from SearchModel import SearchModel
from Config import ServerConfig
def main():
QApplication.setOrganizationName('OpenBossa')
QApplication.setApplicationName('mobtrans')
QApplication.setGraphicsSystem('raster')
app = QApplication([])
serverConfig = ServerConfig()
server = Server(serverConfig)
model = TorrentModel(server)
searchModel = SearchModel()
view = QDeclarativeView()
#view.setMinimumSize(800, 600)
view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
view.rootContext().setContextProperty('server', server)
view.rootContext().setContextProperty('torrentModel', model)
view.rootContext().setContextProperty('searchModel', searchModel)
view.setSource(QUrl.fromLocalFile('./qml/main.qml'))
view.show()
app.exec_()
if __name__ == '__main__':
main()