Merge pull request #185 from albertosottile/master

Change macOS default build to PySide2 and Qt 5.x
This commit is contained in:
Etoh 2018-06-17 14:02:11 +01:00 committed by GitHub
commit cad237c0fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 268 additions and 167 deletions

View File

@ -20,16 +20,16 @@ install:
- for /F "tokens=2 delims='" %%a in ('findstr version syncplay\__init__.py') do @set ver=%%a
- python buildPy2exe.py
- del syncplay_v%ver%\lib\MPR.dll
- mkdir syncplay_v%ver%\platforms
#- copy C:\Miniconda\envs\syncplay\library\plugins\platforms\qwindows.dll C:\projects\syncplay\syncplay_v1.5.0\platforms\
- type nul > syncplay_v%ver%\syncplay.ini
- copy resources\win_lua_note.txt syncplay_v%ver%\"VLC LUA Script installation.txt"
# Not a project with an msbuild file, build done at install.
build: off
build: off
artifacts:
- path: 'syncplay_v$(ver)'
type: zip
name: Syncplay-$(ver)-win
name: Syncplay_v$(ver)_Portable
- path: Syncplay-$(ver)-Setup.exe
name: Syncplay-$(ver)-win-setup
@ -37,6 +37,7 @@ artifacts:
# Push artefact to S3 bucket and list all
before_deploy:
- dir
- dir syncplay_v%ver%
#- python -c "from PySide2 import QtCore; print QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.PluginsPath)"
@ -51,4 +52,4 @@ deploy:
subject: syncplay
version: v$(ver)
publish: true
override: true
override: true

1
.gitignore vendored
View File

@ -12,3 +12,4 @@ syncplay_setup.nsi
dist.7z
.*
!.travis.yml
!.appveyor.yml

View File

@ -6,17 +6,31 @@ branches:
- master
script:
- python buildPy2app.py py2app fix
- python buildPy2app.py py2app
before_install:
- brew update
- brew tap cartr/qt4
- brew tap-pin cartr/qt4
- brew install pyside
- brew install qt
- which python
- which pip
- curl -L https://bintray.com/alby128/Syncplay/download_file?file_path=PySide2-5.11.0-5.11.0-cp27-cp27m-macosx_10_11_x86_64.whl -o PySide2-5.11.0-5.11.0-cp27-cp27m-macosx_10_11_x86_64.whl
- pip install PySide2-5.11.0-5.11.0-cp27-cp27m-macosx_10_11_x86_64.whl
- ln -s /usr/local/lib/python2.7/site-packages/PySide2/libshiboken2-python2.7v.5.11.dylib /usr/local/lib/
- ln -s /usr/local/lib/python2.7/site-packages/PySide2/libpyside2-python2.7v.5.11.dylib /usr/local/lib/
#- python -c "from PySide2 import QtCore"
- python -c "from PySide2.QtCore import __version__; print __version__"
- hg clone https://alby128@bitbucket.org/alby128/py2app
- cd py2app
- python setup.py install
- cd ..
- python -c "from py2app.recipes import pyside2"
install:
- export QT_PREFERRED_BINDING="PySide"
- pip install twisted appnope pyobjc py2app
- pip install twisted appnope
- pip install -U https://github.com/requests/requests/zipball/master
#- git clone -b qtpy-pyside2 https://github.com/alby128/syncplay.git syncplay-qtpy-PySide2
#- cd syncplay-qtpy-PySide2
#- git checkout qtpy-pyside2
before_deploy:
#- travis/cache-homebrew
@ -26,7 +40,7 @@ before_deploy:
- mv resources/lua/intf/syncplay.lua resources/lua/intf/.syncplay.lua
- mv resources/macOS_readme.pdf resources/.macOS_readme.pdf
- export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
- dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay_${VER}_macOS.dmg
- dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay_${VER}.dmg
deploy:
skip_cleanup: true

View File

@ -6,7 +6,7 @@
},
"version": {
"name": "v1.5.3"
"name": "v1.5.4"
},
"files":
@ -16,4 +16,4 @@
"override": 1 }}
],
"publish": true
}
}

View File

