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

Method checkForUpdates

syncplay/ui/gui.py:1944–1967  ·  view source on GitHub ↗
(self, userInitiated=False)

Source from the content-addressed store, hash-verified

1942
1943 @needsClient
1944 def checkForUpdates(self, userInitiated=False):
1945 self.lastCheckedForUpdates = QDateTime.currentDateTime()
1946 updateStatus, updateMessage, updateURL, self.publicServerList = self._syncplayClient.checkForUpdate(userInitiated)
1947
1948 if updateMessage is None:
1949 if updateStatus == "uptodate":
1950 updateMessage = getMessage("syncplay-uptodate-notification")
1951 elif updateStatus == "updateavailale":
1952 updateMessage = getMessage("syncplay-updateavailable-notification")
1953 else:
1954 import syncplay
1955 updateMessage = getMessage("update-check-failed-notification").format(syncplay.version)
1956 if userInitiated == True:
1957 updateURL = constants.SYNCPLAY_DOWNLOAD_URL
1958 if updateURL is not None:
1959 reply = QtWidgets.QMessageBox.question(
1960 self, "Syncplay",
1961 updateMessage, QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)
1962 if reply == QtWidgets.QMessageBox.Yes:
1963 self.QtGui.QDesktopServices.openUrl(QUrl(updateURL))
1964 elif userInitiated:
1965 QtWidgets.QMessageBox.information(self, "Syncplay", updateMessage)
1966 else:
1967 self.showMessage(updateMessage)
1968
1969 def dragEnterEvent(self, event):
1970 data = event.mimeData()

Callers 2

automaticUpdateCheckMethod · 0.95
userCheckForUpdatesMethod · 0.95

Calls 3

showMessageMethod · 0.95
getMessageFunction · 0.90
checkForUpdateMethod · 0.80

Tested by

no test coverage detected