MCPcopy Create free account
hub / github.com/Syncplay/syncplay / addClient

Method addClient

syncplay/ui/gui.py:491–520  ·  view source on GitHub ↗
(self, client)

Source from the content-addressed store, hash-verified

489 self.relistRoomList(roomList)
490
491 def addClient(self, client):
492 self._syncplayClient = client
493 if self.console:
494 self.console.addClient(client)
495 self.config = self._syncplayClient.getConfig()
496 self.roomsCombobox.setEditText(self._syncplayClient.getRoom())
497 self.fillRoomsCombobox()
498 try:
499 self.playlistGroup.blockSignals(True)
500 self.playlistGroup.setChecked(self.config['sharedPlaylistEnabled'])
501 self.playlistGroup.blockSignals(False)
502 self._syncplayClient.fileSwitch.setMediaDirectories(self.config["mediaSearchDirectories"])
503 if not self.config["mediaSearchDirectories"]:
504 self._syncplayClient.ui.showErrorMessage(getMessage("no-media-directories-error"))
505 self.updateReadyState(self.config['readyAtStart'])
506 autoplayInitialState = self.config['autoplayInitialState']
507 if autoplayInitialState is not None:
508 self.autoplayPushButton.blockSignals(True)
509 self.autoplayPushButton.setChecked(autoplayInitialState)
510 self.autoplayPushButton.blockSignals(False)
511 if self.config['autoplayMinUsers'] > 1:
512 self.autoplayThresholdSpinbox.blockSignals(True)
513 self.autoplayThresholdSpinbox.setValue(self.config['autoplayMinUsers'])
514 self.autoplayThresholdSpinbox.blockSignals(False)
515 self.changeAutoplayState()
516 self.changeAutoplayThreshold()
517 self.updateAutoPlayIcon()
518 except:
519 self.showErrorMessage("Failed to load some settings.")
520 self.automaticUpdateCheck()
521
522 def promptFor(self, prompt=">", message=""):
523 # TODO: Prompt user

Callers 1

runMethod · 0.45

Calls 11

fillRoomsComboboxMethod · 0.95
showErrorMessageMethod · 0.95
updateReadyStateMethod · 0.95
changeAutoplayStateMethod · 0.95
updateAutoPlayIconMethod · 0.95
automaticUpdateCheckMethod · 0.95
getMessageFunction · 0.90
getConfigMethod · 0.80
setMediaDirectoriesMethod · 0.80
getRoomMethod · 0.45

Tested by

no test coverage detected