@ -5,21 +5,20 @@ Usage:
python setup.py py2app
"""
from setuptools import setup, Command
from setuptools import setup
from glob import glob
import shutil
import syncplay
cmdlist = {}
APP = ['syncplayClient.py']
DATA_FILES = [
('resources', glob('resources/*.png') + glob('resources/*.rtf') + glob('resources/*.lua')),
]
OPTIONS = {
'iconfile':'resources/icon.icns',
'includes': {'PySide.QtCore', 'PySide.QtUiTools', 'PySide.QtGui'},
'plist': {
'includes': {'PySide2.QtCore', 'PySide2.QtUiTools', 'PySide2.QtGui','PySide2.QtWidgets', 'certifi'},
'excludes': {'PySide', 'PySide.QtCore', 'PySide.QtUiTools', 'PySide.QtGui'},
'qt_plugins': ['platforms/libqcocoa.dylib', 'platforms/libqminimal.dylib','platforms/libqoffscreen.dylib', 'styles/libqmacstyle.dylib'],
'plist': {
'CFBundleName':'Syncplay',
'CFBundleShortVersionString':syncplay.version,
'CFBundleIdentifier':'pl.syncplay.Syncplay',
@ -27,32 +26,10 @@ OPTIONS = {
}
}
class Fix(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def trim_packages(self):
"""Remove big files in external dependencies that Syncplay doesn't need"""
shutil.rmtree('dist/Syncplay.app/Contents/Frameworks/QtDesigner.framework', ignore_errors=True)
shutil.rmtree('dist/Syncplay.app/Contents/Frameworks/QtScript.framework', ignore_errors=True)
shutil.rmtree('dist/Syncplay.app/Contents/Frameworks/QtXml.framework', ignore_errors=True)
def run(self):
self.trim_packages()
cmdlist['fix'] = Fix
setup(
app=APP,
name='Syncplay',
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
cmdclass=cmdlist
)

View File

