def event(self, event): if event.type() == QEvent.FileOpen and event.file().endswith( ".torrent"): self.handle_uri(f'file:{event.file()}') return QtSingleApplication.event(self, event)
def __init__(self, app_name, args): QtSingleApplication.__init__(self, app_name, args) self.code_executor = None self.messageReceived.connect(self.on_app_message)
def __init__(self, app_name, args): QtSingleApplication.__init__(self, app_name, args) self.code_executor = None connect(self.messageReceived, self.on_app_message) self.translator = get_default_system_translator()
def event(self, event): if event.type() == QEvent.FileOpen and event.file().endswith(".torrent"): uri = path_to_uri(event.file()) self.handle_uri(uri) return QtSingleApplication.event(self, event)