diff --git a/.appveyor.yml b/.appveyor.yml index 87132ef..cc8673e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,7 +1,11 @@ +branches: + only: + - master + environment: MINICONDA: "C:\\Miniconda" - PYTHON: "C:\\Python35" - PYTHON_VERSION: 3.5 + PYTHON: "C:\\Python36" + PYTHON_VERSION: 3.6 PYTHON_ARCH: 32 platform: x86 @@ -15,13 +19,13 @@ init: - python --version - python -m pip install -U pip setuptools wheel - pip install -U pypiwin32==223 - - pip install twisted + - pip install twisted[tls] certifi - pip install zope.interface - type nul > %PYTHON%\lib\site-packages\zope\__init__.py - - curl -L https://bintray.com/alby128/Syncplay/download_file?file_path=py2exe-0.9.2.2-py33.py34.py35-none-any.whl -o py2exe-0.9.2.2-py33.py34.py35-none-any.whl - - pip install py2exe-0.9.2.2-py33.py34.py35-none-any.whl - - del py2exe-0.9.2.2-py33.py34.py35-none-any.whl - - pip install shiboken2==5.12.0 PySide2==5.12.0 + - curl -L https://bintray.com/alby128/py2exe/download_file?file_path=py2exe-0.9.3.0-cp36-none-win32.whl -o py2exe-0.9.3.0-cp36-none-win32.whl + - pip install py2exe-0.9.3.0-cp36-none-win32.whl + - del py2exe-0.9.3.0-cp36-none-win32.whl + - pip install shiboken2==5.12.3 PySide2==5.12.3 - pip freeze install: diff --git a/.gitignore b/.gitignore index 95fe6f5..298a39b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ *.exe venv -/SyncPlay.egg-info +/*.egg-info /build /cert /dist diff --git a/.travis.yml b/.travis.yml index fd8ec48..13e3617 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,37 +1,40 @@ -language: objective-c -osx_image: xcode8.3 +# These two are defaults, which get overriden by the jobs matrix +language: minimal +os: linux -branches: - only: - - master +jobs: + include: + - language: objective-c + os: osx + osx_image: xcode8.3 + - language: minimal + dist: xenial + os: linux + env: BUILD_DESTINATION=snapcraft + - language: python + os: linux + dist: xenial + python: 3.6 + env: BUILD_DESTINATION=appimage script: -- python3 buildPy2app.py py2app - -before_install: -- brew update -- brew upgrade python -- which python3 -- python3 --version -- which pip3 -- pip3 --version -- curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/dd6c67c1ba664c8910fe96aeb58f9938d97d9a53/Formula/pyside.rb -o pyside.rb -- brew install ./pyside.rb -- python3 -c "from PySide2 import __version__; print(__version__)" -- python3 -c "from PySide2.QtCore import __version__; print(__version__)" -- pip3 install py2app -- python3 -c "from py2app.recipes import pyside2" +- if [ "$TRAVIS_OS_NAME" == "osx" ]; then python3 buildPy2app.py py2app ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then sudo snapcraft cleanbuild ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then travis/appimage-script.sh ; fi install: -- pip3 install twisted[tls] appnope requests certifi +- if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-install.sh ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then travis/snapcraft-install.sh ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then sudo apt-get install libxkbcommon-x11-0 ; fi before_deploy: -- pip3 install dmgbuild -- mkdir dist_dmg -- mv resources/macOS_readme.pdf resources/.macOS_readme.pdf +- ls -al - export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')" -- dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay_${VER}.dmg - python3 bintray_version.py +- mkdir dist_bintray +- if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-deploy.sh ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then mv syncplay_build_amd64.snap dist_bintray/syncplay_${VER}_amd64.snap ; fi +- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then travis/appimage-deploy.sh ; fi deploy: skip_cleanup: true diff --git a/GNUmakefile b/GNUmakefile index 6936f70..26e75a3 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -35,24 +35,18 @@ endif SHARE_PATH = ${DESTDIR}${PREFIX}/share common: - -mkdir -p $(LIB_PATH)/syncplay/resources/lua/intf + -mkdir -p $(LIB_PATH)/syncplay/syncplay/resources/lua/intf -mkdir -p $(APP_SHORTCUT_PATH) - -mkdir -p $(SHARE_PATH)/app-install/icons - -mkdir -p $(SHARE_PATH)/pixmaps/ cp -r syncplay $(LIB_PATH)/syncplay/ chmod 755 $(LIB_PATH)/syncplay/ - cp -r resources/hicolor $(SHARE_PATH)/icons/ - cp -r resources/*.png $(LIB_PATH)/syncplay/resources/ - cp -r resources/*.lua $(LIB_PATH)/syncplay/resources/ - cp -r resources/lua/intf/*.lua $(LIB_PATH)/syncplay/resources/lua/intf/ - cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/app-install/icons/ - cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/pixmaps/ + cp -r syncplay/resources/hicolor $(SHARE_PATH)/icons/ + cp -r syncplay/resources/*.png $(LIB_PATH)/syncplay/syncplay/resources/ + cp -r syncplay/resources/*.lua $(LIB_PATH)/syncplay/syncplay/resources/ + cp -r syncplay/resources/lua/intf/*.lua $(LIB_PATH)/syncplay/syncplay/resources/lua/intf/ u-common: -rm -rf $(LIB_PATH)/syncplay -rm $(SHARE_PATH)/icons/hicolor/*/apps/syncplay.png - -rm $(SHARE_PATH)/app-install/icons/syncplay.png - -rm $(SHARE_PATH)/pixmaps/syncplay.png client: -mkdir -p $(BIN_PATH) @@ -60,7 +54,7 @@ client: sed -i -e '/# libpath/ a\import site\nsite.addsitedir\("${PREFIX}/lib/syncplay"\)' $(BIN_PATH)/syncplay chmod 755 $(BIN_PATH)/syncplay cp syncplayClient.py $(LIB_PATH)/syncplay/ - cp resources/syncplay.desktop $(APP_SHORTCUT_PATH)/ + cp syncplay/resources/syncplay.desktop $(APP_SHORTCUT_PATH)/ ifeq ($(SINGLE_USER),false) chmod 755 $(APP_SHORTCUT_PATH)/syncplay.desktop @@ -79,7 +73,7 @@ server: sed -i -e '/# libpath/ a\import site\nsite.addsitedir\("${PREFIX}/lib/syncplay"\)' $(BIN_PATH)/syncplay-server chmod 755 $(BIN_PATH)/syncplay-server cp syncplayServer.py $(LIB_PATH)/syncplay/ - cp resources/syncplay-server.desktop $(APP_SHORTCUT_PATH)/ + cp syncplay/resources/syncplay-server.desktop $(APP_SHORTCUT_PATH)/ ifeq ($(SINGLE_USER),false) chmod 755 $(APP_SHORTCUT_PATH)/syncplay-server.desktop diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..29917cb --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,7 @@ +include LICENSE +include syncplay/resources/*.desktop +include syncplay/resources/*.png +include syncplay/resources/*.mng +include syncplay/resources/*.lua +include syncplay/resources/*.rtf +include syncplay/resources/lua/intf/*.lua diff --git a/README.md b/README.md index a873676..2b29916 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,29 @@ -# Syncplay + + +# Syncplay +[![Travis build Status](https://travis-ci.org/Syncplay/syncplay.svg?branch=master)](https://travis-ci.org/Syncplay/syncplay) +[![Appveyor build status](https://ci.appveyor.com/api/projects/status/github/Syncplay/syncplay)](https://ci.appveyor.com/project/Et0h/syncplay/branch/master) Solution to synchronize video playback across multiple instances of mpv, VLC, MPC-HC, MPC-BE and mplayer2 over the Internet. @@ -18,6 +43,10 @@ When a new person joins they will also be synchronised. Syncplay also includes t Syncplay is not a file sharing service. +## License + +This project, the Syncplay released binaries, and all the files included in this repository unless stated otherwise in the header of the file, are licensed under the [Apache License, version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html). A copy of this license is included in the LICENSE file of this repository. Licenses and attribution notices for third-party media are set out in [third-party-notices.rtf](syncplay/resources/third-party-notices.rtf). + ## Authors * *Initial concept and core internals developer* - Uriziel. * *GUI design and current lead developer* - Et0h. diff --git a/appdmg.py b/appdmg.py index 8c23084..2c08dd9 100755 --- a/appdmg.py +++ b/appdmg.py @@ -31,7 +31,7 @@ size = defines.get('size', None) # Files to include files = [ application, - 'resources/.macOS_readme.pdf' + 'syncplay/resources/.macOS_readme.pdf' ] # Symlinks to create @@ -78,7 +78,7 @@ icon_locations = { # # Other color components may be expressed either in the range 0 to 1, or # as percentages (e.g. 60% is equivalent to 0.6). -background = 'resources/macOS_dmg_bkg.tiff' +background = 'syncplay/resources/macOS_dmg_bkg.tiff' show_status_bar = False show_tab_view = False diff --git a/bintray.json b/bintray.json index 5fb36fd..fb2f5c5 100644 --- a/bintray.json +++ b/bintray.json @@ -9,7 +9,7 @@ }, "files": [ { - "includePattern": "dist_dmg/(.*)", + "includePattern": "dist_bintray/(.*)", "uploadPattern": "$1", "matrixParams": { "override": 1 diff --git a/bintray_version.py b/bintray_version.py index 1acad6c..dd7ae29 100644 --- a/bintray_version.py +++ b/bintray_version.py @@ -3,10 +3,12 @@ import json from syncplay import version -f = open('bintray.json', 'r') +bintrayFileName = 'bintray.json' + +f = open(bintrayFileName, 'r') data = json.load(f) data['version']['name'] = 'v' + version -g = open('bintray.json', 'w') +g = open(bintrayFileName, 'w') json.dump(data, g, indent=4) diff --git a/buildPy2app.py b/buildPy2app.py index 4e921c9..659e575 100755 --- a/buildPy2app.py +++ b/buildPy2app.py @@ -11,11 +11,11 @@ import syncplay APP = ['syncplayClient.py'] DATA_FILES = [ - ('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')), - ('resources/lua/intf', glob('resources/lua/intf/*.lua')) + ('resources', glob('syncplay/resources/*.png') + glob('syncplay/resources/*.rtf') + glob('syncplay/resources/*.lua')), + ('resources/lua/intf', glob('syncplay/resources/lua/intf/*.lua')) ] OPTIONS = { - 'iconfile': 'resources/icon.icns', + 'iconfile': 'syncplay/resources/icon.icns', 'extra_scripts': 'syncplayServer.py', 'includes': {'PySide2.QtCore', 'PySide2.QtUiTools', 'PySide2.QtGui', 'PySide2.QtWidgets', 'certifi', 'cffi'}, 'excludes': {'PySide', 'PySide.QtCore', 'PySide.QtUiTools', 'PySide.QtGui'}, @@ -30,7 +30,8 @@ OPTIONS = { 'CFBundleShortVersionString': syncplay.version, 'CFBundleIdentifier': 'pl.syncplay.Syncplay', 'LSMinimumSystemVersion': '10.12.0', - 'NSHumanReadableCopyright': 'Copyright © 2019 Syncplay All Rights Reserved' + 'NSHumanReadableCopyright': 'Copyright © 2019 Syncplay All Rights Reserved', + 'NSRequiresAquaSystemAppearance': False, } } diff --git a/buildPy2exe.py b/buildPy2exe.py old mode 100644 new mode 100755 index 0daf7d0..78bb5d6 --- a/buildPy2exe.py +++ b/buildPy2exe.py @@ -15,6 +15,7 @@ import sys # import warnings # warnings.warn("You must build Syncplay with Python 2.7!") +from glob import glob import os import subprocess from string import Template @@ -29,7 +30,7 @@ import syncplay from syncplay.messages import getMissingStrings missingStrings = getMissingStrings() -if missingStrings is not None and missingStrings is not "": +if missingStrings is not None and missingStrings != "": import warnings warnings.warn("MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings)) @@ -61,6 +62,8 @@ NSIS_SCRIPT_TEMPLATE = r""" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Russian.nlf" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\German.nlf" LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Italian.nlf" + LoadLanguageFile "$${NSISDIR}\Contrib\Language files\Spanish.nlf" + LoadLanguageFile "$${NSISDIR}\Contrib\Language files\PortugueseBR.nlf" Unicode true @@ -68,8 +71,9 @@ NSIS_SCRIPT_TEMPLATE = r""" OutFile "Syncplay-$version-Setup.exe" InstallDir $$PROGRAMFILES\Syncplay RequestExecutionLevel admin + ManifestDPIAware false XPStyle on - Icon resources\icon.ico ;Change DIR + Icon syncplay\resources\icon.ico ;Change DIR SetCompressor /SOLID lzma VIProductVersion "$version.0" @@ -93,6 +97,16 @@ NSIS_SCRIPT_TEMPLATE = r""" VIAddVersionKey /LANG=$${LANG_ITALIAN} "LegalCopyright" "Syncplay" VIAddVersionKey /LANG=$${LANG_ITALIAN} "FileDescription" "Syncplay" + VIAddVersionKey /LANG=$${LANG_SPANISH} "ProductName" "Syncplay" + VIAddVersionKey /LANG=$${LANG_SPANISH} "FileVersion" "$version.0" + VIAddVersionKey /LANG=$${LANG_SPANISH} "LegalCopyright" "Syncplay" + VIAddVersionKey /LANG=$${LANG_SPANISH} "FileDescription" "Syncplay" + + VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "ProductName" "Syncplay" + VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "FileVersion" "$version.0" + VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "LegalCopyright" "Syncplay" + VIAddVersionKey /LANG=$${LANG_PORTUGUESEBR} "FileDescription" "Syncplay" + LangString ^SyncplayLanguage $${LANG_ENGLISH} "en" LangString ^Associate $${LANG_ENGLISH} "Associate Syncplay with multimedia files." LangString ^Shortcut $${LANG_ENGLISH} "Create Shortcuts in following locations:" @@ -137,11 +151,29 @@ NSIS_SCRIPT_TEMPLATE = r""" LangString ^AutomaticUpdates $${LANG_ITALIAN} "Controllo automatico degli aggiornamenti" LangString ^UninstConfig $${LANG_ITALIAN} "Cancella i file di configurazione." + LangString ^SyncplayLanguage $${LANG_SPANISH} "es" + LangString ^Associate $${LANG_SPANISH} "Asociar Syncplay con archivos multimedia." + LangString ^Shortcut $${LANG_SPANISH} "Crear accesos directos en las siguientes ubicaciones:" + LangString ^StartMenu $${LANG_SPANISH} "Menú de inicio" + LangString ^Desktop $${LANG_SPANISH} "Escritorio" + LangString ^QuickLaunchBar $${LANG_SPANISH} "Barra de acceso rápido" + LangString ^AutomaticUpdates $${LANG_SPANISH} "Buscar actualizaciones automáticamente" + LangString ^UninstConfig $${LANG_SPANISH} "Borrar archivo de configuración." + + LangString ^SyncplayLanguage $${LANG_PORTUGUESEBR} "pt_BR" + LangString ^Associate $${LANG_PORTUGUESEBR} "Associar Syncplay aos arquivos multimídia." + LangString ^Shortcut $${LANG_PORTUGUESEBR} "Criar atalhos nos seguintes locais:" + LangString ^StartMenu $${LANG_PORTUGUESEBR} "Menu Iniciar" + LangString ^Desktop $${LANG_PORTUGUESEBR} "Área de trabalho" + LangString ^QuickLaunchBar $${LANG_PORTUGUESEBR} "Barra de acesso rápido" + LangString ^AutomaticUpdates $${LANG_PORTUGUESEBR} "Verificar atualizações automaticamente" + LangString ^UninstConfig $${LANG_PORTUGUESEBR} "Deletar arquivo de configuração." + ; Remove text to save space LangString ^ClickInstall $${LANG_GERMAN} " " PageEx license - LicenseData resources\license.rtf + LicenseData syncplay\resources\license.rtf PageExEnd Page custom DirectoryCustom DirectoryCustomLeave Page instFiles @@ -240,6 +272,10 @@ NSIS_SCRIPT_TEMPLATE = r""" Push Deutsch Push $${LANG_ITALIAN} Push Italiano + Push $${LANG_SPANISH} + Push Español + Push $${LANG_PORTUGUESEBR} + Push 'Português do Brasil' Push A ; A means auto count languages LangDLL::LangDialog "Language Selection" "Please select the language of Syncplay and the installer" Pop $$LANGUAGE @@ -370,6 +406,7 @@ NSIS_SCRIPT_TEMPLATE = r""" $${If} $$CheckBox_StartMenuShortcut_State == $${BST_CHECKED} CreateDirectory $$SMPROGRAMS\Syncplay + SetOutPath "$$INSTDIR" CreateShortCut "$$SMPROGRAMS\Syncplay\Syncplay.lnk" "$$INSTDIR\Syncplay.exe" "" CreateShortCut "$$SMPROGRAMS\Syncplay\Syncplay Server.lnk" "$$INSTDIR\syncplayServer.exe" "" CreateShortCut "$$SMPROGRAMS\Syncplay\Uninstall.lnk" "$$INSTDIR\Uninstall.exe" "" @@ -377,10 +414,12 @@ NSIS_SCRIPT_TEMPLATE = r""" $${EndIf} $${If} $$CheckBox_DesktopShortcut_State == $${BST_CHECKED} + SetOutPath "$$INSTDIR" CreateShortCut "$$DESKTOP\Syncplay.lnk" "$$INSTDIR\Syncplay.exe" "" $${EndIf} $${If} $$CheckBox_QuickLaunchShortcut_State == $${BST_CHECKED} + SetOutPath "$$INSTDIR" CreateShortCut "$$QUICKLAUNCH\Syncplay.lnk" "$$INSTDIR\Syncplay.exe" "" $${EndIf} FunctionEnd @@ -648,39 +687,15 @@ class build_installer(py2exe): script.compile() print("*** DONE ***") -guiIcons = [ - 'resources/accept.png', 'resources/arrow_undo.png', 'resources/clock_go.png', - 'resources/control_pause_blue.png', 'resources/cross.png', 'resources/door_in.png', - 'resources/folder_explore.png', 'resources/help.png', 'resources/table_refresh.png', - 'resources/timeline_marker.png', 'resources/control_play_blue.png', - 'resources/mpc-hc.png', 'resources/mpc-hc64.png', 'resources/mplayer.png', - 'resources/mpc-be.png', - 'resources/mpv.png', 'resources/vlc.png', 'resources/house.png', 'resources/film_link.png', - 'resources/eye.png', 'resources/comments.png', 'resources/cog_delete.png', 'resources/chevrons_right.png', - 'resources/user_key.png', 'resources/lock.png', 'resources/key_go.png', 'resources/page_white_key.png', - 'resources/lock_green.png', 'resources/lock_green_dialog.png', - 'resources/tick.png', 'resources/lock_open.png', 'resources/empty_checkbox.png', 'resources/tick_checkbox.png', - 'resources/world_explore.png', 'resources/application_get.png', 'resources/cog.png', 'resources/arrow_switch.png', - 'resources/film_go.png', 'resources/world_go.png', 'resources/arrow_refresh.png', 'resources/bullet_right_grey.png', - 'resources/user_comment.png', - 'resources/error.png', - 'resources/film_folder_edit.png', - 'resources/film_edit.png', - 'resources/folder_film.png', - 'resources/shield_edit.png', - 'resources/shield_add.png', - 'resources/email_go.png', - 'resources/world_add.png', 'resources/film_add.png', 'resources/delete.png', 'resources/spinner.mng' -] +guiIcons = glob('syncplay/resources/*.ico') + glob('syncplay/resources/*.png') + ['syncplay/resources/spinner.mng'] + resources = [ - "resources/icon.ico", - "resources/syncplay.png", - "resources/syncplayintf.lua", - "resources/license.rtf", - "resources/third-party-notices.rtf" + "syncplay/resources/syncplayintf.lua", + "syncplay/resources/license.rtf", + "syncplay/resources/third-party-notices.rtf" ] resources.extend(guiIcons) -intf_resources = ["resources/lua/intf/syncplay.lua"] +intf_resources = ["syncplay/resources/lua/intf/syncplay.lua"] qt_plugins = ['platforms\\qwindows.dll', 'styles\\qwindowsvistastyle.dll'] @@ -696,7 +711,7 @@ info = dict( common_info, windows=[{ "script": "syncplayClient.py", - "icon_resources": [(1, "resources\\icon.ico")], + "icon_resources": [(1, "syncplay\\resources\\icon.ico")], 'dest_base': "Syncplay"}, ], console=['syncplayServer.py'], @@ -706,8 +721,8 @@ info = dict( options={ 'py2exe': { 'dist_dir': OUT_DIR, - 'packages': 'PySide2', - 'includes': 'twisted, sys, encodings, datetime, os, time, math, liburl, ast, unicodedata, _ssl, win32pipe, win32file', + 'packages': 'PySide2, cffi, OpenSSL, certifi', + 'includes': 'twisted, sys, encodings, datetime, os, time, math, urllib, ast, unicodedata, _ssl, win32pipe, win32file', 'excludes': 'venv, doctest, pdb, unittest, win32clipboard, win32pdh, win32security, win32trace, win32ui, winxpgui, win32process, Tkinter', 'dll_excludes': 'msvcr71.dll, MSVCP90.dll, POWRPROF.dll', 'optimize': 2, @@ -719,5 +734,5 @@ info = dict( cmdclass={"py2exe": build_installer}, ) -sys.argv.extend(['py2exe', '-p win32com ', '-i twisted.web.resource', '-p PySide2']) -setup(**info) \ No newline at end of file +sys.argv.extend(['py2exe']) +setup(**info) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..506c59c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +certifi>=2018.11.29 +twisted[tls]>=16.4.0 +appnope>=0.1.0; sys_platform == 'darwin' +pypiwin32>=223; sys_platform == 'win32' +zope.interface>=4.4.0; sys_platform == 'win32' diff --git a/requirements_gui.txt b/requirements_gui.txt new file mode 100644 index 0000000..5eaed0f --- /dev/null +++ b/requirements_gui.txt @@ -0,0 +1,2 @@ +pyside2>=5.12.0 +requests>=2.20.0; sys_platform == 'darwin' diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..358e9ee --- /dev/null +++ b/setup.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python3 + +import os +import setuptools + +from syncplay import projectURL, version as syncplay_version + +def read(fname): + with open(fname, 'r') as f: + return f.read() + +if os.getenv('SNAPCRAFT_PART_BUILD', None) is not None: + installRequirements = ["pyasn1"] + read('requirements.txt').splitlines() +else: + installRequirements = read('requirements.txt').splitlines() +\ + read('requirements_gui.txt').splitlines() + +setuptools.setup( + name="syncplay", + version=syncplay_version, + author="Syncplay", + author_email="dev@syncplay.pl", + description=' '.join([ + 'Client/server to synchronize media playback', + 'on mpv/VLC/MPC-HC/MPC-BE on many computers' + ]), + long_description=read('README.md'), + long_description_content_type="text/markdown", + url=projectURL, + download_url=projectURL + 'download/', + packages=setuptools.find_packages(), + install_requires=installRequirements, + python_requires=">=3.4", + entry_points={ + 'console_scripts': [ + 'syncplay-server = syncplay.ep_server:main', + ], + 'gui_scripts': [ + 'syncplay = syncplay.ep_client:main', + ] + }, + include_package_data=True, + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Environment :: MacOS X :: Cocoa", + "Environment :: Win32 (MS Windows)", + "Environment :: X11 Applications :: Qt", + "Framework :: Twisted", + "Intended Audience :: End Users/Desktop", + "License :: OSI Approved :: Apache Software License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Natural Language :: English", + "Natural Language :: German", + "Natural Language :: Italian", + "Natural Language :: Russian", + "Natural Language :: Spanish", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Topic :: Internet", + "Topic :: Multimedia :: Video" + ], +) diff --git a/snapcraft.yaml b/snapcraft.yaml new file mode 100644 index 0000000..b92af89 --- /dev/null +++ b/snapcraft.yaml @@ -0,0 +1,35 @@ +name: syncplay +summary: Syncplay +version: build +version-script: cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}' +summary: Client/server to synchronize media playback on many computers +description: | + Syncplay synchronises the position and play state of multiple media players + so that the viewers can watch the same thing at the same time. This means that + when one person pauses/unpauses playback or seeks (jumps position) within their + media player then this will be replicated across all media players connected to + the same server and in the same 'room' (viewing session). When a new person + joins they will also be synchronised. Syncplay also includes text-based chat so + you can discuss a video as you watch it (or you could use third-party Voice over + IP software to talk over a video). + +confinement: classic +icon: syncplay/resources/syncplay.png +grade: stable + +parts: + syncplay: + plugin: python + source: . + stage-packages: + - python3-pyside + after: [desktop-qt4] + +apps: + syncplay: + command: bin/desktop-launch $SNAP/usr/bin/python3 $SNAP/bin/syncplay + desktop: lib/python3.5/site-packages/syncplay/resources/syncplay.desktop + + syncplay-server: + command: bin/syncplay-server + desktop: lib/python3.5/site-packages/syncplay/resources/syncplay-server.desktop diff --git a/syncplay/__init__.py b/syncplay/__init__.py index 3932bf1..da83232 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ -version = '1.6.3' -revision = ' beta' +version = '1.6.5' +revision = ' development' milestone = 'Yoitsu' -release_number = '73' +release_number = '84' projectURL = 'https://syncplay.pl/' diff --git a/syncplay/client.py b/syncplay/client.py index c284e45..5b60888 100755 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -12,10 +12,10 @@ import time from copy import deepcopy from functools import wraps +from twisted.application.internet import ClientService from twisted.internet.endpoints import HostnameEndpoint from twisted.internet.protocol import ClientFactory from twisted.internet import reactor, task, defer, threads -from twisted.application.internet import ClientService try: import certifi @@ -135,7 +135,7 @@ class SyncplayClient(object): if constants.DEBUG_MODE and constants.WARN_ABOUT_MISSING_STRINGS: missingStrings = getMissingStrings() - if missingStrings is not None and missingStrings is not "": + if missingStrings is not None and missingStrings != "": self.ui.showDebugMessage("MISSING/UNUSED STRINGS DETECTED:\n{}".format(missingStrings)) def initProtocol(self, protocol): @@ -199,9 +199,16 @@ class SyncplayClient(object): self.setPosition(-1) self.ui.showDebugMessage("Rewinded after double-check") + def isPlayingMusic(self): + if self.userlist.currentUser.file: + for musicFormat in constants.MUSIC_FORMATS: + if self.userlist.currentUser.file['name'].lower().endswith(musicFormat): + return True + def updatePlayerStatus(self, paused, position): position -= self.getUserOffset() pauseChange, seeked = self._determinePlayerStateChange(paused, position) + positionBeforeSeek = self._playerPosition self._playerPosition = position self._playerPaused = paused currentLength = self.userlist.currentUser.file["duration"] if self.userlist.currentUser.file else 0 @@ -222,7 +229,9 @@ class SyncplayClient(object): if self._lastGlobalUpdate: self._lastPlayerUpdate = time.time() - if (pauseChange or seeked) and self._protocol: + if seeked and not pauseChange and self.isPlayingMusic() and abs(positionBeforeSeek - currentLength) < constants.PLAYLIST_LOAD_NEXT_FILE_TIME_FROM_END_THRESHOLD and self.playlist.notJustChangedPlaylist(): + self.playlist.loadNextFileInPlaylist() + elif (pauseChange or seeked) and self._protocol: if seeked: self.playerPositionBeforeLastSeek = self.getGlobalPosition() self._protocol.sendState(self.getPlayerPosition(), self.getPlayerPaused(), seeked, None, True) @@ -230,7 +239,10 @@ class SyncplayClient(object): def prepareToAdvancePlaylist(self): if self.playlist.canSwitchToNextPlaylistIndex(): self.ui.showDebugMessage("Preparing to advance playlist...") - self._protocol.sendState(0, True, True, None, True) + if self.isPlayingMusic(): + self._protocol.sendState(0, False, True, None, True) + else: + self._protocol.sendState(0, True, True, None, True) else: self.ui.showDebugMessage("Not preparing to advance playlist because the next file cannot be switched to") @@ -508,7 +520,11 @@ class SyncplayClient(object): return True return False - def openFile(self, filePath, resetPosition=False): + def openFile(self, filePath, resetPosition=False, fromUser=False): + if fromUser and filePath.endswith(".txt") or filePath.endswith(".m3u") or filePath.endswith(".m3u8"): + self.playlist.loadPlaylistFromFile(filePath, resetPosition) + return + self.playlist.openedFile() self._player.openFile(filePath, resetPosition) if resetPosition: @@ -527,10 +543,10 @@ class SyncplayClient(object): self.playlist.changeToPlaylistIndex(*args, **kwargs) def loopSingleFiles(self): - return self._config["loopSingleFiles"] + return self._config["loopSingleFiles"] or self.isPlayingMusic() def isPlaylistLoopingEnabled(self): - return self._config["loopAtEndOfPlaylist"] + return self._config["loopAtEndOfPlaylist"] or self.isPlayingMusic() def __executePrivacySettings(self, filename, size): if self._config['filenamePrivacyMode'] == PRIVACY_SENDHASHED_MODE: @@ -629,6 +645,12 @@ class SyncplayClient(object): return features def setRoom(self, roomName, resetAutoplay=False): + roomSplit = roomName.split(":") + if roomName.startswith("+") and len(roomSplit) > 2: + roomName = roomSplit[0] + ":" + roomSplit[1] + password = roomSplit[2] + self.storeControlPassword(roomName, password) + self.ui.updateRoomName(roomName) self.userlist.currentUser.room = roomName if resetAutoplay: self.resetAutoPlayState() @@ -641,6 +663,7 @@ class SyncplayClient(object): self.reIdentifyAsController() def reIdentifyAsController(self): + self.setRoom(self.userlist.currentUser.room) room = self.userlist.currentUser.room if utils.RoomPasswordProvider.isControlledRoom(room): storedRoomPassword = self.getControlledRoomPassword(room) @@ -661,6 +684,9 @@ class SyncplayClient(object): readyState = self._config['readyAtStart'] if self.userlist.currentUser.isReady() is None else self.userlist.currentUser.isReady() self._protocol.setReady(readyState, manuallyInitiated=False) self.reIdentifyAsController() + if self._config["loadPlaylistFromFile"]: + self.playlist.loadPlaylistFromFile(self._config["loadPlaylistFromFile"]) + self._config["loadPlaylistFromFile"] = None def getRoom(self): return self.userlist.currentUser.room @@ -752,12 +778,15 @@ class SyncplayClient(object): return(0.1 * (2 ** min(retries, 5))) self._reconnectingService = ClientService(self._endpoint, self.protocolFactory, retryPolicy=retry) - waitForConnection = self._reconnectingService.whenConnected(failAfterFailures=1) + try: + waitForConnection = self._reconnectingService.whenConnected(failAfterFailures=1) + except TypeError: + waitForConnection = self._reconnectingService.whenConnected() self._reconnectingService.startService() def connectedNow(f): hostIP = connectionHandle.result.transport.addr[0] - self.ui.showMessage(getMessage("handshake-successful-notification").format(host, hostIP)) + self.ui.showMessage(getMessage("reachout-successful-notification").format(host, hostIP)) return def failed(f): @@ -801,6 +830,10 @@ class SyncplayClient(object): @requireServerFeature("chat") def sendChat(self, message): if self._protocol and self._protocol.logged: + try: + message = message.replace("\n", "").replace("\r", "") + except: + pass message = utils.truncateText(message, constants.MAX_CHAT_MESSAGE_LENGTH) self._protocol.sendChatMessage(message) @@ -827,12 +860,16 @@ class SyncplayClient(object): self.autoplayCheck() def autoplayCheck(self): + if self.isPlayingMusic(): + return True if self.autoplayConditionsMet(): self.startAutoplayCountdown() else: self.stopAutoplayCountdown() def instaplayConditionsMet(self): + if self.isPlayingMusic(): + return True if not self.userlist.currentUser.canControl(): return False @@ -1689,6 +1726,25 @@ class SyncplayPlaylist(): filename = _playlist[_index] if len(_playlist) > _index else None return filename + def loadPlaylistFromFile(self, path, shuffle=False): + if not os.path.isfile(path): + self._ui.showDebugMessage("Not loading {} as file could not be found".format(path)) + return + + with open(path) as f: + newPlaylist = f.read().splitlines() + if shuffle: + random.shuffle(newPlaylist) + if newPlaylist: + self.changePlaylist(newPlaylist, username=None, resetIndex=True) + + def savePlaylistToFile(self, path): + with open(path, 'w') as playlistFile: + playlistToSave = utils.getListAsMultilineString(self._playlist) + playlistFile.write(playlistToSave) + self._ui.showMessage("Playlist saved as {}".format(path)) # TODO: Move to messages_en + + def changePlaylist(self, files, username=None, resetIndex=False): if self._playlist == files: if self._playlistIndex != 0 and resetIndex: diff --git a/syncplay/clientManager.py b/syncplay/clientManager.py index bdc3412..b2caafa 100755 --- a/syncplay/clientManager.py +++ b/syncplay/clientManager.py @@ -8,7 +8,8 @@ class SyncplayClientManager(object): def run(self): config = ConfigurationGetter().getConfiguration() from syncplay.client import SyncplayClient # Imported later, so the proper reactor is installed - interface = ui.getUi(graphical=not config["noGui"]) + menuBar = config['menuBar'] if 'menuBar' in config else None + interface = ui.getUi(graphical=not config["noGui"], passedBar=menuBar) syncplayClient = SyncplayClient(config["playerClass"], interface, config) if syncplayClient: interface.addClient(syncplayClient) diff --git a/syncplay/constants.py b/syncplay/constants.py index 5217a7a..7cde152 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -1,4 +1,24 @@ # coding:utf8 +# code needed to get customized constants for different OS +import sys + +OS_WINDOWS = "win" +OS_LINUX = "linux" +OS_MACOS = "darwin" +OS_BSD = "freebsd" +OS_DRAGONFLY = "dragonfly" +OS_DEFAULT = "default" + +def getValueForOS(constantDict): + if sys.platform.startswith(OS_WINDOWS): + return constantDict[OS_WINDOWS] if OS_WINDOWS in constantDict else constantDict[OS_DEFAULT] + if sys.platform.startswith(OS_LINUX): + return constantDict[OS_LINUX] if OS_LINUX in constantDict else constantDict[OS_DEFAULT] + if sys.platform.startswith(OS_MACOS): + return constantDict[OS_MACOS] if OS_MACOS in constantDict else constantDict[OS_DEFAULT] + if OS_BSD in sys.platform or sys.platform.startswith(OS_DRAGONFLY): + return constantDict[OS_BSD] if OS_BSD in constantDict else constantDict[OS_DEFAULT] + # You might want to change these DEFAULT_PORT = 8999 OSD_DURATION = 3.0 @@ -9,7 +29,8 @@ MPLAYER_OSD_LEVEL = 1 UI_TIME_FORMAT = "[%X] " CONFIG_NAMES = [".syncplay", "syncplay.ini"] # Syncplay searches first to last DEFAULT_CONFIG_NAME = "syncplay.ini" -RECENT_CLIENT_THRESHOLD = "1.6.0" # This and higher considered 'recent' clients (no warnings) +RECENT_CLIENT_THRESHOLD = "1.6.4" # This and higher considered 'recent' clients (no warnings) +MUSIC_FORMATS = [".mp3", ".m4a", ".m4p", ".wav", ".aiff", ".r", ".ogg", ".flac"] # ALL LOWER CASE! WARN_OLD_CLIENTS = True # Use MOTD to inform old clients to upgrade LIST_RELATIVE_CONFIGS = True # Print list of relative configs loaded SHOW_CONTACT_INFO = True # Displays dev contact details below list in GUI @@ -24,6 +45,7 @@ FALLBACK_PUBLIC_SYNCPLAY_SERVERS = [ ['syncplay.pl:8999 (France)', 'syncplay.pl:8999']] PLAYLIST_LOAD_NEXT_FILE_MINIMUM_LENGTH = 10 # Seconds PLAYLIST_LOAD_NEXT_FILE_TIME_FROM_END_THRESHOLD = 5 # Seconds (only triggered if file is paused, e.g. due to EOF) +EXECUTABLE_COMBOBOX_MINIMUM_LENGTH = 30 # Minimum number of characters that the combobox will make visible # Overriden by config SHOW_OSD = True # Sends Syncplay messages to media player OSD @@ -62,9 +84,10 @@ PLAYLIST_MAX_CHARACTERS = 10000 PLAYLIST_MAX_ITEMS = 250 MAXIMUM_TAB_WIDTH = 350 TAB_PADDING = 30 -DEFAULT_WINDOWS_MONOSPACE_FONT = "Consolas" -DEFAULT_OSX_MONOSPACE_FONT = "Menlo" -FALLBACK_MONOSPACE_FONT = "Monospace" +MONOSPACE_FONT = getValueForOS({ + OS_DEFAULT: "Monospace", + OS_MACOS: "Menlo", + OS_WINDOWS: "Consolas"}) DEFAULT_CHAT_FONT_SIZE = 24 DEFAULT_CHAT_INPUT_FONT_COLOR = "#FFFF00" DEFAULT_CHAT_OUTPUT_FONT_COLOR = "#FFFF00" @@ -133,6 +156,8 @@ MPLAYER_PATHS = ["mplayer2", "mplayer"] MPV_PATHS = ["mpv", "/opt/mpv/mpv", r"c:\program files\mpv\mpv.exe", r"c:\program files\mpv-player\mpv.exe", r"c:\program Files (x86)\mpv\mpv.exe", r"c:\program Files (x86)\mpv-player\mpv.exe", "/Applications/mpv.app/Contents/MacOS/mpv"] +MPVNET_PATHS = [r"c:\program files\mpv.net\mpvnet.exe", r"c:\program files\mpv.net\mpvnet.exe", + r"c:\program Files (x86)\mpv.net\mpvnet.exe", r"c:\program Files (x86)\mpv.net\mpvnet.exe"] VLC_PATHS = [ r"c:\program files (x86)\videolan\vlc\vlc.exe", r"c:\program files\videolan\vlc\vlc.exe", @@ -140,12 +165,14 @@ VLC_PATHS = [ "/usr/bin/vlc-wrapper", "/Applications/VLC.app/Contents/MacOS/VLC", "/usr/local/bin/vlc", - "/usr/local/bin/vlc-wrapper" + "/usr/local/bin/vlc-wrapper", + "/snap/bin/vlc" ] VLC_ICONPATH = "vlc.png" MPLAYER_ICONPATH = "mplayer.png" MPV_ICONPATH = "mpv.png" +MPVNET_ICONPATH = "mpvnet.ico" MPC_ICONPATH = "mpc-hc.png" MPC64_ICONPATH = "mpc-hc64.png" MPC_BE_ICONPATH = "mpc-be.png" @@ -175,8 +202,12 @@ STYLE_SUBCHECKBOX = "QCheckBox, QLabel, QRadioButton {{ margin-left: 6px; paddin STYLE_SUBLABEL = "QCheckBox, QLabel {{ margin-left: 6px; padding-left: 16px; background:url('{}') left no-repeat }}" # Graphic path STYLE_ERRORLABEL = "QLabel { color : black; border-style: outset; border-width: 2px; border-radius: 7px; border-color: red; padding: 2px; background: #FFAAAA; }" STYLE_SUCCESSLABEL = "QLabel { color : black; border-style: outset; border-width: 2px; border-radius: 7px; border-color: green; padding: 2px; background: #AAFFAA; }" -STYLE_READY_PUSHBUTTON = "QPushButton { text-align: left; padding: 10px 5px 10px 5px;}" -STYLE_AUTO_PLAY_PUSHBUTTON = "QPushButton { text-align: left; padding: 5px 5px 5px 5px; }" +STYLE_READY_PUSHBUTTON = getValueForOS({ + OS_DEFAULT: "QPushButton { text-align: left; padding: 10px 5px 10px 5px;}", + OS_MACOS: "QPushButton { text-align: left; padding: 10px 5px 10px 15px; margin: 0px 3px 0px 2px}"}) +STYLE_AUTO_PLAY_PUSHBUTTON = getValueForOS({ + OS_DEFAULT: "QPushButton { text-align: left; padding: 5px 5px 5px 5px; }", + OS_MACOS: "QPushButton { text-align: left; padding: 10px 5px 10px 15px; margin: 0px 0px 0px -4px}"}) STYLE_NOTIFICATIONBOX = "Username { color: #367AA9; font-weight:bold; }" STYLE_CONTACT_INFO = "{}