@ -1,4 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf830
{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf400
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
@ -45,6 +45,52 @@ along with this program. If not, see <http://www.gnu.org/licenses/>\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\cf0 \
\b Qt for Python\
\b0 \
Copyright (C) 2018 The Qt Company Ltd.\
Contact: https://www.qt.io/licensing/\
\
This program is free software: you can redistribute it and/or modify\
it under the terms of the GNU Lesser General Public License as published\
by the Free Software Foundation, either version 3 of the License, or\
(at your option) any later version.\
\
This program is distributed in the hope that it will be useful,\
but WITHOUT ANY WARRANTY; without even the implied warranty of\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\
GNU Lesser General Public License for more details.\
\
You should have received a copy of the GNU Lesser General Public License\
along with this program. If not, see <http://www.gnu.org/licenses/>.\
\
\b Qt
\b0 \
\
This program uses Qt under the GNU LGPL version 3.\
\
Qt is a C++ toolkit for cross-platform application development.\
\
Qt provides single-source portability across all major desktop operating systems. It is also available for embedded Linux and other embedded and mobile operating systems.\
\
Qt is available under three different licensing options designed to accommodate the needs of our various users.\
\
Qt licensed under our commercial license agreement is appropriate for development of proprietary/commercial software where you do not want to share any source code with third parties or otherwise cannot comply with the terms of the GNU LGPL version 3 or GNU LGPL version 2.1.\
\
Qt licensed under the GNU LGPL version 3 is appropriate for the development of Qt applications provided you can comply with the terms and conditions of the GNU LGPL version 3.\
\
Qt licensed under the GNU LGPL version 2.1 is appropriate for the development of Qt applications provided you can comply with the terms and conditions of the GNU LGPL version 2.1.\
\
Please see qt.io/licensing for an overview of Qt licensing.\
\
Copyright (C) 2017 The Qt Company Ltd and other contributors.\
\
Qt and the Qt logo are trademarks of The Qt Company Ltd.\
\
Qt is The Qt Company Ltd product developed as an open source project. See qt.io for more information.\
\
\b Twisted\
\
@ -113,27 +159,83 @@ The above copyright notice and this permission notice shall be\
included in all copies or substantial portions of the Software.\
\b \
Qt 4\
qt5reactor\
\
\b0 Copyright (C) 2015 The Qt Company Ltd.\
Contact: http://www.qt.io/licensing/\
\b0 Copyright (c) 2001-2018\
Allen Short\
Andy Gayton\
Andrew Bennetts\
Antoine Pitrou\
Apple Computer, Inc.\
Ashwini Oruganti\
bakbuk\
Benjamin Bruheim\
Bob Ippolito\
Burak Nehbit\
Canonical Limited\
Christopher Armstrong\
Christopher R. Wood\
David Reid\
Donovan Preston\
Elvis Stansvik\
Eric Mangold\
Eyal Lotem\
Glenn Tarbox\
Google Inc.\
Hybrid Logic Ltd.\
Hynek Schlawack\
Itamar Turner-Trauring\
James Knight\
Jason A. Mobarak\
Jean-Paul Calderone\
Jessica McKellar\
Jonathan Jacobs\
Jonathan Lange\
Jonathan D. Simms\
J\'fcrgen Hermann\
Julian Berman\
Kevin Horn\
Kevin Turner\
Kyle Altendorf\
Laurens Van Houtven\
Mary Gardiner\
Matthew Lefkowitz\
Massachusetts Institute of Technology\
Moshe Zadka\
Paul Swartz\
Pavel Pergamenshchik\
Ralph Meijer\
Richard Wall\
Sean Riley\
Software Freedom Conservancy\
Tarashish Mishra\
Travis B. Hartwell\
Thijs Triemstra\
Thomas Herve\
Timothy Allen\
Tom Prince\
\
This library is free software; you can redistribute it and/or\
modify it under the terms of the GNU Lesser General Public\
License as published by the Free Software Foundation; either\
version 2.1 of the License, or (at your option) any later version.\
This library is distributed in the hope that it will be useful,\
but WITHOUT ANY WARRANTY; without even the implied warranty of\
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\
Lesser General Public License for more details.\
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.
\b \
\
\pard\pardeftab720\partightenfactor0
\cf0 You should have received a copy of the GNU Lesser General Public License\
along with this program. If not, see <http://www.gnu.org/licenses/>\
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
\b \cf0 \
appnope\
\b0 \
@ -157,17 +259,6 @@ 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 \
PyObjC\
\b0 \
Copyright 2002, 2003 - Bill Bumgarner, Ronald Oussoren, Steve Majewski, Lele Gaifax, et.al.\
Copyright 2003-2016 - Ronald Oussoren\
\
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.\
\
\b py2exe\
@ -215,4 +306,18 @@ 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.\
\
}
\b Requests\
\
\b0 Copyright 2018 Kenneth Reitz\
\
Licensed under the Apache License, Version 2.0 (the \'93License\'94); you may not use this file\
except in compliance with the License. You may obtain a copy of the License at\
\
http://www.apache.org/licenses/LICENSE-2.0\
\
Unless required by applicable law or agreed to in writing, software distributed under the \
License is distributed on an \'93AS IS\'94 BASIS, WITHOUT WARRANTIES OR CONDI-\
TIONS OF ANY KIND, either express or implied. See the License for the specific lang-\
uage governing permissions and limitations under the License.}

6
resources/win_lua_note.txt Executable file
View File

@ -0,0 +1,6 @@
You must follow the following instructions to use Syncplay with VLC:
Place the syncplay.lua file from /resources/lua/intf/ into the main (all user) VLC /lua/intf/ sub-directory:
* Window: %ProgramFiles%\VideoLAN\VLC\lua\intf\
Note: A version of these instructions is also available from http://syncplay.pl/LUA

View File

@ -1,4 +1,4 @@
version = '1.5.3'
version = '1.5.4'
milestone = 'Yoitsu'
release_number = '61'
release_number = '62'
projectURL = 'https://syncplay.pl/'

View File

@ -11,7 +11,8 @@ from twisted.internet import reactor, task, defer, threads
from functools import wraps
from copy import deepcopy
from syncplay.protocols import SyncClientProtocol
from syncplay import utils, constants
from syncplay import utils, constants, version
from syncplay.utils import isMacOS
from syncplay.messages import getMissingStrings, getMessage
from syncplay.constants import PRIVACY_SENDHASHED_MODE, PRIVACY_DONTSEND_MODE, \
PRIVACY_HIDDENFILENAME
@ -910,12 +911,15 @@ class SyncplayClient(object):
def checkForUpdate(self, userInitiated):
try:
import urllib, syncplay, sys, messages, json
params = urllib.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number,
'language': messages.messages["CURRENT"], 'platform': sys.platform, 'userInitiated': userInitiated})
f = urllib.urlopen(constants.SYNCPLAY_UPDATE_URL.format(params))
response = f.read()
import syncplay, sys, messages, urllib, json
params = urllib.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number, 'language': messages.messages["CURRENT"], 'platform': sys.platform, 'userInitiated': userInitiated})
if isMacOS():
import requests
response = requests.get(constants.SYNCPLAY_UPDATE_URL.format(params))
response = response.text
else:
f = urllib.urlopen(constants.SYNCPLAY_UPDATE_URL.format(params))
response = f.read()
response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("&#8220;","\"").replace("&#8221;","\"") # Fix Wordpress
response = json.loads(response)
publicServers = None
@ -926,7 +930,7 @@ class SyncplayClient(object):
return response["version-status"], response["version-message"] if response.has_key("version-message")\
else None, response["version-url"] if response.has_key("version-url") else None, publicServers
except:
return "failed", getMessage("update-check-failed-notification").format(syncplay.version), constants.SYNCPLAY_DOWNLOAD_URL, None
return "failed", getMessage("update-check-failed-notification").format(version), constants.SYNCPLAY_DOWNLOAD_URL, None
class _WarningManager(object):
def __init__(self, player, userlist, ui, client):

