def verify_user(self, profileid=None): if profileid is None: profileid = self.current_profileid if len(profileid) == 0: return False try: username = gameslist.username_from_profile_id(profileid) except gameslist.NoSuchProfileError: return False if windows.desura_running(username): return True verify_dialog = QMessageBox() verify_dialog.setText( "<b>Verify your identity</b><br />Sign in to Desura to continue with account <b>{0}</b> to confirm your identity" .format(username)) verify_dialog.setInformativeText( "<i>Waiting for Desura sign-in...</i>") verify_dialog.setWindowTitle("Sign into Desura to continue") verify_dialog.setStandardButtons(QMessageBox.Cancel) verify_dialog.setIcon(QMessageBox.Information) verify_dialog.setWindowFlags(Qt.CustomizeWindowHint | Qt.WindowTitleHint) desurawaiter = DesuraWaiter(username) desurawaiter.finished.connect(verify_dialog.close) desurawaiter.start() verify_dialog.exec_() if windows.desura_running(username): return True else: desurawaiter.terminate() return False
def verify_user(self, profileid=None): if profileid is None: profileid=self.current_profileid if len(profileid) == 0: return False try: username = gameslist.username_from_profile_id(profileid) except gameslist.NoSuchProfileError: return False if windows.desura_running(username): return True verify_dialog = QMessageBox() verify_dialog.setText("<b>Verify your identity</b><br />Sign in to Desura to continue with account <b>{0}</b> to confirm your identity".format(username)) verify_dialog.setInformativeText("<i>Waiting for Desura sign-in...</i>") verify_dialog.setWindowTitle("Sign into Desura to continue") verify_dialog.setStandardButtons(QMessageBox.Cancel) verify_dialog.setIcon(QMessageBox.Information) verify_dialog.setWindowFlags(Qt.CustomizeWindowHint | Qt.WindowTitleHint) desurawaiter = DesuraWaiter(username) desurawaiter.finished.connect(verify_dialog.close) desurawaiter.start() verify_dialog.exec_() if windows.desura_running(username): return True else: desurawaiter.terminate() return False
def run(self): if len(self.username) == 0: return if not windows.desura_running(self.username): start_desura() while not windows.desura_running(self.username): self.msleep(100) return return