Re-work drop (client.py)
This commit is contained in:
parent
da17982866
commit
33a079e124
@ -366,7 +366,8 @@ class SyncplayClient(object):
|
|||||||
reactor.connectTCP(host, port, self.protocolFactory)
|
reactor.connectTCP(host, port, self.protocolFactory)
|
||||||
reactor.run()
|
reactor.run()
|
||||||
|
|
||||||
def stop(self, promptForAction=False):
|
|
||||||
|
def stop(self, stopMessage=None):
|
||||||
if not self._running:
|
if not self._running:
|
||||||
return
|
return
|
||||||
self._running = False
|
self._running = False
|
||||||
@ -376,10 +377,12 @@ class SyncplayClient(object):
|
|||||||
if self._player:
|
if self._player:
|
||||||
self._player.drop()
|
self._player.drop()
|
||||||
if self.ui:
|
if self.ui:
|
||||||
|
if(stopMessage):
|
||||||
|
self.ui.showErrorMessage(stopMessage, True)
|
||||||
self.ui.drop()
|
self.ui.drop()
|
||||||
reactor.callLater(0.1, reactor.stop)
|
reactor.callLater(0.1, reactor.stop)
|
||||||
if(promptForAction):
|
if(stopMessage):
|
||||||
self.ui.promptFor(getMessage("en", "enter-to-exit-prompt"))
|
self.ui.waitForUserAction(getMessage("en", "enter-to-exit-prompt"))
|
||||||
|
|
||||||
class _WarningManager(object):
|
class _WarningManager(object):
|
||||||
def __init__(self, player, userlist, ui):
|
def __init__(self, player, userlist, ui):
|
||||||
@ -596,8 +599,8 @@ class UiManager(object):
|
|||||||
def showErrorMessage(self, message, criticalerror=False):
|
def showErrorMessage(self, message, criticalerror=False):
|
||||||
self.__ui.showErrorMessage(message, criticalerror)
|
self.__ui.showErrorMessage(message, criticalerror)
|
||||||
|
|
||||||
def promptFor(self, prompt):
|
def waitForUserAction(self, prompt):
|
||||||
return self.__ui.promptFor(prompt)
|
return self.__ui.waitForUserAction(prompt)
|
||||||
|
|
||||||
def userListChange(self):
|
def userListChange(self):
|
||||||
self.__ui.userListChange()
|
self.__ui.userListChange()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user