Exemple #1
0
	app = QApplication([])

	cache_path = os.path.abspath("cache/")

	controller = TorrentController(cache_path)
	main_window = MainWindow(controller)
	torrent_view = TorrentView(controller)
	dht_view = DhtView(controller)

	main_window.showDhtAction.triggered.connect(dht_view.show)
	main_window.showDownloadsAction.triggered.connect(torrent_view.show)

	#autoCreateTorrents(controller, cache_path)
	autoAddTorrents(controller, cache_path)

	controller.loadSettings("libtorrent.json")

	'''handler for the SIGINT signal'''
	def sigint_handler(*args):
		print("sigint_handler")
		QApplication.quit()

	signal.signal(signal.SIGINT, sigint_handler)

	def aboutToQuit():
		print("aboutToQuit")
		controller.storeSettings("libtorrent.json")
		controller.shutdown()
		time.sleep(1)

	qApp.aboutToQuit.connect(aboutToQuit)
Exemple #2
0
    app = QApplication([])

    cache_path = os.path.abspath("cache/")

    controller = TorrentController(cache_path)
    main_window = MainWindow(controller)
    torrent_view = TorrentView(controller)
    dht_view = DhtView(controller)

    main_window.showDhtAction.triggered.connect(dht_view.show)
    main_window.showDownloadsAction.triggered.connect(torrent_view.show)

    #autoCreateTorrents(controller, cache_path)
    autoAddTorrents(controller, cache_path)

    controller.loadSettings("libtorrent.json")
    '''handler for the SIGINT signal'''
    def sigint_handler(*args):
        print("sigint_handler")
        QApplication.quit()

    signal.signal(signal.SIGINT, sigint_handler)

    def aboutToQuit():
        print("aboutToQuit")
        controller.storeSettings("libtorrent.json")
        controller.shutdown()
        time.sleep(1)

    qApp.aboutToQuit.connect(aboutToQuit)