Skip to content

Commit

Permalink
Pause/unpause when not non-operator in managed room toggles readiness…
Browse files Browse the repository at this point in the history
… state
  • Loading branch information
Et0h committed Apr 6, 2015
1 parent c8912d1 commit 5c0f3da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion syncplay/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,16 @@ def updatePlayerStatus(self, paused, position):
self._playerPosition = position
self._playerPaused = paused
if pauseChange and utils.meetsMinVersion(self.serverVersion, constants.USER_READY_MIN_VERSION):
if not paused and not self.instaplayConditionsMet():
if not self.userlist.currentUser.canControl():
self._player.setPaused(self._globalPaused)
self.toggleReady(manuallyInitiated=True)
self._playerPaused = self._globalPaused
pauseChange = False
if self.userlist.currentUser.isReady():
self.ui.showMessage(getMessage("set-as-ready-notification"))
else:
self.ui.showMessage(getMessage("set-as-not-ready-notification"))
elif not paused and not self.instaplayConditionsMet():
paused = True
self._player.setPaused(paused)
self._playerPaused = paused
Expand Down
6 changes: 6 additions & 0 deletions syncplay/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"not-all-ready" : u"Not ready: {}", # Usernames
"all-users-ready" : u"Everyone is ready ({} users)", #Number of ready users
"ready-to-unpause-notification" : u"You are now set as ready - unpause again to unpause",
"set-as-ready-notification" : u"You are now set as ready",
"set-as-not-ready-notification" : u"You are now set as not ready",
"autoplaying-notification" : u"Auto-playing in {}...",

"identifying-as-controller-notification" : u"Identifying as room operator with password '{}'...",
Expand Down Expand Up @@ -388,6 +390,8 @@
"not-all-ready" : u"Not ready: {}", # Usernames # TODO: Translate into Russian
"all-users-ready" : u"Everyone is ready ({} users)", #Number of ready users # TODO: Translate into Russian
"ready-to-unpause-notification" : u"You are now set as ready - unpause again to unpause", # TODO: Translate into Russian
"set-as-ready-notification" : u"You are now set as ready", # TODO: Translate into Russian
"set-as-not-ready-notification" : u"You are now set as not ready", # TODO: Translate into Russian
"autoplaying-notification" : u"Auto-playing in {}...", # TODO: Translate into Russian

"identifying-as-controller-notification" : u"Identifying as room operator with password '{}'...", # TODO: Translate into Russian
Expand Down Expand Up @@ -740,6 +744,8 @@
"not-all-ready" : u"Noch nicht bereit: {}", # Usernames
"all-users-ready" : u"Alle sind bereit ({} Nutzer)", #Number of ready users
"ready-to-unpause-notification" : u"Du bist bereit - noch einmal fortsetzen klicken zum abspielen",
"set-as-ready-notification" : u"Du bist bereit", # TODO: Check German translation
"set-as-not-ready-notification" : u"You are now set as not ready", # TODO: Translate into German
"autoplaying-notification" : u"Starte in {}...",

"identifying-as-controller-notification" : u"Identifiziere als Raumleiter mit Passwort '{}'...", # TODO: find a better translation to "room operator"
Expand Down

0 comments on commit 5c0f3da

Please sign in to comment.