From 759b9a75dd10c3172c4deb559e8a7905e525566b Mon Sep 17 00:00:00 2001
From: Alberto Sottile
Date: Sat, 16 Jun 2018 14:16:04 +0200
Subject: [PATCH] Redesign About dialog to show environment info
---
syncplay/messages_de.py | 2 +-
syncplay/messages_en.py | 2 +-
syncplay/messages_it.py | 2 +-
syncplay/messages_ru.py | 2 +-
syncplay/ui/gui.py | 27 +++++++++++++++------------
5 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py
index ea987db..65b7a51 100644
--- a/syncplay/messages_de.py
+++ b/syncplay/messages_de.py
@@ -311,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 License, Version 2.0",
"about-dialog-license-button": u"License",
"about-dialog-dependencies": u"Dependencies",
diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py
index 6f5d085..6e0fcbb 100644
--- a/syncplay/messages_en.py
+++ b/syncplay/messages_en.py
@@ -316,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 License, Version 2.0",
"about-dialog-license-button": u"License",
"about-dialog-dependencies": u"Dependencies",
diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py
index f73e6d0..d893421 100644
--- a/syncplay/messages_it.py
+++ b/syncplay/messages_it.py
@@ -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 License, Version 2.0",
"about-dialog-license-button": u"Licenza",
"about-dialog-dependencies": u"Dipendenze",
diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py
index ca790d6..975a397 100644
--- a/syncplay/messages_ru.py
+++ b/syncplay/messages_ru.py
@@ -319,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 License, Version 2.0",
"about-dialog-license-button": u"License",
"about-dialog-dependencies": u"Dependencies",
diff --git a/syncplay/ui/gui.py b/syncplay/ui/gui.py
index 5d2c5e4..7e5d1ba 100755
--- a/syncplay/ui/gui.py
+++ b/syncplay/ui/gui.py
@@ -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("Syncplay")
- nameLabel.setFont(QtGui.QFont("Helvetica", 20))
+ nameLabel.setFont(QtGui.QFont("Helvetica", 18))
linkLabel = QtWidgets.QLabel("syncplay.pl")
linkLabel.setOpenExternalLinks(True)
- versionLabel = QtWidgets.QLabel("" + getMessage("about-dialog-release").format(version, release_number, __binding__) + "")
- licenseLabel = QtWidgets.QLabel("Copyright © 2017 Syncplay
" + getMessage("about-dialog-license-text") + "
")
+ versionLabel = QtWidgets.QLabel("" + getMessage("about-dialog-release").format(version, release_number) + "
Python " + python_version() + " - " + __binding__ + " " + __binding_version__ + " - Qt " + __qt_version__ + "
")
+ licenseLabel = QtWidgets.QLabel("Copyright © 2012–2018 Syncplay
" + getMessage("about-dialog-license-text") + "
")
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)