diff --git a/Makefile b/Makefile index 89c24d5..3563e89 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,8 @@ res: pyuic4 -o qubesmanager/ui_backupdlg.py backupdlg.ui pyuic4 -o qubesmanager/ui_globalsettingsdlg.py globalsettingsdlg.ui pyuic4 -o qubesmanager/ui_logdlg.py logdlg.ui + pyuic4 -o qubesmanager/ui_about.py about.ui + pyuic4 -o qubesmanager/ui_releasenotes.py releasenotes.ui update-repo-current: ln -f $(RPMS_DIR)/x86_64/qubes-manager-*$(VERSION)*.rpm ../yum/current-release/current/dom0/rpm/ diff --git a/about.ui b/about.ui new file mode 100644 index 0000000..97f944f --- /dev/null +++ b/about.ui @@ -0,0 +1,97 @@ + + + AboutDialog + + + Qt::NonModal + + + + 0 + 0 + 400 + 197 + + + + About + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + Qt::StrongFocus + + + + + + false + + + + + + + + + Qubes OS + + + + + + + Qubes OS release + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Release notes + + + + + + + OK + + + + + + + + + + diff --git a/qubesmanager/about.py b/qubesmanager/about.py new file mode 100644 index 0000000..5e7dbd6 --- /dev/null +++ b/qubesmanager/about.py @@ -0,0 +1,49 @@ +#!/usr/bin/python2 +# coding=utf-8 +# +# The Qubes OS Project, http://www.qubes-os.org +# +# Copyright (C) 2015 Marek Marczykowski-Górecki +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# +from PyQt4.QtCore import SIGNAL, SLOT +from PyQt4.QtGui import QDialog, QIcon +from qubesmanager.releasenotes import ReleaseNotesDialog + +from ui_about import * + + + +class AboutDialog(Ui_AboutDialog, QDialog): + def __init__(self): + super(AboutDialog, self).__init__() + + self.setupUi(self) + + self.icon.setPixmap(QIcon().fromTheme("qubes-manager").pixmap(96)) + with open('/etc/qubes-release', 'r') as release_file: + self.release.setText(release_file.read()) + + self.connect(self.ok, SIGNAL("clicked()"), SLOT("accept()")) + self.connect(self.releaseNotes, SIGNAL("clicked()"), + self.on_release_notes_clicked) + + def on_release_notes_clicked(self): + release_notes_dialog = ReleaseNotesDialog() + release_notes_dialog.exec_() + self.accept() diff --git a/qubesmanager/main.py b/qubesmanager/main.py index 6b261f5..8683df3 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -40,6 +40,7 @@ from qubes.qubes import QubesException from qubes.qubes import system_path from qubes.qubes import QubesDaemonPidfile from qubes.qubes import QubesHost +from qubesmanager.about import AboutDialog import table_widgets from block import QubesBlockDevicesManager from table_widgets import VmTypeWidget, VmLabelWidget, VmNameItem, \ @@ -1570,11 +1571,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): @pyqtSlot(name='on_action_about_qubes_triggered') def action_about_qubes_triggered(self): - release_file = open('/etc/qubes-release', 'r') - release = release_file.read() - release_file.close() - QMessageBox.about(self, "About...", - "Qubes OS

%s" % release) + about = AboutDialog() + about.exec_() def createPopupMenu(self): menu = QMenu() diff --git a/qubesmanager/releasenotes.py b/qubesmanager/releasenotes.py new file mode 100644 index 0000000..f9da897 --- /dev/null +++ b/qubesmanager/releasenotes.py @@ -0,0 +1,38 @@ +#!/usr/bin/python2 +# coding=utf-8 +# +# The Qubes OS Project, http://www.qubes-os.org +# +# Copyright (C) 2015 Marek Marczykowski-Górecki +# +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# +from PyQt4.QtCore import SIGNAL +from PyQt4.QtGui import QDialog, QIcon + +from ui_releasenotes import * + + +class ReleaseNotesDialog(Ui_ReleaseNotesDialog, QDialog): + def __init__(self): + super(ReleaseNotesDialog, self).__init__() + + self.setupUi(self) + + with open('/usr/share/doc/qubes-release-notes/README.Qubes-Release' + '-Notes', 'r') as release_notes: + self.releaseNotes.setText(release_notes.read()) diff --git a/releasenotes.ui b/releasenotes.ui new file mode 100644 index 0000000..6c30cb5 --- /dev/null +++ b/releasenotes.ui @@ -0,0 +1,67 @@ + + + ReleaseNotesDialog + + + + 0 + 0 + 400 + 300 + + + + Qubes Release Notes + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + ReleaseNotesDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ReleaseNotesDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/rpm_spec/qmgr.spec b/rpm_spec/qmgr.spec index a83cb21..f956002 100644 --- a/rpm_spec/qmgr.spec +++ b/rpm_spec/qmgr.spec @@ -49,6 +49,8 @@ cp qubesmanager/multiselectwidget.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qub cp qubesmanager/restore.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager cp qubesmanager/settings.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager cp qubesmanager/log_dialog.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager +cp qubesmanager/about.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager +cp qubesmanager/releasenotes.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager cp qubesmanager/create_new_vm.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager cp qubesmanager/thread_monitor.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager cp qubesmanager/resources_rc.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager @@ -62,6 +64,8 @@ cp qubesmanager/ui_newfwruledlg.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubes cp qubesmanager/ui_restoredlg.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager cp qubesmanager/ui_settingsdlg.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager cp qubesmanager/ui_logdlg.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager +cp qubesmanager/ui_about.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager +cp qubesmanager/ui_releasenotes.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager mkdir -p $RPM_BUILD_ROOT/usr/share/applications cp qubes-manager.desktop $RPM_BUILD_ROOT/usr/share/applications @@ -126,6 +130,12 @@ rm -rf $RPM_BUILD_ROOT %{python_sitearch}/qubesmanager/log_dialog.py %{python_sitearch}/qubesmanager/log_dialog.pyc %{python_sitearch}/qubesmanager/log_dialog.pyo +%{python_sitearch}/qubesmanager/about.py +%{python_sitearch}/qubesmanager/about.pyc +%{python_sitearch}/qubesmanager/about.pyo +%{python_sitearch}/qubesmanager/releasenotes.py +%{python_sitearch}/qubesmanager/releasenotes.pyc +%{python_sitearch}/qubesmanager/releasenotes.pyo %{python_sitearch}/qubesmanager/create_new_vm.py %{python_sitearch}/qubesmanager/create_new_vm.pyc %{python_sitearch}/qubesmanager/create_new_vm.pyo @@ -162,6 +172,12 @@ rm -rf $RPM_BUILD_ROOT %{python_sitearch}/qubesmanager/ui_logdlg.py %{python_sitearch}/qubesmanager/ui_logdlg.pyc %{python_sitearch}/qubesmanager/ui_logdlg.pyo +%{python_sitearch}/qubesmanager/ui_about.py +%{python_sitearch}/qubesmanager/ui_about.pyc +%{python_sitearch}/qubesmanager/ui_about.pyo +%{python_sitearch}/qubesmanager/ui_releasenotes.py +%{python_sitearch}/qubesmanager/ui_releasenotes.pyc +%{python_sitearch}/qubesmanager/ui_releasenotes.pyo /usr/share/applications/qubes-manager.desktop