View File

@ -149,7 +149,7 @@ de = {
"no-media-directories-error" : u"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" : u"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
"failed-to-load-server-list-error" : u"Konnte die Liste der öffentlichen Server nicht laden. Bitte besuche http://www.syncplay.pl/ [Englisch] mit deinem Browser.",
"failed-to-load-server-list-error" : u"Konnte die Liste der öffentlichen Server nicht laden. Bitte besuche https://www.syncplay.pl/ [Englisch] mit deinem Browser.",
# Client arguments
"argument-description" : u'Syncplay ist eine Anwendung um mehrere MPlayer, MPC-HC, MPC-BE und VLC-Instanzen über das Internet zu synchronisieren.',
@ -218,7 +218,8 @@ de = {
"misc-label" : u"Diverse",
"core-behaviour-title" : u"Verhalten des Raumes",
"syncplay-internals-title" : u"Syncplay intern",
"syncplay-mediasearchdirectories-title" : u"In diesen Verzeichnissen nach Medien suchen (ein Pfad pro Zeile)",
"syncplay-mediasearchdirectories-title" : u"In diesen Verzeichnissen nach Medien suchen", #needs to be checked
"syncplay-mediasearchdirectories-label" : u"In diesen Verzeichnissen nach Medien suchen (ein Pfad pro Zeile)",
"sync-label" : u"Synchronisation",
"sync-otherslagging-title" : u"Wenn andere laggen...",
"sync-youlaggging-title" : u"Wenn du laggst...",
@ -310,7 +311,7 @@ de = {
#About dialog - TODO: Translate
"about-menu-label": u"&About Syncplay",
"about-dialog-title": u"About Syncplay",
"about-dialog-release": u"Version {} release {} on {}",
"about-dialog-release": u"Version {} release {}",
"about-dialog-license-text" : u"Licensed under the Apache&nbsp;License,&nbsp;Version 2.0",
"about-dialog-license-button": u"License",
"about-dialog-dependencies": u"Dependencies",

View File

@ -152,7 +152,7 @@ en = {
"no-media-directories-error" : u"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.",
"cannot-find-directory-error" : u"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.",
"failed-to-load-server-list-error" : u"Failed to load public server list. Please visit http://www.syncplay.pl/ in your browser.",
"failed-to-load-server-list-error" : u"Failed to load public server list. Please visit https://www.syncplay.pl/ in your browser.",
# Client arguments
"argument-description" : 'Solution to synchronize playback of multiple media player instances over the network.',
@ -223,7 +223,8 @@ en = {
"misc-label" : u"Misc",
"core-behaviour-title" : "Core room behaviour",
"syncplay-internals-title" : u"Syncplay internals",
"syncplay-mediasearchdirectories-title" : u"Directories to search for media (one path per line)",
"syncplay-mediasearchdirectories-title" : u"Directories to search for media",
"syncplay-mediasearchdirectories-label" : u"Directories to search for media (one path per line)",
"sync-label" : "Sync",
"sync-otherslagging-title" : "If others are lagging behind...",
"sync-youlaggging-title" : "If you are lagging behind...",
@ -315,7 +316,7 @@ en = {
#About dialog
"about-menu-label": u"&About Syncplay",
"about-dialog-title": u"About Syncplay",
"about-dialog-release": u"Version {} release {} on {}",
"about-dialog-release": u"Version {} release {}",
"about-dialog-license-text" : u"Licensed under the Apache&nbsp;License,&nbsp;Version 2.0",
"about-dialog-license-button": u"License",
"about-dialog-dependencies": u"Dependencies",

View File

@ -152,7 +152,7 @@ it = {
"no-media-directories-error" : u"Nessuna cartella multimediale è stata configurata. Per permettere il corretto funzionamento delle playlist condivise e la selezione automatica dei file, naviga in File->Imposta cartelle multimediali e specifica dove Syncplay deve ricercare i file multimediali.",
"cannot-find-directory-error" : u"Impossibile trovare la cartella multimediale '{}'. Per aggiornare la lista delle cartelle multimediali seleziona File->Imposta cartelle multimediali dalla barra dei menù e specifica dove Syncplay deve ricercare i file multimediali.",
"failed-to-load-server-list-error" : u"Impossibile caricare la lista dei server pubblici. Per favore, visita http://www.syncplay.pl/ con il tuo browser.",
"failed-to-load-server-list-error" : u"Impossibile caricare la lista dei server pubblici. Per favore, visita https://www.syncplay.pl/ con il tuo browser.",
# Client arguments
"argument-description" : u'Programma per sincronizzare la riproduzione di media player multipli attraverso la rete.',
@ -316,7 +316,7 @@ it = {
#About dialog
"about-menu-label": u"&Informazioni su Syncplay",
"about-dialog-title": u"Informazioni su Syncplay",
"about-dialog-release": u"Versione {} release {} con {}",
"about-dialog-release": u"Versione {} release {}",
"about-dialog-license-text" : u"Rilasciato sotto Apache&nbsp;License,&nbsp;Version 2.0",
"about-dialog-license-button": u"Licenza",
"about-dialog-dependencies": u"Dipendenze",

View File

@ -155,7 +155,7 @@ ru = {
"no-media-directories-error" : u"Вы не указали папки воспроизведения. Для корректной работы зайдите через выпадающее меню в Файл->Папки воспроизведения и укажите нужные каталоги.",
"cannot-find-directory-error" : u"Не удалось найти папку воспроизведения '{}'. Для обновления списка папок, через выпадающее меню, перейдите в Файл->Папки воспроизведения и укажите нужные каталоги.",
"failed-to-load-server-list-error" : u"Не удалось загрузить список публичных серверов. Откройте http://www.syncplay.pl/ через браузер.",
"failed-to-load-server-list-error" : u"Не удалось загрузить список публичных серверов. Откройте https://www.syncplay.pl/ через браузер.",
# Client arguments
"argument-description" : u'Решение для синхронного воспроизведения в VLC, MPlayer или MPC-HC/BE через Интернет.',
@ -226,7 +226,8 @@ ru = {
"misc-label" : u"Прочее",
"core-behaviour-title" : u"Информация о файлах",
"syncplay-internals-title" : u"Системные настройки",
"syncplay-mediasearchdirectories-title" : u"Папки воспроизведения (один путь на строку)",
"syncplay-mediasearchdirectories-title" : u"Папки воспроизведения", #needs to be checked
"syncplay-mediasearchdirectories-label" : u"Папки воспроизведения (один путь на строку)",
"sync-label" : u"Синхронизация",
"sync-otherslagging-title" : u"Опережение",
"sync-youlaggging-title" : u"Отставание",
@ -318,7 +319,7 @@ ru = {
#About dialog - TODO: Translate
"about-menu-label": u"&About Syncplay",
"about-dialog-title": u"About Syncplay",
"about-dialog-release": u"Version {} release {} on {}",
"about-dialog-release": u"Version {} release {}",
"about-dialog-license-text" : u"Licensed under the Apache&nbsp;License,&nbsp;Version 2.0",
"about-dialog-license-button": u"License",
"about-dialog-dependencies": u"Dependencies",

View File

@ -475,17 +475,17 @@ class ConfigurationGetter(object):
self._overrideConfigWithArgs(args)
if not self._config['noGui']:
try:
from syncplay.vendor.Qt import QtWidgets, IsPySide, IsPySide2
from syncplay.vendor.Qt.QtCore import QCoreApplication
from syncplay.vendor import qt5reactor
if not (IsPySide2 or IsPySide):
raise ImportError
if QCoreApplication.instance() is None:
self.app = QtWidgets.QApplication(sys.argv)
qt5reactor.install()
if isMacOS():
import appnope
appnope.nope()
from syncplay.vendor.Qt import QtWidgets, IsPySide, IsPySide2
from syncplay.vendor.Qt.QtCore import QCoreApplication
from syncplay.vendor import qt5reactor
if not (IsPySide2 or IsPySide):
raise ImportError
if QCoreApplication.instance() is None:
self.app = QtWidgets.QApplication(sys.argv)
qt5reactor.install()
if isMacOS():
import appnope
appnope.nope()
except ImportError:
print getMessage("unable-import-gui-error")
self._config['noGui'] = True

View File

@ -20,6 +20,7 @@ class GuiConfiguration:
self.config = config
self._availablePlayerPaths = []
self.error = error
constants.DEBUG_MODE = config['debug']
def run(self):
if QCoreApplication.instance() is None:
@ -342,7 +343,7 @@ class ConfigDialog(QtWidgets.QDialog):
try:
servers = utils.getListOfPublicServers()
except IOError as e:
self.showErrorMessage(unicode(e))
self.showErrorMessage(e.args[0])
return
currentServer = self.hostCombobox.currentText()
self.hostCombobox.clear()

View File

@ -1,6 +1,7 @@
from syncplay.vendor import Qt
from syncplay.vendor.Qt import QtWidgets, QtGui, __binding__, __binding_version__, IsPySide, IsPySide2
from syncplay.vendor.Qt import QtWidgets, QtGui, __binding__, __binding_version__, __qt_version__, IsPySide, IsPySide2
from syncplay.vendor.Qt.QtCore import Qt, QSettings, QSize, QPoint, QUrl, QLine, QDateTime
from platform import python_version
if IsPySide2:
from PySide2.QtCore import QStandardPaths
from syncplay import utils, constants, version, release_number
@ -106,33 +107,35 @@ class AboutDialog(QtWidgets.QDialog):
super(AboutDialog, self).__init__(parent)
if isMacOS():
self.setWindowTitle("")
self.setWindowFlags(Qt.Dialog | Qt.WindowTitleHint | Qt.WindowCloseButtonHint | Qt.CustomizeWindowHint)
else:
self.setWindowTitle(getMessage("about-dialog-title"))
if isWindows():
self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)
nameLabel = QtWidgets.QLabel("<center><strong>Syncplay</strong></center>")
nameLabel.setFont(QtGui.QFont("Helvetica", 20))
nameLabel.setFont(QtGui.QFont("Helvetica", 18))
linkLabel = QtWidgets.QLabel("<center><a href=\"https://syncplay.pl\">syncplay.pl</a></center>")
linkLabel.setOpenExternalLinks(True)
versionLabel = QtWidgets.QLabel("<center>" + getMessage("about-dialog-release").format(version, release_number, __binding__) + "</center>")
licenseLabel = QtWidgets.QLabel("<center><p>Copyright &copy; 2017 Syncplay</p><p>" + getMessage("about-dialog-license-text") + "</p></center>")
versionLabel = QtWidgets.QLabel("<p><center>" + getMessage("about-dialog-release").format(version, release_number) + "<br />Python " + python_version() + " - " + __binding__ + " " + __binding_version__ + " - Qt " + __qt_version__ + "</center></p>")
licenseLabel = QtWidgets.QLabel("<center><p>Copyright &copy; 2012&ndash;2018 Syncplay</p><p>" + getMessage("about-dialog-license-text") + "</p></center>")
aboutIconPixmap = QtGui.QPixmap(resourcespath + u"syncplay.png")
aboutIconLabel = QtWidgets.QLabel()
aboutIconLabel.setPixmap(aboutIconPixmap.scaled(120, 120, Qt.KeepAspectRatio))
aboutIconLabel.setPixmap(aboutIconPixmap.scaled(65, 65, Qt.KeepAspectRatio))
aboutLayout = QtWidgets.QGridLayout()
aboutLayout.addWidget(aboutIconLabel, 0, 0, 4, 2)
aboutLayout.addWidget(nameLabel, 0, 2, 1, 2)
aboutLayout.addWidget(linkLabel, 1, 2, 1, 2)
aboutLayout.addWidget(versionLabel, 2, 2, 1, 2)
aboutLayout.addWidget(licenseLabel, 3, 2, 1, 2)
aboutLayout.addWidget(aboutIconLabel, 0, 0, 3, 4, Qt.AlignHCenter)
aboutLayout.addWidget(nameLabel, 3, 0, 1, 4)
aboutLayout.addWidget(linkLabel, 4, 0, 1, 4)
aboutLayout.addWidget(versionLabel, 5, 0, 1, 4)
aboutLayout.addWidget(licenseLabel, 6, 0, 1, 4)
licenseButton = QtWidgets.QPushButton(getMessage("about-dialog-license-button"))
licenseButton.setAutoDefault(False)
licenseButton.clicked.connect(self.openLicense)
aboutLayout.addWidget(licenseButton, 4, 2)
aboutLayout.addWidget(licenseButton, 7, 0, 1, 2)
dependenciesButton = QtWidgets.QPushButton(getMessage("about-dialog-dependencies"))
dependenciesButton.setAutoDefault(False)
dependenciesButton.clicked.connect(self.openDependencies)
aboutLayout.addWidget(dependenciesButton, 4, 3)
aboutLayout.addWidget(dependenciesButton, 7, 2, 1, 2)
aboutLayout.setVerticalSpacing(10)
aboutLayout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
self.setSizeGripEnabled(False)
self.setLayout(aboutLayout)
@ -1559,16 +1562,20 @@ class MainWindow(QtWidgets.QMainWindow):
currentDateTimeValue = QDateTime.currentDateTime()
if not self.config['checkForUpdatesAutomatically']:
return
if self.config['lastCheckedForUpdates']:
configLastChecked = datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f")
if self.lastCheckedForUpdates is None or configLastChecked > self.lastCheckedForUpdates.toPython():
self.lastCheckedForUpdates = QDateTime.fromString(self.config["lastCheckedForUpdates"],'yyyy-MM-dd HH-mm-ss')
if self.lastCheckedForUpdates is None:
self.checkForUpdates()
else:
timeDelta = currentDateTimeValue.toPython() - self.lastCheckedForUpdates.toPython()
if timeDelta.total_seconds() > constants.AUTOMATIC_UPDATE_CHECK_FREQUENCY:
try:
if self.config['lastCheckedForUpdates']:
configLastChecked = datetime.strptime(self.config["lastCheckedForUpdates"], "%Y-%m-%d %H:%M:%S.%f")
if self.lastCheckedForUpdates is None or configLastChecked > self.lastCheckedForUpdates.toPython():
self.lastCheckedForUpdates = QDateTime.fromString(self.config["lastCheckedForUpdates"],'yyyy-MM-dd HH-mm-ss')
if self.lastCheckedForUpdates is None:
self.checkForUpdates()
else:
timeDelta = currentDateTimeValue.toPython() - self.lastCheckedForUpdates.toPython()
if timeDelta.total_seconds() > constants.AUTOMATIC_UPDATE_CHECK_FREQUENCY:
self.checkForUpdates()
except:
self.showDebugMessage(u"Automatic check for updates failed. An update check was manually trigggered.")
self.checkForUpdates()
def userCheckForUpdates(self):
self.checkForUpdates(userInitiated=True)

View File

@ -14,6 +14,7 @@ import ast
import unicodedata
import platform
import subprocess
import traceback
folderSearchEnabled = True
@ -373,11 +374,15 @@ def open_system_file_browser(path):
def getListOfPublicServers():
try:
import urllib, syncplay, sys, messages, json
params = urllib.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number,
'language': messages.messages["CURRENT"]})
f = urllib.urlopen(constants.SYNCPLAY_PUBLIC_SERVER_LIST_URL.format(params))
response = f.read()
import syncplay, sys, messages, urllib
params = urllib.urlencode({'version': syncplay.version, 'milestone': syncplay.milestone, 'release_number': syncplay.release_number, 'language': messages.messages["CURRENT"]})
if isMacOS():
import requests
response = requests.get(constants.SYNCPLAY_PUBLIC_SERVER_LIST_URL.format(params))
response = response.text
else:
f = urllib.urlopen(constants.SYNCPLAY_PUBLIC_SERVER_LIST_URL.format(params))
response = f.read()
response = response.replace("<p>","").replace("</p>","").replace("<br />","").replace("&#8220;","'").replace("&#8221;","'").replace(":&#8217;","'").replace("&#8217;","'").replace("&#8242;","'").replace("\n","").replace("\r","") # Fix Wordpress
response = ast.literal_eval(response)
@ -386,7 +391,11 @@ def getListOfPublicServers():
else:
raise IOError
except:
raise IOError(getMessage("failed-to-load-server-list-error"))
if constants.DEBUG_MODE == True:
traceback.print_exc()
raise
else:
raise IOError(getMessage("failed-to-load-server-list-error"))
class RoomPasswordProvider(object):
CONTROLLED_ROOM_REGEX = re.compile("^\+(.*):(\w{12})$")

View File

@ -106,6 +106,8 @@ Subsequent port by therve
import sys
from syncplay.utils import isMacOS, isWindows
from syncplay.vendor.Qt import IsPySide2
from syncplay.vendor.Qt.QtCore import (
QCoreApplication, QEventLoop, QObject, QSocketNotifier, QTimer, Signal)
from twisted.internet import posixbase
@ -124,7 +126,12 @@ class TwistedSocketNotifier(QObject):
self.reactor = reactor
self.watcher = watcher
fd = self.watcher.fileno()
self.notifier = QSocketNotifier(watcher, socketType, parent)
if (isMacOS() and IsPySide2):
self.notifier = QSocketNotifier(watcher, socketType, parent)
elif (isWindows() and IsPySide2):
self.notifier = QSocketNotifier(watcher, socketType, parent)
else:
self.notifier = QSocketNotifier(fd, socketType, parent)
self.notifier.setEnabled(True)
if socketType == QSocketNotifier.Read:
self.fn = self.read

View File

@ -1,6 +0,0 @@
#!/bin/sh
mkdir travis-cache
if [ ! -f homebrew-cache.tar.gz ]; then
tar czf travis-cache/homebrew-cache.tar.gz --directory /usr/local/Cellar pkg-config readline sqlite gdbm makedepend openssl python@2
fi

View File

@ -1,5 +0,0 @@
#!/bin/sh
if [ ! -f python-cache.tar.gz ]; then
tar czf travis-cache/python-cache.tar.gz --directory /usr/local/lib/python2.7 site-packages
fi

View File

@ -1,13 +0,0 @@
#!/bin/sh
curl -L "https://dl.bintray.com/alby128/Syncplay/homebrew-cache.tar.gz" -o homebrew-cache.tar.gz
if [ -f homebrew-cache.tar.gz ]; then
if ! tar tf homebrew-cache.tar.gz &>/dev/null; then
rm homebrew-cache.tar.gz
exit 0
fi
tar zxf homebrew-cache.tar.gz --directory /usr/local/Cellar
brew unlink pkg-config
brew link pkg-config
brew link --force readline sqlite gdbm makedepend python@2
fi

View File

@ -1,10 +0,0 @@
#!/bin/sh
curl -L "https://dl.bintray.com/alby128/Syncplay/python-cache.tar.gz" -o python-cache.tar.gz
if [ -f python-cache.tar.gz ]; then
if ! tar tf python-cache.tar.gz &>/dev/null; then
rm python-cache.tar.gz
exit 0
fi
tar zxf python-cache.tar.gz --directory /usr/local/lib/python2.7
fi