Fixed Login bug, modify CONTRIBUTING.md
This commit is contained in:
parent
0500137999
commit
5bda59e8c5
|
@ -11,7 +11,7 @@
|
|||
|
||||
### Add Stylesheets
|
||||
|
||||
For this you can create a .qss file in Rare/Styles/ directory. Here are some exmples:
|
||||
For this you can create a .qss file in Rare/Styles/ directory or modify the existing RareStyle.qss file. Here are some exmples:
|
||||
[Qt Docs](https://doc.qt.io/qt-5/stylesheet-examples.html)
|
||||
|
||||
### Add features
|
||||
|
|
|
@ -23,6 +23,7 @@ class LaunchThread(QThread):
|
|||
self.action.emit("finish")
|
||||
|
||||
class LoginThread(QThread):
|
||||
login = pyqtSignal()
|
||||
def __init__(self, core: LegendaryCore):
|
||||
super(LoginThread, self).__init__()
|
||||
self.core = core
|
||||
|
@ -36,9 +37,7 @@ class LoginThread(QThread):
|
|||
self.run()
|
||||
except ValueError:
|
||||
logger.info("You are not logged in. Open Login Window")
|
||||
login_window = LoginDialog(self.core)
|
||||
if not login_window.login():
|
||||
return
|
||||
self.login.emit()
|
||||
|
||||
|
||||
class LaunchDialog(QDialog):
|
||||
|
@ -46,6 +45,7 @@ class LaunchDialog(QDialog):
|
|||
super(LaunchDialog, self).__init__()
|
||||
self.core = core
|
||||
self.login_thread = LoginThread(core)
|
||||
self.login_thread.login.connect(self.login)
|
||||
self.login_thread.finished.connect(self.launch)
|
||||
self.login_thread.start()
|
||||
|
||||
|
@ -60,6 +60,11 @@ class LaunchDialog(QDialog):
|
|||
|
||||
self.setLayout(self.layout)
|
||||
|
||||
def login(self):
|
||||
if not LoginDialog(core=self.core).login():
|
||||
self.close()
|
||||
|
||||
|
||||
|
||||
def launch(self):
|
||||
self.info_pb.setMaximum(len(self.core.get_game_list()))
|
||||
|
|
Loading…
Reference in a new issue