Enabled about dialog on all OS

This commit is contained in:
alby128 2017-10-02 14:24:26 +02:00
parent 0aea1eacf4
commit 4d404b69f5
1 changed files with 17 additions and 8 deletions

15
syncplay/ui/gui.py Normal file → Executable file
View File

@ -1,6 +1,6 @@
from PySide import QtGui
from PySide.QtCore import Qt, QSettings, QSize, QPoint, QUrl, QLine
from syncplay import utils, constants, version
from syncplay import utils, constants, version, release_number
from syncplay.messages import getMessage
import sys
import time
@ -94,12 +94,15 @@ class AboutDialog(QtGui.QDialog):
def __init__(self, parent=None):
super(AboutDialog, self).__init__(parent)
if sys.platform.startswith('darwin'):
self.setWindowTitle("")
else:
self.setWindowTitle("About Syncplay")
nameLabel = QtGui.QLabel("<center><strong>Syncplay</strong></center>")
nameLabel.setFont(QtGui.QFont("Helvetica", 20))
linkLabel = QtGui.QLabel("<center><a href=\"http://syncplay.pl\">syncplay.pl</a></center>")
linkLabel.setOpenExternalLinks(True)
versionLabel = QtGui.QLabel("<center>Version v" + version + "</center>")
versionLabel = QtGui.QLabel("<center>Version v" + version + " release " + release_number + "</center>")
licenseLabel = QtGui.QLabel("<center><p>Copyright &copy; 2017 Syncplay</p><p>Licensed under the Apache&nbsp;License,&nbsp;Version 2.0</p></center>")
aboutIconPixmap = QtGui.QPixmap(self.resourcespath + u"syncplay.png")
aboutIconLabel = QtGui.QLabel()
@ -123,9 +126,15 @@ class AboutDialog(QtGui.QDialog):
self.setLayout(aboutLayout)
def openLicense(self):
if sys.platform.startswith('win'):
QtGui.QDesktopServices.openUrl(QUrl("file:///" + self.resourcespath + u"license.rtf"))
else:
QtGui.QDesktopServices.openUrl(QUrl("file://" + self.resourcespath + u"license.rtf"))
def openDependencies(self):
if sys.platform.startswith('win'):
QtGui.QDesktopServices.openUrl(QUrl("file:///" + self.resourcespath + u"third-party-notices.rtf"))
else:
QtGui.QDesktopServices.openUrl(QUrl("file://" + self.resourcespath + u"third-party-notices.rtf"))
class MainWindow(QtGui.QMainWindow):
@ -1402,7 +1411,7 @@ class MainWindow(QtGui.QMainWindow):
# Help menu
window.helpMenu = QtGui.QMenu(getMessage("help-menu-label"), self)
if sys.platform.startswith('darwin'):
window.about = window.helpMenu.addAction("&About")
window.about.triggered.connect(self.openAbout)