Show number of users who are ready
This commit is contained in:
parent
09d515e97f
commit
c7ae68c5bf
@ -655,14 +655,14 @@ class SyncplayClient(object):
|
||||
fileDifferencesMessage = getMessage("room-file-differences").format(self._userlist.getFileDifferencesForRoom())
|
||||
if self._userlist.currentUser.canControl() and self._userlist.isReadinessSupported():
|
||||
if self._userlist.areAllUsersInRoomReady():
|
||||
osdMessage = u"{}{}{}".format(fileDifferencesMessage, self._client._player.osdMessageSeparator, getMessage("all-users-ready"))
|
||||
osdMessage = u"{}{}{}".format(fileDifferencesMessage, self._client._player.osdMessageSeparator, getMessage("all-users-ready").format(self._userlist.readyUserCount()))
|
||||
else:
|
||||
osdMessage = u"{}{}{}".format(fileDifferencesMessage, self._client._player.osdMessageSeparator, getMessage("not-all-ready").format(self._userlist.usersInRoomNotReady()))
|
||||
else:
|
||||
osdMessage = fileDifferencesMessage
|
||||
elif self._userlist.isReadinessSupported():
|
||||
if self._userlist.areAllUsersInRoomReady():
|
||||
osdMessage = getMessage("all-users-ready")
|
||||
osdMessage = getMessage("all-users-ready").format(self._userlist.readyUserCount())
|
||||
else:
|
||||
osdMessage = getMessage("not-all-ready").format(self._userlist.usersInRoomNotReady())
|
||||
if osdMessage:
|
||||
@ -882,6 +882,15 @@ class SyncplayUserlist(object):
|
||||
return False
|
||||
return True
|
||||
|
||||
def readyUserCount(self):
|
||||
readyCount = 0
|
||||
if self.currentUser.isReady():
|
||||
readyCount += 1
|
||||
for user in self._users.itervalues():
|
||||
if user.room == self.currentUser.room and user.isReady():
|
||||
readyCount += 1
|
||||
return readyCount
|
||||
|
||||
def usersInRoomNotReady(self):
|
||||
notReady = []
|
||||
if not self.currentUser.isReady():
|
||||
|
||||
@ -34,7 +34,7 @@ en = {
|
||||
"playing-notification/room-addendum" : u" in room: '{}'", # Room
|
||||
|
||||
"not-all-ready" : u"Not ready: {}", # Usernames
|
||||
"all-users-ready" : u"Everyone is ready",
|
||||
"all-users-ready" : u"Everyone is ready ({} users)", #Number of ready users
|
||||
|
||||
"identifying-as-controller-notification" : u"Identifying as room controller with password '{}'...",
|
||||
"failed-to-identify-as-controller-notification" : u"<{}> failed to identify as a room controller.",
|
||||
@ -373,7 +373,7 @@ ru = {
|
||||
"playing-notification/room-addendum" : u" в комнате: '{}'", # Room
|
||||
|
||||
"not-all-ready" : u"Not ready: {}", # Usernames # TODO: Translate into Russian
|
||||
"all-users-ready" : u"Everyone is ready", # TODO: Translate into Russian
|
||||
"all-users-ready" : u"Everyone is ready ({} users)", #Number of ready users # TODO: Translate into Russian
|
||||
|
||||
"identifying-as-controller-notification" : u"Identifying as room controller with password '{}'...", # TODO: Translate into Russian
|
||||
"failed-to-identify-as-controller-notification" : u"<{}> failed to identify as a room controller.", # TODO: Translate into Russian
|
||||
@ -713,7 +713,7 @@ de = {
|
||||
"playing-notification/room-addendum" : u" in Raum: '{}'", # Room
|
||||
|
||||
"not-all-ready" : u"Not ready: {}", # Usernames # TODO: Translate into German
|
||||
"all-users-ready" : u"Everyone is ready", # TODO: Translate into German
|
||||
"all-users-ready" : u"Everyone is ready ({} users)", #Number of ready users # TODO: Translate into German
|
||||
|
||||
"identifying-as-controller-notification" : u"Identifiziere als Raumleiter mit Passwort '{}'...", # TODO: find a better translation to "room controller"
|
||||
"failed-to-identify-as-controller-notification" : u"<{}> konnte sich nicht als Raumleiter identifizieren.",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user