about.py 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. ########################################################################
  2. # Wiizard - A Wii games manager
  3. # Copyright (C) 2023 CYBERDEViL
  4. #
  5. # This file is part of Wiizard.
  6. #
  7. # Wiizard is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # Wiizard is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. #
  20. ########################################################################
  21. from PyQt5.QtWidgets import (
  22. QDialog,
  23. QGridLayout,
  24. QLabel
  25. )
  26. from PyQt5.QtGui import QPixmap
  27. from PyQt5.QtCore import Qt
  28. import pywwt
  29. from wiizard.version import __version__ as WiizardVersion
  30. from wiizard.images import AppResources
  31. from wiizard.translations import _
  32. class AboutDialog(QDialog):
  33. def __init__(self, parent=None):
  34. QDialog.__init__(self, parent=parent)
  35. self.setWindowTitle(_("About Wiizard"))
  36. layout = QGridLayout(self)
  37. logo = QLabel(self)
  38. logo.setPixmap(QPixmap(AppResources.getImagePath("wiizard_logo.png")))
  39. title = QLabel("<h1>Wiizard</h1>", self)
  40. summary = QLabel(_("<i>A Wii games manager</i>"), self)
  41. versionLabel = QLabel(_("<b>Version:</b>"), self)
  42. versionValue = QLabel(WiizardVersion)
  43. versionValue.setTextInteractionFlags(Qt.TextSelectableByMouse)
  44. licenseLabel = QLabel(_("<b>License:</b>"), self)
  45. licenseValue = QLabel("<a href=\"https://www.gnu.org/licenses/licenses"
  46. ".html#GPL\">GPL3</a>")
  47. pywwtVersionLabel = QLabel("<b>PyWWT:</b>", self)
  48. pywwtVersionValue = QLabel("{} r{} arch: {}".format(*pywwt.version().values()))
  49. pywwtVersionValue.setTextInteractionFlags(Qt.TextSelectableByMouse)
  50. urlLabel = QLabel("<a href=\"https://notabug.org/CYBERDEViL/Wiizard\">"
  51. "https://notabug.org/CYBERDEViL/Wiizard</a>", self)
  52. layout.addWidget(logo , 0, 0, 1, 3, Qt.AlignHCenter)
  53. layout.addWidget(title , 1, 0, 1, 3, Qt.AlignHCenter)
  54. layout.addWidget(summary , 2, 0, 1, 3, Qt.AlignHCenter)
  55. layout.addWidget(versionLabel , 3, 0, 1, 1, Qt.AlignRight)
  56. layout.addWidget(versionValue , 3, 1, 1, 2)
  57. layout.addWidget(licenseLabel , 4, 0, 1, 1, Qt.AlignRight)
  58. layout.addWidget(licenseValue , 4, 1, 1, 2)
  59. layout.addWidget(pywwtVersionLabel, 5, 0, 1, 1, Qt.AlignRight)
  60. layout.addWidget(pywwtVersionValue, 5, 1, 1, 2)
  61. layout.addWidget(urlLabel , 6, 0, 1, 3, Qt.AlignHCenter)