Make login button work for login page

This commit is contained in:
miruka
2019-04-26 18:47:25 -04:00
parent c7dd602687
commit dc2f779d4b
6 changed files with 24 additions and 5 deletions

View File

@@ -115,8 +115,7 @@ class Client(QObject):
self.net_sync.http_disconnect()
@pyqtSlot()
@futurize()
@futurize(pyqt=False)
def startSyncing(self) -> None:
while True:
self._on_sync(self.net_sync.talk(

View File

@@ -61,7 +61,7 @@ class ClientManager(QObject):
@pyqtSlot(str, str, str)
@pyqtSlot(str, str, str)
@pyqtSlot(str, str, str, str)
def new(self, hostname: str, username: str, password: str,
device_id: str = "") -> None:

View File

@@ -67,7 +67,8 @@ class PyQtFuture(QObject):
_RUNNING: List[Tuple[Executor, Callable, tuple, dict]] = []
def futurize(max_instances: Optional[int] = None) -> Callable:
def futurize(max_instances: Optional[int] = None, pyqt: bool = True
) -> Callable:
def decorator(func: Callable) -> Callable:
@@ -89,7 +90,8 @@ def futurize(max_instances: Optional[int] = None) -> Callable:
return None
_RUNNING.append((self.pool, func, args, kws))
return PyQtFuture(self.pool.submit(run_and_catch_errs), self)
future = self.pool.submit(run_and_catch_errs)
return PyQtFuture(future, self) if pyqt else future
return wrapper

View File

@@ -33,6 +33,7 @@ class SignalManager(QObject):
def onClientAdded(self, client: Client) -> None:
print(client)
self.connectClient(client)
self.backend.models.accounts.append(User(
userId = client.userId,