" # Contact info message STYLE_USER_MESSAGE = "<{}> {}" @@ -187,9 +218,19 @@ STYLE_NOFILEITEM_COLOR = 'blue' STYLE_NOTCONTROLLER_COLOR = 'grey' STYLE_UNTRUSTEDITEM_COLOR = 'purple' +STYLE_DARK_LINKS_COLOR = "a {color: #1A78D5; }" +STYLE_DARK_ABOUT_LINK_COLOR = "color: #1A78D5;" +STYLE_DARK_ERRORNOTIFICATION = "color: #E94F64;" +STYLE_DARK_DIFFERENTITEM_COLOR = '#E94F64' +STYLE_DARK_NOFILEITEM_COLOR = '#1A78D5' +STYLE_DARK_NOTCONTROLLER_COLOR = 'grey' +STYLE_DARK_UNTRUSTEDITEM_COLOR = '#882fbc' + TLS_CERT_ROTATION_MAX_RETRIES = 10 -USERLIST_GUI_USERNAME_OFFSET = 21 # Pixels +USERLIST_GUI_USERNAME_OFFSET = getValueForOS({ + OS_DEFAULT: 21, + OS_MACOS: 26}) # Pixels USERLIST_GUI_USERNAME_COLUMN = 0 USERLIST_GUI_FILENAME_COLUMN = 3 @@ -217,8 +258,9 @@ MPV_SYNCPLAYINTF_CONSTANTS_TO_SEND = [ MPV_SYNCPLAYINTF_LANGUAGE_TO_SEND = ["mpv-key-tab-hint", "mpv-key-hint", "alphakey-mode-warning-first-line", "alphakey-mode-warning-second-line"] VLC_SLAVE_ARGS = ['--extraintf=luaintf', '--lua-intf=syncplay', '--no-quiet', '--no-input-fast-seek', '--play-and-pause', '--start-time=0'] -VLC_SLAVE_MACOS_ARGS = ['--verbose=2', '--no-file-logging'] -VLC_SLAVE_NONMACOS_ARGS = ['--no-one-instance', '--no-one-instance-when-started-from-file'] +VLC_SLAVE_EXTRA_ARGS = getValueForOS({ + OS_DEFAULT: ['--no-one-instance', '--no-one-instance-when-started-from-file'], + OS_MACOS: ['--verbose=2', '--no-file-logging']}) MPV_SUPERSEDE_IF_DUPLICATE_COMMANDS = ["no-osd set time-pos ", "loadfile "] MPV_REMOVE_BOTH_IF_DUPLICATE_COMMANDS = ["cycle pause"] MPLAYER_ANSWER_REGEX = "^ANS_([a-zA-Z_-]+)=(.+)$|^(Exiting)\.\.\. \((.+)\)$" @@ -275,9 +317,3 @@ DEFAULT_TRUSTED_DOMAINS = ["youtube.com", "youtu.be"] TRUSTABLE_WEB_PROTOCOLS = ["http://www.", "https://www.", "http://", "https://"] PRIVATE_FILE_FIELDS = ["path"] - -OS_WINDOWS = "win" -OS_LINUX = "linux" -OS_MACOS = "darwin" -OS_BSD = "freebsd" -OS_DRAGONFLY = "dragonfly" diff --git a/syncplay/ep_client.py b/syncplay/ep_client.py new file mode 100644 index 0000000..f93793b --- /dev/null +++ b/syncplay/ep_client.py @@ -0,0 +1,11 @@ +import sys + +from syncplay.clientManager import SyncplayClientManager +from syncplay.utils import blackholeStdoutForFrozenWindow + +def main(): + blackholeStdoutForFrozenWindow() + SyncplayClientManager().run() + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/syncplay/ep_server.py b/syncplay/ep_server.py new file mode 100644 index 0000000..22aec44 --- /dev/null +++ b/syncplay/ep_server.py @@ -0,0 +1,57 @@ +import sys + +from twisted.internet import reactor +from twisted.internet.endpoints import TCP4ServerEndpoint, TCP6ServerEndpoint +from twisted.internet.error import CannotListenError + +from syncplay.server import SyncFactory, ConfigurationGetter + +class ServerStatus: pass + +def isListening6(f): + ServerStatus.listening6 = True + +def isListening4(f): + ServerStatus.listening4 = True + +def failed6(f): + ServerStatus.listening6 = False + print(f.value) + print("IPv6 listening failed.") + +def failed4(f): + ServerStatus.listening4 = False + if f.type is CannotListenError and ServerStatus.listening6: + pass + else: + print(f.value) + print("IPv4 listening failed.") + +def main(): + argsGetter = ConfigurationGetter() + args = argsGetter.getConfiguration() + factory = SyncFactory( + args.port, + args.password, + args.motd_file, + args.isolate_rooms, + args.salt, + args.disable_ready, + args.disable_chat, + args.max_chat_message_length, + args.max_username_length, + args.stats_db_file, + args.tls + ) + endpoint6 = TCP6ServerEndpoint(reactor, int(args.port)) + endpoint6.listen(factory).addCallbacks(isListening6, failed6) + endpoint4 = TCP4ServerEndpoint(reactor, int(args.port)) + endpoint4.listen(factory).addCallbacks(isListening4, failed4) + if ServerStatus.listening6 or ServerStatus.listening4: + reactor.run() + else: + print("Unable to listen using either IPv4 and IPv6 protocols. Quitting the server now.") + sys.exit() + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/syncplay/messages.py b/syncplay/messages.py index 4142cbb..a5e9b24 100755 --- a/syncplay/messages.py +++ b/syncplay/messages.py @@ -5,12 +5,16 @@ from . import messages_en from . import messages_ru from . import messages_de from . import messages_it +from . import messages_es +from . import messages_pt_BR messages = { "en": messages_en.en, "ru": messages_ru.ru, "de": messages_de.de, "it": messages_it.it, + "es": messages_es.es, + "es": messages_pt_BR.pt_BR, "CURRENT": None } @@ -42,9 +46,15 @@ def getMissingStrings(): def getInitialLanguage(): - import locale try: - initialLanguage = locale.getdefaultlocale()[0].split("_")[0] + import sys + frozen = getattr(sys, 'frozen', '') + if frozen in 'macosx_app': + from PySide2.QtCore import QLocale + initialLanguage = QLocale.system().uiLanguages()[0].split('-')[0] + else: + import locale + initialLanguage = locale.getdefaultlocale()[0].split("_")[0] if initialLanguage not in messages: initialLanguage = constants.FALLBACK_INITIAL_LANGUAGE except: @@ -75,5 +85,5 @@ def getMessage(type_, locale=None): return str(messages["en"][type_]) else: print("WARNING: Cannot find message '{}'!".format(type_)) - return "!{}".format(type_) # TODO: Remove - # raise KeyError(type_) + #return "!{}".format(type_) # TODO: Remove + raise KeyError(type_) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 999bf35..63330bf 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -16,7 +16,7 @@ de = { "connection-failed-notification": "Verbindung zum Server fehlgeschlagen", "connected-successful-notification": "Erfolgreich mit Server verbunden", "retrying-notification": "%s, versuche erneut in %d Sekunden...", # Seconds - "handshake-successful-notification": "Connection established with {} ({})", # TODO: Translate + "reachout-successful-notification": "{} ({}) erfolgreich erreicht", "rewind-notification": "Zurückgespult wegen Zeitdifferenz mit {}", # User "fastforward-notification": "Vorgespult wegen Zeitdifferenz mit {}", # User @@ -29,13 +29,13 @@ de = { "current-offset-notification": "Aktueller Offset: {} Sekunden", # Offset - "media-directory-list-updated-notification": "Syncplay media directories have been updated.", # TODO: Translate + "media-directory-list-updated-notification": "Syncplay-Medienverzeichnisse wurden aktualisiert.", - "room-join-notification": "{} hat den Raum '{}' betreten", # User + "room-join-notification": "{} hat den Raum „{}“ betreten", # User "left-notification": "{} ist gegangen", # User "left-paused-notification": "{} ist gegangen, {} pausierte", # User who left, User who paused - "playing-notification": "{} spielt '{}' ({})", # User, file, duration - "playing-notification/room-addendum": " in Raum: '{}'", # Room + "playing-notification": "{} spielt „{}“ ({})", # User, file, duration + "playing-notification/room-addendum": " in Raum: „{}“", # Room "not-all-ready": "Noch nicht bereit: {}", # Usernames "all-users-ready": "Alle sind bereit ({} Nutzer)", # Number of ready users @@ -44,10 +44,10 @@ de = { "set-as-not-ready-notification": "Du bist nicht bereit", "autoplaying-notification": "Starte in {}...", # Number of seconds until playback will start - "identifying-as-controller-notification": "Identifiziere als Raumleiter mit Passwort '{}'...", # TODO: find a better translation to "room operator" + "identifying-as-controller-notification": "Identifiziere als Raumleiter mit Passwort „{}“...", # TODO: find a better translation to "room operator" "failed-to-identify-as-controller-notification": "{} konnte sich nicht als Raumleiter identifizieren.", "authenticated-as-controller-notification": "{} authentifizierte sich als Raumleiter", - "created-controlled-room-notification": "Gesteuerten Raum '{}' mit Passwort '{}' erstellt. Bitte diese Informationen für die Zukunft aufheben!", # RoomName, operatorPassword + "created-controlled-room-notification": "Gesteuerten Raum „{}“ mit Passwort „{}“ erstellt. Bitte diese Informationen für die Zukunft aufheben!", # RoomName, operatorPassword "file-different-notification": "Deine Datei scheint sich von {}s zu unterscheiden", # User "file-differences-notification": "Deine Datei unterscheidet sich auf folgende Art: {}", @@ -62,7 +62,7 @@ de = { "file-played-by-notification": "Datei: {} wird gespielt von:", # File "no-file-played-notification": "{} spielt keine Datei ab", # Username "notplaying-notification": "Personen im Raum, die keine Dateien spielen:", - "userlist-room-notification": "In Raum '{}':", # Room + "userlist-room-notification": "In Raum „{}“:", # Room "userlist-file-notification": "Datei", "controller-userlist-userflag": "Raumleiter", "ready-userlist-userflag": "Bereit", @@ -86,7 +86,7 @@ de = { "commandlist-notification/toggle": "\tt - Bereitschaftsanzeige umschalten", "commandlist-notification/create": "\tc [name] - erstelle zentral gesteuerten Raum mit dem aktuellen Raumnamen", "commandlist-notification/auth": "\ta [password] - authentifiziere als Raumleiter mit Passwort", - "commandlist-notification/chat": "\tch [message] - send a chat message in a room", # TODO: Translate + "commandlist-notification/chat": "\tch [message] - Chatnachricht an einem Raum senden", "syncplay-version-notification": "Syncplay Version: {}", # syncplay.version "more-info-notification": "Weitere Informationen auf: {}", # projectURL @@ -108,18 +108,18 @@ de = { "mpc-be-version-insufficient-error": "MPC-Version nicht ausreichend, bitte nutze `mpc-be` >= `{}`", "mpv-version-error": "Syncplay ist nicht kompatibel mit dieser Version von mpv. Bitte benutze eine andere Version (z.B. Git HEAD).", "player-file-open-error": "Fehler beim Öffnen der Datei durch den Player", - "player-path-error": "Ungültiger Player-Pfad. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end + "player-path-error": "Ungültiger Player-Pfad. Unterstützte Player sind: mpv, mpv.net, VLC, MPC-HC, MPC-BE und mplayer2", "hostname-empty-error": "Hostname darf nicht leer sein", "empty-error": "{} darf nicht leer sein", # Configuration "media-player-error": "Player-Fehler: \"{}\"", # Error line "unable-import-gui-error": "Konnte die GUI-Bibliotheken nicht importieren. PySide muss installiert sein, damit die grafische Oberfläche funktioniert.", - "unable-import-twisted-error": "Could not import Twisted. Please install Twisted v12.1.0 or later.", #To do: translate + "unable-import-twisted-error": "Twisted konnte nicht importiert werden. Bitte installiere Twisted v16.4.0 oder höher", "arguments-missing-error": "Notwendige Argumente fehlen, siehe --help", "unable-to-start-client-error": "Client kann nicht gestartet werden", - "player-path-config-error": "Player-Pfad ist nicht ordnungsgemäß gesetzt. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2.", # To do: Translate end + "player-path-config-error": "Player-Pfad ist nicht ordnungsgemäß gesetzt. Unterstützte Player sind: mpv, mpv.net, VLC, MPC-HC, MPC-BE und mplayer2", "no-file-path-config-error": "Es muss eine Datei ausgewählt werden, bevor der Player gestartet wird.", "no-hostname-config-error": "Hostname darf nicht leer sein", "invalid-port-config-error": "Port muss gültig sein", @@ -132,24 +132,24 @@ de = { "vlc-failed-noscript": "Laut VLC ist das syncplay.lua Interface-Skript nicht installiert. Auf https://syncplay.pl/LUA/ [Englisch] findest du eine Anleitung.", "vlc-failed-versioncheck": "Diese VLC-Version wird von Syncplay nicht unterstützt. Bitte nutze VLC 2.0", - "feature-sharedPlaylists": "shared playlists", # used for not-supported-by-server-error # TODO: Translate - "feature-chat": "chat", # used for not-supported-by-server-error # TODO: Translate - "feature-readiness": "readiness", # used for not-supported-by-server-error # TODO: Translate - "feature-managedRooms": "managed rooms", # used for not-supported-by-server-error # TODO: Translate + "feature-sharedPlaylists": "Geteilte Playlists", # used for not-supported-by-server-error + "feature-chat": "Chat", # used for not-supported-by-server-error + "feature-readiness": "Bereitschaftsstatus", # used for not-supported-by-server-error + "feature-managedRooms": "Zentral gesteuerte Räume", # used for not-supported-by-server-error - "not-supported-by-server-error": "Dieses Feature wird vom Server nicht unterstützt. Es wird ein Server mit Syncplay Version {}+ benötigt, aktuell verwendet wird jedoch Version {}.", # minVersion, serverVersion - "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 # TODO: Translate - "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.", # TODO: Translate + "not-supported-by-server-error": "Diese Funktion wird vom Server nicht unterstützt. Es wird ein Server mit Syncplay Version {}+ benötigt, aktuell verwendet wird jedoch Version {}.", # minVersion, serverVersion + "shared-playlists-not-supported-by-server-error": "Die Geteilte-Playlists-Funktion wird von diesem Server eventuell nicht unterstützt. Um ein korrektes Funktionieren sicherzustellen wird ein Server mit Syncplay Version {}+ benötigt, aktuell verwendet wird jedoch Version {}.", # minVersion, serverVersion + "shared-playlists-disabled-by-server-error": "Die Geteilte-Playlists-Funktion wurde in der Serverkonfiguration deaktiviert. Um diese Funktion zu verwenden, musst du dich mit einem anderen Server verbinden.", "invalid-seek-value": "Ungültige Zeitangabe", "invalid-offset-value": "Ungültiger Offset-Wert", - "switch-file-not-found-error": "Konnte nicht zur Datei '{0}' wechseln. Syncplay looks in the specified media directories.", # File not found, folder it was not found in # TODO: Re-translate "Syncplay sucht im Ordner der aktuellen Datei und angegebenen Medien-Verzeichnissen." to reference to checking in "current media directory" - "folder-search-timeout-error": "The search for media in media directories was aborted as it took too long to search through '{}'. This will occur if you select a folder with too many sub-folders in your list of media folders to search through. For automatic file switching to work again please select File->Set Media Directories in the menu bar and remove this directory or replace it with an appropriate sub-folder. If the folder is actually fine then you can re-enable it by selecting File->Set Media Directories and pressing 'OK'.", # Folder # TODO: Translate - "folder-search-first-file-timeout-error": "The search for media in '{}' was aborted as it took too long to access the directory. This could happen if it is a network drive or if you configure your drive to spin down after a period of inactivity. For automatic file switching to work again please go to File->Set Media Directories and either remove the directory or resolve the issue (e.g. by changing power saving settings).", # Folder # TODO: Translate - "added-file-not-in-media-directory-error": "You loaded a file in '{}' which is not a known media directory. You can add this as a media directory by selecting File->Set Media Directories in the menu bar.", # Folder # TODO: Translate - "no-media-directories-error": "No media directories have been set. For shared playlist and file switching features to work properly please select File->Set Media Directories and specify where Syncplay should look to find media files.", # TODO: Translate - "cannot-find-directory-error": "Could not find media directory '{}'. To update your list of media directories please select File->Set Media Directories from the menu bar and specify where Syncplay should look to find media files.", # TODO: Translate + "switch-file-not-found-error": "Konnte nicht zur Datei „{0}“ wechseln. Syncplay sucht im Verzeichnis der aktuellen Datei und angegebenen Medienverzeichnissen.", # File not found, folder it was not found in + "folder-search-timeout-error": "Die Suche nach Medien in den Medienverzeichnissen wurde abgebrochen, weil es zu lange gedauert hat, „{}“ zu durchsuchen. Das kann passieren, wenn du in deiner Liste der Medienverzeichnisse ein Verzeichnis mit zu vielen Unterverzeichnissen auswhälst. Damit der automatische Dateiwechsel wieder funktioniert, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und entferne dieses Verzeichnis oder ersetze es mit einem geeigneten Unterverzeichnis. Wenn das Verzeichnis in Ordnung ist, kannst du es reaktivieren, indem du Datei->Medienverzeichnisse auswählen wählst und „OK“ drückst.", # Folder + "folder-search-first-file-timeout-error": "Die Suche nach Medien in den Medienverzeichnissen wurde abgebrochen, weil es zu lange gedauert hat, auf „{}“ zuzugreifen. Das kann passieren, wenn es sich dabei um ein Netzwerkgerät handelt und du eingestellt hast, dass es sich nach Inaktivität ausschaltet. Damit der automatische Dateiwechsel wieder funktioniert, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und entferne dieses Verzeichnis oder löse das Problem (z.B. indem du die Energiespareinstellungen anpasst).", # Folder + "added-file-not-in-media-directory-error": "Du hast eine Datei in im Verzeichnis „{}“ geladeden, welches kein bekanntes Medienverzeichnis ist. Du kannst es als Medienverzeichnis hinzufügen, indem du Datei->Medienverzeichnisse auswählen in der Menüleiste wählst.", # Folder + "no-media-directories-error": "Es wurden keine Medienverzeichnisse ausgewählt. Damit geteilte Playlists und Dateiwechsel korrekt funktionieren, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und gib an, wo Syncplay nach Mediendateien suchen soll.", + "cannot-find-directory-error": "Das Medienverzeichnis „{}“ konnte nicht gefunden werden. Um deine Liste an Medienverzeichnissen anzupassen, wähle Datei->Medienverzeichnisse auswählen in der Menüleiste und gib an, wo Syncplay nach Mediendateien suchen soll.", "failed-to-load-server-list-error": "Konnte die Liste der öffentlichen Server nicht laden. Bitte besuche https://www.syncplay.pl/ [Englisch] mit deinem Browser.", @@ -168,13 +168,15 @@ de = { "file-argument": 'Abzuspielende Datei', "args-argument": 'Player-Einstellungen; Wenn du Einstellungen, die mit - beginnen, nutzen willst, stelle ein einzelnes \'--\'-Argument davor', "clear-gui-data-argument": 'Setzt die Pfad- und GUI-Fenster-Daten die in den QSettings gespeichert sind zurück', - "language-argument": 'Sprache für Syncplay-Nachrichten (de/en/ru)', + "language-argument": 'Sprache für Syncplay-Nachrichten (de/en/ru/it/es/pt_BR)', "version-argument": 'gibt die aktuelle Version aus', "version-message": "Du verwendest Syncplay v. {} ({})", + "load-playlist-from-file-argument": "lädt eine Playlist aus einer Textdatei (ein Eintrag pro Zeile)", + # Client labels - "config-window-title": "Syncplay Konfiguration", + "config-window-title": "Syncplay-Konfiguration", "connection-group-title": "Verbindungseinstellungen", "host-label": "Server-Adresse:", @@ -184,7 +186,7 @@ de = { "media-setting-title": "Media-Player Einstellungen", "executable-path-label": "Pfad zum Media-Player:", - "media-path-label": "Pfad zur Datei:", # Todo: Translate to 'Path to video (optional)' + "media-path-label": "Pfad zum Video (optional):", "player-arguments-label": "Playerparameter:", "browse-label": "Durchsuchen", "update-server-list-label": "Liste aktualisieren", @@ -200,10 +202,10 @@ de = { "checkforupdatesautomatically-label": "Automatisch nach Updates suchen", "slowondesync-label": "Verlangsamen wenn nicht synchron (nicht unterstützt mit MPC-HC/BE)", "dontslowdownwithme-label": "Nie verlangsamen oder andere zurückspulen (Experimentell)", - "pausing-title": "Pausing", # TODO: Translate + "pausing-title": "Pausiere", "pauseonleave-label": "Pausieren wenn ein Benutzer austritt", - "readiness-title": "Initial readiness state", # TODO: Translate - "readyatstart-label": "Standardmäßig auf \'Bereit\' stellen", + "readiness-title": "Anfänglicher Bereitschaftsstatus", + "readyatstart-label": "Standardmäßig auf „Bereit“ stellen", "forceguiprompt-label": "Diesen Dialog nicht mehr anzeigen", "showosd-label": "OSD-Nachrichten anzeigen", @@ -228,7 +230,7 @@ de = { "messages-label": "Nachrichten", "messages-osd-title": "OSD-(OnScreenDisplay)-Einstellungen", "messages-other-title": "Weitere Display-Einstellungen", - "chat-label": "Chat", # TODO: Translate + "chat-label": "Chat", "privacy-label": "Privatsphäre", "privacy-title": "Privatsphäreneinstellungen", "unpause-title": "Wenn du Play drückst, auf Bereit setzen und:", @@ -236,36 +238,36 @@ de = { "unpause-ifothersready-option": "Wiedergeben wenn bereits als Bereit gesetzt oder alle anderen bereit sind (Standard)", "unpause-ifminusersready-option": "Wiedergeben wenn bereits als Bereit gesetzt oder die minimale Anzahl anderer Nutzer bereit ist", "unpause-always": "Immer wiedergeben", - "syncplay-trusteddomains-title": "Trusted domains (for streaming services and hosted content)", # TODO: Translate into German + "syncplay-trusteddomains-title": "Vertrauenswürdige Domains (für Streamingdienste und gehostete Inhalte)", - "chat-title": "Chat message input", # TODO: Translate - "chatinputenabled-label": "Enable chat input via mpv (using enter key)", # TODO: Translate - "chatdirectinput-label": "Allow instant chat input (bypass having to press enter key to chat)", # TODO: Translate - "chatinputfont-label": "Chat input font", # TODO: Translate - "chatfont-label": "Set font", # TODO: Translate - "chatcolour-label": "Set colour", # TODO: Translate - "chatinputposition-label": "Position of message input area in mpv", # TODO: Translate - "chat-top-option": "Top", # TODO: Translate - "chat-middle-option": "Middle", # TODO: Translate - "chat-bottom-option": "Bottom", # TODO: Translate - "chatoutputheader-label": "Chat message output", # TODO: Translate - "chatoutputfont-label": "Chat output font", # TODO: Translate - "chatoutputenabled-label": "Enable chat output in media player (mpv only for now)", # TODO: Translate - "chatoutputposition-label": "Output mode", # TODO: Translate - "chat-chatroom-option": "Chatroom style", # TODO: Translate - "chat-scrolling-option": "Scrolling style", # TODO: Translate + "chat-title": "Chatnachrichten-Eingabe", + "chatinputenabled-label": "Chateingabe via mpv erlauben (mit der Entertaste)", + "chatdirectinput-label": "Sofotige Chateingabe erlauben (ohne die Entertaste zu drücken)", + "chatinputfont-label": "Chateingabe-Schriftart", + "chatfont-label": "Schriftart wählen", + "chatcolour-label": "Farbe wählen", + "chatinputposition-label": "Position des Nachrichteneingabe-Felds in mpv", + "chat-top-option": "Oben", + "chat-middle-option": "Mitte", + "chat-bottom-option": "Unten", + "chatoutputheader-label": "Chatnachrichten-Eingabe", + "chatoutputfont-label": "Chateingabe-Schriftart", + "chatoutputenabled-label": "Chatausgabe im Medienplayer aktivieren (bisher nur mpv)", + "chatoutputposition-label": "Ausgabemodus", + "chat-chatroom-option": "Chatroom-Stil", + "chat-scrolling-option": "Scrolling-Stil", - "mpv-key-tab-hint": "[TAB] to toggle access to alphabet row key shortcuts.", # TODO: Translate - "mpv-key-hint": "[ENTER] to send message. [ESC] to escape chat mode.", # TODO: Translate - "alphakey-mode-warning-first-line": "You can temporarily use old mpv bindings with a-z keys.", # TODO: Translate - "alphakey-mode-warning-second-line": "Press [TAB] to return to Syncplay chat mode.", # TODO: Translate + "mpv-key-tab-hint": "[TAB] um Zugriff auf die Buchstabentastenkürzel ein-/auszuschalten.", + "mpv-key-hint": "[ENTER] um eine Nachricht zu senden. [ESC] um den Chatmodus zu verlassen.", + "alphakey-mode-warning-first-line": "Du kannst vorübergehend die alten mpv-Tastaturkürzel mit den a–z-Tasten verwenden.", + "alphakey-mode-warning-second-line": "Drücke [TAB], um in den Syncplay-Chatmodus zurückzukehren.", "help-label": "Hilfe", - "reset-label": "Standardwerte zurücksetzen", + "reset-label": "Auf Standardwerte zurücksetzen", "run-label": "Syncplay starten", "storeandrun-label": "Konfiguration speichern und Syncplay starten", - "contact-label": "Du hast eine Idee, einen Bug gefunden oder möchtest Feedback geben? Sende eine E-Mail an dev@syncplay.pl, chatte auf dem #Syncplay IRC-Kanal auf irc.freenode.net oder öffne eine Fehlermeldung auf GitHub. Außerdem findest du auf https://syncplay.pl/ weitere Informationen, Hilfestellungen und Updates. OTE: Chat messages are not encrypted so do not use Syncplay to send sensitive information.", # TODO: Translate last sentence + "contact-label": "Du hast eine Idee, einen Bug gefunden oder möchtest Feedback geben? Sende eine E-Mail an dev@syncplay.pl, chatte auf dem #Syncplay IRC-Kanal auf irc.freenode.net oder öffne eine Fehlermeldung auf GitHub. Außerdem findest du auf https://syncplay.pl/ weitere Informationen, Hilfestellungen und Updates. Chatnachrichten sind nicht verschlüsselt, also verwende Syncplay nicht, um sensible Daten zu verschicken.", "joinroom-label": "Raum beitreten", "joinroom-menu-label": "Raum beitreten {}", # TODO: Might want to fix this @@ -278,9 +280,9 @@ de = { "autoplay-guipushbuttonlabel": "Automatisch abspielen wenn alle bereit sind", "autoplay-minimum-label": "Minimum an Nutzern:", - "sendmessage-label": "Send", # TODO: Translate + "sendmessage-label": "Senden", - "ready-guipushbuttonlabel": "Ich bin bereit den Film anzuschauen!", + "ready-guipushbuttonlabel": "Ich bin bereit zum Gucken!", "roomuser-heading-label": "Raum / Benutzer", "size-heading-label": "Größe", @@ -294,15 +296,23 @@ de = { "file-menu-label": "&Datei", # & precedes shortcut key "openmedia-menu-label": "&Mediendatei öffnen...", "openstreamurl-menu-label": "&Stream URL öffnen", - "setmediadirectories-menu-label": "Set media &directories", # TODO: Translate + "setmediadirectories-menu-label": "Medienverzeichnisse &auswählen", + "loadplaylistfromfile-menu-label": "&Lade Playlist aus Datei", + "saveplaylisttofile-menu-label": "&Speichere Playlist in Datei", "exit-menu-label": "&Beenden", "advanced-menu-label": "&Erweitert", "window-menu-label": "&Fenster", "setoffset-menu-label": "&Offset einstellen", "createcontrolledroom-menu-label": "&Zentral gesteuerten Raum erstellen", "identifyascontroller-menu-label": "Als Raumleiter &identifizieren", - "settrusteddomains-menu-label": "Set &trusted domains", # TODO: Translate - "addtrusteddomain-menu-label": "Add {} as trusted domain", # Domain # TODO: Translate + "settrusteddomains-menu-label": "&Vertrauenswürdige Domains auswählen", + "addtrusteddomain-menu-label": "{} als vertrauenswürdige Domain hinzufügen", # Domain + + "edit-menu-label": "&Bearbeiten", + "cut-menu-label": "Aus&schneiden", + "copy-menu-label": "&Kopieren", + "paste-menu-label": "&Einsetzen", + "selectall-menu-label": "&Alles auswälhen", "playback-menu-label": "&Wiedergabe", @@ -310,39 +320,39 @@ de = { "userguide-menu-label": "&Benutzerhandbuch öffnen", "update-menu-label": "auf &Aktualisierung prüfen", - # startTLS messages - TODO: Translate - "startTLS-initiated": "Attempting secure connection", - "startTLS-secure-connection-ok": "Secure connection established ({})", - "startTLS-server-certificate-invalid": 'Secure connection failed. The server uses an invalid security certificate. This communication could be intercepted by a third party. For further details and troubleshooting see here.', - "startTLS-not-supported-client": "This client does not support TLS", - "startTLS-not-supported-server": "This server does not support TLS", + # startTLS messages + "startTLS-initiated": "Sichere Verbindung wird versucht", + "startTLS-secure-connection-ok": "Sichere Verbindung hergestellt ({})", + "startTLS-server-certificate-invalid": 'Sichere Verbindung fehlgeschlagen. Der Server benutzt ein ungültiges Sicherheitszertifikat. Der Kanal könnte von Dritten abgehört werden. Für weitere Details und Problemlösung siehe hier [Englisch].', + "startTLS-not-supported-client": "Dieser Server unterstützt kein TLS", + "startTLS-not-supported-server": "Dieser Server unterstützt kein TLS", - # TLS certificate dialog - TODO: Translate - "tls-information-title": "Certificate Details", - "tls-dialog-status-label": "Syncplay is using an encrypted connection to {}.", - "tls-dialog-desc-label": "Encryption with a digital certificate keeps information private as it is sent to or from the
server {}.", - "tls-dialog-connection-label": "Information encrypted using Transport Layer Security (TLS), version {} with the cipher
suite: {}.", - "tls-dialog-certificate-label": "Certificate issued by {} valid until {}.", + # TLS certificate dialog + "tls-information-title": "Zertifikatdetails", + "tls-dialog-status-label": "Syncplay nutzt eine verschlüsselte Verbindung zu {}.", + "tls-dialog-desc-label": "Verschlüsselung mit einem digitalen Zertifikat hält Informationen geheim, die vom Server {} gesendet oder empfangen werden.", + "tls-dialog-connection-label": "Daten werden verschlüsselt mit Transport Layer Security (TLS) Version {} und
folgender Chiffre: {}.", + "tls-dialog-certificate-label": "Zertifikat ausgestellt durch {} gültig bis {}.", - # About dialog - TODO: Translate - "about-menu-label": "&About Syncplay", - "about-dialog-title": "About Syncplay", - "about-dialog-release": "Version {} release {}", - "about-dialog-license-text": "Licensed under the Apache License, Version 2.0", - "about-dialog-license-button": "License", - "about-dialog-dependencies": "Dependencies", + # About dialog + "about-menu-label": "&Über Syncplay", + "about-dialog-title": "Über Syncplay", + "about-dialog-release": "Version {} Release {}", + "about-dialog-license-text": "Lizensiert unter der Apache-Lizenz Version 2.0", + "about-dialog-license-button": "Lizenz", + "about-dialog-dependencies": "Abhängigkeiten", "setoffset-msgbox-label": "Offset einstellen", "offsetinfo-msgbox-label": "Offset (siehe https://syncplay.pl/guide/ für eine Anleitung [Englisch]):", - "promptforstreamurl-msgbox-label": "Stream URL öffnen", - "promptforstreamurlinfo-msgbox-label": "Stream URL", + "promptforstreamurl-msgbox-label": "Stream-URL öffnen", + "promptforstreamurlinfo-msgbox-label": "Stream-URL", - "addfolder-label": "Add folder", # TODO: Translate + "addfolder-label": "Verzeichnis hinzufügen", - "adduris-msgbox-label": "Add URLs to playlist (one per line)", # TODO: Translate - "editplaylist-msgbox-label": "Set playlist (one per line)", # TODO: Translate - "trusteddomains-msgbox-label": "Domains it is okay to automatically switch to (one per line)", # TODO: Translate + "adduris-msgbox-label": "URLs zur Playlist hinzufügen (ein Eintrag pro Zeile)", + "editplaylist-msgbox-label": "Playlist auswählen (ein Eintrag pro Zeile)", + "trusteddomains-msgbox-label": "Domains, zu denen automatisch gewechselt werden darf (ein Eintrag pro Zeile)", "createcontrolledroom-msgbox-label": "Zentral gesteuerten Raum erstellen", "controlledroominfo-msgbox-label": "Namen des zentral gesteuerten Raums eingeben\r\n(siehe https://syncplay.pl/guide/ für eine Anleitung [Englisch]):", @@ -362,9 +372,9 @@ de = { "room-tooltip": "Der Raum, der betreten werden soll, kann ein x-beliebiger sein. Allerdings werden nur Clients im selben Raum synchronisiert.", "executable-path-tooltip": "Pfad zum ausgewählten, unterstützten Mediaplayer (MPC-HC, MPC-BE, VLC, mplayer2 or mpv).", - "media-path-tooltip": "Pfad zum wiederzugebenden Video oder Stream. Notwendig für mplayer2.", # TODO: Confirm translation - "player-arguments-tooltip": "Zusätzliche Kommandozeilenparameter / -schalter für diesen Mediaplayer.", - "mediasearcdirectories-arguments-tooltip": "Verzeichnisse, in denen Syncplay nach Mediendateien suchen soll, z.B. wenn du das Click-to-switch-Feature verwendest. Syncplay wird rekursiv Unterordner durchsuchen.", # TODO: Translate Click-to-switch? (or use as name for feature) + "media-path-tooltip": "Pfad zum wiederzugebenden Video oder Stream. Notwendig für mplayer2.", + "player-arguments-tooltip": "Zusätzliche Kommandozeilenparameter/-schalter für diesen Mediaplayer.", + "mediasearcdirectories-arguments-tooltip": "Verzeichnisse, in denen Syncplay nach Mediendateien suchen soll, z.B. wenn du die Click-to-switch-Funktion verwendest. Syncplay wird Unterverzeichnisse rekursiv durchsuchen.", # TODO: Translate Click-to-switch? (or use as name for feature) "more-tooltip": "Weitere Einstellungen anzeigen.", "filename-privacy-tooltip": "Privatheitsmodus beim Senden des Namens der aktuellen Datei zum Server.", @@ -378,11 +388,11 @@ de = { "fastforwardondesync-label": "Vorspulen wenn das Video laggt (empfohlen)", "dontslowdownwithme-tooltip": "Lässt andere nicht langsamer werden oder zurückspringen, wenn deine Wiedergabe hängt.", "pauseonleave-tooltip": "Wiedergabe anhalten, wenn deine Verbindung verloren geht oder jemand den Raum verlässt.", - "readyatstart-tooltip": "Zu Beginn auf 'Bereit' setzen (sonst bist du als 'Nicht Bereit' gesetzt, bis du den Status änderst)", + "readyatstart-tooltip": "Zu Beginn auf „Bereit“ setzen (sonst bist du als „Nicht Bereit“ gesetzt, bis du den Status änderst)", "forceguiprompt-tooltip": "Der Konfigurationsdialog wird nicht angezeigt, wenn eine Datei mit Syncplay geöffnet wird.", "nostore-tooltip": "Syncplay mit den angegebenen Einstellungen starten, diese aber nicht dauerhaft speichern.", "rewindondesync-tooltip": "Zum Wiederherstellen der Synchronität in der Zeit zurückspringen (empfohlen)", - "fastforwardondesync-tooltip": "Nach vorne springen, wenn asynchron zum Raumleiter (oder deine vorgetäuschte Position, falls 'Niemals verlangsamen oder andere zurückspulen' aktiviert ist).", + "fastforwardondesync-tooltip": "Nach vorne springen, wenn asynchron zum Raumleiter (oder deine vorgetäuschte Position, falls „Niemals verlangsamen oder andere zurückspulen“ aktiviert ist).", "showosd-tooltip": "Syncplay-Nachrichten auf dem OSD (= OnScreenDisplay, ein eingeblendetes Textfeld) des Players anzeigen.", "showosdwarnings-tooltip": "Warnungen bei Unterschiedlichen Dateien oder Alleinsein im Raum anzeigen.", "showsameroomosd-tooltip": "OSD-Meldungen über Ereignisse im selben Raum anzeigen.", @@ -395,36 +405,36 @@ de = { "unpause-ifalreadyready-tooltip": "Wenn du nicht bereit bist und Play drückst wirst du als bereit gesetzt - zum Starten der Wiedergabe nochmal drücken.", "unpause-ifothersready-tooltip": "Wenn du Play drückst und nicht bereit bist, wird nur gestartet, wenn alle anderen bereit sind.", "unpause-ifminusersready-tooltip": "Wenn du Play drückst und nicht bereit bist, wird nur gestartet, wenn die minimale Anzahl anderer Benutzer bereit ist.", - "trusteddomains-arguments-tooltip": "Domains that it is okay for Syncplay to automatically switch to when shared playlists is enabled.", # TODO: Translate into German + "trusteddomains-arguments-tooltip": "Domains, zu denen Syncplay automatisch wechself darf, wenn geteilte Playlists aktiviert sind.", - "chatinputenabled-tooltip": "Enable chat input in mpv (press enter to chat, enter to send, escape to cancel)", # TODO: Translate - "chatdirectinput-tooltip": "Skip having to press 'enter' to go into chat input mode in mpv. Press TAB in mpv to temporarily disable this feature.", # TODO: Translate - "font-label-tooltip": "Font used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", # TODO: Translate - "set-input-font-tooltip": "Font family used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", # TODO: Translate - "set-input-colour-tooltip": "Font colour used for when entering chat messages in mpv. Client-side only, so doesn't affect what other see.", # TODO: Translate - "chatinputposition-tooltip": "Location in mpv where chat input text will appear when you press enter and type.", # TODO: Translate - "chatinputposition-top-tooltip": "Place chat input at top of mpv window.", # TODO: Translate - "chatinputposition-middle-tooltip": "Place chat input in dead centre of mpv window.", # TODO: Translate - "chatinputposition-bottom-tooltip": "Place chat input at bottom of mpv window.", # TODO: Translate - "chatoutputenabled-tooltip": "Show chat messages in OSD (if supported by media player).", # TODO: Translate - "font-output-label-tooltip": "Chat output font.", # TODO: Translate - "set-output-font-tooltip": "Font used for when displaying chat messages.", # TODO: Translate - "chatoutputmode-tooltip": "How chat messages are displayed.", # TODO: Translate - "chatoutputmode-chatroom-tooltip": "Display new lines of chat directly below previous line.", # TODO: Translate - "chatoutputmode-scrolling-tooltip": "Scroll chat text from right to left.", # TODO: Translate + "chatinputenabled-tooltip": "Chateingabe in mpv aktivieren (Drücke Enter zum Chatten, Enter zum Senden, Esc um abzubrechen)", + "chatdirectinput-tooltip": "Überspringe, Enter drücken zu müssen, um in mpv in den Chatmodus zu gelangen. Drücke TAB, um diese Funktion vorübergehend zu deaktivieren.", + "font-label-tooltip": "Schriftart für die Darstellung der Chateingabe in mpv. Nur clientseitig, beeinflusst also nicht, was andere sehen.", + "set-input-font-tooltip": "Schriftfamilie für die Darstellung der Chateingabe in mpv. Nur clientseitig, beeinflusst also nicht, was andere sehen.", + "set-input-colour-tooltip": "Schriftfarbe für die Darstellung der Chateingabe in mpv. Nur clientseitig, beeinflusst also nicht, was andere sehen.", + "chatinputposition-tooltip": "Position in mpv, an der Text der Chateingabe erscheint, wenn du Enter drückst und tippst.", + "chatinputposition-top-tooltip": "Chateingabe oben im mpv-Fenster platzieren.", + "chatinputposition-middle-tooltip": "Chateingabe mittig im mpv-Fenster platzieren.", + "chatinputposition-bottom-tooltip": "Chateingabe unten im mpv-Fenster platzieren.", + "chatoutputenabled-tooltip": "Chatnachrichten im OSD anzeigen (sofern vom Medienplayer unterstützt).", + "font-output-label-tooltip": "Chatausgabe-Schriftart.", + "set-output-font-tooltip": "Schriftart für die Darstellung von Chatnachrichten.", + "chatoutputmode-tooltip": "Wie Chatnachrichten dargestellt werden.", + "chatoutputmode-chatroom-tooltip": "Neue Chatzeilen unmittelbar unterder vorangehenden Zeile anzeigen.", + "chatoutputmode-scrolling-tooltip": "Chat-Text von rechts nach links scrollen lassen", "help-tooltip": "Öffnet Hilfe auf syncplay.pl [Englisch]", "reset-tooltip": "Alle Einstellungen auf Standardwerte zurücksetzen.", "update-server-list-tooltip": "Mit syncplay.pl verbinden um die Liste öffentlicher Server zu aktualisieren.", - "sslconnection-tooltip": "Securely connected to server. Click for certificate details.", # TODO: Translate + "sslconnection-tooltip": "Sicher mit Server verbunden. Klicken, um Zertifikatdetails anzuzeigen.", "joinroom-tooltip": "Den aktuellen Raum verlassen und stattdessen den angegebenen betreten.", "seektime-msgbox-label": "Springe zur angegebenen Zeit (in Sekunden oder min:sek). Verwende +/- zum relativen Springen.", "ready-tooltip": "Zeigt an, ob du bereit zum anschauen bist", "autoplay-tooltip": "Automatisch abspielen, wenn alle Nutzer bereit sind oder die minimale Nutzerzahl erreicht ist.", "switch-to-file-tooltip": "Doppelklicken um zu {} zu wechseln", # Filename - "sendmessage-tooltip": "Send message to room", # TODO: Translate + "sendmessage-tooltip": "Nachricht an Raum senden", # In-userlist notes (GUI) "differentsize-note": "Verschiedene Größe!", @@ -437,7 +447,7 @@ de = { # Server notifications "welcome-server-notification": "Willkommen zum Syncplay-Server, v. {0}", # version - "client-connected-room-server-notification": "{0}({2}) hat den Raum '{1}' betreten", # username, host, room + "client-connected-room-server-notification": "{0}({2}) hat den Raum „{1}“ betreten", # username, host, room "client-left-server-notification": "{0} hat den Server verlassen", # name "no-salt-notification": "WICHTIGER HINWEIS: Damit von dem Server generierte Passwörter für geführte Räume auch nach einem Serverneustart funktionieren, starte den Server mit dem folgenden Parameter: --salt {}", # Salt @@ -445,52 +455,52 @@ de = { "server-argument-description": 'Anwendung, um mehrere MPlayer, MPC-HC/BE und VLC-Instanzen über das Internet zu synchronisieren. Server', "server-argument-epilog": 'Wenn keine Optionen angegeben sind, werden die _config-Werte verwendet', "server-port-argument": 'Server TCP-Port', - "server-password-argument": 'Server Passwort', + "server-password-argument": 'Server-Passwort', "server-isolate-room-argument": 'Sollen die Räume isoliert sein?', "server-salt-argument": "zufällige Zeichenkette, die zur Erstellung von Passwörtern verwendet wird", "server-disable-ready-argument": "Bereitschaftsfeature deaktivieren", "server-motd-argument": "Pfad zur Datei, von der die Nachricht des Tages geladen wird", - "server-chat-argument": "Should chat be disabled?", # TODO: Translate - "server-chat-maxchars-argument": "Maximum number of characters in a chat message (default is {})", # TODO: Translate - "server-maxusernamelength-argument": "Maximum number of characters in a username (default is {})", # TODO: Translate - "server-stats-db-file-argument": "Enable server stats using the SQLite db file provided", # TODO: Translate - "server-startTLS-argument": "Enable TLS connections using the certificate files in the path provided", # TODO: Translate + "server-chat-argument": "Soll Chat deaktiviert werden?", + "server-chat-maxchars-argument": "Maximale Zeichenzahl in einer Chatnachricht (Standard ist {})", + "server-maxusernamelength-argument": "Maximale Zeichenzahl in einem Benutzernamen (Standard ist {})", + "server-stats-db-file-argument": "Aktiviere Server-Statistiken mithilfe der bereitgestellten SQLite-db-Datei", + "server-startTLS-argument": "Erlaube TLS-Verbindungen mit den Zertifikatdateien im Angegebenen Pfad", "server-messed-up-motd-unescaped-placeholders": "Die Nachricht des Tages hat unmaskierte Platzhalter. Alle $-Zeichen sollten verdoppelt werden ($$).", "server-messed-up-motd-too-long": "Die Nachricht des Tages ist zu lang - Maximal {} Zeichen, aktuell {}.", # Server errors "unknown-command-server-error": "Unbekannter Befehl {}", # message "not-json-server-error": "Kein JSON-String {}", # message - "line-decode-server-error": "Not a utf-8 string", # TODO: Translate + "line-decode-server-error": "Keine utf-8-Zeichenkette", "not-known-server-error": "Der Server muss dich kennen, bevor du diesen Befehl nutzen kannst", "client-drop-server-error": "Client verloren: {} -- {}", # host, error "password-required-server-error": "Passwort nötig", "wrong-password-server-error": "Ungültiges Passwort", "hello-server-error": "Zu wenige Hello-Argumente", - # Playlists TODO: Translate all this to German - "playlist-selection-changed-notification": "{} changed the playlist selection", # Username - "playlist-contents-changed-notification": "{} updated the playlist", # Username - "cannot-find-file-for-playlist-switch-error": "Could not find file {} in media directories for playlist switch!", # Filename - "cannot-add-duplicate-error": "Could not add second entry for '{}' to the playlist as no duplicates are allowed.", # Filename - "cannot-add-unsafe-path-error": "Could not automatically load {} because it is not on a trusted domain. You can switch to the URL manually by double clicking it in the playlist, and add trusted domains via File->Advanced->Set Trusted Domains. If you right click on a URL then you can add its domain as a trusted domain via the context menu.", # Filename - "sharedplaylistenabled-label": "Enable shared playlists", - "removefromplaylist-menu-label": "Remove from playlist", - "shuffleremainingplaylist-menu-label": "Shuffle remaining playlist", - "shuffleentireplaylist-menu-label": "Shuffle entire playlist", - "undoplaylist-menu-label": "Undo last change to playlist", - "addfilestoplaylist-menu-label": "Add file(s) to bottom of playlist", - "addurlstoplaylist-menu-label": "Add URL(s) to bottom of playlist", - "editplaylist-menu-label": "Edit playlist", + # Playlists + "playlist-selection-changed-notification": "{} hat die Playlist-Auswahl geändert", # Username + "playlist-contents-changed-notification": "{} hat die Playlist aktualisiert", # Username + "cannot-find-file-for-playlist-switch-error": "Die Datei {} konnte zum Dateiwechsel nicht in den Medienverzeichnissen gefunden werden!", # Filename + "cannot-add-duplicate-error": "Konnte zweiten Eintrag für „{}“ nicht zur Playlist hinzufügen, weil Dubletten nicht erlaubt sind.", # Filename + "cannot-add-unsafe-path-error": "{} konnte nicht automatisch geladen werden, weil es sich nicht um eine vertrauenswürdige Domain handelt. Du kannst manuell zu der URL wechseln, indem du sie in der Playlist doppelklickst oder vertrauenswürdige Domains unter Datei->Erweitert->Vertrauenswürdige Domains auswählen hinzufügst. Wenn du einen Rechtsklick auf eine URL ausführst, kannst du ihre Domain im Kontextmenü als vertrauenswürdig hinzufügen.", # Filename + "sharedplaylistenabled-label": "Geteilte Playlists aktivieren", + "removefromplaylist-menu-label": "Von Playlist entfernen", + "shuffleremainingplaylist-menu-label": "Verbleibende Playlist shuffeln", + "shuffleentireplaylist-menu-label": "Gesamte Playlist shuffeln", + "undoplaylist-menu-label": "Letze Playlist-Änderung rückgängig machen", + "addfilestoplaylist-menu-label": "Datei(en) zum Ende der Playlist hinzufügen", + "addurlstoplaylist-menu-label": "URL(s) zum Ende der Playlist hinzufügen", + "editplaylist-menu-label": "Playlist bearbeiten", - "open-containing-folder": "Open folder containing this file", - "addusersfiletoplaylist-menu-label": "Add {} file to playlist", # item owner indicator - "addusersstreamstoplaylist-menu-label": "Add {} stream to playlist", # item owner indicator - "openusersstream-menu-label": "Open {} stream", # [username]'s - "openusersfile-menu-label": "Open {} file", # [username]'s - "item-is-yours-indicator": "your", # Goes with addusersfiletoplaylist/addusersstreamstoplaylist - "item-is-others-indicator": "{}'s", # username - goes with addusersfiletoplaylist/addusersstreamstoplaylist + "open-containing-folder": "Übergeordnetes Verzeichnis der Datei öffnen", + "addyourfiletoplaylist-menu-label": "Deine Datei zur Playlist hinzufügen", + "addotherusersfiletoplaylist-menu-label": "{}s Datei zur Playlist hinzufügen", # [Username] + "addyourstreamstoplaylist-menu-label": "Deinen Stream zur Playlist hinzufügen", + "addotherusersstreamstoplaylist-menu-label": "{}s Stream zur Playlist hinzufügen", # [Username] + "openusersstream-menu-label": "{}s Stream öffnen", # [username]'s + "openusersfile-menu-label": "{}s Datei öffnen", # [username]'s - "playlist-instruction-item-message": "Drag file here to add it to the shared playlist.", - "sharedplaylistenabled-tooltip": "Room operators can add files to a synced playlist to make it easy for everyone to watching the same thing. Configure media directories under 'Misc'.", + "playlist-instruction-item-message": "Zieh eine Datei hierher, um sie zur geteilten Playlist hinzuzufügen.", + "sharedplaylistenabled-tooltip": "Raumleiter können Dateien zu einer geteilten Playlist hinzufügen und es so erleichtern, gemeinsam das Gleiche zu gucken. Konfiguriere Medienverzeichnisse unter „Diverse“", } diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 9474452..0ad1f34 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -16,7 +16,7 @@ en = { "connection-failed-notification": "Connection with server failed", "connected-successful-notification": "Successfully connected to server", "retrying-notification": "%s, Retrying in %d seconds...", # Seconds - "handshake-successful-notification": "Connection established with {} ({})", + "reachout-successful-notification": "Successfully reached {} ({})", "rewind-notification": "Rewinded due to time difference with {}", # User "fastforward-notification": "Fast-forwarded due to time difference with {}", # User @@ -108,18 +108,18 @@ en = { "mpc-be-version-insufficient-error": "MPC version not sufficient, please use `mpc-be` >= `{}`", "mpv-version-error": "Syncplay is not compatible with this version of mpv. Please use a different version of mpv (e.g. Git HEAD).", "player-file-open-error": "Player failed opening file", - "player-path-error": "Player path is not set properly. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2", + "player-path-error": "Player path is not set properly. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", "hostname-empty-error": "Hostname can't be empty", "empty-error": "{} can't be empty", # Configuration "media-player-error": "Media player error: \"{}\"", # Error line "unable-import-gui-error": "Could not import GUI libraries. If you do not have PySide installed then you will need to install it for the GUI to work.", - "unable-import-twisted-error": "Could not import Twisted. Please install Twisted v12.1.0 or later.", + "unable-import-twisted-error": "Could not import Twisted. Please install Twisted v16.4.0 or later.", "arguments-missing-error": "Some necessary arguments are missing, refer to --help", "unable-to-start-client-error": "Unable to start client", - "player-path-config-error": "Player path is not set properly. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2.", + "player-path-config-error": "Player path is not set properly. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", "no-file-path-config-error": "File must be selected before starting your player", "no-hostname-config-error": "Hostname can't be empty", "invalid-port-config-error": "Port must be valid", @@ -168,11 +168,13 @@ en = { "file-argument": 'file to play', "args-argument": 'player options, if you need to pass options starting with - prepend them with single \'--\' argument', "clear-gui-data-argument": 'resets path and window state GUI data stored as QSettings', - "language-argument": 'language for Syncplay messages (de/en/ru)', + "language-argument": 'language for Syncplay messages (de/en/ru/it/es/pt_BR)', "version-argument": 'prints your version', "version-message": "You're using Syncplay version {} ({})", + "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", + # Client labels "config-window-title": "Syncplay configuration", @@ -297,6 +299,8 @@ en = { "openmedia-menu-label": "&Open media file", "openstreamurl-menu-label": "Open &media stream URL", "setmediadirectories-menu-label": "Set media &directories", + "loadplaylistfromfile-menu-label": "&Load playlist from file", + "saveplaylisttofile-menu-label": "&Save playlist to file", "exit-menu-label": "E&xit", "advanced-menu-label": "&Advanced", "window-menu-label": "&Window", @@ -306,6 +310,12 @@ en = { "settrusteddomains-menu-label": "Set &trusted domains", "addtrusteddomain-menu-label": "Add {} as trusted domain", # Domain + "edit-menu-label": "&Edit", + "cut-menu-label": "Cu&t", + "copy-menu-label": "&Copy", + "paste-menu-label": "&Paste", + "selectall-menu-label": "&Select All", + "playback-menu-label": "&Playback", "help-menu-label": "&Help", @@ -392,7 +402,7 @@ en = { "language-tooltip": "Language to be used by Syncplay.", "unpause-always-tooltip": "If you press unpause it always sets you as ready and unpause, rather than just setting you as ready.", "unpause-ifalreadyready-tooltip": "If you press unpause when not ready it will set you as ready - press unpause again to unpause.", - "unpause-ifothersready-tooltip": "If you press unpause when not ready, it will only upause if others are ready.", + "unpause-ifothersready-tooltip": "If you press unpause when not ready, it will only unpause if others are ready.", "unpause-ifminusersready-tooltip": "If you press unpause when not ready, it will only unpause if others are ready and minimum users threshold is met.", "trusteddomains-arguments-tooltip": "Domains that it is okay for Syncplay to automatically switch to when shared playlists is enabled.", @@ -484,12 +494,12 @@ en = { "editplaylist-menu-label": "Edit playlist", "open-containing-folder": "Open folder containing this file", - "addusersfiletoplaylist-menu-label": "Add {} file to playlist", # item owner indicator - "addusersstreamstoplaylist-menu-label": "Add {} stream to playlist", # item owner indicator - "openusersstream-menu-label": "Open {} stream", # [username]'s - "openusersfile-menu-label": "Open {} file", # [username]'s - "item-is-yours-indicator": "your", # Goes with addusersfiletoplaylist/addusersstreamstoplaylist - "item-is-others-indicator": "{}'s", # username - goes with addusersfiletoplaylist/addusersstreamstoplaylist + "addyourfiletoplaylist-menu-label": "Add your file to playlist", + "addotherusersfiletoplaylist-menu-label": "Add {}'s file to playlist", # [Username] + "addyourstreamstoplaylist-menu-label": "Add your stream to playlist", + "addotherusersstreamstoplaylist-menu-label": "Add {}' stream to playlist", # [Username] + "openusersstream-menu-label": "Open {}'s stream", # [username]'s + "openusersfile-menu-label": "Open {}'s file", # [username]'s "playlist-instruction-item-message": "Drag file here to add it to the shared playlist.", "sharedplaylistenabled-tooltip": "Room operators can add files to a synced playlist to make it easy for everyone to watching the same thing. Configure media directories under 'Misc'.", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py new file mode 100644 index 0000000..7763bbc --- /dev/null +++ b/syncplay/messages_es.py @@ -0,0 +1,506 @@ +# coding:utf8 + +"""Spanish dictionary""" + +es = { + "LANGUAGE": "Español", + + # Client notifications + "config-cleared-notification": "Ajustes limpiados. Los cambios serán guardados cuando almacenes una configuración válida.", + + "relative-config-notification": "Cargados los archivo(s) de configuración relativa: {}", + + "connection-attempt-notification": "Intentando conectarse a {}:{}", # Port, IP + "reconnection-attempt-notification": "Se perdió la conexión con el servidor, intentando reconectar", + "disconnection-notification": "Desconectado del servidor", + "connection-failed-notification": "La conexión con el servidor falló", + "connected-successful-notification": "Conectado al servidor exitosamente", + "retrying-notification": "%s, Reintentando en %d segundos...", # Seconds + "reachout-successful-notification": "Se alcanzó {} ({}) satisfactoriamente", + + "rewind-notification": "Rebobinado debido a diferencia de tiempo con {}", # User + "fastforward-notification": "Adelantado debido a diferencia de tiempo con {}", # User + "slowdown-notification": "Ralentizando debido a diferencia de tiempo con {}", # User + "revert-notification": "Revirtiendo a la velocidad normal", + + "pause-notification": "{} pausado", # User + "unpause-notification": "{} resumido", # User + "seek-notification": "{} saltó desde {} hasta {}", # User, from time, to time + + "current-offset-notification": "Compensación actual: {} segundos", # Offset + + "media-directory-list-updated-notification": "Se han actualizado los directorios multimedia de Syncplay.", + + "room-join-notification": "{} se unió al canal: '{}'", # User + "left-notification": "{} se fue", # User + "left-paused-notification": "{} se fue, {} pausó", # User who left, User who paused + "playing-notification": "{} está reproduciendo '{}' ({})", # User, file, duration + "playing-notification/room-addendum": " en la sala: '{}'", # Room + + "not-all-ready": "No están listos: {}", # Usernames + "all-users-ready": "Todos están listos ({} users)", # Number of ready users + "ready-to-unpause-notification": "Se te ha establecido como listo - despausa nuevamente para resumir", + "set-as-ready-notification": "Se te ha establecido como listo", + "set-as-not-ready-notification": "Se te ha establecido como no-listo", + "autoplaying-notification": "Reproduciendo automáticamente en {}...", # Number of seconds until playback will start + + "identifying-as-controller-notification": "Autentificando como el operador de la sala, con contraseña '{}'...", + "failed-to-identify-as-controller-notification": "{} falló la autentificación como operador de la sala.", + "authenticated-as-controller-notification": "{} autentificado como operador de la sala", + "created-controlled-room-notification": "Sala administrada '{}' creada con contraseña '{}'. Por favor guarda esta información para referencias futuras!", # RoomName, operatorPassword + + "file-different-notification": "El archivo que reproduces parece ser diferente al archivo de {}", # User + "file-differences-notification": "Tu archivo difiere de la(s) siguiente(s) forma(s): {}", # Differences + "room-file-differences": "Diferencias de archivo: {}", # File differences (filename, size, and/or duration) + "file-difference-filename": "nombre", + "file-difference-filesize": "tamaño", + "file-difference-duration": "duración", + "alone-in-the-room": "Estás solo en la sala", + + "different-filesize-notification": " (el tamaño de su archivo difiere con el tuyo!)", + "userlist-playing-notification": "{} está reproduciendo:", # Username + "file-played-by-notification": "Archivo: {} está siendo reproducido por:", # File + "no-file-played-notification": "{} está ahora reproduciendo un archivo", # Username + "notplaying-notification": "Personas que no reproducen algún archivo:", + "userlist-room-notification": "En sala '{}':", # Room + "userlist-file-notification": "Archivo", + "controller-userlist-userflag": "Operador", + "ready-userlist-userflag": "Listo", + + "update-check-failed-notification": "No se pudo determinar automáticamente que Syncplay {} esté actualizado. ¿Te gustaría visitar https://syncplay.pl/ para buscar actualizaciones manualmente?", # Syncplay version + "syncplay-uptodate-notification": "Syncplay está actualizado", + "syncplay-updateavailable-notification": "Una nueva versión de Syncplay está disponible. ¿Te gustaría visitar la página del lanzamiento?", + + "mplayer-file-required-notification": "Al utilizar Syncplay con mplayer se debe proveer un archivo al inicio.", + "mplayer-file-required-notification/example": "Ejemplo de uso: syncplay [opciones] [url|ubicación/]nombreDelArchivo", + "mplayer2-required": "Syncplay no es compatible con MPlayer 1.x, por favor utiliza mplayer2 o mpv", + + "unrecognized-command-notification": "Comando no reconocido", + "commandlist-notification": "Comandos disponibles:", + "commandlist-notification/room": "\tr [nombre] - cambiar de sala", + "commandlist-notification/list": "\tl - mostrar lista de usuarios", + "commandlist-notification/undo": "\tu - deshacer última búsqueda", + "commandlist-notification/pause": "\tp - activar pausa", + "commandlist-notification/seek": "\t[s][+-]tiempo - ir al tiempo definido, si no se especifica + o -, será el tiempo absoluto en segundos o min:sec", + "commandlist-notification/help": "\th - esta ayuda", + "commandlist-notification/toggle": "\tt - activa/inactiva señal que estás listo para ver", + "commandlist-notification/create": "\tc [nombre] - crear sala administrada usando el nombre de la sala actual", + "commandlist-notification/auth": "\ta [contraseña] - autentificar como operador de la sala con la contraseña de operador", + "commandlist-notification/chat": "\tch [mensaje] - enviar un mensaje en la sala", + "syncplay-version-notification": "Versión de Syncplay: {}", # syncplay.version + "more-info-notification": "Más información disponible en: {}", # projectURL + + "gui-data-cleared-notification": "Syncplay limpió la ruta y el estado de la ventana utilizado por la GUI.", + "language-changed-msgbox-label": "El lenguaje se modificará cuando ejecutes Syncplay.", + "promptforupdate-label": "¿Está bien si Syncplay comprueba por actualizaciones automáticamente y de vez en cuando?", + + "media-player-latency-warning": "Advertencia: El reproductor multimedia tardó {} segundos en responder. Si experimentas problemas de sincronización, cierra otros programas para liberar recursos del sistema; si esto no funciona, intenta con otro reproductor multimedia.", # Seconds to respond + "mpv-unresponsive-error": "mpv no ha respondido por {} segundos. Al aparecer no está funcionando correctamente. Por favor reinicia Syncplay.", # Seconds to respond + + # Client prompts + "enter-to-exit-prompt": "Presiona intro para salir\n", + + # Client errors + "missing-arguments-error": "Están faltando algunos argumentos necesarios. Por favor revisa --help", + "server-timeout-error": "La conexión con el servidor ha caducado", + "mpc-slave-error": "No se logró iniciar MPC en modo esclavo!", + "mpc-version-insufficient-error": "La versión de MPC no es suficiente, por favor utiliza `mpc-hc` >= `{}`", + "mpc-be-version-insufficient-error": "La versión de MPC no es suficiente, por favor utiliza `mpc-be` >= `{}`", + "mpv-version-error": "Syncplay no es compatible con esta versión de mpv. Por favor utiliza una versión diferente de mpv (p.ej. Git HEAD).", + "player-file-open-error": "El reproductor falló al abrir el archivo", + "player-path-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, mpv.net, VLC, MPC-HC, MPC-BE y mplayer2", + "hostname-empty-error": "El nombre del host no puede ser vacío", + "empty-error": "{} no puede ser vacío", # Configuration + "media-player-error": "Error del reproductor multimedia: \"{}\"", # Error line + "unable-import-gui-error": "No se lograron importar las librerías GUI. Si no tienes instalado PySide, entonces tendrás que instalarlo para que funcione el GUI.", + "unable-import-twisted-error": "No se logró importar Twisted. Por favor instala Twisted v16.4.0 o posterior.", + + "arguments-missing-error": "Están faltando algunos argumentos necesarios. Por favor revisa --help", + + "unable-to-start-client-error": "No se logró iniciar el cliente", + + "player-path-config-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, mpv.net, VLC, MPC-HC, MPC-BE y mplayer2.", + "no-file-path-config-error": "El archivo debe ser seleccionado antes de iniciar el reproductor", + "no-hostname-config-error": "El nombre del host no puede ser vacío", + "invalid-port-config-error": "El puerto debe ser válido", + "empty-value-config-error": "{} no puede ser vacío", # Config option + + "not-json-error": "No es una cadena de caracteres JSON válida\n", + "hello-arguments-error": "Not enough Hello arguments\n", # DO NOT TRANSLATE + "version-mismatch-error": "No coinciden las versiones del cliente y servidor\n", + "vlc-failed-connection": "Falló la conexión con VLC. Si no has instalado syncplay.lua y estás usando la última versión de VLC, por favor revisa https://syncplay.pl/LUA/ para obtener instrucciones.", + "vlc-failed-noscript": "VLC ha reportado que la interfaz syncplay.lua no se ha instalado. Por favor revisa https://syncplay.pl/LUA/ para obtener instrucciones.", + "vlc-failed-versioncheck": "Esta versión de VLC no está soportada por Syncplay.", + + "feature-sharedPlaylists": "listas de reproducción compartidas", # used for not-supported-by-server-error + "feature-chat": "chat", # used for not-supported-by-server-error + "feature-readiness": "preparación", # used for not-supported-by-server-error + "feature-managedRooms": "salas administradas", # used for not-supported-by-server-error + + "not-supported-by-server-error": "La característica {} no está soportada por este servidor..", # feature + "shared-playlists-not-supported-by-server-error": "El servidor no admite la función de listas de reproducción compartidas. Para asegurarse de que funciona correctamente, se requiere un servidor que ejecute Syncplay {}+, pero el servidor está ejecutando Syncplay {}.", # minVersion, serverVersion + "shared-playlists-disabled-by-server-error": "La función de lista de reproducción compartida no está habilitada en la configuración del servidor. Para utilizar esta función, debes conectarte a un servidor distinto.", + + "invalid-seek-value": "Valor de búsqueda inválido", + "invalid-offset-value": "Valor de desplazamiento inválido", + + "switch-file-not-found-error": "No se pudo cambiar el archivo '{0}'. Syncplay busca en los directorios de medios especificados.", # File not found + "folder-search-timeout-error": "Se anuló la búsqueda de medios en el directorio de medios, ya que tardó demasiado buscando en '{}'. Esto ocurrirá si seleccionas una carpeta con demasiadas subcarpetas en tu lista de carpetas de medios para buscar. Para que el cambio automático de archivos vuelva a funcionar, selecciona Archivo->Establecer directorios de medios en la barra de menú y elimina este directorio o reemplázalo con una subcarpeta apropiada. Si la carpeta está bien, puedes volver a reactivarlo seleccionando Archivo->Establecer directorios de medios y presionando 'OK'.", # Folder + "folder-search-first-file-timeout-error": "Se anuló la búsqueda de medios en '{}', ya que tardó demasiado buscando en acceder al directorio. Esto podría ocurrir si se trata de una unidad de red, o si tienes configurada la unidad para centrifugar luego de cierto período de inactividad. Para que el cambio automático de archivos vuelva a funcionar, por favor dirígete a Archivo->Establecer directorios de medios y elimina el directorio o resuelve el problema (p.ej. cambiando la configuración de ahorro de energía).", # Folder + "added-file-not-in-media-directory-error": "Has cargado un archivo en '{}' el cual no es un directorio de medios conocido. Puedes agregarlo como un directorio de medios seleccionado Archivo->Establecer directorios de medios en la barra de menú.", # Folder + "no-media-directories-error": "No se han establecido directorios de medios. Para que las funciones de lista de reproducción compartida y cambio de archivos funcionen correctamente, selecciona Archivo->Establecer directorios de medios y especifica dónde debe buscar Syncplay para encontrar archivos multimedia.", + "cannot-find-directory-error": "No se encontró el directorio de medios '{}'.Para actualizar tu lista de directorios de medios, seleccciona Archivo->Establecer directorios de medios desde la barra de menú y especifica dónde debe buscar Syncplay para encontrar archivos multimedia.", + + "failed-to-load-server-list-error": "Error al cargar la lista de servidor públicos. Por favor visita https://www.syncplay.pl/ en tu navegador.", + + # Client arguments + "argument-description": 'Solución para sincronizar la reproducción de múltiples instancias de reproductores de medios, a través de la red.', + "argument-epilog": 'Si no se especifican opciones, se utilizarán los valores de _config', + "nogui-argument": 'no mostrar GUI', + "host-argument": 'dirección del servidor', + "name-argument": 'nombre de usuario deseado', + "debug-argument": 'modo debug', + "force-gui-prompt-argument": 'hacer que aparezca el aviso de configuración', + "no-store-argument": 'no guardar valores en .syncplay', + "room-argument": 'sala por defecto', + "password-argument": 'contraseña del servidor', + "player-path-argument": 'ruta al ejecutable de tu reproductor', + "file-argument": 'archivo a reproducir', + "args-argument": 'opciones del reproductor, si necesitas pasar opciones que empiezan con -, pásalas utilizando \'--\'', + "clear-gui-data-argument": 'restablece ruta y los datos del estado de la ventana GUI almacenados como QSettings', + "language-argument": 'lenguaje para los mensajes de Syncplay (de/en/ru/it/es/pt_BR)', + + "version-argument": 'imprime tu versión', + "version-message": "Estás usando la versión de Syncplay {} ({})", + + "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", # TODO: Translate + + # Client labels + "config-window-title": "Configuración de Syncplay", + + "connection-group-title": "Configuración de conexión", + "host-label": "Dirección del servidor: ", + "name-label": "Nombre de usuario (opcional):", + "password-label": "Contraseña del servidor (si corresponde):", + "room-label": "Sala por defecto: ", + + "media-setting-title": "Configuración del reproductor multimedia", + "executable-path-label": "Ruta al reproductor multimedia:", + "media-path-label": "Ruta al video (opcional):", + "player-arguments-label": "Argumentos del reproductor (si corresponde):", + "browse-label": "Visualizar", + "update-server-list-label": "Actualizar lista", + + "more-title": "Mostrar más configuraciones", + "never-rewind-value": "Nunca", + "seconds-suffix": " segs", + "privacy-sendraw-option": "Enviar crudo", + "privacy-sendhashed-option": "Enviar \"hasheado\"", + "privacy-dontsend-option": "No enviar", + "filename-privacy-label": "Información del nombre de archivo:", + "filesize-privacy-label": "Información del tamaño de archivo:", + "checkforupdatesautomatically-label": "Buscar actualizaciones de Syncplay automáticamente", + "slowondesync-label": "Ralentizar si hay una desincronización menor (no soportado en MPC-HC/BE)", + "rewindondesync-label": "Rebobinar si hay una desincronización mayor (recomendado)", + "fastforwardondesync-label": "Avanzar rápidamente si hay un retraso (recomendado)", + "dontslowdownwithme-label": "Nunca ralentizar ni rebobinar a otros (experimental)", + "pausing-title": "Pausando", + "pauseonleave-label": "Pausar cuando un usuario se va (p.ej. si se desconectan)", + "readiness-title": "Estado de preparación inicial", + "readyatstart-label": "Establecerme como \"listo-para-ver\" por defecto", + "forceguiprompt-label": "No mostrar siempre la ventana de configuración de Syncplay", # (Inverted) + "showosd-label": "Activar mensajes OSD", + + "showosdwarnings-label": "Incluir advertencias (p.ej. cuando los archivos son distintos, los usuarios no están listos)", + "showsameroomosd-label": "Incluir eventos en tu sala", + "shownoncontrollerosd-label": "Incluir eventos de no-operadores en salas administradas", + "showdifferentroomosd-label": "Incluir eventos en otras salas", + "showslowdownosd-label": "Incluir notificaciones de ralentización/reversión", + "language-label": "Lenguaje:", + "automatic-language": "Predeterminado ({})", # Default language + "showdurationnotification-label": "Advertir sobre discrepancias en la duración de los medios", + "basics-label": "Básicos", + "readiness-label": "Reproducir/Pausar", + "misc-label": "Misc.", + "core-behaviour-title": "Comportamiento de la sala central", + "syncplay-internals-title": "Internos de Syncplay", + "syncplay-mediasearchdirectories-title": "Directorios para buscar medios", + "syncplay-mediasearchdirectories-label": "Directorios para buscar medios (una ruta por línea)", + "sync-label": "Sincronizar", + "sync-otherslagging-title": "Si otros se están quedando atrás...", + "sync-youlaggging-title": "Si tú te estás quedando atrás...", + "messages-label": "Mensajes", + "messages-osd-title": "Configuraciones de visualización en pantalla", + "messages-other-title": "Otras configuraciones de visualización", + "chat-label": "Chat", + "privacy-label": "Privacidad", # Currently unused, but will be brought back if more space is needed in Misc tab + "privacy-title": "Configuración de privacidad", + "unpause-title": "Si presionas reproducir, definir como listo y:", + "unpause-ifalreadyready-option": "Despausar si ya está definido como listo", + "unpause-ifothersready-option": "Despausar si ya está listo u otros en la sala están listos (predeterminado)", + "unpause-ifminusersready-option": "Despausar si ya está listo, o si todos los demás están listos y el mín. de usuarios están listos", + "unpause-always": "Siempre despausar", + "syncplay-trusteddomains-title": "Dominios de confianza (para servicios de transmisión y contenido alojado)", + + "chat-title": "Entrada de mensaje de chat", + "chatinputenabled-label": "Habilitar entrada de chat a través de mpv", + "chatdirectinput-label": "Permitir entrada de chat instantánea (omitir tener que presionar Intro para chatear)", + "chatinputfont-label": "Fuente de entrada de chat", + "chatfont-label": "Establecer fuente", + "chatcolour-label": "Establecer color", + "chatinputposition-label": "Posición del área de entrada del mensaje en mpv", + "chat-top-option": "Arriba", + "chat-middle-option": "Medio", + "chat-bottom-option": "Fondo", + "chatoutputheader-label": "Salida de mensaje de chat", + "chatoutputfont-label": "Fuente de salida de chat", + "chatoutputenabled-label": "Habilitar salida de chat en el reproductor (solo mpv por ahora)", + "chatoutputposition-label": "Modo de salida", + "chat-chatroom-option": "Estilo de sala de chat", + "chat-scrolling-option": "Estilo de desplazamiento", + + "mpv-key-tab-hint": "[TAB] para alternar acceso a los accesos directos de las teclas de la fila del alfabeto", + "mpv-key-hint": "[INTRO] para enviar mensaje. [ESC] para salir del modo de chat.", + "alphakey-mode-warning-first-line": "Puedes usar temporalmente los enlaces de mpv con las teclas a-z.", + "alphakey-mode-warning-second-line": "Presiona [TAB] para retornar al modo de chat de Syncplay.", + + "help-label": "Ayuda", + "reset-label": "Restaurar valores predeterminados", + "run-label": "Ejecutar Syncplay", + "storeandrun-label": "Almacenar la configuración y ejecutar Syncplay", + + "contact-label": "No dudes en enviar un correo electrónico a dev@syncplay.pl, chatea a través del canal de IRC #Syncplay en irc.freenode.net, reportar un problema vía GitHub, danos \"me gusta\" en Facebook, síguenos en Twitter, o visita https://syncplay.pl/. No utilices Syncplay para enviar información sensible.", + + "joinroom-label": "Unirse a la sala", + "joinroom-menu-label": "Unirse a la sala {}", + "seektime-menu-label": "Buscar tiempo", + "undoseek-menu-label": "Deshacer búsqueda", + "play-menu-label": "Reproducir", + "pause-menu-label": "Pausar", + "playbackbuttons-menu-label": "Mostrar botones de reproducción", + "autoplay-menu-label": "Mostrar botón de auto-reproducción", + "autoplay-guipushbuttonlabel": "Reproducir cuando todos estén listos", + "autoplay-minimum-label": "Mín. de usuarios:", + + "sendmessage-label": "Enviar", + + "ready-guipushbuttonlabel": "¡Estoy listo para ver!", + + "roomuser-heading-label": "Sala / Usuario", + "size-heading-label": "Tamaño", + "duration-heading-label": "Duración", + "filename-heading-label": "Nombre de archivo", + "notifications-heading-label": "Notificaciones", + "userlist-heading-label": "Lista de quién reproduce qué", + + "browseformedia-label": "Buscar archivos multimedia", + + "file-menu-label": "&Archivo", # & precedes shortcut key + "openmedia-menu-label": "A&brir archivo multimedia", + "openstreamurl-menu-label": "Abrir URL de &flujo de medios", + "setmediadirectories-menu-label": "&Establecer directorios de medios", + "loadplaylistfromfile-menu-label": "&Load playlist from file", # TODO: Translate + "saveplaylisttofile-menu-label": "&Save playlist to file", # TODO: Translate + "exit-menu-label": "&Salir", + "advanced-menu-label": "A&vanzado", + "window-menu-label": "&Ventana", + "setoffset-menu-label": "Establecer &compensación", + "createcontrolledroom-menu-label": "C&rear sala administrada", + "identifyascontroller-menu-label": "&Identificar como operador de sala", + "settrusteddomains-menu-label": "Es&tablecer dominios de confianza", + "addtrusteddomain-menu-label": "Agregar {} como dominio de confianza", # Domain + + "edit-menu-label": "&Edición", + "cut-menu-label": "Cor&tar", + "copy-menu-label": "&Copiar", + "paste-menu-label": "&Pegar", + "selectall-menu-label": "&Seleccionar todo", + + "playback-menu-label": "Re&producción", + + "help-menu-label": "A&yuda", + "userguide-menu-label": "Abrir &guía de usuario", + "update-menu-label": "Buscar actuali&zaciones", + + "startTLS-initiated": "Intentando conexión segura", + "startTLS-secure-connection-ok": "Conexión segura establecida ({})", + "startTLS-server-certificate-invalid": 'Falló la conexión segura. El servidor utiliza un certificado inválido. Esta comunicación podría ser interceptada por un tercero. Para más detalles y solución de problemas, consulta aquí.', + "startTLS-not-supported-client": "Este cliente no soporta TLS", + "startTLS-not-supported-server": "Este servidor no soporta TLS", + + # TLS certificate dialog + "tls-information-title": "Detalles del certificado", + "tls-dialog-status-label": "Syncplay está utilizando una conexión cifrada con {}.", + "tls-dialog-desc-label": "El cifrado con un certificado digital, mantiene la información privada cuando se envía hacia o desde
el servidor {}.", + "tls-dialog-connection-label": "Información cifrada utilizando \"Transport Layer Security\" (TLS), versión {} con la
suite de cifrado: {}.", + "tls-dialog-certificate-label": "Certificado emitido por {} válido hasta {}.", + + # About dialog + "about-menu-label": "Acerca de Sy&ncplay", + "about-dialog-title": "Acerca de Syncplay", + "about-dialog-release": "Versión {} lanzamiento {}", + "about-dialog-license-text": "Licenciado bajo la Licencia Apache Versión 2.0", + "about-dialog-license-button": "Licencia", + "about-dialog-dependencies": "Dependencias", + + "setoffset-msgbox-label": "Establecer compensación", + "offsetinfo-msgbox-label": "Compensación (consulta https://syncplay.pl/guide/ para obtener instrucciones de uso):", + + "promptforstreamurl-msgbox-label": "Abrir URL de flujo de medios", + "promptforstreamurlinfo-msgbox-label": "Publicar URL", + + "addfolder-label": "Agregar carpeta", + + "adduris-msgbox-label": "Agregar URLs a la lista de reproducción (una por línea)", + "editplaylist-msgbox-label": "Establecer lista de reproducción (una por línea)", + "trusteddomains-msgbox-label": "Dominios con los cuales está bien intercambiar automáticamente (uno por línea)", + + "createcontrolledroom-msgbox-label": "Crear sala administrada", + "controlledroominfo-msgbox-label": "Ingresa el nombre de la sala administrada\r\n(consulta https://syncplay.pl/guide/ para obtener instrucciones de uso):", + + "identifyascontroller-msgbox-label": "Identificar como operador de la sala", + "identifyinfo-msgbox-label": "Ingresa la contraseña de operador para esta sala\r\n(consulta https://syncplay.pl/guide/ para obtener instrucciones de uso):", + + "public-server-msgbox-label": "Selecciona el servidor público para esta sesión de visualización", + + "megabyte-suffix": " MB", + + # Tooltips + + "host-tooltip": "Nombre de host o IP para conectarse, opcionalmente incluyendo puerto (p.ej. syncplay.pl:8999). Sólo sincronizado con personas en el mismo servidor/puerto.", + "name-tooltip": "Apodo por el que se te conocerá. No hay registro, por lo que puedes cambiarlo fácilmente más tarde. Si no se especifica, se genera un nombre aleatorio.", + "password-tooltip": "Las contraseñas son sólo necesarias para conectarse a servidores privados.", + "room-tooltip": "La sala para unirse en la conexión puede ser casi cualquier cosa, pero sólo se sincronizará con las personas en la misma sala.", + + "executable-path-tooltip": "Ubicación de tu reproductor multimedia compatible elegido (mpv, VLC, MPC-HC/BE o mplayer2).", + "media-path-tooltip": "Ubicación del video o flujo que se abrirá. Necesario para mplayer2.", + "player-arguments-tooltip": "Arguementos de línea de comandos adicionales / parámetros para pasar a este reproductor multimedia.", + "mediasearcdirectories-arguments-tooltip": "Directorios donde Syncplay buscará archivos de medios, p.ej. cuando estás usando la función \"clic para cambiar\". Syncplay buscará recursivamente a través de las subcarpetas.", + + "more-tooltip": "Mostrar configuraciones usadas con menos frecuencia.", + "filename-privacy-tooltip": "Modo de privacidad para enviar el nombre del archivo que se está reproduciendo actualmente al servidor.", + "filesize-privacy-tooltip": "Modo de privacidad para enviar el tamaño del archivo que se está reproduciendo actualmente al servidor.", + "privacy-sendraw-tooltip": "Enviar esta información sin ofuscación. Ésta es la opción predeterminada en la mayoría de las funciones.", + "privacy-sendhashed-tooltip": "Enviar una versión \"hasheada\" de la información, para que sea menos visible para otros clientes.", + "privacy-dontsend-tooltip": "No enviar esta información al servidor. Esto proporciona la máxima privacidad.", + "checkforupdatesautomatically-tooltip": "Regularmente verificar con el sitio Web de Syncplay para ver si hay una nueva versión de Syncplay disponible.", + "slowondesync-tooltip": "Reducir la velocidad de reproducción temporalmente cuando sea necesario, para volver a sincronizar con otros espectadores. No soportado en MPC-HC/BE.", + "dontslowdownwithme-tooltip": "Significa que otros no se ralentizan ni rebobinan si la reproducción se retrasa. Útil para operadores de la sala.", + "pauseonleave-tooltip": "Pausa la reproducción si te desconectas o alguien sale de tu sala.", + "readyatstart-tooltip": "Establecerte como 'listo' al inicio (de lo contrario, se te establecerá como 'no-listo' hasta que cambies tu estado de preparación)", + "forceguiprompt-tooltip": "El diálogo de configuración no es mostrado cuando se abre un archivo con Syncplay.", # (Inverted) + "nostore-tooltip": "Ejecutar Syncplay con la configuración dada, pero no guardar los cambios permanentemente.", # (Inverted) + "rewindondesync-tooltip": "Retroceder cuando sea necesario para volver a sincronizar. ¡Deshabilitar esta opción puede resultar en desincronizaciones importantes!", + "fastforwardondesync-tooltip": "Saltar hacia adelante cuando no está sincronizado con el operador de la sala (o tu posición ficticia 'Nunca ralentizar o rebobinar a otros' está activada).", + "showosd-tooltip": "Envía mensajes de Syncplay al reproductor multimedia OSD.", + "showosdwarnings-tooltip": "Mostrar advertencias si se está reproduciendo un archivo diferente, solo en la sala, usuarios no están listos, etc.", + "showsameroomosd-tooltip": "Mostrar notificaciones de OSD para eventos relacionados con la sala en la que está el usuario.", + "shownoncontrollerosd-tooltip": "Mostrar notificaciones de OSD para eventos relacionados con no-operadores que están en salas administradas.", + "showdifferentroomosd-tooltip": "Mostrar notificaciones de OSD para eventos relacionados la sala en la que no está el usuario.", + "showslowdownosd-tooltip": "Mostrar notificaciones de desaceleración / diferencia de la reversión.", + "showdurationnotification-tooltip": "Útil cuando falta un segmento de un archivo de varias partes, pero puede dar lugar a falsos positivos.", + "language-tooltip": "Idioma a ser utilizado por Syncplay.", + "unpause-always-tooltip": "Si presionas despausar siempre te pone como listo y despausa, en lugar de simplemente ponerte como listo.", + "unpause-ifalreadyready-tooltip": "Si presionas despausar cuando no estás listo, te pondrá como listo - presiona despausar nuevamente para despausar.", + "unpause-ifothersready-tooltip": "Si presionas despausar cuando no estás listo, sólo se despausará si los otros están listos.", + "unpause-ifminusersready-tooltip": "Si presionas despausar cuando no estás listo, sólo se despausará si los otros están listos y se cumple con el mínimo requerido de usuarios.", + "trusteddomains-arguments-tooltip": "Dominios con los cuales está bien intercambiar automáticamente, cuando las listas de reproducción compartidas están activas.", + + "chatinputenabled-tooltip": "Activa la entrada de chat en mpv (presiona intro para chatear, intro para enviar, escape para cancelar)", + "chatdirectinput-tooltip": "Omitir tener que presionar 'intro' para ir al modo de entrada de chat en mpv. Presiona TAB en mpv para desactivar temporalmente esta función.", + "font-label-tooltip": "Fuente utilizada cuando se ingresan mensajes de chat en mpv. Sólo del lado del cliente, por lo que no afecta lo que otros ven.", + "set-input-font-tooltip": "Familia de fuentes utilizada cuando se ingresan mensajes de chat en mpv. Sólo del lado del cliente, por lo que no afecta lo que otros ven.", + "set-input-colour-tooltip": "Color de fuente utilizado cuando se ingresan mensajes de chat en mpv. Sólo del lado del cliente, por lo que no afecta lo que otros ven.", + "chatinputposition-tooltip": "Ubicación en mpv donde aparecerán los mensajes de chat cuando se presione intro y se escriba.", + "chatinputposition-top-tooltip": "Colocar la entrada del chat en la parte superior de la ventana de mpv.", + "chatinputposition-middle-tooltip": "Colocar la entrada del chat en el centro muerto de la ventana de mpv.", + "chatinputposition-bottom-tooltip": "Colocar la entrada del chat en la parte inferior de la ventana de mpv.", + "chatoutputenabled-tooltip": "Mostrar mensajes de chat en OSD (si está soportado por el reproductor multimedia).", + "font-output-label-tooltip": "Fuente de salida del chat.", + "set-output-font-tooltip": "Fuente utilizada para mostrar mensajes de chat.", + "chatoutputmode-tooltip": "Cómo se muestran los mensajes de chat.", + "chatoutputmode-chatroom-tooltip": "Mostrar nuevas líneas de chat directamente debajo de la línea anterior.", + "chatoutputmode-scrolling-tooltip": "Desplazar el texto del chat de derecha a izquierda.", + + "help-tooltip": "Abrir la guía de usuario de Syncplay.pl.", + "reset-tooltip": "Restablecer todas las configuraciones a la configuración predeterminada.", + "update-server-list-tooltip": "Conectar a syncplay.pl para actualizar la lista de servidores públicos.", + + "sslconnection-tooltip": "Conectado de forma segura al servidor. Haga clic para obtener los detalles del certificado.", + + "joinroom-tooltip": "Abandonar la sala actual y unirse a la sala especificada.", + "seektime-msgbox-label": "Saltar al tiempo especificado (en segundos / min:seg). Usar +/- para una búsqueda relativa.", + "ready-tooltip": "Indica si estás listo para ver.", + "autoplay-tooltip": "Reproducir automáticamente cuando todos los usuarios que tienen indicador de preparación están listos, y se ha alcanzado el mínimo requerido de usuarios.", + "switch-to-file-tooltip": "Hacer doble clic para cambiar a {}", # Filename + "sendmessage-tooltip": "Enviar mensaje a la sala", + + # In-userlist notes (GUI) + "differentsize-note": "¡Tamaño diferente!", + "differentsizeandduration-note": "¡Tamaño y duración diferentes!", + "differentduration-note": "¡Duración diferente!", + "nofile-note": "(No se está reproduciendo ningún archivo)", + + # Server messages to client + "new-syncplay-available-motd-message": "Estás usando Syncplay {} pero hay una versión más nueva disponible en https://syncplay.pl", # ClientVersion + + # Server notifications + "welcome-server-notification": "Bienvenido al servidor de Syncplay, ver. {0}", # version + "client-connected-room-server-notification": "{0}({2}) conectado a la sala '{1}'", # username, host, room + "client-left-server-notification": "{0} abandonó el servidor", # name + "no-salt-notification": "IMPORTANTE: Para permitir que las contraseñas del operador de la sala, generadas por esta instancia del servidor, sigan funcionando cuando se reinicie el servidor, por favor en el futuro agregar el siguiente argumento de línea de comandos al ejecutar el servidor de Syncplay: --salt {}", # Salt + + + # Server arguments + "server-argument-description": 'Solución para sincronizar la reproducción de múltiples instancias de MPlayer y MPC-HC/BE a través de la red. Instancia del servidor', + "server-argument-epilog": 'Si no se especifican opciones, serán utilizados los valores de _config', + "server-port-argument": 'puerto TCP del servidor', + "server-password-argument": 'contraseña del servidor', + "server-isolate-room-argument": '¿las salas deberían estar aisladas?', + "server-salt-argument": "cadena aleatoria utilizada para generar contraseñas de salas administradas", + "server-disable-ready-argument": "deshabilitar la función de preparación", + "server-motd-argument": "ruta al archivo del cual se obtendrá el texto motd", + "server-chat-argument": "¿Debería deshabilitarse el chat?", + "server-chat-maxchars-argument": "Número máximo de caracteres en un mensaje de chat (el valor predeterminado es {})", # Default number of characters + "server-maxusernamelength-argument": "Número máximo de caracteres para el nombre de usuario (el valor predeterminado es {})", + "server-stats-db-file-argument": "Habilitar estadísticas del servidor utilizando el archivo db SQLite proporcionado", + "server-startTLS-argument": "Habilitar conexiones TLS usando los archivos de certificado en la ruta provista", + "server-messed-up-motd-unescaped-placeholders": "El mensaje del dia contiene marcadores de posición sin escapar. Todos los signos $ deberían ser dobles ($$).", + "server-messed-up-motd-too-long": "El mensaje del día es muy largo - máximo de {} caracteres, se recibieron {}.", + + # Server errors + "unknown-command-server-error": "Comando desconocido {}", # message + "not-json-server-error": "No es una cadena JSON válida {}", # message + "line-decode-server-error": "No es una cadena utf-8", + "not-known-server-error": "Debes ser reconocido por el servidor antes de enviar este comando", + "client-drop-server-error": "Caída del cliente: {} -- {}", # host, error + "password-required-server-error": "Contraseña requerida", + "wrong-password-server-error": "Contraseña ingresada incorrecta", + "hello-server-error": "Not enough Hello arguments", # DO NOT TRANSLATE + + # Playlists + "playlist-selection-changed-notification": "{} cambió la selección de la lista de reproducción", # Username + "playlist-contents-changed-notification": "{} actualizó la lista de reproducción", # Username + "cannot-find-file-for-playlist-switch-error": "¡No se encontró el archivo {} en el directorio de medios para intercambiar en la lista de reproducción!", # Filename + "cannot-add-duplicate-error": "No se pudo agregar una segunda entrada para '{}' a la lista de reproducción ya que no se admiten duplicados.", # Filename + "cannot-add-unsafe-path-error": "No se pudo cargar automáticamente {} porque no es un dominio de confianza. Puedes intercambiar la URL manualmente dándole doble clic en la lista de reproducción, y agregar dominios de confianza vía Archivo->Avanzado->Establecer dominios de confianza. Si haces doble clic en una URL entonces puedes agregar su dominio como un dominio de confianza, desde el menú de contexto.", # Filename + "sharedplaylistenabled-label": "Activar listas de reproducción compartidas", + "removefromplaylist-menu-label": "Remover de la lista de reproducción", + "shuffleremainingplaylist-menu-label": "Mezclar el resto de la lista de reproducción", + "shuffleentireplaylist-menu-label": "Mezclar toda la lista de reproducción", + "undoplaylist-menu-label": "Deshacer el último cambio a la lista de reproducción", + "addfilestoplaylist-menu-label": "Agregar archivo(s) al final de la lista de reproducción", + "addurlstoplaylist-menu-label": "Agregar URL(s) al final de la lista de reproducción", + "editplaylist-menu-label": "Editar lista de reproducción", + + "open-containing-folder": "Abrir directorio que contiene este archivo", + "addyourfiletoplaylist-menu-label": "Agregar tu archivo a la lista de reproducción", + "addotherusersfiletoplaylist-menu-label": "Agregar el archivo de {} a la lista de reproducción", # [Username] + "addyourstreamstoplaylist-menu-label": "Agregar tu flujo a la lista de reproducción", + "addotherusersstreamstoplaylist-menu-label": "Agregar el flujo de {} a la lista de reproducción", # [Username] + "openusersstream-menu-label": "Abrir el flujo de {}", # [username]'s + "openusersfile-menu-label": "Abrir el archivo de {}", # [username]'s + + "playlist-instruction-item-message": "Desplazar aquí el archivo para agregarlo a la lista de reproducción compartida.", + "sharedplaylistenabled-tooltip": "Los operadores de la sala pueden agregar archivos a una lista de reproducción sincronizada, para que visualizar la misma cosa sea más sencillo para todos. Configurar directorios multimedia en 'Misc'.", +} diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 2153a38..7b41927 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -16,7 +16,7 @@ it = { "connection-failed-notification": "Connessione col server fallita", "connected-successful-notification": "Connessione al server effettuata con successo", "retrying-notification": "%s, Nuovo tentativo in %d secondi...", # Seconds - "handshake-successful-notification": "Connessione stabilita con {} ({})", + "reachout-successful-notification": "Collegamento stabilito con {} ({})", "rewind-notification": "Riavvolgo a causa della differenza temporale con {}", # User "fastforward-notification": "Avanzamento rapido a causa della differenza temporale con {}", # User @@ -108,18 +108,18 @@ it = { "mpc-be-version-insufficient-error": "La tua versione di MPC è troppo vecchia, per favore usa `mpc-be` >= `{}`", "mpv-version-error": "Syncplay non è compatibile con questa versione di mpv. Per favore usa un'altra versione di mpv (es. Git HEAD).", "player-file-open-error": "Il player non è riuscito ad aprire il file", - "player-path-error": "Il path del player non è configurato correttamente. I player supportati sono: mpv, VLC, MPC-HC, MPC-BE e mplayer2", + "player-path-error": "Il path del player non è configurato correttamente. I player supportati sono: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2", "hostname-empty-error": "Il campo hostname non può essere vuoto", "empty-error": "Il campo {} non può esssere vuoto", # Configuration "media-player-error": "Errore media player: \"{}\"", # Error line "unable-import-gui-error": "Non è possibile importare le librerie di interfaccia grafica. Hai bisogno di PySide per poter utilizzare l'interfaccia grafica.", - "unable-import-twisted-error": "Non è possibile importare Twisted. Si prega di installare Twisted v12.1. o superiore.", + "unable-import-twisted-error": "Non è possibile importare Twisted. Si prega di installare Twisted v16.4.0 o superiore.", "arguments-missing-error": "Alcuni argomenti obbligatori non sono stati trovati. Fai riferimento a --help", "unable-to-start-client-error": "Impossibile avviare il client", - "player-path-config-error": "Il percorso del player non è configurato correttamente. I player supportati sono: mpv, VLC, MPC-HC, MPC-BE e mplayer2.", + "player-path-config-error": "Il percorso del player non è configurato correttamente. I player supportati sono: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2.", "no-file-path-config-error": "Deve essere selezionato un file prima di avviare il player", "no-hostname-config-error": "Il campo hostname non può essere vuoto", "invalid-port-config-error": "La porta deve essere valida", @@ -168,11 +168,13 @@ it = { "file-argument": 'file da riprodurre', "args-argument": 'opzioni del player, se hai bisogno di utilizzare opzioni che iniziano con - anteponi un singolo \'--\'', "clear-gui-data-argument": 'ripristina il percorso e i dati impostati tramite interfaccia grafica e salvati come QSettings', - "language-argument": 'lingua per i messaggi di Syncplay (de/en/ru/it)', + "language-argument": 'lingua per i messaggi di Syncplay (de/en/ru/it/es/pt_BR)', "version-argument": 'mostra la tua versione', "version-message": "Stai usando la versione di Syncplay {} ({})", + "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", # TODO: Translate + # Client labels "config-window-title": "Configurazione di Syncplay", @@ -267,7 +269,7 @@ it = { "run-label": "Avvia Syncplay", "storeandrun-label": "Salva la configurazione e avvia Syncplay", - "contact-label": "Sentiti libero di inviare un'e-mail a dev@syncplay.pl, chattare tramite il canale IRC #Syncplay su irc.freenode.net, segnalare un problema su GitHub, lasciare un like sulla nostra pagina Facebook, seguirci su Twitter, o visitare https://syncplay.pl/. Non usare Syncplay per inviare dati sensibili.", # TODO: Check translation + "contact-label": "Sentiti libero di inviare un'e-mail a dev@syncplay.pl, chattare tramite il canale IRC #Syncplay su irc.freenode.net, segnalare un problema su GitHub, lasciare un like sulla nostra pagina Facebook, seguirci su Twitter, o visitare https://syncplay.pl/. Non usare Syncplay per inviare dati sensibili.", "joinroom-label": "Entra nella stanza", "joinroom-menu-label": "Entra nella stanza {}", @@ -297,6 +299,8 @@ it = { "openmedia-menu-label": "&Apri file multimediali", "openstreamurl-menu-label": "Apri indirizzo di &rete", "setmediadirectories-menu-label": "Imposta &cartelle multimediali", + "loadplaylistfromfile-menu-label": "&Load playlist from file", # TODO: Translate + "saveplaylisttofile-menu-label": "&Save playlist to file", # TODO: Translate "exit-menu-label": "&Esci", "advanced-menu-label": "&Avanzate", "window-menu-label": "&Finestra", @@ -306,6 +310,12 @@ it = { "settrusteddomains-menu-label": "Imposta &domini fidati", "addtrusteddomain-menu-label": "Aggiungi {} come dominio fidato", # Domain + "edit-menu-label": "&Modifica", + "cut-menu-label": "&Taglia", + "copy-menu-label": "&Copia", + "paste-menu-label": "&Incolla", + "selectall-menu-label": "&Seleziona tutto", + "playback-menu-label": "&Riproduzione", "help-menu-label": "&Aiuto", @@ -461,7 +471,7 @@ it = { # Server errors "unknown-command-server-error": "Comando non riconosciuto {}", # message "not-json-server-error": "Non è una stringa in codifica JSON {}", # message - "line-decode-server-error": "Not a utf-8 string", # TODO: Translate + "line-decode-server-error": "Non è una stringa utf-8", "not-known-server-error": "Devi essere autenticato dal server prima di poter inviare questo comando", "client-drop-server-error": "Il client è caduto: {} -- {}", # host, error "password-required-server-error": "È richiesta una password", @@ -484,12 +494,12 @@ it = { "editplaylist-menu-label": "Modifica la playlist", "open-containing-folder": "Apri la cartella contenente questo file", - "addusersfiletoplaylist-menu-label": "Aggiungi il file {} alla playlist", # item owner indicator # TODO needs testing - "addusersstreamstoplaylist-menu-label": "Aggiungi l'indirizzo {} alla playlist", # item owner indicator # TODO needs testing - "openusersstream-menu-label": "Apri l'indirizzo di {}", # [username]'s + "addyourfiletoplaylist-menu-label": "Aggiungi il tuo file alla playlist", + "addotherusersfiletoplaylist-menu-label": "Aggiungi il file di {} alla playlist", # Username + "addyourstreamstoplaylist-menu-label": "Aggiungi il tuo indirizzo alla playlist", + "addotherusersstreamstoplaylist-menu-label": "Aggiungi l'indirizzo di {} alla playlist", # Username # item owner indicator + "openusersstream-menu-label": "Apri l'indirizzo di {}", # [username] "openusersfile-menu-label": "Apri il file di {}", # [username]'s - "item-is-yours-indicator": "tuo", # Goes with addusersfiletoplaylist/addusersstreamstoplaylist # TODO needs testing - "item-is-others-indicator": "di {}", # username - goes with addusersfiletoplaylist/addusersstreamstoplaylist # TODO needs testing "playlist-instruction-item-message": "Trascina qui i file per aggiungerli alla playlist condivisa.", "sharedplaylistenabled-tooltip": "Gli operatori della stanza possono aggiungere i file a una playlist sincronizzata per garantire che tutti i partecipanti stiano guardando la stessa cosa. Configura le cartelle multimediali alla voce 'Miscellanea'.", diff --git a/syncplay/messages_pt_BR.py b/syncplay/messages_pt_BR.py new file mode 100644 index 0000000..15e2dff --- /dev/null +++ b/syncplay/messages_pt_BR.py @@ -0,0 +1,506 @@ +# coding:utf8 + +"""Brazilian Portuguese dictionary""" + +pt_BR = { + "LANGUAGE": "Português do Brasil", + + # Client notifications + "config-cleared-notification": "Configurações removidas. Mudanças serão salvas quando você armazenar uma configuração válida.", + + "relative-config-notification": "Arquivo(s) de configuração relativa carregado(s): {}", + + "connection-attempt-notification": "Tentando se conectar a {}:{}", # Port, IP + "reconnection-attempt-notification": "Conexão com o servidor perdida, tentando reconectar", + "disconnection-notification": "Desconectado do servidor", + "connection-failed-notification": "Conexão com o servidor falhou", + "connected-successful-notification": "Conectado com sucesso ao servidor", + "retrying-notification": "%s, tentando novamente em %d segundos...", # Seconds + "reachout-successful-notification": "Alcançado {} ({}) com sucesso", + + "rewind-notification": "Retrocedendo devido à diferença de tempo com {}", # User + "fastforward-notification": "Avançando devido à diferença de tempo com {}", # User + "slowdown-notification": "Diminuindo a velocidade devido à diferença de tempo com {}", # User + "revert-notification": "Revertendo velocidade ao normal", + + "pause-notification": "{} pausou", # User + "unpause-notification": "{} despausou", # User + "seek-notification": "{} saltou de {} para {}", # User, from time, to time + + "current-offset-notification": "Deslocamento atual: {} segundos", # Offset + + "media-directory-list-updated-notification": "Os diretórios de mídia do Syncplay foram atualizados.", + + "room-join-notification": "{} entrou na sala: '{}'", # User + "left-notification": "{} saiu da sala", # User + "left-paused-notification": "{} saiu da sala, {} pausou", # User who left, User who paused + "playing-notification": "{} está tocando '{}' ({})", # User, file, duration + "playing-notification/room-addendum": " na sala: '{}'", # Room + + "not-all-ready": "Não está pronto: {}", # Usernames + "all-users-ready": "Todo mundo está pronto ({} users)", # Number of ready users + "ready-to-unpause-notification": "Agora você está definido como pronto - despause novamente para despausar", + "set-as-ready-notification": "Agora você está definido como pronto", + "set-as-not-ready-notification": "Agora você está definido como não pronto", + "autoplaying-notification": "Reprodução automática em {}...", # Number of seconds until playback will start + + "identifying-as-controller-notification": "Identificando-se como operador da sala com a senha '{}'...", + "failed-to-identify-as-controller-notification": "{} falhou ao se identificar como operador da sala.", + "authenticated-as-controller-notification": "{} autenticou-se como um operador da sala", + "created-controlled-room-notification": "Criou a sala gerenciada '{}' com a senha '{}'. Por favor, salve essa informação para futura referência!", # RoomName, operatorPassword + + "file-different-notification": "O arquivo que você está tocando parece ser diferente do arquivo de {}", # User + "file-differences-notification": "Seus arquivos se diferem da(s) seguinte(s) forma(s): {}", # Differences + "room-file-differences": "Diferenças de arquivos: {}", # File differences (filename, size, and/or duration) + "file-difference-filename": "nome", + "file-difference-filesize": "tamanho", + "file-difference-duration": "duração", + "alone-in-the-room": "Você está sozinho na sala", + + "different-filesize-notification": " (o tamanho do arquivo deles é diferente do seu!)", + "userlist-playing-notification": "{} está tocando:", # Username + "file-played-by-notification": "Arquivo: {} está sendo tocado por:", # File + "no-file-played-notification": "{} não está tocando um arquivo", # Username + "notplaying-notification": "Pessoas que não estão tocando nenhum arquivo:", + "userlist-room-notification": "Na sala '{}':", # Room + "userlist-file-notification": "Arquivo", + "controller-userlist-userflag": "Operador", + "ready-userlist-userflag": "Pronto", + + "update-check-failed-notification": "Não foi possível verificar automaticamente se o Syncplay {} é a versão mais recente. Deseja visitar https://syncplay.pl/ para checar manualmente por atualizações?", # Syncplay version + "syncplay-uptodate-notification": "O Syncplay está atualizado", + "syncplay-updateavailable-notification": "Uma nova versão do Syncplay está disponível. Deseja visitar a página de lançamentos?", + + "mplayer-file-required-notification": "Syncplay com mplayer requer que você forneça o arquivo ao começar", + "mplayer-file-required-notification/example": "Exemplo de uso: syncplay [opções] [url|caminho_ate_o_arquivo/]nome_do_arquivo", + "mplayer2-required": "O Syncplay é incompatível com o MPlayer 1.x, por favor use mplayer2 ou mpv", + + "unrecognized-command-notification": "Comando não reconhecido", + "commandlist-notification": "Comandos disponíveis:", + "commandlist-notification/room": "\tr [nome] - muda de sala", + "commandlist-notification/list": "\tl - mostra lista de usuários", + "commandlist-notification/undo": "\tu - desfaz último salto", + "commandlist-notification/pause": "\tp - alterna pausa", + "commandlist-notification/seek": "\t[s][+-]time - salta para o valor de tempo dado, se + ou - não forem especificados, será o tempo absoluto em segundos ou minutos:segundos", + "commandlist-notification/help": "\th - esta mensagem de ajuda", + "commandlist-notification/toggle": "\tt - alterna o seu status de prontidão para assistir", + "commandlist-notification/create": "\tc [nome] - cria sala gerenciado usando o nome da sala atual", + "commandlist-notification/auth": "\ta [senha] - autentica-se como operador da sala com a senha", + "commandlist-notification/chat": "\tch [mensagem] - envia uma mensagem no chat da sala", + "syncplay-version-notification": "Versão do Syncplay: {}", # syncplay.version + "more-info-notification": "Mais informações disponíveis em: {}", # projectURL + + "gui-data-cleared-notification": "O Syncplay limpou o caminho e o estado de dados da janela usados pela GUI.", + "language-changed-msgbox-label": "O idioma será alterado quando você salvar as mudanças e abrir o Syncplay novamente.", + "promptforupdate-label": "O Syncplay pode verificar automaticamente por atualizações de tempos em tempos?", + + "media-player-latency-warning": "Aviso: O reprodutor de mídia demorou {} para responder. Se você tiver problemas de sincronização, feche outros programas para liberar recursos do sistema e, se isso não funcionar, tente outro reprodutor de mídia.", # Seconds to respond + "mpv-unresponsive-error": "O mpv não respondeu por {} segundos, portanto parece que não está funcionando. Por favor, reinicie o Syncplay.", # Seconds to respond + + # Client prompts + "enter-to-exit-prompt": "Aperte Enter para sair\n", + + # Client errors + "missing-arguments-error": "Alguns argumentos necessários estão faltando, por favor reveja --help", + "server-timeout-error": "A conexão com o servidor ultrapassou o tempo limite", + "mpc-slave-error": "Não foi possível abrir o MPC no slave mode!", + "mpc-version-insufficient-error": "A versão do MPC é muito antiga, por favor use `mpc-hc` >= `{}`", + "mpc-be-version-insufficient-error": "A versão do MPC-BE é muito antiga, por favor use `mpc-be` >= `{}`", + "mpv-version-error": "O Syncplay não é compatível com esta versão do mpv. Por favor, use uma versão diferente do mpv (por exemplo, Git HEAD).", + "player-file-open-error": "O reprodutor falhou ao abrir o arquivo", + "player-path-error": "O caminho até o arquivo executável do reprodutor não está configurado corretamente. Os reprodutores suportados são: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2", + "hostname-empty-error": "O endereço do servidor não pode ser vazio", + "empty-error": "{} não pode ser vazio", # Configuration + "media-player-error": "Erro do reprodutor de mídia: \"{}\"", # Error line + "unable-import-gui-error": "Não foi possível importar bibliotecas da GUI. Se você não possuir o PySide instalado, instale-o para que a GUI funcione.", + "unable-import-twisted-error": "Não foi possível importar o Twisted. Por favor, instale o Twisted v16.4.0 ou superior.", + + "arguments-missing-error": "Alguns argumentos necessários estão faltando, por favor reveja --help", + + "unable-to-start-client-error": "Não foi possível iniciar o client", + + "player-path-config-error": "O caminho até o arquivo executável do reprodutor não está configurado corretamente. Os reprodutores suportados são: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2.", + "no-file-path-config-error": "O arquivo deve ser selecionado antes de iniciar seu reprodutor", + "no-hostname-config-error": "O endereço do servidor não pode ser vazio", + "invalid-port-config-error": "A porta deve ser válida", + "empty-value-config-error": "{} não pode ser vazio", # Config option + + "not-json-error": "Não é uma string codificada como json\n", + "hello-arguments-error": "Not enough Hello arguments\n", # DO NOT TRANSLATE + "version-mismatch-error": "Discrepância entre versões do client e do servidor\n", + "vlc-failed-connection": "Falha ao conectar ao VLC. Se você não instalou o syncplay.lua e está usando a versão mais recente do VLC, por favor veja https://syncplay.pl/LUA/ para mais instruções.", + "vlc-failed-noscript": "O VLC reportou que a interface de script do syncplay.lua não foi instalada. Por favor, veja https://syncplay.pl/LUA/ para mais instruções.", + "vlc-failed-versioncheck": "Esta versão do VLC não é suportada pelo Syncplay.", + + "feature-sharedPlaylists": "playlists compartilhadas", # used for not-supported-by-server-error + "feature-chat": "chat", # used for not-supported-by-server-error + "feature-readiness": "prontidão", # used for not-supported-by-server-error + "feature-managedRooms": "salas gerenciadas", # used for not-supported-by-server-error + + "not-supported-by-server-error": "O recurso {} não é suportado por este servidor.", # feature + "shared-playlists-not-supported-by-server-error": "O recurso de playlists compartilhadas pode não ser suportado por este servidor. Para garantir que funcione corretamente, é necessário um servidor rodando Syncplay {} ou superior, mas este está rodando Syncplay {}.", # minVersion, serverVersion + "shared-playlists-disabled-by-server-error": "O recurso de playlists compartilhadas foi desativado nas configurações do servidor. Para usar este recurso, você precisa se conectar a um servidor diferente.", + + "invalid-seek-value": "Valor de salto inválido", + "invalid-offset-value": "Valor de deslocamento inválido", + + "switch-file-not-found-error": "Não foi possível mudar para o arquivo '{0}'. O Syncplay procura nos diretórios de mídia especificados.", # File not found + "folder-search-timeout-error": "A busca por mídias no diretório de mídias foi cancelada pois demorou muito tempo para procurar em '{}'. Isso ocorre quando você seleciona uma pasta com muitas subpastas em sua lista de pastas de mídias a serem pesquisadas. Para que a troca automática de arquivos funcione novamente, selecione 'Arquivo -> Definir diretórios de mídias' na barra de menus e remova esse diretório ou substitua-o por uma subpasta apropriada. Se a pasta não tiver problemas, é possível reativá-la selecionando 'Arquivo -> Definir diretórios de mídias' e pressionando 'OK'.", # Folder + "folder-search-first-file-timeout-error": "A busca por mídias em '{}' foi interrompida, pois demorou muito para acessar o diretório. Isso pode acontecer se for uma unidade de rede ou se você configurar sua unidade para hibernar depois de um período de inatividade. Para que a troca automática de arquivos funcione novamente, vá para 'Arquivo -> Definir diretórios de mídias' e remova o diretório ou resolva o problema (por exemplo, alterando as configurações de economia de energia da unidade).", # Folder + "added-file-not-in-media-directory-error": "Você carregou um arquivo em '{}', que não é um diretório de mídias conhecido. Você pode adicioná-lo isso como um diretório de mídia selecionando 'Arquivo -> Definir diretórios de mídias' na barra de menus.", # Folder + "no-media-directories-error": "Nenhum diretório de mídias foi definido. Para que os recursos de playlists compartilhadas e troca automática de arquivos funcionem corretamente, selecione 'Arquivo -> Definir diretórios de mídias' e especifique onde o Syncplay deve procurar para encontrar arquivos de mídia.", + "cannot-find-directory-error": "Não foi possível encontrar o diretório de mídia '{}'. Para atualizar sua lista de diretórios de mídias, selecione 'Arquivo -> Definir diretórios de mídias' na barra de menus e especifique onde o Syncplay deve procurar para encontrar arquivos de mídia.", + + "failed-to-load-server-list-error": "Não foi possível carregar a lista de servidores públicos. Por favor, visite https://www.syncplay.pl/ em seu navegador.", + + # Client arguments + "argument-description": 'Solução para sincronizar reprodução de múltiplas instâncias de reprodutores de mídia pela rede.', + "argument-epilog": 'Se nenhuma opção for fornecida, os valores de _config serão usados', + "nogui-argument": 'não mostrar GUI', + "host-argument": 'endereço do servidor', + "name-argument": 'nome de usuário desejado', + "debug-argument": 'modo depuração', + "force-gui-prompt-argument": 'fazer o prompt de configuração aparecer', + "no-store-argument": 'não guardar valores em .syncplay', + "room-argument": 'sala padrão', + "password-argument": 'senha do servidor', + "player-path-argument": 'caminho até o executável do reprodutor de mídia', + "file-argument": 'arquivo a ser tocado', + "args-argument": 'opções do reprodutor; se você precisar passar opções começando com -, as preceda com um único argumento \'--\'', + "clear-gui-data-argument": 'redefine o caminho e o estado de dados da janela da GUI para as de QSettings', + "language-argument": 'idioma para mensagens do Syncplay (de/en/ru/it/es/pt_BR)', + + "version-argument": 'exibe sua versão', + "version-message": "Você está usando o Syncplay versão {} ({})", + + "load-playlist-from-file-argument": "carrega playlist de um arquivo de texto (uma entrada por linha)", + + # Client labels + "config-window-title": "Configuração do Syncplay", + + "connection-group-title": "Configurações de conexão", + "host-label": "Endereço do servidor: ", + "name-label": "Nome de usuário (opcional): ", + "password-label": "Senha do servidor (se existir): ", + "room-label": "Sala padrão: ", + + "media-setting-title": "Configurações do reprodutor de mídia", + "executable-path-label": "Executável do reprodutor:", + "media-path-label": "Arquivo de vídeo ou URL (opcional):", + "player-arguments-label": "Argumentos para o reprodutor (opcional):", + "browse-label": "Navegar", + "update-server-list-label": "Atualizar lista", + + "more-title": "Mostrar mais configurações", + "never-rewind-value": "Nunca", + "seconds-suffix": " s", + "privacy-sendraw-option": "Enviar bruto", + "privacy-sendhashed-option": "Enviar hasheado", + "privacy-dontsend-option": "Não enviar", + "filename-privacy-label": "Informação do nome do arquivo:", + "filesize-privacy-label": "Informação do tamanho do arquivo:", + "checkforupdatesautomatically-label": "Verificar atualizações do Syncplay automaticamente", + "slowondesync-label": "Diminuir velocidade em dessincronizações menores (não suportado pelo MPC-HC/BE)", + "rewindondesync-label": "Retroceder em dessincronização maiores (recomendado)", + "fastforwardondesync-label": "Avançar se estiver ficando para trás (recomendado)", + "dontslowdownwithme-label": "Nunca desacelerar ou retroceder outros (experimental)", + "pausing-title": "Pausando", + "pauseonleave-label": "Pausar quando um usuário sair (por exemplo, se for desconectado)", + "readiness-title": "Estado de prontidão inicial", + "readyatstart-label": "Marque-me como 'pronto para assistir' por padrão", + "forceguiprompt-label": "Não mostrar sempre a janela de configuração do Syncplay", # (Inverted) + "showosd-label": "Ativar mensagens na tela (OSD)", + + "showosdwarnings-label": "Incluir avisos (por exemplo, quando arquivos são diferentes, usuários não estão prontos, etc)", + "showsameroomosd-label": "Incluir eventos da sua sala", + "shownoncontrollerosd-label": "Incluir eventos de não operadores em salas gerenciadas", + "showdifferentroomosd-label": "Incluir eventos de outras salas", + "showslowdownosd-label": "Incluir notificações de desaceleramento ou retrocedimento", + "language-label": "Idioma:", + "automatic-language": "Padrão ({})", # Default language + "showdurationnotification-label": "Avisar sobre discrepância nas durações dos arquivos de mídia", + "basics-label": "Básicos", + "readiness-label": "Play/Pause", + "misc-label": "Miscelânea", + "core-behaviour-title": "Comportamento da sala padrão", + "syncplay-internals-title": "Syncplay internals", + "syncplay-mediasearchdirectories-title": "Diretórios a buscar por mídias", + "syncplay-mediasearchdirectories-label": "Diretórios a buscar por mídias (um caminho por linha)", + "sync-label": "Sincronizar", + "sync-otherslagging-title": "Se outros estiverem ficando pra trás...", + "sync-youlaggging-title": "Se você estiver ficando pra trás...", + "messages-label": "Mensagens", + "messages-osd-title": "Configurações das mensagens na tela (OSD)", + "messages-other-title": "Outras configurações de tela", + "chat-label": "Chat", + "privacy-label": "Privacidade", # Currently unused, but will be brought back if more space is needed in Misc tab + "privacy-title": "Configurações de privacidade", + "unpause-title": "Se você apertar play, definir-se como pronto e:", + "unpause-ifalreadyready-option": "Despausar se você já estiver definido como pronto", + "unpause-ifothersready-option": "Despausar se você já estiver pronto ou outros na sala estiverem prontos (padrão)", + "unpause-ifminusersready-option": "Despausar se você já estiver pronto ou outros na sala estiverem prontos e o número mínimo de usuários está pronto", + "unpause-always": "Sempre despausar", + "syncplay-trusteddomains-title": "Domínios confiáveis (para serviços de streaming e conteúdo hospedado)", + + "chat-title": "Entrada de mensagem do chat", + "chatinputenabled-label": "Habilitar entrada de chat via mpv", + "chatdirectinput-label": "Permitir entrada instantânea de chat (evita ter de apertar Enter para abrir o chat)", + "chatinputfont-label": "Fonte da entrada de chat", + "chatfont-label": "Definir fonte", + "chatcolour-label": "Definir cor", + "chatinputposition-label": "Posição da área de entrada de mensagens no mpv", + "chat-top-option": "Topo", + "chat-middle-option": "Meio", + "chat-bottom-option": "Fundo", + "chatoutputheader-label": "Saída de mensagem do chat", + "chatoutputfont-label": "Fonte da saída de chat", + "chatoutputenabled-label": "Habilitar saída de chat no reprodutor de mídia (apenas mpv por enquanto)", + "chatoutputposition-label": "Modo de saída", + "chat-chatroom-option": "Estilo sala de bate-papo", + "chat-scrolling-option": "Estilo de rolagem", + + "mpv-key-tab-hint": "[TAB] para alternar acesso instantâneo ao chat.", + "mpv-key-hint": "[ENTER] para enviar mensagem. [ESC] para sair do modo de chat.", + "alphakey-mode-warning-first-line": "Você pode usar os antigos atalhos do mpv com as teclas a-z.", + "alphakey-mode-warning-second-line": "Aperte [TAB] para retornar ao modo de chat instantâneo do Syncplay.", + + "help-label": "Ajuda", + "reset-label": "Restaurar padrões", + "run-label": "Começar Syncplay", + "storeandrun-label": "Salvar mudanças e começar Syncplay", + + "contact-label": "Sinta-se livre para mandar um e-mail para dev@syncplay.pl, conversar via chat pelo canal do IRC #Syncplay no irc.freenode.net, abrir uma issue pelo GitHub, curtir nossa página no Facebook, nos seguir no Twitter ou visitar https://syncplay.pl/. Não use o Syncplay para mandar informações sensíveis/confidenciais.", + + "joinroom-label": "Juntar-se a uma sala", + "joinroom-menu-label": "Juntar-se à sala {}", + "seektime-menu-label": "Saltar para o tempo", + "undoseek-menu-label": "Desfazer salto", + "play-menu-label": "Play", + "pause-menu-label": "Pause", + "playbackbuttons-menu-label": "Mostrar botões de reprodução", + "autoplay-menu-label": "Mostrar botão de reprodução automática", + "autoplay-guipushbuttonlabel": "Tocar quando todos estiverem prontos", + "autoplay-minimum-label": "Mín. de usuários:", + + "sendmessage-label": "Enviar", + + "ready-guipushbuttonlabel": "Estou pronto para assistir!", + + "roomuser-heading-label": "Sala / Usuário", + "size-heading-label": "Tamanho", + "duration-heading-label": "Duração", + "filename-heading-label": "Nome do arquivo", + "notifications-heading-label": "Notificações", + "userlist-heading-label": "Lista de quem está tocando o quê", + + "browseformedia-label": "Navegar por arquivos de mídia", + + "file-menu-label": "&Arquivo", # & precedes shortcut key + "openmedia-menu-label": "A&brir arquivo de mídia", + "openstreamurl-menu-label": "Abrir &URL de stream de mídia", + "setmediadirectories-menu-label": "Definir &diretórios de mídias", + "loadplaylistfromfile-menu-label": "&Carregar playlist de arquivo", + "saveplaylisttofile-menu-label": "&Salvar playlist em arquivo", + "exit-menu-label": "&Sair", + "advanced-menu-label": "A&vançado", + "window-menu-label": "&Janela", + "setoffset-menu-label": "Definir &deslocamento", + "createcontrolledroom-menu-label": "&Criar sala gerenciada", + "identifyascontroller-menu-label": "&Identificar-se como operador da sala", + "settrusteddomains-menu-label": "D&efinir domínios confiáveis", + "addtrusteddomain-menu-label": "Adicionar {} como domínio confiável", # Domain + + "edit-menu-label": "&Editar", + "cut-menu-label": "Cor&tar", + "copy-menu-label": "&Copiar", + "paste-menu-label": "C&olar", + "selectall-menu-label": "&Selecionar todos", + + "playback-menu-label": "&Reprodução", + + "help-menu-label": "&Ajuda", + "userguide-menu-label": "Abrir &guia de usuário", + "update-menu-label": "&Verificar atualizações", + + "startTLS-initiated": "Tentando estabelecer conexão segura", + "startTLS-secure-connection-ok": "Conexão segura estabelecida ({})", + "startTLS-server-certificate-invalid": 'Não foi possível estabelecer uma conexão segura. O servidor usa um certificado de segurança inválido. Essa comunicação pode ser interceptada por terceiros. Para mais detalhes de solução de problemas, consulte aqui.', + "startTLS-not-supported-client": "Este client não possui suporte para TLS", + "startTLS-not-supported-server": "Este servidor não possui suporte para TLS", + + # TLS certificate dialog + "tls-information-title": "Detalhes do certificado", + "tls-dialog-status-label": "Syncplay está usando uma conexão criptografada para {}.", + "tls-dialog-desc-label": "A criptografia com um certificado digital mantém as informações em sigilo quando são enviadas para ou do
servidor {}.", + "tls-dialog-connection-label": "Informações criptografadas usando o Transport Layer Security (TLS), versão {} com o conjunto de cifras (cipher suite)
: {}.", + "tls-dialog-certificate-label": "Certificado emitido em {} e válido até {}.", + + # About dialog + "about-menu-label": "&Sobre o Syncplay", + "about-dialog-title": "Sobre o Syncplay", + "about-dialog-release": "Versão {}, lançamento {}", + "about-dialog-license-text": "Licenciado sob a Licença Apache, Versão 2.0", + "about-dialog-license-button": "Licença", + "about-dialog-dependencies": "Dependências", + + "setoffset-msgbox-label": "Definir deslocamento", + "offsetinfo-msgbox-label": "Deslocamento (veja https://syncplay.pl/guide/ para instruções de uso):", + + "promptforstreamurl-msgbox-label": "Abrir transmissão de mídia via URL", + "promptforstreamurlinfo-msgbox-label": "Transmitir URL", + + "addfolder-label": "Adicionar pasta", + + "adduris-msgbox-label": "Adicionar URLs à playlist (uma por linha)", + "editplaylist-msgbox-label": "Definir playlist (uma por linha)", + "trusteddomains-msgbox-label": "Domínios para os quais é permitido trocar automaticamente (um por linha)", + + "createcontrolledroom-msgbox-label": "Criar sala gerenciada", + "controlledroominfo-msgbox-label": "Informe o nome da sala gerenciada\r\n(veja https://syncplay.pl/guide/ para instruções de uso):", + + "identifyascontroller-msgbox-label": "Identificar-se como operador da sala", + "identifyinfo-msgbox-label": "Informe a senha de operador para esta sala\r\n(veja https://syncplay.pl/guide/ para instruções de uso):", + + "public-server-msgbox-label": "Selecione o servidor público para esta sessão de visualização", + + "megabyte-suffix": " MB", + + # Tooltips + + "host-tooltip": "Hostname ou IP para se conectar, opcionalmente incluindo uma porta (por exemplo, syncplay.pl:8999). Só sincroniza-se com pessoas no mesmo servidor/porta.", + "name-tooltip": "Nome pelo qual você será conhecido. Não há cadastro, então você pode facilmente mudar mais tarde. Se não for especificado, será gerado aleatoriamente.", + "password-tooltip": "Senhas são necessárias apenas para servidores privados.", + "room-tooltip": "O nome da sala para se conectar pode ser praticamente qualquer coisa, mas você só irá se sincronizar com pessoas na mesma sala.", + + "executable-path-tooltip": "Localização do seu reprodutor de mídia preferido (mpv, VLC, MPC-HC/BE ou mplayer2).", + "media-path-tooltip": "Localização do vídeo ou transmissão a ser aberto. Necessário com o mplayer2.", + "player-arguments-tooltip": "Argumentos de comando de linha adicionais para serem repassados ao reprodutor de mídia.", + "mediasearcdirectories-arguments-tooltip": "Diretório onde o Syncplay vai procurar por arquivos de mídia, por exemplo quando você estiver usando o recurso de clicar para mudar. O Syncplay irá procurar recursivamente pelas subpastas.", + + "more-tooltip": "Exibe configurações menos frequentemente utilizadas.", + "filename-privacy-tooltip": "Modo de privacidade para mandar nome de arquivo do arquivo atual para o servidor.", + "filesize-privacy-tooltip": "Modo de privacidade para mandar tamanho do arquivo atual para o servidor.", + "privacy-sendraw-tooltip": "Enviar esta informação sem ofuscação. Esta é a opção padrão com mais funcionalidades.", + "privacy-sendhashed-tooltip": "Mandar versão hasheada da informação, tornando-a menos visível aos outros clients.", + "privacy-dontsend-tooltip": "Não enviar esta informação ao servidor. Esta opção oferece a maior privacidade.", + "checkforupdatesautomatically-tooltip": "Checar o site do Syncplay regularmente para ver se alguma nova versão do Syncplay está disponível.", + "slowondesync-tooltip": "Reduzir a velocidade de reprodução temporariamente quando necessário para trazer você de volta à sincronia com os outros espectadores. Não suportado pelo MPC-HC/BE.", + "dontslowdownwithme-tooltip": "Significa que outros não serão desacelerados ou retrocedidos se sua reprodução estiver ficando para trás. Útil para operadores de salas.", + "pauseonleave-tooltip": "Pausar reprodução se você for disconectado ou se alguém sair da sua sala.", + "readyatstart-tooltip": "Definir-se como 'pronto' ao começar (do contrário você será definido como 'não pronto' até mudar seu estado de prontidão)", + "forceguiprompt-tooltip": "Diálogo de configuração não é exibido ao abrir um arquivo com o Syncplay.", # (Inverted) + "nostore-tooltip": "Começar Syncplay com a dada configuração, mas não guardar as mudanças permanentemente.", # (Inverted) + "rewindondesync-tooltip": "Retroceder automaticamente quando necessário para sincronizar. Desabilitar isto pode resultar em grandes dessincronizações!", + "fastforwardondesync-tooltip": "Avançar automaticamente quando estiver fora de sincronia com o operador da sala (ou sua posição pretendida caso 'Nunca desacelerar ou retroceder outros' estiver habilitada).", + "showosd-tooltip": "Envia mensagens do Syncplay à tela do reprodutor de mídia (OSD).", + "showosdwarnings-tooltip": "Mostra avisos se: estiver tocando arquivos diferentes, sozinho na sala, usuários não prontos, etc.", + "showsameroomosd-tooltip": "Mostra notificações na tela (OSD) sobre eventos relacionados à sala em que o usuário está.", + "shownoncontrollerosd-tooltip": "Mostra notificações na tela (OSD) sobre eventos relacionados a não operadores que estão em salas gerenciadas.", + "showdifferentroomosd-tooltip": "Mostra notificações na tela (OSD) sobre eventos relacionados à sala em que o usuário não está.", + "showslowdownosd-tooltip": "Mostra notificações na tela (OSD) sobre desaceleramento/retrocedimento por conta de diferença nos tempos.", + "showdurationnotification-tooltip": "Útil quando um segmento em um arquivo de múltiplas partes está faltando, mas pode resultar em falsos positivos.", + "language-tooltip": "Idioma a ser utilizado pelo Syncplay.", + "unpause-always-tooltip": "Se você pressionar para despausar, sempre te definirá como pronto e despausará em vez de simplesmente te definir com pronto.", + "unpause-ifalreadyready-tooltip": "Se você pressionar para despausar quando não estiver pronto, irá te definir como pronto - despause novamente para despausar.", + "unpause-ifothersready-tooltip": "Se você apertar para despausar quando não estiver pronto, só irá despausar quando outros estiverem prontos.", + "unpause-ifminusersready-tooltip": "Se você apertar para despausar quando não estiver pronto, só irá despausar quando outros estiverem prontos e o número mínimo de usuários for atingido.", + "trusteddomains-arguments-tooltip": "Domínios para os quais é permitido trocar automaticamente quando as playlists compartilhadas estiverem habilitadas.", + + "chatinputenabled-tooltip": "Ativar entrada de chat via mpv (pressione Enter para escrever, Enter para enviar, ESC para cancelar)", + "chatdirectinput-tooltip": "Evita ter de apertar 'Enter' para entrar no modo de entrada de chat no mpv. Pressione TAB no mpv para temporariamente desabilitar esta função.", + "font-label-tooltip": "Fonte usada ao escrever mensagens no chat no mpv. Apenas no lado do client, portanto não afeta a cor que os outros veem.", + "set-input-font-tooltip": "Família de fonte usada ao escrever mensagens no chat no mpv. Apenas no lado do client, portanto não afeta a cor que os outros veem.", + "set-input-colour-tooltip": "Cor de fonte usada ao escrever mensagens no chat no mpv. Apenas no lado do client, portanto não afeta a cor que os outros veem.", + "chatinputposition-tooltip": "Lugar no mpv onde a entrada de chat será exibida quando você apertar Enter e digitar.", + "chatinputposition-top-tooltip": "Colocar entrada de chat no topo da janela do mpv.", + "chatinputposition-middle-tooltip": "Colocar entrada de chat no meio da janela do mpv.", + "chatinputposition-bottom-tooltip": "Colocar entrada de chat no fundo da janela do mpv.", + "chatoutputenabled-tooltip": "Mostrar mensagens de chat na tela do reprodutor (OSD) (se suportado pelo reprodutor).", + "font-output-label-tooltip": "Fonte da saída de chat.", + "set-output-font-tooltip": "Fonte usada para exibir mensagens do chat.", + "chatoutputmode-tooltip": "Como as mensagens do chat são exibidas.", + "chatoutputmode-chatroom-tooltip": "Exibe novas linhas de chat diretamente abaixo da linha anterior.", + "chatoutputmode-scrolling-tooltip": "Exibe novas linhas de chat rolando-as da direita pra esquerda.", + + "help-tooltip": "Abre o guia de usuário do Syncplay.pl.", + "reset-tooltip": "Redefine todas as configurações para seus respectivos padrões.", + "update-server-list-tooltip": "Conecta ao syncplay.pl para atualizar a lista de servidores públicos.", + + "sslconnection-tooltip": "Conectado com segurança ao servidor. Clique para exibir detalhes do certificado.", + + "joinroom-tooltip": "Sair da sala atual e ingressar na sala especificada.", + "seektime-msgbox-label": "Saltar para tempo especificado (em segundos ou minutos:segundos). Use + ou - para fazer um pulo relativo ao tempo atual.", + "ready-tooltip": "Indica se você está pronto para assistir.", + "autoplay-tooltip": "Reproduzir automaticamente quando todos os usuários que tiverem indicadores de prontidão estiverem prontos e o limiar de usuários for atingido.", + "switch-to-file-tooltip": "Clique duas vezes para mudar para {}", # Filename + "sendmessage-tooltip": "Mandar mensagem para a sala", + + # In-userlist notes (GUI) + "differentsize-note": "Tamanhos diferentes!", + "differentsizeandduration-note": "Tamanhos e durações diferentes!", + "differentduration-note": "Durações diferentes!", + "nofile-note": "(Nenhum arquivo está sendo tocado)", + + # Server messages to client + "new-syncplay-available-motd-message": "Você está usando o Syncplay {}, mas uma versão mais nova está disponível em https://syncplay.pl", # ClientVersion + + # Server notifications + "welcome-server-notification": "Seja bem-vindo ao servidor de Syncplay, versão {0}", # version + "client-connected-room-server-notification": "{0}({2}) conectou-se à sala '{1}'", # username, host, room + "client-left-server-notification": "{0} saiu do servidor", # name + "no-salt-notification": "POR FAVOR, NOTE: Para permitir que as senhas de operadores de sala geradas por esta instância do servidor ainda funcionem quando o servidor for reiniciado, por favor, adicione o seguinte argumento de linha de comando ao executar o servidor de Syncplay no futuro: --salt {}", # Salt + + + # Server arguments + "server-argument-description": 'Solução para sincronizar a reprodução de múltiplas instâncias de MPlayer e MPC-HC/BE pela rede. Instância de servidor', + "server-argument-epilog": 'Se nenhuma opção for fornecida, os valores de _config serão utilizados', + "server-port-argument": 'porta TCP do servidor', + "server-password-argument": 'senha do servidor', + "server-isolate-room-argument": 'salas devem ser isoladas?', + "server-salt-argument": "string aleatória utilizada para gerar senhas de salas gerenciadas", + "server-disable-ready-argument": "desativar recurso de prontidão", + "server-motd-argument": "caminho para o arquivo o qual o motd será obtido", + "server-chat-argument": "O chat deve ser desativado?", + "server-chat-maxchars-argument": "Número máximo de caracteres numa mensagem do chat (o padrão é {})", # Default number of characters + "server-maxusernamelength-argument": "Número máximos de caracteres num nome de usuário (o padrão é {})", + "server-stats-db-file-argument": "Habilita estatísticas de servidor usando o arquivo db SQLite fornecido", + "server-startTLS-argument": "Habilita conexões TLS usando os arquivos de certificado no caminho fornecido", + "server-messed-up-motd-unescaped-placeholders": "A Mensagem do Dia possui placeholders não escapados. Todos os sinais de $ devem ser dobrados (como em $$).", + "server-messed-up-motd-too-long": "A Mensagem do Dia é muito longa - máximo de {} caracteres, {} foram dados.", + + # Server errors + "unknown-command-server-error": "Comando desconhecido: {}", # message + "not-json-server-error": "Não é uma string codificada como json: {}", # message + "line-decode-server-error": "Não é uma string UTF-8", + "not-known-server-error": "Você deve ser conhecido pelo servidor antes de mandar este comando", + "client-drop-server-error": "Drop do client: {} -- {}", # host, error + "password-required-server-error": "Senha necessária", + "wrong-password-server-error": "Senha incorreta fornecida", + "hello-server-error": "Not enough Hello arguments", # DO NOT TRANSLATE + + # Playlists + "playlist-selection-changed-notification": "{} mudou a seleção da playlist", # Username + "playlist-contents-changed-notification": "{} atualizou playlist", # Username + "cannot-find-file-for-playlist-switch-error": "Não foi possível encontrar o arquivo {} no diretórios de mídia para a troca de playlist!", # Filename + "cannot-add-duplicate-error": "Não foi possível adicionar uma segunda entrada para '{}' para a playlist uma vez que duplicatas não são permitidas.", # Filename + "cannot-add-unsafe-path-error": "Não foi possível automaticamente carregar {} porque este não é um domínio confiado. Você pode trocar para a URL manualmente dando um clique duplo nela na playlist e adicionando o domínio aos domínios confiáveis em 'Arquivo -> Avançado -> Definir domínios confiáveis'. Se você clicar com o botão direito na URL, você pode adicionar esta URL como domínio confiável pelo menu de contexto.", # Filename + "sharedplaylistenabled-label": "Habilitar playlists compartilhadas", + "removefromplaylist-menu-label": "Remover da playlist", + "shuffleremainingplaylist-menu-label": "Embaralhar resto da playlist", + "shuffleentireplaylist-menu-label": "Embaralhar toda a playlist", + "undoplaylist-menu-label": "Desfazer última alteração à playlist", + "addfilestoplaylist-menu-label": "Adicionar arquivo(s) ao final da playlist", + "addurlstoplaylist-menu-label": "Adicionar URL(s) ao final da playlist", + "editplaylist-menu-label": "Editar playlist", + + "open-containing-folder": "Abrir pasta contendo este arquivo", + "addyourfiletoplaylist-menu-label": "Adicionar seu arquivo à playlist", + "addotherusersfiletoplaylist-menu-label": "Adicionar arquivos de {} à playlist", # [Username] + "addyourstreamstoplaylist-menu-label": "Adicionar sua transmissão à playlist", + "addotherusersstreamstoplaylist-menu-label": "Adicionar transmissão de {} à playlist", # [Username] + "openusersstream-menu-label": "Abrir transmissão de {}", # [username]'s + "openusersfile-menu-label": "Abrir arquivo de {}", # [username]'s + + "playlist-instruction-item-message": "Arraste um arquivo aqui para adicioná-lo à playlist compartilhada.", + "sharedplaylistenabled-tooltip": "Operadores da sala podem adicionar arquivos para a playlist compartilhada para tornar mais fácil para todo mundo assistir a mesma coisa. Configure os diretórios de mídia em 'Miscelânea'.", +} diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 7452db0..7d9b3a2 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -16,7 +16,7 @@ ru = { "connection-failed-notification": "Не удалось подключиться к серверу", "connected-successful-notification": "Соединение с сервером установлено", "retrying-notification": "%s, следующая попытка через %d секунд(ы)...", # Seconds - "handshake-successful-notification": "Connection established with {} ({})", # TODO: Translate + "reachout-successful-notification": "Successfully reached {} ({})", # TODO: Translate "rewind-notification": "Перемотано из-за разницы во времени с {}", # User "fastforward-notification": "Ускорено из-за разницы во времени с {}", # User @@ -108,18 +108,18 @@ ru = { "mpc-be-version-insufficient-error": "Версия MPC слишком старая, пожалуйста, используйте `mpc-be` >= `{}`", "mpv-version-error": "Syncplay не совместим с данной версией mpv. Пожалуйста, используйте другую версию mpv (лучше свежайшую).", "player-file-open-error": "Проигрыватель не может открыть файл.", - "player-path-error": "Путь к проигрывателю задан неверно. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2.", # TODO: Translate last sentence + "player-path-error": "Путь к проигрывателю задан неверно. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", # TODO: Translate last sentence "hostname-empty-error": "Имя пользователя не может быть пустым.", "empty-error": "{} не может быть пустым.", # Configuration "media-player-error": "Ошибка проигрывателя: \"{}\"", # Error line "unable-import-gui-error": "Невозможно импортировать библиотеки GUI (графического интерфейса). Необходимо установить PySide, иначе графический интерфейс не будет работать.", - "unable-import-twisted-error": "Could not import Twisted. Please install Twisted v12.1.0 or later.", #To do: translate + "unable-import-twisted-error": "Could not import Twisted. Please install Twisted v16.4.0 or later.", #To do: translate "arguments-missing-error": "Некоторые необходимые аргументы отсутствуют, обратитесь к --help", "unable-to-start-client-error": "Невозможно запустить клиент", - "player-path-config-error": "Путь к проигрывателю установлен неверно. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end + "player-path-config-error": "Путь к проигрывателю установлен неверно. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end "no-file-path-config-error": "Файл должен быть указан до включения проигрывателя", "no-hostname-config-error": "Имя сервера не может быть пустым", "invalid-port-config-error": "Неверный номер порта", @@ -169,11 +169,13 @@ ru = { "file-argument": 'воспроизводимый файл', "args-argument": 'параметры проигрывателя; если нужно передать параметры, начинающиеся с - , то сначала пишите \'--\'', "clear-gui-data-argument": 'сбрасывает путь и данные о состоянии окна GUI, хранимые как QSettings', - "language-argument": 'язык сообщений Syncplay (de/en/ru)', + "language-argument": 'язык сообщений Syncplay (de/en/ru/it/es/pt_BR)', "version-argument": 'выводит номер версии', "version-message": "Вы используете Syncplay версии {} ({})", + "load-playlist-from-file-argument": "loads playlist from text file (one entry per line)", # TODO: Translate + # Client labels "config-window-title": "Настройка Syncplay", @@ -299,6 +301,8 @@ ru = { "openmedia-menu-label": "&Открыть файл", "openstreamurl-menu-label": "Открыть &ссылку", "setmediadirectories-menu-label": "&Папки воспроизведения", + "loadplaylistfromfile-menu-label": "&Load playlist from file", # TODO: Translate + "saveplaylisttofile-menu-label": "&Save playlist to file", # TODO: Translate "exit-menu-label": "&Выход", "advanced-menu-label": "&Дополнительно", "window-menu-label": "&Вид", @@ -307,6 +311,13 @@ ru = { "identifyascontroller-menu-label": "&Войти как оператор комнаты", "settrusteddomains-menu-label": "Доверенные &сайты", + # Edit menu - TODO: check - these should match the values of macOS menubar + "edit-menu-label": "&Правка", + "cut-menu-label": "Bы&резать", + "copy-menu-label": "&Скопировать", + "paste-menu-label": "&Bставить", + "selectall-menu-label": "Bыбра&ть все", + "playback-menu-label": "&Управление", "help-menu-label": "&Помощь", @@ -484,12 +495,12 @@ ru = { "editplaylist-menu-label": "Редактировать список", "open-containing-folder": "Open folder containing this file", # TODO: Traslate - "addusersfiletoplaylist-menu-label": "Добавить файл {} в список воспроизведения", # item owner indicator - "addusersstreamstoplaylist-menu-label": "Добавить поток {} в список воспроизведения", # item owner indicator + "addyourfiletoplaylist-menu-label": "Добавить файл от вас в список воспроизведения", # TODO: Check + "addotherusersfiletoplaylist-menu-label": "Добавить файл {} в список воспроизведения", # Username # TODO: Check + "addyourstreamstoplaylist-menu-label": "Добавить поток от вас в список воспроизведения", # TODO: Check + "addotherusersstreamstoplaylist-menu-label": "Добавить поток {} в список воспроизведения", # Username # TODO: Check "openusersstream-menu-label": "Открыть поток от {}", # [username]'s "openusersfile-menu-label": "Открыть файл от {}", # [username]'s - "item-is-yours-indicator": "от вас", # Goes with addusersfiletoplaylist/addusersstreamstoplaylist - "item-is-others-indicator": "{}", # username - goes with addusersfiletoplaylist/addusersstreamstoplaylist "playlist-instruction-item-message": "Перетащите сюда файлы, чтобы добавить их в общий список.", "sharedplaylistenabled-tooltip": "Оператор комнаты может добавлять файлы в список общего воспроизведения для удобного совместного просмотра. Папки воспроизведения настраиваются во вкладке 'Файл'.", diff --git a/syncplay/players/__init__.py b/syncplay/players/__init__.py index 6ba79d3..8c812db 100755 --- a/syncplay/players/__init__.py +++ b/syncplay/players/__init__.py @@ -1,5 +1,6 @@ from syncplay.players.mplayer import MplayerPlayer from syncplay.players.mpv import MpvPlayer +from syncplay.players.mpvnet import MpvnetPlayer from syncplay.players.vlc import VlcPlayer try: from syncplay.players.mpc import MPCHCAPIPlayer @@ -14,4 +15,4 @@ except ImportError: def getAvailablePlayers(): - return [MPCHCAPIPlayer, MplayerPlayer, MpvPlayer, VlcPlayer, MpcBePlayer] + return [MPCHCAPIPlayer, MpvPlayer, MpvnetPlayer, VlcPlayer, MpcBePlayer, MplayerPlayer] diff --git a/syncplay/players/mplayer.py b/syncplay/players/mplayer.py index 69fa0d2..a46e77f 100755 --- a/syncplay/players/mplayer.py +++ b/syncplay/players/mplayer.py @@ -1,4 +1,5 @@ # coding:utf8 +import ast import os import re import subprocess @@ -10,7 +11,7 @@ import time from syncplay import constants, utils from syncplay.players.basePlayer import BasePlayer from syncplay.messages import getMessage -from syncplay.utils import isWindows +from syncplay.utils import isMacOS, isWindows class MplayerPlayer(BasePlayer): @@ -304,7 +305,7 @@ class MplayerPlayer(BasePlayer): def drop(self): self._listener.sendLine('quit') self._takeLocksDown() - self.reactor.callFromThread(self._client.stop, True) + self.reactor.callFromThread(self._client.stop, False) class __Listener(threading.Thread): def __init__(self, playerController, playerPath, filePath, args): @@ -338,6 +339,20 @@ class MplayerPlayer(BasePlayer): env = os.environ.copy() if 'TERM' in env: del env['TERM'] + # On macOS, youtube-dl requires system python to run. Set the environment + # to allow that version of python to be executed in the mpv subprocess. + if isMacOS(): + try: + pythonLibs = subprocess.check_output(['/usr/bin/python', '-E', '-c', + 'import sys; print(sys.path)'], + text=True, env=dict()) + pythonLibs = ast.literal_eval(pythonLibs) + pythonPath = ':'.join(pythonLibs[1:]) + except: + pythonPath = None + if pythonPath is not None: + env['PATH'] = '/usr/bin:/usr/local/bin' + env['PYTHONPATH'] = pythonPath if filePath: self.__process = subprocess.Popen( call, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT, diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 776a9a3..68beb0d 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -55,7 +55,7 @@ class MpvPlayer(MplayerPlayer): @staticmethod def isValidPlayerPath(path): - if "mpv" in path and MpvPlayer.getExpandedPath(path): + if "mpv" in path and "mpvnet" not in path and MpvPlayer.getExpandedPath(path): return True return False @@ -128,7 +128,7 @@ class NewMpvPlayer(OldMpvPlayer): def displayMessage(self, message, duration=(constants.OSD_DURATION * 1000), OSDType=constants.OSD_NOTIFICATION, mood=constants.MESSAGE_NEUTRAL): if not self._client._config["chatOutputEnabled"]: - super(self.__class__, self).displayMessage(message=message, duration=duration, OSDType=OSDType, mood=mood) + MplayerPlayer.displayMessage(self, message=message, duration=duration, OSDType=OSDType, mood=mood) return messageString = self._sanitizeText(message.replace("\\n", "")).replace( "\\\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER).replace("", "\\n") @@ -136,7 +136,7 @@ class NewMpvPlayer(OldMpvPlayer): def displayChatMessage(self, username, message): if not self._client._config["chatOutputEnabled"]: - super(self.__class__, self).displayChatMessage(username, message) + MplayerPlayer.displayChatMessage(self, username, message) return username = self._sanitizeText(username.replace("\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER)) message = self._sanitizeText(message.replace("\\", constants.MPV_INPUT_BACKSLASH_SUBSTITUTE_CHARACTER)) @@ -197,6 +197,10 @@ class NewMpvPlayer(OldMpvPlayer): return self._position def _storePosition(self, value): + if self._client.isPlayingMusic() and self._paused == False and self._position == value and abs(self._position-self._position) < 0.5: + self._client.ui.showDebugMessage("EOF DETECTED!") + self._position = 0 + self.setPosition(0) self.lastMPVPositionUpdate = time.time() if self._recentlyReset(): self._client.ui.showDebugMessage("Recently reset, so storing position as 0") @@ -252,7 +256,7 @@ class NewMpvPlayer(OldMpvPlayer): self._client.ui.showDebugMessage( "Did not seek as recently reset and {} below 'do not reset position' threshold".format(value)) return - super(self.__class__, self).setPosition(value) + MplayerPlayer.setPosition(self, value) self.lastMPVPositionUpdate = time.time() def openFile(self, filePath, resetPosition=False): diff --git a/syncplay/players/mpvnet.py b/syncplay/players/mpvnet.py new file mode 100644 index 0000000..5813e37 --- /dev/null +++ b/syncplay/players/mpvnet.py @@ -0,0 +1,51 @@ +import os +from syncplay import constants +from syncplay.players.mpv import NewMpvPlayer + +class MpvnetPlayer(NewMpvPlayer): + + + @staticmethod + def run(client, playerPath, filePath, args): + constants.MPV_NEW_VERSION = True + constants.MPV_OSC_VISIBILITY_CHANGE_VERSION = True + return MpvnetPlayer(client, MpvnetPlayer.getExpandedPath(playerPath), filePath, args) + + @staticmethod + def getDefaultPlayerPathsList(): + l = [] + for path in constants.MPVNET_PATHS: + p = MpvnetPlayer.getExpandedPath(path) + if p: + l.append(p) + return l + + + @staticmethod + def isValidPlayerPath(path): + if "mpvnet" in path and MpvnetPlayer.getExpandedPath(path): + return True + return False + + + @staticmethod + def getExpandedPath(playerPath): + if not os.path.isfile(playerPath): + if os.path.isfile(playerPath + "mpvnet.exe"): + playerPath += "mpvnet.exe" + return playerPath + elif os.path.isfile(playerPath + "\\mpvnet.exe"): + playerPath += "\\mpvnet.exe" + return playerPath + if os.access(playerPath, os.X_OK): + return playerPath + for path in os.environ['PATH'].split(':'): + path = os.path.join(os.path.realpath(path), playerPath) + if os.access(path, os.X_OK): + return path + + + @staticmethod + def getIconPath(path): + return constants.MPVNET_ICONPATH + diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index 2f7cf8c..712387c 100755 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -28,10 +28,7 @@ class VlcPlayer(BasePlayer): RE_ANSWER = re.compile(constants.VLC_ANSWER_REGEX) SLAVE_ARGS = constants.VLC_SLAVE_ARGS - if isMacOS(): - SLAVE_ARGS.extend(constants.VLC_SLAVE_MACOS_ARGS) - else: - SLAVE_ARGS.extend(constants.VLC_SLAVE_NONMACOS_ARGS) + SLAVE_ARGS.extend(constants.VLC_SLAVE_EXTRA_ARGS) vlcport = random.randrange(constants.VLC_MIN_PORT, constants.VLC_MAX_PORT) if (constants.VLC_MIN_PORT < constants.VLC_MAX_PORT) else constants.VLC_MIN_PORT def __init__(self, client, playerPath, filePath, args): @@ -343,8 +340,12 @@ class VlcPlayer(BasePlayer): else: call.append(self.__playerController.getMRL(filePath)) if isLinux(): - playerController.vlcIntfPath = "/usr/lib/vlc/lua/intf/" - playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), ".local/share/vlc/lua/intf/") + if 'snap' in playerPath: + playerController.vlcIntfPath = '/snap/vlc/current/usr/lib/vlc/lua/intf/' + playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), "snap/vlc/current/.local/share/vlc/lua/intf/") + else: + playerController.vlcIntfPath = "/usr/lib/vlc/lua/intf/" + playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), ".local/share/vlc/lua/intf/") elif isMacOS(): playerController.vlcIntfPath = "/Applications/VLC.app/Contents/MacOS/share/lua/intf/" playerController.vlcIntfUserPath = os.path.join( @@ -354,6 +355,9 @@ class VlcPlayer(BasePlayer): # This should also work for all the other BSDs, such as OpenBSD or DragonFly. playerController.vlcIntfPath = "/usr/local/lib/vlc/lua/intf/" playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), ".local/share/vlc/lua/intf/") + elif "vlcportable.exe" in playerPath.lower(): + playerController.vlcIntfPath = os.path.dirname(playerPath).replace("\\", "/") + "/App/vlc/lua/intf/" + playerController.vlcIntfUserPath = playerController.vlcIntfPath else: playerController.vlcIntfPath = os.path.dirname(playerPath).replace("\\", "/") + "/lua/intf/" playerController.vlcIntfUserPath = os.path.join(os.getenv('APPDATA', '.'), "VLC\\lua\\intf\\") diff --git a/syncplay/protocols.py b/syncplay/protocols.py index 7607fad..3bf0902 100755 --- a/syncplay/protocols.py +++ b/syncplay/protocols.py @@ -1,10 +1,13 @@ # coding:utf8 import json import time +from datetime import datetime from functools import wraps -from twisted.protocols.basic import LineReceiver +from twisted import version as twistedVersion from twisted.internet.interfaces import IHandshakeListener +from twisted.protocols.basic import LineReceiver +from twisted.python.versions import Version from zope.interface.declarations import implementer import syncplay @@ -334,12 +337,24 @@ class SyncClientProtocol(JSONCommandProtocol): answer = message["startTLS"] if "startTLS" in message else None if "true" in answer and not self.logged and self._client.protocolFactory.options is not None: self.transport.startTLS(self._client.protocolFactory.options) + # To be deleted when the support for Twisted between >=16.4.0 and < 17.1.0 is dropped + minTwistedVersion = Version('twisted', 17, 1, 0) + if twistedVersion < minTwistedVersion: + self._client.protocolFactory.options._ctx.set_info_callback(self.customHandshakeCallback) elif "false" in answer: self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-server")) - self.sendHello() + self.sendHello() + + def customHandshakeCallback(self, conn, where, ret): + # To be deleted when the support for Twisted between >=16.4.0 and < 17.1.0 is dropped + from OpenSSL.SSL import SSL_CB_HANDSHAKE_START, SSL_CB_HANDSHAKE_DONE + if where == SSL_CB_HANDSHAKE_START: + self._client.ui.showDebugMessage("TLS handshake started") + if where == SSL_CB_HANDSHAKE_DONE: + self._client.ui.showDebugMessage("TLS handshake done") + self.handshakeCompleted() def handshakeCompleted(self): - from datetime import datetime self._serverCertificateTLS = self.transport.getPeerCertificate() self._subjectTLS = self._serverCertificateTLS.get_subject().CN self._issuerTLS = self._serverCertificateTLS.get_issuer().CN @@ -362,6 +377,8 @@ class SyncClientProtocol(JSONCommandProtocol): 'protocolString': self._connVersionStringTLS, 'protocolVersion': self._connVersionNumberTLS, 'cipher': self._cipherNameTLS}) + self.sendHello() + class SyncServerProtocol(JSONCommandProtocol): def __init__(self, factory): diff --git a/resources/accept.png b/syncplay/resources/accept.png similarity index 100% rename from resources/accept.png rename to syncplay/resources/accept.png diff --git a/resources/application_get.png b/syncplay/resources/application_get.png similarity index 100% rename from resources/application_get.png rename to syncplay/resources/application_get.png diff --git a/resources/arrow_refresh.png b/syncplay/resources/arrow_refresh.png similarity index 100% rename from resources/arrow_refresh.png rename to syncplay/resources/arrow_refresh.png diff --git a/resources/arrow_switch.png b/syncplay/resources/arrow_switch.png similarity index 100% rename from resources/arrow_switch.png rename to syncplay/resources/arrow_switch.png diff --git a/resources/arrow_undo.png b/syncplay/resources/arrow_undo.png similarity index 100% rename from resources/arrow_undo.png rename to syncplay/resources/arrow_undo.png diff --git a/resources/bullet_right_grey.png b/syncplay/resources/bullet_right_grey.png similarity index 100% rename from resources/bullet_right_grey.png rename to syncplay/resources/bullet_right_grey.png diff --git a/resources/chevrons_right.png b/syncplay/resources/chevrons_right.png similarity index 100% rename from resources/chevrons_right.png rename to syncplay/resources/chevrons_right.png diff --git a/resources/clock_go.png b/syncplay/resources/clock_go.png similarity index 100% rename from resources/clock_go.png rename to syncplay/resources/clock_go.png diff --git a/resources/cog.png b/syncplay/resources/cog.png similarity index 100% rename from resources/cog.png rename to syncplay/resources/cog.png diff --git a/resources/cog_delete.png b/syncplay/resources/cog_delete.png similarity index 100% rename from resources/cog_delete.png rename to syncplay/resources/cog_delete.png diff --git a/resources/comments.png b/syncplay/resources/comments.png similarity index 100% rename from resources/comments.png rename to syncplay/resources/comments.png diff --git a/resources/control_pause_blue.png b/syncplay/resources/control_pause_blue.png similarity index 100% rename from resources/control_pause_blue.png rename to syncplay/resources/control_pause_blue.png diff --git a/resources/control_play_blue.png b/syncplay/resources/control_play_blue.png similarity index 100% rename from resources/control_play_blue.png rename to syncplay/resources/control_play_blue.png diff --git a/resources/cross.png b/syncplay/resources/cross.png similarity index 100% rename from resources/cross.png rename to syncplay/resources/cross.png diff --git a/resources/cross_checkbox.png b/syncplay/resources/cross_checkbox.png similarity index 100% rename from resources/cross_checkbox.png rename to syncplay/resources/cross_checkbox.png diff --git a/resources/delete.png b/syncplay/resources/delete.png similarity index 100% rename from resources/delete.png rename to syncplay/resources/delete.png diff --git a/resources/door_in.png b/syncplay/resources/door_in.png similarity index 100% rename from resources/door_in.png rename to syncplay/resources/door_in.png diff --git a/resources/email_go.png b/syncplay/resources/email_go.png similarity index 100% rename from resources/email_go.png rename to syncplay/resources/email_go.png diff --git a/resources/empty_checkbox.png b/syncplay/resources/empty_checkbox.png similarity index 100% rename from resources/empty_checkbox.png rename to syncplay/resources/empty_checkbox.png diff --git a/resources/error.png b/syncplay/resources/error.png similarity index 100% rename from resources/error.png rename to syncplay/resources/error.png diff --git a/resources/eye.png b/syncplay/resources/eye.png similarity index 100% rename from resources/eye.png rename to syncplay/resources/eye.png diff --git a/resources/film_add.png b/syncplay/resources/film_add.png similarity index 100% rename from resources/film_add.png rename to syncplay/resources/film_add.png diff --git a/resources/film_edit.png b/syncplay/resources/film_edit.png similarity index 100% rename from resources/film_edit.png rename to syncplay/resources/film_edit.png diff --git a/resources/film_folder_edit.png b/syncplay/resources/film_folder_edit.png similarity index 100% rename from resources/film_folder_edit.png rename to syncplay/resources/film_folder_edit.png diff --git a/resources/film_go.png b/syncplay/resources/film_go.png similarity index 100% rename from resources/film_go.png rename to syncplay/resources/film_go.png diff --git a/resources/film_link.png b/syncplay/resources/film_link.png similarity index 100% rename from resources/film_link.png rename to syncplay/resources/film_link.png diff --git a/resources/folder_explore.png b/syncplay/resources/folder_explore.png similarity index 100% rename from resources/folder_explore.png rename to syncplay/resources/folder_explore.png diff --git a/resources/folder_film.png b/syncplay/resources/folder_film.png similarity index 100% rename from resources/folder_film.png rename to syncplay/resources/folder_film.png diff --git a/resources/help.png b/syncplay/resources/help.png similarity index 100% rename from resources/help.png rename to syncplay/resources/help.png diff --git a/resources/hicolor/128x128/apps/syncplay.png b/syncplay/resources/hicolor/128x128/apps/syncplay.png similarity index 100% rename from resources/hicolor/128x128/apps/syncplay.png rename to syncplay/resources/hicolor/128x128/apps/syncplay.png diff --git a/resources/hicolor/16x16/apps/syncplay.png b/syncplay/resources/hicolor/16x16/apps/syncplay.png similarity index 100% rename from resources/hicolor/16x16/apps/syncplay.png rename to syncplay/resources/hicolor/16x16/apps/syncplay.png diff --git a/resources/hicolor/24x24/apps/syncplay.png b/syncplay/resources/hicolor/24x24/apps/syncplay.png similarity index 100% rename from resources/hicolor/24x24/apps/syncplay.png rename to syncplay/resources/hicolor/24x24/apps/syncplay.png diff --git a/resources/hicolor/256x256/apps/syncplay.png b/syncplay/resources/hicolor/256x256/apps/syncplay.png similarity index 100% rename from resources/hicolor/256x256/apps/syncplay.png rename to syncplay/resources/hicolor/256x256/apps/syncplay.png diff --git a/resources/hicolor/32x32/apps/syncplay.png b/syncplay/resources/hicolor/32x32/apps/syncplay.png similarity index 100% rename from resources/hicolor/32x32/apps/syncplay.png rename to syncplay/resources/hicolor/32x32/apps/syncplay.png diff --git a/resources/hicolor/48x48/apps/syncplay.png b/syncplay/resources/hicolor/48x48/apps/syncplay.png similarity index 100% rename from resources/hicolor/48x48/apps/syncplay.png rename to syncplay/resources/hicolor/48x48/apps/syncplay.png diff --git a/resources/hicolor/64x64/apps/syncplay.png b/syncplay/resources/hicolor/64x64/apps/syncplay.png similarity index 100% rename from resources/hicolor/64x64/apps/syncplay.png rename to syncplay/resources/hicolor/64x64/apps/syncplay.png diff --git a/resources/hicolor/96x96/apps/syncplay.png b/syncplay/resources/hicolor/96x96/apps/syncplay.png similarity index 100% rename from resources/hicolor/96x96/apps/syncplay.png rename to syncplay/resources/hicolor/96x96/apps/syncplay.png diff --git a/resources/house.png b/syncplay/resources/house.png similarity index 100% rename from resources/house.png rename to syncplay/resources/house.png diff --git a/resources/icon.icns b/syncplay/resources/icon.icns similarity index 100% rename from resources/icon.icns rename to syncplay/resources/icon.icns diff --git a/resources/icon.ico b/syncplay/resources/icon.ico similarity index 100% rename from resources/icon.ico rename to syncplay/resources/icon.ico diff --git a/resources/key_go.png b/syncplay/resources/key_go.png similarity index 100% rename from resources/key_go.png rename to syncplay/resources/key_go.png diff --git a/resources/license.rtf b/syncplay/resources/license.rtf similarity index 100% rename from resources/license.rtf rename to syncplay/resources/license.rtf diff --git a/resources/lock.png b/syncplay/resources/lock.png similarity index 100% rename from resources/lock.png rename to syncplay/resources/lock.png diff --git a/resources/lock_green.png b/syncplay/resources/lock_green.png similarity index 100% rename from resources/lock_green.png rename to syncplay/resources/lock_green.png diff --git a/resources/lock_green_dialog.png b/syncplay/resources/lock_green_dialog.png similarity index 100% rename from resources/lock_green_dialog.png rename to syncplay/resources/lock_green_dialog.png diff --git a/syncplay/resources/lock_green_dialog@2x.png b/syncplay/resources/lock_green_dialog@2x.png new file mode 100644 index 0000000..44788f1 Binary files /dev/null and b/syncplay/resources/lock_green_dialog@2x.png differ diff --git a/resources/lock_open.png b/syncplay/resources/lock_open.png similarity index 100% rename from resources/lock_open.png rename to syncplay/resources/lock_open.png diff --git a/resources/lua/intf/syncplay.lua b/syncplay/resources/lua/intf/syncplay.lua similarity index 100% rename from resources/lua/intf/syncplay.lua rename to syncplay/resources/lua/intf/syncplay.lua diff --git a/resources/macOS_dmg_bkg.tiff b/syncplay/resources/macOS_dmg_bkg.tiff similarity index 100% rename from resources/macOS_dmg_bkg.tiff rename to syncplay/resources/macOS_dmg_bkg.tiff diff --git a/resources/macOS_readme.pdf b/syncplay/resources/macOS_readme.pdf similarity index 100% rename from resources/macOS_readme.pdf rename to syncplay/resources/macOS_readme.pdf diff --git a/resources/man/changelog.md b/syncplay/resources/man/changelog.md similarity index 100% rename from resources/man/changelog.md rename to syncplay/resources/man/changelog.md diff --git a/resources/mpc-be.png b/syncplay/resources/mpc-be.png similarity index 100% rename from resources/mpc-be.png rename to syncplay/resources/mpc-be.png diff --git a/resources/mpc-hc.png b/syncplay/resources/mpc-hc.png similarity index 100% rename from resources/mpc-hc.png rename to syncplay/resources/mpc-hc.png diff --git a/resources/mpc-hc64.png b/syncplay/resources/mpc-hc64.png similarity index 100% rename from resources/mpc-hc64.png rename to syncplay/resources/mpc-hc64.png diff --git a/resources/mplayer.png b/syncplay/resources/mplayer.png similarity index 100% rename from resources/mplayer.png rename to syncplay/resources/mplayer.png diff --git a/resources/mpv.png b/syncplay/resources/mpv.png similarity index 100% rename from resources/mpv.png rename to syncplay/resources/mpv.png diff --git a/syncplay/resources/mpvnet.ico b/syncplay/resources/mpvnet.ico new file mode 100644 index 0000000..a70ca15 Binary files /dev/null and b/syncplay/resources/mpvnet.ico differ diff --git a/resources/page_white_key.png b/syncplay/resources/page_white_key.png similarity index 100% rename from resources/page_white_key.png rename to syncplay/resources/page_white_key.png diff --git a/resources/shield_add.png b/syncplay/resources/shield_add.png similarity index 100% rename from resources/shield_add.png rename to syncplay/resources/shield_add.png diff --git a/resources/shield_edit.png b/syncplay/resources/shield_edit.png similarity index 100% rename from resources/shield_edit.png rename to syncplay/resources/shield_edit.png diff --git a/resources/spinner.mng b/syncplay/resources/spinner.mng similarity index 100% rename from resources/spinner.mng rename to syncplay/resources/spinner.mng diff --git a/resources/syncplay-server.desktop b/syncplay/resources/syncplay-server.desktop similarity index 100% rename from resources/syncplay-server.desktop rename to syncplay/resources/syncplay-server.desktop diff --git a/resources/syncplay.desktop b/syncplay/resources/syncplay.desktop similarity index 100% rename from resources/syncplay.desktop rename to syncplay/resources/syncplay.desktop diff --git a/resources/syncplay.png b/syncplay/resources/syncplay.png similarity index 100% rename from resources/syncplay.png rename to syncplay/resources/syncplay.png diff --git a/syncplay/resources/syncplayAbout.png b/syncplay/resources/syncplayAbout.png new file mode 100644 index 0000000..63c472c Binary files /dev/null and b/syncplay/resources/syncplayAbout.png differ diff --git a/syncplay/resources/syncplayAbout@2x.png b/syncplay/resources/syncplayAbout@2x.png new file mode 100644 index 0000000..8a6123d Binary files /dev/null and b/syncplay/resources/syncplayAbout@2x.png differ diff --git a/resources/syncplayintf.lua b/syncplay/resources/syncplayintf.lua similarity index 98% rename from resources/syncplayintf.lua rename to syncplay/resources/syncplayintf.lua index 9115faf..839f4e4 100644 --- a/resources/syncplayintf.lua +++ b/syncplay/resources/syncplayintf.lua @@ -133,6 +133,7 @@ function add_chat(chat_message, mood) chat_log[entry] = { xpos=CANVAS_WIDTH, timecreated=mp.get_time(), text=tostring(chat_message), row=row } end +local old_ass_text = '' function chat_update() local ass = assdraw.ass_new() local chat_ass = '' @@ -179,7 +180,14 @@ function chat_update() ass:append(input_ass()) ass:append(chat_ass) end - mp.set_osd_ass(CANVAS_WIDTH,CANVAS_HEIGHT, ass.text) + + -- The commit that introduced the new API removed the internal heuristics on whether a refresh is required, + -- so we check for changed text manually to not cause excessive GPU load + -- https://github.com/mpv-player/mpv/commit/07287262513c0d1ea46b7beaf100e73f2008295f#diff-d88d582039dea993b6229da9f61ba76cL530 + if ass.text ~= old_ass_text then + mp.set_osd_ass(CANVAS_WIDTH,CANVAS_HEIGHT, ass.text) + old_ass_text = ass.text + end end function process_alert_osd() @@ -982,4 +990,4 @@ function set_syncplayintf_options(input) end chat_format = get_output_style() readyMpvAfterSettingsKnown() -end \ No newline at end of file +end diff --git a/resources/table_refresh.png b/syncplay/resources/table_refresh.png similarity index 100% rename from resources/table_refresh.png rename to syncplay/resources/table_refresh.png diff --git a/resources/third-party-notices.rtf b/syncplay/resources/third-party-notices.rtf similarity index 86% rename from resources/third-party-notices.rtf rename to syncplay/resources/third-party-notices.rtf index 13d3355..bd2c722 100644 --- a/resources/third-party-notices.rtf +++ b/syncplay/resources/third-party-notices.rtf @@ -303,6 +303,24 @@ TIONS OF ANY KIND, either express or implied. See the License for the specific l uage governing permissions and limitations under the License.\ \ +\b mpv-repl +\b0 \ +\ +Copyright 2016, James Ross-Gowan\ +\ +Permission to use, copy, modify, and/or distribute this software for any\ +purpose with or without fee is hereby granted, provided that the above\ +copyright notice and this permission notice appear in all copies.\ +\ +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\ +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\ +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\ +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\ +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\ +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\ +PERFORMANCE OF THIS SOFTWARE.\ +\ + \b python-certifi \b0 \ \ @@ -400,6 +418,35 @@ TIONS OF ANY KIND, either express or implied. See the License for the specific l uage governing permissions and limitations under the License.\ \ +\b Darkdetect +\b0 \ +\ +Copyright (c) 2019, Alberto Sottile\ +All rights reserved.\ +\ +Redistribution and use in source and binary forms, with or without\ +modification, are permitted provided that the following conditions are met:\ + * Redistributions of source code must retain the above copyright\ + notice, this list of conditions and the following disclaimer.\ + * Redistributions in binary form must reproduce the above copyright\ + notice, this list of conditions and the following disclaimer in the\ + documentation and/or other materials provided with the distribution.\ + * Neither the name of "darkdetect" nor the\ + names of its contributors may be used to endorse or promote products\ + derived from this software without specific prior written permission.\ +\ +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\ +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\ +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\ +DISCLAIMED. IN NO EVENT SHALL "Alberto Sottile" BE LIABLE FOR ANY\ +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\ +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\ +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\ +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\ +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\ +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\ +\ + \b Icons\ \ diff --git a/resources/tick.png b/syncplay/resources/tick.png similarity index 100% rename from resources/tick.png rename to syncplay/resources/tick.png diff --git a/resources/tick_checkbox.png b/syncplay/resources/tick_checkbox.png similarity index 100% rename from resources/tick_checkbox.png rename to syncplay/resources/tick_checkbox.png diff --git a/resources/timeline_marker.png b/syncplay/resources/timeline_marker.png similarity index 100% rename from resources/timeline_marker.png rename to syncplay/resources/timeline_marker.png diff --git a/resources/user_comment.png b/syncplay/resources/user_comment.png similarity index 100% rename from resources/user_comment.png rename to syncplay/resources/user_comment.png diff --git a/resources/user_key.png b/syncplay/resources/user_key.png similarity index 100% rename from resources/user_key.png rename to syncplay/resources/user_key.png diff --git a/resources/vlc.png b/syncplay/resources/vlc.png similarity index 100% rename from resources/vlc.png rename to syncplay/resources/vlc.png diff --git a/resources/world_add.png b/syncplay/resources/world_add.png similarity index 100% rename from resources/world_add.png rename to syncplay/resources/world_add.png diff --git a/resources/world_explore.png b/syncplay/resources/world_explore.png similarity index 100% rename from resources/world_explore.png rename to syncplay/resources/world_explore.png diff --git a/resources/world_go.png b/syncplay/resources/world_go.png similarity index 100% rename from resources/world_go.png rename to syncplay/resources/world_go.png diff --git a/syncplay/ui/ConfigurationGetter.py b/syncplay/ui/ConfigurationGetter.py index 2cbcaa6..8586301 100755 --- a/syncplay/ui/ConfigurationGetter.py +++ b/syncplay/ui/ConfigurationGetter.py @@ -92,7 +92,8 @@ class ConfigurationGetter(object): "notificationTimeout": 3, "alertTimeout": 5, "chatTimeout": 7, - "publicServers": [] + "publicServers": [], + "loadPlaylistFromFile": None } self._defaultConfig = self._config.copy() @@ -307,6 +308,8 @@ class ConfigurationGetter(object): key = "noGui" if key == "clear_gui_data": key = "clearGUIData" + if key == "load_playlist_from_file": + key = "loadPlaylistFromFile" self._config[key] = val def _splitPortAndHost(self, host): @@ -490,10 +493,13 @@ class ConfigurationGetter(object): self._argparser.add_argument('-r', '--room', metavar='room', type=str, nargs='?', help=getMessage("room-argument")) self._argparser.add_argument('-p', '--password', metavar='password', type=str, nargs='?', help=getMessage("password-argument")) self._argparser.add_argument('--player-path', metavar='path', type=str, help=getMessage("player-path-argument")) + self._argparser.add_argument('-psn', metavar='blackhole', type=str, help=argparse.SUPPRESS) self._argparser.add_argument('--language', metavar='language', type=str, help=getMessage("language-argument")) self._argparser.add_argument('file', metavar='file', type=str, nargs='?', help=getMessage("file-argument")) self._argparser.add_argument('--clear-gui-data', action='store_true', help=getMessage("clear-gui-data-argument")) self._argparser.add_argument('-v', '--version', action='store_true', help=getMessage("version-argument")) + self._argparser.add_argument('--load-playlist-from-file', metavar="loadPlaylistFromFile", type=str, help=getMessage("load-playlist-from-file-argument")) + self._argparser.add_argument('_args', metavar='options', type=str, nargs='*', help=getMessage("args-argument")) args = self._argparser.parse_args() if args.version: diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index 2ef7d65..c6f3a30 100755 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -117,6 +117,7 @@ class ConfigDialog(QtWidgets.QDialog): self.saveMoreState(True) self.tabListWidget.setCurrentRow(0) self.ensureTabListIsVisible() + if isMacOS(): self.mediaplayerSettingsGroup.setFixedHeight(self.mediaplayerSettingsGroup.minimumSizeHint().height()) self.stackedFrame.setFixedHeight(self.stackedFrame.minimumSizeHint().height()) else: self.tabListFrame.hide() @@ -134,12 +135,21 @@ class ConfigDialog(QtWidgets.QDialog): self.mediabrowseButton.show() self.saveMoreState(False) self.stackedLayout.setCurrentIndex(0) - newHeight = self.connectionSettingsGroup.minimumSizeHint().height() + self.mediaplayerSettingsGroup.minimumSizeHint().height() + self.bottomButtonFrame.minimumSizeHint().height() + 3 + if isMacOS(): + self.mediaplayerSettingsGroup.setFixedHeight(self.mediaplayerSettingsGroup.minimumSizeHint().height()) + newHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+50 + else: + newHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+13 if self.error: newHeight += self.errorLabel.height()+3 self.stackedFrame.setFixedHeight(newHeight) self.adjustSize() - self.setFixedSize(self.sizeHint()) + if isMacOS(): + newHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+50+16 + self.setFixedWidth(self.sizeHint().width()) + self.setFixedHeight(newHeight) + else: + self.setFixedSize(self.sizeHint()) self.moreToggling = False self.setFixedWidth(self.minimumSizeHint().width()) @@ -310,7 +320,7 @@ class ConfigDialog(QtWidgets.QDialog): try: self.lastCheckedForUpdates = settings.value("lastCheckedQt", None) if self.lastCheckedForUpdates: - if self.config["lastCheckedForUpdates"] is not None and self.config["lastCheckedForUpdates"] is not "": + if self.config["lastCheckedForUpdates"] != None and self.config["lastCheckedForUpdates"] != "": if self.lastCheckedForUpdates.toPython() > datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f"): self.config["lastCheckedForUpdates"] = self.lastCheckedForUpdates.toString("yyyy-MM-d HH:mm:ss.z") else: @@ -584,11 +594,7 @@ class ConfigDialog(QtWidgets.QDialog): i += 1 self.hostCombobox.setEditable(True) self.hostCombobox.setEditText(host) - self.hostCombobox.setFixedWidth(250) self.hostLabel = QLabel(getMessage("host-label"), self) - self.findServerButton = QtWidgets.QPushButton(QtGui.QIcon(resourcespath + 'arrow_refresh.png'), getMessage("update-server-list-label")) - self.findServerButton.clicked.connect(self.updateServerList) - self.findServerButton.setToolTip(getMessage("update-server-list-tooltip")) self.usernameTextbox = QLineEdit(self) self.usernameTextbox.setObjectName("name") @@ -610,20 +616,21 @@ class ConfigDialog(QtWidgets.QDialog): self.defaultroomLabel.setObjectName("room") self.defaultroomTextbox.setObjectName("room") - self.defaultroomTextbox.setMaxLength(constants.MAX_ROOM_NAME_LENGTH) - self.connectionSettingsLayout = QtWidgets.QGridLayout() self.connectionSettingsLayout.addWidget(self.hostLabel, 0, 0) self.connectionSettingsLayout.addWidget(self.hostCombobox, 0, 1) - self.connectionSettingsLayout.addWidget(self.findServerButton, 0, 2) self.connectionSettingsLayout.addWidget(self.serverpassLabel, 1, 0) - self.connectionSettingsLayout.addWidget(self.serverpassTextbox, 1, 1, 1, 2) + self.connectionSettingsLayout.addWidget(self.serverpassTextbox, 1, 1) self.connectionSettingsLayout.addWidget(self.usernameLabel, 2, 0) - self.connectionSettingsLayout.addWidget(self.usernameTextbox, 2, 1, 1, 2) + self.connectionSettingsLayout.addWidget(self.usernameTextbox, 2, 1) self.connectionSettingsLayout.addWidget(self.defaultroomLabel, 3, 0) - self.connectionSettingsLayout.addWidget(self.defaultroomTextbox, 3, 1, 1, 2) + self.connectionSettingsLayout.addWidget(self.defaultroomTextbox, 3, 1) + self.connectionSettingsLayout.setSpacing(10) self.connectionSettingsGroup.setLayout(self.connectionSettingsLayout) - self.connectionSettingsGroup.setMaximumHeight(self.connectionSettingsGroup.minimumSizeHint().height()) + if isMacOS(): + self.connectionSettingsGroup.setFixedHeight(self.connectionSettingsGroup.minimumSizeHint().height()) + else: + self.connectionSettingsGroup.setMaximumHeight(self.connectionSettingsGroup.minimumSizeHint().height()) self.playerargsTextbox = QLineEdit("", self) self.playerargsTextbox.textEdited.connect(self.changedPlayerArgs) @@ -632,13 +639,12 @@ class ConfigDialog(QtWidgets.QDialog): self.mediaplayerSettingsGroup = QtWidgets.QGroupBox(getMessage("media-setting-title")) self.executableiconImage = QtGui.QImage() self.executableiconLabel = QLabel(self) - self.executableiconLabel.setMinimumWidth(16) + self.executableiconLabel.setFixedWidth(16) self.executableiconLabel.setAlignment(Qt.AlignRight | Qt.AlignVCenter) self.executablepathCombobox = QtWidgets.QComboBox(self) self.executablepathCombobox.setEditable(True) self.executablepathCombobox.currentIndexChanged.connect(self.updateExecutableIcon) self.executablepathCombobox.setEditText(self._tryToFillPlayerPath(config['playerPath'], playerpaths)) - self.executablepathCombobox.setFixedWidth(330) self.executablepathCombobox.editTextChanged.connect(self.updateExecutableIcon) self.executablepathLabel = QLabel(getMessage("executable-path-label"), self) @@ -651,23 +657,45 @@ class ConfigDialog(QtWidgets.QDialog): self.executablepathLabel.setObjectName("executable-path") self.executablepathCombobox.setObjectName("executable-path") + self.executablepathCombobox.setMinimumContentsLength(constants.EXECUTABLE_COMBOBOX_MINIMUM_LENGTH) + self.executablepathCombobox.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToMinimumContentsLength) self.mediapathLabel.setObjectName("media-path") self.mediapathTextbox.setObjectName(constants.LOAD_SAVE_MANUALLY_MARKER + "media-path") self.playerargsLabel.setObjectName("player-arguments") self.playerargsTextbox.setObjectName(constants.LOAD_SAVE_MANUALLY_MARKER + "player-arguments") self.mediaplayerSettingsLayout = QtWidgets.QGridLayout() - self.mediaplayerSettingsLayout.addWidget(self.executablepathLabel, 0, 0) - self.mediaplayerSettingsLayout.addWidget(self.executableiconLabel, 0, 1) - self.mediaplayerSettingsLayout.addWidget(self.executablepathCombobox, 0, 2) - self.mediaplayerSettingsLayout.addWidget(self.executablebrowseButton, 0, 3) - self.mediaplayerSettingsLayout.addWidget(self.mediapathLabel, 1, 0) - self.mediaplayerSettingsLayout.addWidget(self.mediapathTextbox, 1, 2) - self.mediaplayerSettingsLayout.addWidget(self.mediabrowseButton, 1, 3) + self.mediaplayerSettingsLayout.addWidget(self.executablepathLabel, 0, 0, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.executableiconLabel, 0, 1, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.executablepathCombobox, 0, 2, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.executablebrowseButton, 0, 3, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.mediapathLabel, 1, 0, 1, 2) + self.mediaplayerSettingsLayout.addWidget(self.mediapathTextbox, 1, 2, 1, 1) + self.mediaplayerSettingsLayout.addWidget(self.mediabrowseButton, 1, 3, 1, 1) self.mediaplayerSettingsLayout.addWidget(self.playerargsLabel, 2, 0, 1, 2) self.mediaplayerSettingsLayout.addWidget(self.playerargsTextbox, 2, 2, 1, 2) + self.mediaplayerSettingsLayout.setSpacing(10) self.mediaplayerSettingsGroup.setLayout(self.mediaplayerSettingsLayout) + iconWidth = self.executableiconLabel.minimumSize().width()+self.mediaplayerSettingsLayout.spacing() + maxWidth = max( + self.hostLabel.minimumSizeHint().width(), + self.usernameLabel.minimumSizeHint().width(), + self.serverpassLabel.minimumSizeHint().width(), + self.defaultroomLabel.minimumSizeHint().width(), + self.executablepathLabel.minimumSizeHint().width(), + self.mediapathLabel.minimumSizeHint().width(), + self.playerargsLabel.minimumSizeHint().width() + ) + + self.hostLabel.setMinimumWidth(maxWidth+iconWidth) + self.usernameLabel.setMinimumWidth(maxWidth+iconWidth) + self.serverpassLabel.setMinimumWidth(maxWidth+iconWidth) + self.defaultroomLabel.setMinimumWidth(maxWidth+iconWidth) + self.executablepathLabel.setMinimumWidth(maxWidth) + self.mediapathLabel.setMinimumWidth(maxWidth+iconWidth) + self.playerargsLabel.setMinimumWidth(maxWidth+iconWidth) + self.showmoreCheckbox = QCheckBox(getMessage("more-title")) self.showmoreCheckbox.setObjectName(constants.LOAD_SAVE_MANUALLY_MARKER + "more") @@ -683,7 +711,7 @@ class ConfigDialog(QtWidgets.QDialog): self.errorLabel.setStyleSheet(constants.STYLE_SUCCESSLABEL) self.errorLabel.setText(error) self.errorLabel.setAlignment(Qt.AlignCenter) - self.basicOptionsLayout.addWidget(self.errorLabel, 0, 0) + self.basicOptionsLayout.addWidget(self.errorLabel) self.connectionSettingsGroup.setMaximumHeight(self.connectionSettingsGroup.minimumSizeHint().height()) self.basicOptionsLayout.setAlignment(Qt.AlignTop) self.basicOptionsLayout.addWidget(self.connectionSettingsGroup) @@ -1157,11 +1185,17 @@ class ConfigDialog(QtWidgets.QDialog): self.bottomButtonLayout.addWidget(self.runButton) self.bottomButtonLayout.addWidget(self.storeAndRunButton) self.bottomButtonFrame.setLayout(self.bottomButtonLayout) - self.bottomButtonLayout.setContentsMargins(5, 0, 5, 0) + if isMacOS(): + self.bottomButtonLayout.setContentsMargins(15, 0, 15, 0) + else: + self.bottomButtonLayout.setContentsMargins(5, 0, 5, 0) self.mainLayout.addWidget(self.bottomButtonFrame, 1, 0, 1, 2) self.bottomCheckboxFrame = QtWidgets.QFrame() - self.bottomCheckboxFrame.setContentsMargins(0, 0, 0, 0) + if isMacOS(): + self.bottomCheckboxFrame.setContentsMargins(3, 0, 6, 0) + else: + self.bottomCheckboxFrame.setContentsMargins(0, 0, 0, 0) self.bottomCheckboxLayout = QtWidgets.QGridLayout() self.alwaysshowCheckbox = QCheckBox(getMessage("forceguiprompt-label")) @@ -1262,6 +1296,30 @@ class ConfigDialog(QtWidgets.QDialog): self.serverpassTextbox.setReadOnly(False) self.serverpassTextbox.setText(self.storedPassword) + def createMenubar(self): + self.menuBar = QtWidgets.QMenuBar() + + # Edit menu + self.editMenu = QtWidgets.QMenu(getMessage("edit-menu-label"), self) + + self.cutAction = self.editMenu.addAction(getMessage("cut-menu-label")) + self.cutAction.setShortcuts(QtGui.QKeySequence.Cut) + + self.copyAction = self.editMenu.addAction(getMessage("copy-menu-label")) + self.copyAction.setShortcuts(QtGui.QKeySequence.Copy) + + self.pasteAction = self.editMenu.addAction(getMessage("paste-menu-label")) + self.pasteAction.setShortcuts(QtGui.QKeySequence.Paste) + + self.selectAction = self.editMenu.addAction(getMessage("selectall-menu-label")) + self.selectAction.setShortcuts(QtGui.QKeySequence.SelectAll) + + self.editMenu.addSeparator() + + self.menuBar.addMenu(self.editMenu) + + self.mainLayout.setMenuBar(self.menuBar) + def __init__(self, config, playerpaths, error, defaultConfig): self.config = config self.defaultConfig = defaultConfig @@ -1313,6 +1371,14 @@ class ConfigDialog(QtWidgets.QDialog): self.addMiscTab() self.tabList() + if isMacOS(): + self.createMenubar() + self.config['menuBar'] = dict() + self.config['menuBar']['bar'] = self.menuBar + self.config['menuBar']['editMenu'] = self.editMenu + else: + self.config['menuBar'] = None + self.mainLayout.addWidget(self.stackedFrame, 0, 1) self.addBottomLayout() self.updatePasswordVisibilty() @@ -1331,7 +1397,10 @@ class ConfigDialog(QtWidgets.QDialog): self.mediapathTextbox.show() self.mediapathLabel.show() self.mediabrowseButton.show() - newHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+3 + if isMacOS(): + newHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+50 + else: + newHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+13 if self.error: newHeight += self.errorLabel.height() + 3 self.stackedFrame.setFixedHeight(newHeight) @@ -1340,6 +1409,7 @@ class ConfigDialog(QtWidgets.QDialog): self.tabListWidget.setCurrentRow(0) self.stackedFrame.setFixedHeight(self.stackedFrame.minimumSizeHint().height()) + self.showmoreCheckbox.toggled.connect(self.moreToggled) self.setLayout(self.mainLayout) @@ -1347,7 +1417,14 @@ class ConfigDialog(QtWidgets.QDialog): self.runButton.setFocus() else: self.storeAndRunButton.setFocus() - self.setFixedSize(self.sizeHint()) + if isMacOS(): + initialHeight = self.connectionSettingsGroup.minimumSizeHint().height()+self.mediaplayerSettingsGroup.minimumSizeHint().height()+self.bottomButtonFrame.minimumSizeHint().height()+50 + if self.error: + initialHeight += 40 + self.setFixedWidth(self.sizeHint().width()) + self.setFixedHeight(initialHeight) + else: + self.setFixedSize(self.sizeHint()) self.setAcceptDrops(True) if constants.SHOW_TOOLTIPS: diff --git a/syncplay/ui/__init__.py b/syncplay/ui/__init__.py index c61a305..f883ef5 100755 --- a/syncplay/ui/__init__.py +++ b/syncplay/ui/__init__.py @@ -12,9 +12,9 @@ except ImportError: from syncplay.ui.consoleUI import ConsoleUI -def getUi(graphical=True): +def getUi(graphical=True, passedBar=None): if graphical: - ui = GraphicalUI() + ui = GraphicalUI(passedBar=passedBar) else: ui = ConsoleUI() ui.setDaemon(True) diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py index a50ca16..27dcb87 100755 --- a/syncplay/ui/gui.py +++ b/syncplay/ui/gui.py @@ -31,6 +31,11 @@ if isMacOS() and IsPySide: from Foundation import NSURL from Cocoa import NSString, NSUTF8StringEncoding lastCheckedForUpdates = None +from syncplay.vendor import darkdetect +if isMacOS(): + isDarkMode = darkdetect.isDark() +else: + isDarkMode = None class ConsoleInGUI(ConsoleUI): @@ -51,7 +56,8 @@ class ConsoleInGUI(ConsoleUI): class UserlistItemDelegate(QtWidgets.QStyledItemDelegate): - def __init__(self): + def __init__(self, view=None): + self.view = view QtWidgets.QStyledItemDelegate.__init__(self) def sizeHint(self, option, index): @@ -71,6 +77,11 @@ class UserlistItemDelegate(QtWidgets.QStyledItemDelegate): crossIconQPixmap = QtGui.QPixmap(resourcespath + "cross.png") roomController = currentQAbstractItemModel.data(itemQModelIndex, Qt.UserRole + constants.USERITEM_CONTROLLER_ROLE) userReady = currentQAbstractItemModel.data(itemQModelIndex, Qt.UserRole + constants.USERITEM_READY_ROLE) + isUserRow = indexQModelIndex.parent() != indexQModelIndex.parent().parent() + bkgColor = self.view.palette().color(QtGui.QPalette.Base) + if isUserRow and (isMacOS() or isLinux()): + blankRect = QtCore.QRect(0, optionQStyleOptionViewItem.rect.y(), optionQStyleOptionViewItem.rect.width(), optionQStyleOptionViewItem.rect.height()) + itemQPainter.fillRect(blankRect, bkgColor) if roomController and not controlIconQPixmap.isNull(): itemQPainter.drawPixmap( @@ -89,7 +100,6 @@ class UserlistItemDelegate(QtWidgets.QStyledItemDelegate): (optionQStyleOptionViewItem.rect.x()-10), midY - 8, crossIconQPixmap.scaled(16, 16, Qt.KeepAspectRatio)) - isUserRow = indexQModelIndex.parent() != indexQModelIndex.parent().parent() if isUserRow: optionQStyleOptionViewItem.rect.setX(optionQStyleOptionViewItem.rect.x()+constants.USERLIST_GUI_USERNAME_OFFSET) if column == constants.USERLIST_GUI_FILENAME_COLUMN: @@ -127,7 +137,11 @@ class AboutDialog(QtWidgets.QDialog): self.setWindowIcon(QtGui.QPixmap(resourcespath + 'syncplay.png')) nameLabel = QtWidgets.QLabel("
Syncplay
") nameLabel.setFont(QtGui.QFont("Helvetica", 18)) - linkLabel = QtWidgets.QLabel("
syncplay.pl
") + linkLabel = QtWidgets.QLabel() + if isDarkMode: + linkLabel.setText(("
syncplay.pl
").format(constants.STYLE_DARK_ABOUT_LINK_COLOR)) + else: + linkLabel.setText("
syncplay.pl
") linkLabel.setOpenExternalLinks(True) versionExtString = version + revision versionLabel = QtWidgets.QLabel( @@ -137,9 +151,10 @@ class AboutDialog(QtWidgets.QDialog): licenseLabel = QtWidgets.QLabel( "

Copyright © 2012–2019 Syncplay

" + getMessage("about-dialog-license-text") + "

") - aboutIconPixmap = QtGui.QPixmap(resourcespath + "syncplay.png") + aboutIcon = QtGui.QIcon() + aboutIcon.addFile(resourcespath + "syncplayAbout.png") aboutIconLabel = QtWidgets.QLabel() - aboutIconLabel.setPixmap(aboutIconPixmap.scaled(65, 65, Qt.KeepAspectRatio)) + aboutIconLabel.setPixmap(aboutIcon.pixmap(64, 64)) aboutLayout = QtWidgets.QGridLayout() aboutLayout.addWidget(aboutIconLabel, 0, 0, 3, 4, Qt.AlignHCenter) aboutLayout.addWidget(nameLabel, 3, 0, 1, 4) @@ -192,9 +207,10 @@ class CertificateDialog(QtWidgets.QDialog): descLabel.setFont(QtGui.QFont("Helvetica", 12)) connDataLabel.setFont(QtGui.QFont("Helvetica", 12)) certDataLabel.setFont(QtGui.QFont("Helvetica", 12)) - lockIconPixmap = QtGui.QPixmap(resourcespath + "lock_green_dialog.png") + lockIcon = QtGui.QIcon() + lockIcon.addFile(resourcespath + "lock_green_dialog.png") lockIconLabel = QtWidgets.QLabel() - lockIconLabel.setPixmap(lockIconPixmap.scaled(64, 64, Qt.KeepAspectRatio)) + lockIconLabel.setPixmap(lockIcon.pixmap(64, 64)) certLayout = QtWidgets.QGridLayout() certLayout.addWidget(lockIconLabel, 1, 0, 3, 1, Qt.AlignLeft | Qt.AlignTop) certLayout.addWidget(statusLabel, 0, 1, 1, 3) @@ -320,11 +336,17 @@ class MainWindow(QtWidgets.QMainWindow): fileIsAvailable = self.selfWindow.isFileAvailable(itemFilename) fileIsUntrusted = self.selfWindow.isItemUntrusted(itemFilename) if fileIsUntrusted: - self.item(item).setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_UNTRUSTEDITEM_COLOR))) + if isDarkMode: + self.item(item).setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_DARK_UNTRUSTEDITEM_COLOR))) + else: + self.item(item).setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_UNTRUSTEDITEM_COLOR))) elif fileIsAvailable: - self.item(item).setForeground(QtGui.QBrush(QtGui.QColor(QtGui.QPalette.ColorRole(QtGui.QPalette.Text)))) + self.item(item).setForeground(QtGui.QBrush(self.selfWindow.palette().color(QtGui.QPalette.Text))) else: - self.item(item).setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_DIFFERENTITEM_COLOR))) + if isDarkMode: + self.item(item).setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_DARK_DIFFERENTITEM_COLOR))) + else: + self.item(item).setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_DIFFERENTITEM_COLOR))) self.selfWindow._syncplayClient.fileSwitch.setFilenameWatchlist(self.selfWindow.newWatchlist) self.forceUpdate() @@ -601,24 +623,28 @@ class MainWindow(QtWidgets.QMainWindow): sameDuration = sameFileduration(user.file['duration'], currentUser.file['duration']) underlinefont = QtGui.QFont() underlinefont.setUnderline(True) + differentItemColor = constants.STYLE_DARK_DIFFERENTITEM_COLOR if isDarkMode else constants.STYLE_DIFFERENTITEM_COLOR if sameRoom: if not sameName: - filenameitem.setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_DIFFERENTITEM_COLOR))) + filenameitem.setForeground(QtGui.QBrush(QtGui.QColor(differentItemColor))) filenameitem.setFont(underlinefont) if not sameSize: if formatSize(user.file['size']) == formatSize(currentUser.file['size']): filesizeitem = QtGui.QStandardItem(formatSize(user.file['size'], precise=True)) filesizeitem.setFont(underlinefont) - filesizeitem.setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_DIFFERENTITEM_COLOR))) + filesizeitem.setForeground(QtGui.QBrush(QtGui.QColor(differentItemColor))) if not sameDuration: - filedurationitem.setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_DIFFERENTITEM_COLOR))) + filedurationitem.setForeground(QtGui.QBrush(QtGui.QColor(differentItemColor))) filedurationitem.setFont(underlinefont) else: filenameitem = QtGui.QStandardItem(getMessage("nofile-note")) filedurationitem = QtGui.QStandardItem("") filesizeitem = QtGui.QStandardItem("") if room == currentUser.room: - filenameitem.setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_NOFILEITEM_COLOR))) + if isDarkMode: + filenameitem.setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_DARK_NOFILEITEM_COLOR))) + else: + filenameitem.setForeground(QtGui.QBrush(QtGui.QColor(constants.STYLE_NOFILEITEM_COLOR))) font = QtGui.QFont() if currentUser.username == user.username: font.setWeight(QtGui.QFont.Bold) @@ -633,7 +659,7 @@ class MainWindow(QtWidgets.QMainWindow): roomitem.appendRow((useritem, filesizeitem, filedurationitem, filenameitem)) self.listTreeModel = self._usertreebuffer self.listTreeView.setModel(self.listTreeModel) - self.listTreeView.setItemDelegate(UserlistItemDelegate()) + self.listTreeView.setItemDelegate(UserlistItemDelegate(view=self.listTreeView)) self.listTreeView.setItemsExpandable(False) self.listTreeView.setRootIsDecorated(False) self.listTreeView.expandAll() @@ -666,9 +692,9 @@ class MainWindow(QtWidgets.QMainWindow): pathFound = self._syncplayClient.fileSwitch.findFilepath(firstFile) if not isURL(firstFile) else None if self._syncplayClient.userlist.currentUser.file is None or firstFile != self._syncplayClient.userlist.currentUser.file["name"]: if isURL(firstFile): - menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openstreamurl-menu-label"), lambda: self.openFile(firstFile, resetPosition=True)) + menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openstreamurl-menu-label"), lambda: self.openFile(firstFile, resetPosition=True, fromUser=True)) elif pathFound: - menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openmedia-menu-label"), lambda: self.openFile(pathFound, resetPosition=True)) + menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openmedia-menu-label"), lambda: self.openFile(pathFound, resetPosition=True, fromUser=True)) if pathFound: menu.addAction(QtGui.QPixmap(resourcespath + "folder_film.png"), getMessage('open-containing-folder'), @@ -685,6 +711,10 @@ class MainWindow(QtWidgets.QMainWindow): menu.addAction(QtGui.QPixmap(resourcespath + "film_add.png"), getMessage("addfilestoplaylist-menu-label"), lambda: self.OpenAddFilesToPlaylistDialog()) menu.addAction(QtGui.QPixmap(resourcespath + "world_add.png"), getMessage("addurlstoplaylist-menu-label"), lambda: self.OpenAddURIsToPlaylistDialog()) menu.addSeparator() + menu.addAction(getMessage("loadplaylistfromfile-menu-label"),lambda: self.OpenLoadPlaylistFromFileDialog()) # TODO: Add icon + menu.addAction("Load and shuffle playlist from file",lambda: self.OpenLoadPlaylistFromFileDialog(shuffle=True)) # TODO: Add icon and messages_en + menu.addAction(getMessage("saveplaylisttofile-menu-label"),lambda: self.OpenSavePlaylistToFileDialog()) # TODO: Add icon + menu.addSeparator() menu.addAction(QtGui.QPixmap(resourcespath + "film_folder_edit.png"), getMessage("setmediadirectories-menu-label"), lambda: self.openSetMediaDirectoriesDialog()) menu.addAction(QtGui.QPixmap(resourcespath + "shield_edit.png"), getMessage("settrusteddomains-menu-label"), lambda: self.openSetTrustedDomainsDialog()) menu.exec_(self.playlist.viewport().mapToGlobal(position)) @@ -699,12 +729,18 @@ class MainWindow(QtWidgets.QMainWindow): menu = QtWidgets.QMenu() username = item.sibling(item.row(), 0).data() - if username == self._syncplayClient.userlist.currentUser.username: - shortUsername = getMessage("item-is-yours-indicator") - elif len(username) < 15: - shortUsername = getMessage("item-is-others-indicator").format(username) + + if len(username) < 15: + shortUsername = username else: - shortUsername = "{}...".format(getMessage("item-is-others-indicator").format(username[0:12])) # TODO: Enforce username limits in client and server + shortUsername = "{}...".format(username[0:12]) + + if username == self._syncplayClient.userlist.currentUser.username: + addUsersFileToPlaylistLabelText = getMessage("addyourfiletoplaylist-menu-label") + addUsersStreamToPlaylistLabelText = getMessage("addyourstreamstoplaylist-menu-label") + else: + addUsersFileToPlaylistLabelText = getMessage("addotherusersfiletoplaylist-menu-label").format(shortUsername) + addUsersStreamToPlaylistLabelText = getMessage("addotherusersstreamstoplaylist-menu-label").format(shortUsername) filename = item.sibling(item.row(), 3).data() while item.parent().row() != -1: @@ -715,17 +751,17 @@ class MainWindow(QtWidgets.QMainWindow): elif username and filename and filename != getMessage("nofile-note"): if self.config['sharedPlaylistEnabled'] and not self.isItemInPlaylist(filename): if isURL(filename): - menu.addAction(QtGui.QPixmap(resourcespath + "world_add.png"), getMessage("addusersstreamstoplaylist-menu-label").format(shortUsername), lambda: self.addStreamToPlaylist(filename)) + menu.addAction(QtGui.QPixmap(resourcespath + "world_add.png"), addUsersStreamToPlaylistLabelText, lambda: self.addStreamToPlaylist(filename)) else: - menu.addAction(QtGui.QPixmap(resourcespath + "film_add.png"), getMessage("addusersfiletoplaylist-menu-label").format(shortUsername), lambda: self.addStreamToPlaylist(filename)) + menu.addAction(QtGui.QPixmap(resourcespath + "film_add.png"), addUsersFileToPlaylistLabelText, lambda: self.addStreamToPlaylist(filename)) if self._syncplayClient.userlist.currentUser.file is None or filename != self._syncplayClient.userlist.currentUser.file["name"]: if isURL(filename): - menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openusersstream-menu-label").format(shortUsername), lambda: self.openFile(filename)) + menu.addAction(QtGui.QPixmap(resourcespath + "world_go.png"), getMessage("openusersstream-menu-label").format(shortUsername), lambda: self.openFile(filename, resetPosition=False, fromUser=True)) else: pathFound = self._syncplayClient.fileSwitch.findFilepath(filename) if pathFound: - menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openusersfile-menu-label").format(shortUsername), lambda: self.openFile(pathFound)) + menu.addAction(QtGui.QPixmap(resourcespath + "film_go.png"), getMessage("openusersfile-menu-label").format(shortUsername), lambda: self.openFile(pathFound, resetPosition=False, fromUser=True)) if self._syncplayClient.isUntrustedTrustableURI(filename): domain = utils.getDomainFromURL(filename) menu.addAction(QtGui.QPixmap(resourcespath + "shield_add.png"), getMessage("addtrusteddomain-menu-label").format(domain), lambda: self.addTrustedDomain(domain)) @@ -782,11 +818,11 @@ class MainWindow(QtWidgets.QMainWindow): if self._isTryingToChangeToCurrentFile(filename): return if isURL(filename): - self._syncplayClient._player.openFile(filename, resetPosition=True) + self._syncplayClient.openFile(filename, resetPosition=True) else: pathFound = self._syncplayClient.fileSwitch.findFilepath(filename, highPriority=True) if pathFound: - self._syncplayClient._player.openFile(pathFound, resetPosition=True) + self._syncplayClient.openFile(pathFound, resetPosition=True) else: self._syncplayClient.ui.showErrorMessage(getMessage("cannot-find-file-for-playlist-switch-error").format(filename)) @@ -809,11 +845,11 @@ class MainWindow(QtWidgets.QMainWindow): if self._isTryingToChangeToCurrentFile(filename): return if isURL(filename): - self._syncplayClient._player.openFile(filename) + self._syncplayClient.openFile(filename) else: pathFound = self._syncplayClient.fileSwitch.findFilepath(filename, highPriority=True) if pathFound: - self._syncplayClient._player.openFile(pathFound) + self._syncplayClient.openFile(pathFound) else: self._syncplayClient.fileSwitch.updateInfo() self.showErrorMessage(getMessage("switch-file-not-found-error").format(filename)) @@ -839,7 +875,10 @@ class MainWindow(QtWidgets.QMainWindow): message = message.replace("&", "&").replace('"', """).replace("<", "<").replace(">", ">") message = message.replace("<a href="https://syncplay.pl/trouble">", '').replace("</a>", "") message = message.replace("\n", "
") - message = "".format(constants.STYLE_ERRORNOTIFICATION) + message + "" + if isDarkMode: + message = "".format(constants.STYLE_DARK_ERRORNOTIFICATION) + message + "" + else: + message = "".format(constants.STYLE_ERRORNOTIFICATION) + message + "" self.newMessage(time.strftime(constants.UI_TIME_FORMAT, time.localtime()) + message + "
") @needsClient @@ -971,7 +1010,7 @@ class MainWindow(QtWidgets.QMainWindow): self.mediadirectory = os.path.dirname(fileName) self._syncplayClient.fileSwitch.setCurrentDirectory(self.mediadirectory) self.saveMediaBrowseSettings() - self._syncplayClient._player.openFile(fileName) + self._syncplayClient.openFile(fileName, resetPosition=False, fromUser=True) @needsClient def OpenAddFilesToPlaylistDialog(self): @@ -1006,6 +1045,47 @@ class MainWindow(QtWidgets.QMainWindow): self.updatingPlaylist = False self.playlist.updatePlaylist(self.getPlaylistState()) + @needsClient + def OpenLoadPlaylistFromFileDialog(self, shuffle=False): + self.loadMediaBrowseSettings() + if isMacOS() and IsPySide: + options = QtWidgets.QFileDialog.Options(QtWidgets.QFileDialog.DontUseNativeDialog) + else: + options = QtWidgets.QFileDialog.Options() + self.mediadirectory = "" + currentdirectory = os.path.dirname(self._syncplayClient.userlist.currentUser.file["path"]) if self._syncplayClient.userlist.currentUser.file else None + if currentdirectory and os.path.isdir(currentdirectory): + defaultdirectory = currentdirectory + else: + defaultdirectory = self.getInitialMediaDirectory() + browserfilter = "Playlists (*.m3u *.m3u8 *.txt)" + filepath, filtr = QtWidgets.QFileDialog.getOpenFileName( + self, "Load playlist from file", defaultdirectory, + browserfilter, "", options) # TODO: Note Shuffle and move to messages_en + if os.path.isfile(filepath): + self._syncplayClient.playlist.loadPlaylistFromFile(filepath, shuffle=shuffle) + self.playlist.updatePlaylist(self.getPlaylistState()) + + @needsClient + def OpenSavePlaylistToFileDialog(self): + self.loadMediaBrowseSettings() + if isMacOS() and IsPySide: + options = QtWidgets.QFileDialog.Options(QtWidgets.QFileDialog.DontUseNativeDialog) + else: + options = QtWidgets.QFileDialog.Options() + self.mediadirectory = "" + currentdirectory = os.path.dirname(self._syncplayClient.userlist.currentUser.file["path"]) if self._syncplayClient.userlist.currentUser.file else None + if currentdirectory and os.path.isdir(currentdirectory): + defaultdirectory = currentdirectory + else: + defaultdirectory = self.getInitialMediaDirectory() + browserfilter = "Playlist (*.m3u8 *.m3u *.txt)" + filepath, filtr = QtWidgets.QFileDialog.getSaveFileName( + self, "Save playlist to file", defaultdirectory, + browserfilter, "", options) # TODO: Move to messages_en + if filepath: + self._syncplayClient.playlist.savePlaylistToFile(filepath) + @needsClient def OpenAddURIsToPlaylistDialog(self): URIsDialog = QtWidgets.QDialog() @@ -1151,7 +1231,7 @@ class MainWindow(QtWidgets.QMainWindow): self, getMessage("promptforstreamurl-msgbox-label"), getMessage("promptforstreamurlinfo-msgbox-label"), QtWidgets.QLineEdit.Normal, "") if ok and streamURL != '': - self._syncplayClient._player.openFile(streamURL) + self._syncplayClient.openFile(streamURL, resetPosition=False, fromUser=True) @needsClient def createControlledRoom(self): @@ -1249,6 +1329,7 @@ class MainWindow(QtWidgets.QMainWindow): window.outputLayout = QtWidgets.QVBoxLayout() window.outputbox = QtWidgets.QTextBrowser() + if isDarkMode: window.outputbox.document().setDefaultStyleSheet(constants.STYLE_DARK_LINKS_COLOR); window.outputbox.setReadOnly(True) window.outputbox.setTextInteractionFlags(window.outputbox.textInteractionFlags() | Qt.TextSelectableByKeyboard) window.outputbox.setOpenExternalLinks(True) @@ -1256,7 +1337,8 @@ class MainWindow(QtWidgets.QMainWindow): window.outputbox.moveCursor(QtGui.QTextCursor.End) window.outputbox.insertHtml(constants.STYLE_CONTACT_INFO.format(getMessage("contact-label"))) window.outputbox.moveCursor(QtGui.QTextCursor.End) - window.outputbox.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) + window.outputbox.setCursorWidth(0) + if not isMacOS(): window.outputbox.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) window.outputlabel = QtWidgets.QLabel(getMessage("notifications-heading-label")) window.outputlabel.setMinimumHeight(27) @@ -1280,6 +1362,7 @@ class MainWindow(QtWidgets.QMainWindow): window.outputFrame = QtWidgets.QFrame() window.outputFrame.setLineWidth(0) window.outputFrame.setMidLineWidth(0) + if isMacOS(): window.outputLayout.setSpacing(8) window.outputLayout.setContentsMargins(0, 0, 0, 0) window.outputLayout.addWidget(window.outputlabel) window.outputLayout.addWidget(window.outputbox) @@ -1296,8 +1379,8 @@ class MainWindow(QtWidgets.QMainWindow): self.listTreeView.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.listTreeView.customContextMenuRequested.connect(self.openRoomMenu) window.listlabel = QtWidgets.QLabel(getMessage("userlist-heading-label")) - window.listlabel.setMinimumHeight(27) if isMacOS: + window.listlabel.setMinimumHeight(21) window.sslButton = QtWidgets.QPushButton(QtGui.QPixmap(resourcespath + 'lock_green.png').scaled(14, 14),"") window.sslButton.setVisible(False) window.sslButton.setFixedHeight(21) @@ -1305,6 +1388,7 @@ class MainWindow(QtWidgets.QMainWindow): window.sslButton.setMinimumSize(21, 21) window.sslButton.setStyleSheet("QPushButton:!hover{border: 1px solid gray;} QPushButton:hover{border:2px solid black;}") else: + window.listlabel.setMinimumHeight(27) window.sslButton = QtWidgets.QPushButton(QtGui.QPixmap(resourcespath + 'lock_green.png'),"") window.sslButton.setVisible(False) window.sslButton.setFixedHeight(27) @@ -1316,6 +1400,7 @@ class MainWindow(QtWidgets.QMainWindow): window.listFrame.setMidLineWidth(0) window.listFrame.setSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) window.listLayout.setContentsMargins(0, 0, 0, 0) + if isMacOS(): window.listLayout.setSpacing(8) window.userlistLayout = QtWidgets.QGridLayout() window.userlistFrame = QtWidgets.QFrame() @@ -1327,6 +1412,7 @@ class MainWindow(QtWidgets.QMainWindow): window.userlistLayout.addWidget(window.listlabel, 0, 0, Qt.AlignLeft) window.userlistLayout.addWidget(window.sslButton, 0, 2, Qt.AlignRight) window.userlistLayout.addWidget(window.listTreeView, 1, 0, 1, 3) + if isMacOS(): window.userlistLayout.setContentsMargins(3, 0, 3, 0) window.listSplit = QtWidgets.QSplitter(Qt.Vertical, self) window.listSplit.addWidget(window.userlistFrame) @@ -1342,9 +1428,13 @@ class MainWindow(QtWidgets.QMainWindow): window.roomLayout = QtWidgets.QHBoxLayout() window.roomFrame = QtWidgets.QFrame() window.roomFrame.setLayout(self.roomLayout) - window.roomFrame.setContentsMargins(0, 0, 0, 0) window.roomFrame.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) - window.roomLayout.setContentsMargins(0, 0, 0, 0) + if isMacOS(): + window.roomLayout.setSpacing(8) + window.roomLayout.setContentsMargins(3, 0, 0, 0) + else: + window.roomFrame.setContentsMargins(0, 0, 0, 0) + window.roomLayout.setContentsMargins(0, 0, 0, 0) self.roomButton.setToolTip(getMessage("joinroom-tooltip")) window.roomLayout.addWidget(window.roomInput) window.roomLayout.addWidget(window.roomButton) @@ -1352,6 +1442,7 @@ class MainWindow(QtWidgets.QMainWindow): window.listLayout.addWidget(window.roomFrame, Qt.AlignRight) window.listFrame.setLayout(window.listLayout) + if isMacOS(): window.listFrame.setMinimumHeight(window.outputFrame.height()) window.topSplit.addWidget(window.outputFrame) window.topSplit.addWidget(window.listFrame) @@ -1365,6 +1456,7 @@ class MainWindow(QtWidgets.QMainWindow): window.bottomFrame = QtWidgets.QFrame() window.bottomFrame.setLayout(window.bottomLayout) window.bottomLayout.setContentsMargins(0, 0, 0, 0) + if isMacOS(): window.bottomLayout.setSpacing(0) self.addPlaybackLayout(window) @@ -1394,8 +1486,6 @@ class MainWindow(QtWidgets.QMainWindow): playlistItem = QtWidgets.QListWidgetItem(getMessage("playlist-instruction-item-message")) playlistItem.setFont(noteFont) window.playlist.addItem(playlistItem) - playlistItem.setFont(noteFont) - window.playlist.addItem(playlistItem) window.playlistLayout.addWidget(window.playlist) window.playlistLayout.setAlignment(Qt.AlignTop) window.playlistGroup.setLayout(window.playlistLayout) @@ -1412,11 +1502,12 @@ class MainWindow(QtWidgets.QMainWindow): window.readyPushButton.setStyleSheet(constants.STYLE_READY_PUSHBUTTON) window.readyPushButton.setToolTip(getMessage("ready-tooltip")) window.listLayout.addWidget(window.readyPushButton, Qt.AlignRight) + if isMacOS(): window.listLayout.setContentsMargins(0, 0, 0, 10) window.autoplayLayout = QtWidgets.QHBoxLayout() window.autoplayFrame = QtWidgets.QFrame() window.autoplayFrame.setVisible(False) - window.autoplayLayout.setContentsMargins(0, 0, 0, 0) + window.autoplayFrame.setLayout(window.autoplayLayout) window.autoplayPushButton = QtWidgets.QPushButton() autoPlayFont = QtGui.QFont() @@ -1426,8 +1517,15 @@ class MainWindow(QtWidgets.QMainWindow): window.autoplayPushButton.setAutoExclusive(False) window.autoplayPushButton.toggled.connect(self.changeAutoplayState) window.autoplayPushButton.setFont(autoPlayFont) + if isMacOS(): + window.autoplayFrame.setMinimumWidth(window.listFrame.sizeHint().width()) + window.autoplayLayout.setSpacing(15) + window.autoplayLayout.setContentsMargins(0, 8, 3, 3) + window.autoplayPushButton.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) + else: + window.autoplayLayout.setContentsMargins(0, 0, 0, 0) + window.autoplayPushButton.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) window.autoplayPushButton.setStyleSheet(constants.STYLE_AUTO_PLAY_PUSHBUTTON) - window.autoplayPushButton.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding) window.autoplayPushButton.setToolTip(getMessage("autoplay-tooltip")) window.autoplayLabel = QtWidgets.QLabel(getMessage("autoplay-minimum-label")) window.autoplayLabel.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) @@ -1483,9 +1581,15 @@ class MainWindow(QtWidgets.QMainWindow): window.playbackFrame.setMaximumWidth(window.playbackFrame.sizeHint().width()) window.outputLayout.addWidget(window.playbackFrame) - def addMenubar(self, window): - window.menuBar = QtWidgets.QMenuBar() + def loadMenubar(self, window, passedBar): + if passedBar is not None: + window.menuBar = passedBar['bar'] + window.editMenu = passedBar['editMenu'] + else: + window.menuBar = QtWidgets.QMenuBar() + window.editMenu = None + def populateMenubar(self, window): # File menu window.fileMenu = QtWidgets.QMenu(getMessage("file-menu-label"), self) @@ -1499,10 +1603,17 @@ class MainWindow(QtWidgets.QMainWindow): getMessage("setmediadirectories-menu-label")) window.openAction.triggered.connect(self.openSetMediaDirectoriesDialog) - window.exitAction = window.fileMenu.addAction(QtGui.QPixmap(resourcespath + 'cross.png'), - getMessage("exit-menu-label")) + window.exitAction = window.fileMenu.addAction(getMessage("exit-menu-label")) + if isMacOS(): + window.exitAction.setMenuRole(QtWidgets.QAction.QuitRole) + else: + window.exitAction.setIcon(QtGui.QPixmap(resourcespath + 'cross.png')) window.exitAction.triggered.connect(self.exitSyncplay) - window.menuBar.addMenu(window.fileMenu) + + if(window.editMenu is not None): + window.menuBar.insertMenu(window.editMenu.menuAction(), window.fileMenu) + else: + window.menuBar.addMenu(window.fileMenu) # Playback menu @@ -1579,11 +1690,11 @@ class MainWindow(QtWidgets.QMainWindow): getMessage("about-menu-label")) else: window.about = window.helpMenu.addAction("&About") + window.about.setMenuRole(QtWidgets.QAction.AboutRole) window.about.triggered.connect(self.openAbout) window.menuBar.addMenu(window.helpMenu) - if not isMacOS(): - window.mainLayout.setMenuBar(window.menuBar) + window.mainLayout.setMenuBar(window.menuBar) @needsClient def openSSLDetails(self): @@ -1737,10 +1848,10 @@ class MainWindow(QtWidgets.QMainWindow): else: dropfilepath = os.path.abspath(str(url.toLocalFile())) if rewindFile == False: - self._syncplayClient._player.openFile(dropfilepath) + self._syncplayClient.openFile(dropfilepath, resetPosition=False, fromUser=True) else: self._syncplayClient.setPosition(0) - self._syncplayClient._player.openFile(dropfilepath, resetPosition=True) + self._syncplayClient.openFile(dropfilepath, resetPosition=True, fromUser=True) self._syncplayClient.setPosition(0) def setPlaylist(self, newPlaylist, newIndexFilename=None): @@ -1782,8 +1893,8 @@ class MainWindow(QtWidgets.QMainWindow): else: self.playlist.insertItem(index, filePath) - def openFile(self, filePath, resetPosition=False): - self._syncplayClient._player.openFile(filePath, resetPosition) + def openFile(self, filePath, resetPosition=False, fromUser=False): + self._syncplayClient.openFile(filePath, resetPosition, fromUser=fromUser) def noPlaylistDuplicates(self, filename): if self.isItemInPlaylist(filename): @@ -1859,7 +1970,7 @@ class MainWindow(QtWidgets.QMainWindow): settings.beginGroup("PublicServerList") self.publicServerList = settings.value("publicServers", None) - def __init__(self): + def __init__(self, passedBar=None): super(MainWindow, self).__init__() self.console = ConsoleInGUI() self.console.setDaemon(True) @@ -1873,15 +1984,16 @@ class MainWindow(QtWidgets.QMainWindow): self.setWindowFlags(self.windowFlags()) else: self.setWindowFlags(self.windowFlags() & Qt.AA_DontUseNativeMenuBar) - self.setWindowTitle("Syncplay v" + version) + self.setWindowTitle("Syncplay v" + version + revision) self.mainLayout = QtWidgets.QVBoxLayout() self.addTopLayout(self) self.addBottomLayout(self) - self.addMenubar(self) + self.loadMenubar(self, passedBar) + self.populateMenubar(self) self.addMainFrame(self) self.loadSettings() self.setWindowIcon(QtGui.QPixmap(resourcespath + "syncplay.png")) - self.setWindowFlags(self.windowFlags() & Qt.WindowCloseButtonHint & Qt.AA_DontUseNativeMenuBar & Qt.WindowMinimizeButtonHint & ~Qt.WindowContextHelpButtonHint) + self.setWindowFlags(self.windowFlags() & Qt.WindowCloseButtonHint & Qt.WindowMinimizeButtonHint & ~Qt.WindowContextHelpButtonHint) self.show() self.setAcceptDrops(True) self.clearedPlaylistNote = False diff --git a/syncplay/utils.py b/syncplay/utils.py index 776889b..5a394d3 100755 --- a/syncplay/utils.py +++ b/syncplay/utils.py @@ -147,7 +147,7 @@ def isASCII(s): def findResourcePath(resourceName): if resourceName == "syncplay.lua": - resourcePath = os.path.join(findWorkingDir(),"resources", "lua", "intf", resourceName) + resourcePath = os.path.join(findWorkingDir(), "resources", "lua", "intf", resourceName) else: resourcePath = os.path.join(findWorkingDir(), "resources", resourceName) return resourcePath @@ -156,7 +156,7 @@ def findResourcePath(resourceName): def findWorkingDir(): frozen = getattr(sys, 'frozen', '') if not frozen: - path = os.path.dirname(os.path.dirname(__file__)) + path = os.path.dirname(__file__) elif frozen in ('dll', 'console_exe', 'windows_exe', 'macosx_app'): path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) elif frozen: # needed for PyInstaller @@ -181,12 +181,7 @@ posixresourcespath = findWorkingDir().replace("\\", "/") + "/resources/" def getDefaultMonospaceFont(): - if platform.system() == "Windows": - return constants.DEFAULT_WINDOWS_MONOSPACE_FONT - elif platform.system() == "Darwin": - return constants.DEFAULT_OSX_MONOSPACE_FONT - else: - return constants.FALLBACK_MONOSPACE_FONT + return constants.MONOSPACE_FONT def limitedPowerset(s, minLength): diff --git a/syncplay/vendor/darkdetect/__init__.py b/syncplay/vendor/darkdetect/__init__.py new file mode 100755 index 0000000..4cce200 --- /dev/null +++ b/syncplay/vendor/darkdetect/__init__.py @@ -0,0 +1,22 @@ +#----------------------------------------------------------------------------- +# Copyright (C) 2019 Alberto Sottile +# +# Distributed under the terms of the 3-clause BSD License. +#----------------------------------------------------------------------------- + +__version__ = '0.1.1' + +import sys +import platform + +if sys.platform != "darwin": + from ._dummy import * +else: + from distutils.version import LooseVersion as V + if V(platform.mac_ver()[0]) < V("10.14"): + from ._dummy import * + else: + from ._detect import * + del V + +del sys, platform \ No newline at end of file diff --git a/syncplay/vendor/darkdetect/_detect.py b/syncplay/vendor/darkdetect/_detect.py new file mode 100755 index 0000000..9a79f7c --- /dev/null +++ b/syncplay/vendor/darkdetect/_detect.py @@ -0,0 +1,64 @@ +#----------------------------------------------------------------------------- +# Copyright (C) 2019 Alberto Sottile +# +# Distributed under the terms of the 3-clause BSD License. +#----------------------------------------------------------------------------- + +import ctypes +import ctypes.util + +appkit = ctypes.cdll.LoadLibrary(ctypes.util.find_library('AppKit')) +objc = ctypes.cdll.LoadLibrary(ctypes.util.find_library('objc')) + +void_p = ctypes.c_void_p +ull = ctypes.c_uint64 + +objc.objc_getClass.restype = void_p +objc.sel_registerName.restype = void_p +objc.objc_msgSend.restype = void_p +objc.objc_msgSend.argtypes = [void_p, void_p] + +msg = objc.objc_msgSend + +def _utf8(s): + if not isinstance(s, bytes): + s = s.encode('utf8') + return s + +def n(name): + return objc.sel_registerName(_utf8(name)) + +def C(classname): + return objc.objc_getClass(_utf8(classname)) + +def theme(): + NSAutoreleasePool = objc.objc_getClass('NSAutoreleasePool') + pool = msg(NSAutoreleasePool, n('alloc')) + pool = msg(pool, n('init')) + + NSUserDefaults = C('NSUserDefaults') + stdUserDef = msg(NSUserDefaults, n('standardUserDefaults')) + + NSString = C('NSString') + + key = msg(NSString, n("stringWithUTF8String:"), _utf8('AppleInterfaceStyle')) + appearanceNS = msg(stdUserDef, n('stringForKey:'), void_p(key)) + appearanceC = msg(appearanceNS, n('UTF8String')) + + if appearanceC is not None: + out = ctypes.string_at(appearanceC) + else: + out = None + + msg(pool, n('release')) + + if out is not None: + return out.decode('utf-8') + else: + return 'Light' + +def isDark(): + return theme() == 'Dark' + +def isLight(): + return theme() == 'Light' diff --git a/syncplay/vendor/darkdetect/_dummy.py b/syncplay/vendor/darkdetect/_dummy.py new file mode 100755 index 0000000..1e99668 --- /dev/null +++ b/syncplay/vendor/darkdetect/_dummy.py @@ -0,0 +1,14 @@ +#----------------------------------------------------------------------------- +# Copyright (C) 2019 Alberto Sottile +# +# Distributed under the terms of the 3-clause BSD License. +#----------------------------------------------------------------------------- + +def theme(): + return None + +def isDark(): + return None + +def isLight(): + return None diff --git a/syncplay/vendor/qt5reactor.py b/syncplay/vendor/qt5reactor.py index da82ccc..fc54a09 100755 --- a/syncplay/vendor/qt5reactor.py +++ b/syncplay/vendor/qt5reactor.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2001-2017 +# Copyright (c) 2001-2018 # Allen Short # Andy Gayton # Andrew Bennetts @@ -113,7 +113,6 @@ from twisted.internet.interfaces import IReactorFDSet from twisted.python import log, runtime from zope.interface import implementer - class TwistedSocketNotifier(QObject): """Connection between an fd event and reader/writer callbacks.""" @@ -123,7 +122,7 @@ class TwistedSocketNotifier(QObject): QObject.__init__(self, parent) self.reactor = reactor self.watcher = watcher - fd = self.watcher.fileno() + fd = watcher.fileno() self.notifier = QSocketNotifier(fd, socketType, parent) self.notifier.setEnabled(True) if socketType == QSocketNotifier.Read: @@ -251,10 +250,10 @@ class QtReactor(posixbase.PosixReactorBase): return self._removeAll(self._reads, self._writes) def getReaders(self): - return list(self._reads.keys()) + return self._reads.keys() def getWriters(self): - return list(self._writes.keys()) + return self._writes.keys() def callLater(self, howlong, *args, **kargs): rval = super(QtReactor, self).callLater(howlong, *args, **kargs) @@ -286,13 +285,10 @@ class QtReactor(posixbase.PosixReactorBase): delay = max(delay, 1) if not fromqt: self.qApp.processEvents(QEventLoop.AllEvents, delay * 1000) - t = self.timeout() - if t is None: - timeout = 0.01 - else: - timeout = min(t, 0.01) - self._timer.setInterval(timeout * 1000) - self._timer.start() + timeout = self.timeout() + if timeout is not None: + self._timer.setInterval(timeout * 1000) + self._timer.start() def runReturn(self, installSignalHandlers=True): self.startRunning(installSignalHandlers=installSignalHandlers) @@ -337,7 +333,7 @@ class QtEventReactor(QtReactor): del self._events[event] def doEvents(self): - handles = list(self._events.keys()) + handles = self._events.keys() if len(handles) > 0: val = None while val != WAIT_TIMEOUT: diff --git a/syncplayClient.py b/syncplayClient.py index dad7ac3..2f40d78 100755 --- a/syncplayClient.py +++ b/syncplayClient.py @@ -11,9 +11,7 @@ except AttributeError: import warnings warnings.warn("You must run Syncplay with Python 3.4 or newer!") -from syncplay.clientManager import SyncplayClientManager -from syncplay.utils import blackholeStdoutForFrozenWindow +from syncplay import ep_client if __name__ == '__main__': - blackholeStdoutForFrozenWindow() - SyncplayClientManager().run() + ep_client.main() \ No newline at end of file diff --git a/syncplayServer.py b/syncplayServer.py index b0538d3..369714f 100755 --- a/syncplayServer.py +++ b/syncplayServer.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 #coding:utf8 -import socket import sys # libpath @@ -13,56 +12,7 @@ except AttributeError: import warnings warnings.warn("You must run Syncplay with Python 3.4 or newer!") -from twisted.internet import reactor -from twisted.internet.endpoints import TCP4ServerEndpoint, TCP6ServerEndpoint -from twisted.internet.error import CannotListenError - -from syncplay.server import SyncFactory, ConfigurationGetter - -class ServerStatus: pass - -def isListening6(f): - ServerStatus.listening6 = True - -def isListening4(f): - ServerStatus.listening4 = True - -def failed6(f): - ServerStatus.listening6 = False - print(f.value) - print("IPv6 listening failed.") - -def failed4(f): - ServerStatus.listening4 = False - if f.type is CannotListenError and ServerStatus.listening6: - pass - else: - print(f.value) - print("IPv4 listening failed.") - +from syncplay import ep_server if __name__ == '__main__': - argsGetter = ConfigurationGetter() - args = argsGetter.getConfiguration() - factory = SyncFactory( - args.port, - args.password, - args.motd_file, - args.isolate_rooms, - args.salt, - args.disable_ready, - args.disable_chat, - args.max_chat_message_length, - args.max_username_length, - args.stats_db_file, - args.tls - ) - endpoint6 = TCP6ServerEndpoint(reactor, int(args.port)) - endpoint6.listen(factory).addCallbacks(isListening6, failed6) - endpoint4 = TCP4ServerEndpoint(reactor, int(args.port)) - endpoint4.listen(factory).addCallbacks(isListening4, failed4) - if ServerStatus.listening6 or ServerStatus.listening4: - reactor.run() - else: - print("Unable to listen using either IPv4 and IPv6 protocols. Quitting the server now.") - sys.exit() + ep_server.main() \ No newline at end of file diff --git a/travis/appimage-deploy.sh b/travis/appimage-deploy.sh new file mode 100755 index 0000000..1293922 --- /dev/null +++ b/travis/appimage-deploy.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +wget https://github.com/TheAssassin/appimagelint/releases/download/continuous/appimagelint-x86_64.AppImage +chmod a+x appimagelint-x86_64.AppImage +./appimagelint-x86_64.AppImage Syncplay*.AppImage +mv Syncplay*.AppImage dist_bintray/ diff --git a/travis/appimage-script.sh b/travis/appimage-script.sh new file mode 100755 index 0000000..56283c3 --- /dev/null +++ b/travis/appimage-script.sh @@ -0,0 +1,114 @@ +#! /bin/bash + +# Copyright (C) 2019 Syncplay +# This file is licensed under the MIT license - http://opensource.org/licenses/MIT + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +set -x +set -e + +# use RAM disk if possible +if [ "$CI" == "" ] && [ -d /dev/shm ]; then + TEMP_BASE=/dev/shm +else + TEMP_BASE=/tmp +fi + +BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" appimagelint-build-XXXXXX) + +cleanup () { + if [ -d "$BUILD_DIR" ]; then + rm -rf "$BUILD_DIR" + fi +} + +trap cleanup EXIT + +# store repo root as variable +REPO_ROOT=$(readlink -f $(dirname $(dirname "$0"))) +#REPO_ROOT="." +OLD_CWD=$(readlink -f .) + +pushd "$BUILD_DIR" + +wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage +wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-conda/master/linuxdeploy-plugin-conda.sh + +chmod +x linuxdeploy*.AppImage +chmod +x linuxdeploy*.sh + +# set up custom AppRun script +cat > AppRun.sh <<\EAT +#! /bin/bash +# make sure to set APPDIR when run directly from the AppDir +if [ -z $APPDIR ]; then APPDIR=$(readlink -f $(dirname "$0")); fi +export LD_LIBRARY_PATH="$APPDIR"/usr/lib +export PATH="$PATH":"$APPDIR"/usr/bin + +if [ "$1" == "--server" ]; then + exec "$APPDIR"/usr/bin/python "$APPDIR"/usr/bin/syncplay-server "${@:2}" +else + exec "$APPDIR"/usr/bin/python "$APPDIR"/usr/bin/syncplay "$@" +fi +EAT +chmod +x AppRun.sh + +# add AppStream metadata +mkdir -p AppDir/usr/share/metainfo/ +cat > pl.syncplay.syncplay.appdata.xml <<\EAT + + + pl.syncplay.syncplay + MIT + Apache-2.0 + Syncplay + Client/server to synchronize media playback on mpv/VLC/MPC-HC/MPC-BE on many computers + +

Syncplay synchronises the position and play state of multiple media players so that the viewers can watch the same thing at the same time. This means that when one person pauses/unpauses playback or seeks (jumps position) within their media player then this will be replicated across all media players connected to the same server and in the same 'room' (viewing session). When a new person joins they will also be synchronised. Syncplay also includes text-based chat so you can discuss a video as you watch it (or you could use third-party Voice over IP software to talk over a video).

+
+ pl.syncplay.syncplay.desktop + https://syncplay.pl/ + + + https://syncplay.pl/2019-05-26.png + + + + pl.syncplay.syncplay.desktop + +
+EAT +mv pl.syncplay.syncplay.appdata.xml AppDir/usr/share/metainfo/ + +# move and rename .desktop file +cp "$REPO_ROOT"/syncplay/resources/syncplay.desktop ./pl.syncplay.syncplay.desktop + +#export CONDA_PACKAGES="Pillow" +export PIP_REQUIREMENTS="." +export PIP_WORKDIR="$REPO_ROOT" +export VERSION="$(cat $REPO_ROOT/syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')" +export OUTPUT=Syncplay-$VERSION-x86_64.AppImage + +./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin conda \ + -e $(which readelf) \ + -i "$REPO_ROOT"/syncplay/resources/syncplay.png -d pl.syncplay.syncplay.desktop \ + --output appimage --custom-apprun AppRun.sh -l /usr/lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 + +mv Syncplay*.AppImage "$OLD_CWD" \ No newline at end of file diff --git a/travis/macos-deploy.sh b/travis/macos-deploy.sh new file mode 100755 index 0000000..08c74ba --- /dev/null +++ b/travis/macos-deploy.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -ex + +mkdir dist/Syncplay.app/Contents/Resources/English.lproj +mkdir dist/Syncplay.app/Contents/Resources/en_AU.lproj +mkdir dist/Syncplay.app/Contents/Resources/en_GB.lproj +mkdir dist/Syncplay.app/Contents/Resources/German.lproj +mkdir dist/Syncplay.app/Contents/Resources/Italian.lproj +mkdir dist/Syncplay.app/Contents/Resources/ru.lproj +mkdir dist/Syncplay.app/Contents/Resources/Spanish.lproj +mkdir dist/Syncplay.app/Contents/Resources/es_419.lproj +pip3 install dmgbuild +mv syncplay/resources/macOS_readme.pdf syncplay/resources/.macOS_readme.pdf +dmgbuild -s appdmg.py "Syncplay" dist_bintray/Syncplay_${VER}.dmg diff --git a/travis/macos-install.sh b/travis/macos-install.sh new file mode 100755 index 0000000..3d688da --- /dev/null +++ b/travis/macos-install.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -ex + +export HOMEBREW_NO_INSTALL_CLEANUP=1 + +# Reinstall openssl to fix Python pip install issues +brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/openssl@1.1.rb + +# Python 3.7.4 with 10.12 bottle +brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e9004bd764c9436750a50e0b428548f68fe6a38a/Formula/python.rb + +which python3 +python3 --version +which pip3 +pip3 --version + +# Pyside 5.13.0 for 10.12 bottle +brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/99219f0923014b24f33eae624fbfe83772c35f54/Formula/pyside.rb + +# Explicitly upgrade Qt 5.13.1 as the pyside above needs it +brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/dcc34dd3cb24cb4f7cfa0047ccdb712d7cc4c6e4/Formula/qt.rb + +python3 -c "from PySide2 import __version__; print(__version__)" +python3 -c "from PySide2.QtCore import __version__; print(__version__)" +python3 -c "import ssl; print(ssl)" +pip3 install py2app +python3 -c "from py2app.recipes import pyside2" +pip3 install twisted[tls] appnope requests certifi diff --git a/travis/snapcraft-install.sh b/travis/snapcraft-install.sh new file mode 100755 index 0000000..f7c52de --- /dev/null +++ b/travis/snapcraft-install.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +sudo groupadd --system lxd +sudo usermod -a -G lxd $USER +sudo apt-get -qq update +sudo apt-get -y install snapd +sudo snap install lxd +sudo lxd.migrate -yes +sudo lxd waitready +sudo lxd init --auto --storage-backend dir +sudo snap install snapcraft --classic