about.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/usr/bin/python2
  2. # coding=utf-8
  3. # pylint: skip-file
  4. #
  5. # The Qubes OS Project, http://www.qubes-os.org
  6. #
  7. # Copyright (C) 2015 Marek Marczykowski-Górecki
  8. # <marmarek@invisiblethingslab.com>
  9. #
  10. # This program is free software; you can redistribute it and/or
  11. # modify it under the terms of the GNU General Public License
  12. # as published by the Free Software Foundation; either version 2
  13. # of the License, or (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU Lesser General Public License along
  21. # with this program; if not, see <http://www.gnu.org/licenses/>.
  22. #
  23. #
  24. from PyQt4.QtCore import SIGNAL, SLOT
  25. from PyQt4.QtGui import QDialog, QIcon
  26. from qubesmanager.releasenotes import ReleaseNotesDialog
  27. from qubesmanager.informationnotes import InformationNotesDialog
  28. from .ui_about import *
  29. class AboutDialog(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.connect(self.ok, SIGNAL("clicked()"), SLOT("accept()"))
  37. self.connect(self.releaseNotes, SIGNAL("clicked()"),
  38. self.on_release_notes_clicked)
  39. self.connect(self.informationNotes, SIGNAL("clicked()"),
  40. self.on_information_notes_clicked)
  41. def on_release_notes_clicked(self):
  42. release_notes_dialog = ReleaseNotesDialog()
  43. release_notes_dialog.exec_()
  44. self.accept()
  45. def on_information_notes_clicked(self):
  46. information_notes_dialog = InformationNotesDialog()
  47. information_notes_dialog.exec_()
  48. self.accept()