Show current offset in set offset dialog (#642)

This commit is contained in:
Etoh 2023-11-09 18:58:18 +00:00 committed by GitHub
parent 20846ca78c
commit f4fae95408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1355,9 +1355,10 @@ class MainWindow(QtWidgets.QMainWindow):
@needsClient @needsClient
def setOffset(self): def setOffset(self):
oldoffset = str(self._syncplayClient.getUserOffset())
newoffset, ok = QtWidgets.QInputDialog.getText( newoffset, ok = QtWidgets.QInputDialog.getText(
self, getMessage("setoffset-msgbox-label"), self, getMessage("setoffset-msgbox-label"),
getMessage("offsetinfo-msgbox-label"), QtWidgets.QLineEdit.Normal, "") getMessage("offsetinfo-msgbox-label"), QtWidgets.QLineEdit.Normal, oldoffset)
if ok and newoffset != '': if ok and newoffset != '':
o = re.match(constants.UI_OFFSET_REGEX, "o " + newoffset) o = re.match(constants.UI_OFFSET_REGEX, "o " + newoffset)
if o: if o: