about.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/python3
  2. # coding=utf-8
  3. #
  4. # The Qubes OS Project, http://www.qubes-os.org
  5. #
  6. # Copyright (C) 2015 Marek Marczykowski-Górecki
  7. # <marmarek@invisiblethingslab.com>
  8. #
  9. # This program is free software; you can redistribute it and/or
  10. # modify it under the terms of the GNU General Public License
  11. # as published by the Free Software Foundation; either version 2
  12. # of the License, or (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU Lesser General Public License along
  20. # with this program; if not, see <http://www.gnu.org/licenses/>.
  21. #
  22. #
  23. from PyQt5.QtWidgets import QDialog # pylint: disable=import-error
  24. from PyQt5.QtGui import QIcon # pylint: disable=import-error
  25. from qubesmanager.releasenotes import ReleaseNotesDialog
  26. from qubesmanager.informationnotes import InformationNotesDialog
  27. from . import ui_about # pylint: disable=no-name-in-module
  28. # pylint: disable=too-few-public-methods
  29. class AboutDialog(ui_about.Ui_AboutDialog, QDialog):
  30. def __init__(self):
  31. super(AboutDialog, self).__init__()
  32. self.setupUi(self)
  33. self.icon.setPixmap(QIcon().fromTheme("qubes-manager").pixmap(96))
  34. with open('/etc/qubes-release', 'r') as release_file:
  35. self.release.setText(release_file.read())
  36. self.ok.clicked.connect(self.accept)
  37. self.releaseNotes.clicked.connect(on_release_notes_clicked)
  38. self.informationNotes.clicked.connect(on_information_notes_clicked)
  39. def on_release_notes_clicked():
  40. release_notes_dialog = ReleaseNotesDialog()
  41. release_notes_dialog.exec_()
  42. def on_information_notes_clicked():
  43. information_notes_dialog = InformationNotesDialog()
  44. information_notes_dialog.exec_()