From 907904f890fabebcb253bfa890c8d4e62555803e Mon Sep 17 00:00:00 2001 From: Nico769 Date: Tue, 6 Feb 2018 22:55:04 +0100 Subject: [PATCH] Removes hardcoded label in GuiConfiguration and replaces it with chatoutputheader-label --- syncplay/messages_de.py | 3 ++- syncplay/messages_en.py | 7 ++++--- syncplay/messages_ru.py | 3 ++- syncplay/ui/GuiConfiguration.py | 20 ++++++++++---------- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 768118b..f015834 100644 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -245,6 +245,7 @@ de = { "chat-top-option": u"Top", # TODO: Translate "chat-middle-option": u"Middle", # TODO: Translate "chat-bottom-option": u"Bottom", # TODO: Translate + "chatoutputheader-label" : u"Chat message output", # TODO: Translate "chatoutputfont-label": u"Chat output font", # TODO: Translate "chatoutputenabled-label": u"Enable chat output in media player (mpv only for now)", # TODO: Translate "chatoutputposition-label": u"Output mode", # TODO: Translate @@ -305,7 +306,7 @@ de = { "help-menu-label" : u"&Hilfe", "userguide-menu-label" : u"&Benutzerhandbuch öffnen", "update-menu-label" : u"auf &Aktualisierung prüfen", - + #About dialog - TODO: Translate "about-menu-label": u"&About Syncplay", "about-dialog-title": u"About Syncplay", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index e0f7925..05d4cf6 100644 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -137,7 +137,7 @@ en = { "feature-chat" : u"chat", # used for not-supported-by-server-error "feature-readiness" : u"readiness", # used for not-supported-by-server-error "feature-managedRooms" : u"managed rooms", # used for not-supported-by-server-error - + "not-supported-by-server-error" : u"The {} feature is not supported by this server..", #feature "shared-playlists-not-supported-by-server-error" : "The shared playlists feature may not be supported by the server. To ensure that it works correctly requires a server running Syncplay {}+, but the server is running Syncplay {}.", #minVersion, serverVersion "shared-playlists-disabled-by-server-error" : "The shared playlist feature has been disabled in the server configuration. To use this feature you will need to connect to a different server.", @@ -239,7 +239,7 @@ en = { "unpause-ifminusersready-option" : u"Unpause if already ready or if all others ready and min users ready", "unpause-always" : u"Always unpause", "syncplay-trusteddomains-title": u"Trusted domains (for streaming services and hosted content)", - + "chat-title" : u"Chat message input", "chatinputenabled-label" : u"Enable chat input via mpv", "chatdirectinput-label" : u"Allow instant chat input (bypass having to press enter key to chat)", @@ -250,6 +250,7 @@ en = { "chat-top-option" : u"Top", "chat-middle-option" : u"Middle", "chat-bottom-option" : u"Bottom", + "chatoutputheader-label" : u"Chat message output", "chatoutputfont-label": u"Chat output font", "chatoutputenabled-label": u"Enable chat output in media player (mpv only for now)", "chatoutputposition-label": u"Output mode", @@ -310,7 +311,7 @@ en = { "help-menu-label" : "&Help", "userguide-menu-label" : "Open user &guide", "update-menu-label" : "Check for &update", - + #About dialog "about-menu-label": u"&About Syncplay", "about-dialog-title": u"About Syncplay", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 9bed670..0b47c07 100644 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -254,6 +254,7 @@ ru = { "chat-top-option": u"Top", # TODO: Translate "chat-middle-option": u"Middle", # TODO: Translate "chat-bottom-option": u"Bottom", # TODO: Translate + "chatoutputheader-label" : u"Chat message output", # TODO: Traslate "chatoutputfont-label": u"Chat output font", # TODO: Translate "chatoutputenabled-label": u"Enable chat output in media player (mpv only for now)", # TODO: Translate "chatoutputposition-label": u"Output mode", # TODO: Translate @@ -313,7 +314,7 @@ ru = { "help-menu-label" : u"&Помощь", "userguide-menu-label" : u"&Руководство пользователя", "update-menu-label" : u"Проверить &обновления", - + #About dialog - TODO: Translate "about-menu-label": u"&About Syncplay", "about-dialog-title": u"About Syncplay", diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index b5ef9d7..373715d 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -257,7 +257,7 @@ class ConfigDialog(QtWidgets.QDialog): # executable. I would have used plistlib here, but since the version of this library in # py < 3.4 can't read from binary plist files it's pretty much useless. Therefore, let's # play a game of "Guess my executable!" - + # Step 1: get all the executable files. In a Mac OS X Application bundle, executables are stored # inside /Contents/MacOS. execPath = os.path.join(os.path.normpath(fileName), 'Contents', 'MacOS') @@ -266,7 +266,7 @@ class ConfigDialog(QtWidgets.QDialog): fn = os.path.join(execPath, fn) if os.path.isfile(fn) and os.access(fn, os.X_OK): execFiles.append(fn) - + # Step 2: figure out which file name looks like the application name baseAppName = os.path.basename(fileName).replace('.app', '').lower() foundExe = False @@ -276,14 +276,14 @@ class ConfigDialog(QtWidgets.QDialog): fileName = fn foundExe = True break - + # Step 3: use the first executable in the list if no executable was found try: if not foundExe: fileName = execFiles[0] except IndexError: # whoops, looks like this .app doesn't contain a executable file at all pass - + self.executablepathCombobox.setEditText(os.path.normpath(fileName)) def loadLastUpdateCheckDate(self): @@ -379,7 +379,7 @@ class ConfigDialog(QtWidgets.QDialog): elif os.path.isdir(QStandardPaths.standardLocations(QStandardPaths.HomeLocation)[0]): defaultdirectory = QStandardPaths.standardLocations(QStandardPaths.HomeLocation)[0] else: - defaultdirectory = "" + defaultdirectory = "" browserfilter = "All files (*)" fileName, filtr = QtWidgets.QFileDialog.getOpenFileName(self, "Browse for media files", defaultdirectory, browserfilter, "", options) @@ -387,10 +387,10 @@ class ConfigDialog(QtWidgets.QDialog): self.mediapathTextbox.setText(os.path.normpath(fileName)) self.mediadirectory = os.path.dirname(fileName) self.saveMediaBrowseSettings() - + def _runWithoutStoringConfig(self): self._saveDataAndLeave(False) - + def _saveDataAndLeave(self, storeConfiguration=True): self.config['noStore'] = not storeConfiguration if storeConfiguration: @@ -946,7 +946,7 @@ class ConfigDialog(QtWidgets.QDialog): self.chatInputFontButton.objectName(), self.chatFontLabel.objectName(), self.chatInputColourButton.objectName(), self.chatDirectInputCheckbox.objectName()] # Output - self.chatOutputGroup = QtWidgets.QGroupBox(u"Chat message output") + self.chatOutputGroup = QtWidgets.QGroupBox(getMessage("chatoutputheader-label")) self.chatOutputLayout = QtWidgets.QGridLayout() self.chatLayout.addWidget(self.chatOutputGroup) self.chatOutputGroup.setLayout(self.chatOutputLayout) @@ -1213,7 +1213,7 @@ class ConfigDialog(QtWidgets.QDialog): settings = QSettings("Syncplay", "MoreSettings") settings.clear() self.datacleared = True - + def populateEmptyServerList(self): if self.publicServers is None: if self.config["checkForUpdatesAutomatically"] == True: @@ -1241,7 +1241,7 @@ class ConfigDialog(QtWidgets.QDialog): self.serverpassTextbox.setEnabled(True) self.serverpassTextbox.setReadOnly(False) self.serverpassTextbox.setText(self.storedPassword) - + def __init__(self, config, playerpaths, error, defaultConfig): self.config = config self.defaultConfig = defaultConfig