apol: Add an "about" dialog

This commit is contained in:
Chris PeBenito 2016-04-18 11:16:02 -04:00
parent 7fdff6941b
commit edde585e5f
2 changed files with 14 additions and 3 deletions

View File

@ -76,7 +76,7 @@
<property name="title"> <property name="title">
<string>&amp;Help</string> <string>&amp;Help</string>
</property> </property>
<addaction name="about_Apol"/> <addaction name="about_apol_action"/>
</widget> </widget>
<widget class="QMenu" name="menu_Edit"> <widget class="QMenu" name="menu_Edit">
<property name="title"> <property name="title">
@ -136,7 +136,7 @@
<string>Ctrl+Q</string> <string>Ctrl+Q</string>
</property> </property>
</action> </action>
<action name="about_Apol"> <action name="about_apol_action">
<property name="text"> <property name="text">
<string>About Apol</string> <string>About Apol</string>
</property> </property>

View File

@ -21,7 +21,7 @@ import logging
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QApplication, QFileDialog, QLineEdit, QMainWindow, QMessageBox from PyQt5.QtWidgets import QApplication, QFileDialog, QLineEdit, QMainWindow, QMessageBox
from setools import PermissionMap, SELinuxPolicy from setools import __version__, PermissionMap, SELinuxPolicy
from ..widget import SEToolsWidget from ..widget import SEToolsWidget
from ..logtosignal import LogHandlerToSignal from ..logtosignal import LogHandlerToSignal
@ -95,6 +95,7 @@ class ApolMainWindow(SEToolsWidget, QMainWindow):
self.paste_action.triggered.connect(self.paste) self.paste_action.triggered.connect(self.paste)
self.edit_permmap_action.triggered.connect(self.edit_permmap) self.edit_permmap_action.triggered.connect(self.edit_permmap)
self.save_permmap_action.triggered.connect(self.save_permmap) self.save_permmap_action.triggered.connect(self.save_permmap)
self.about_apol_action.triggered.connect(self.about_apol)
self.show() self.show()
@ -294,3 +295,13 @@ class ApolMainWindow(SEToolsWidget, QMainWindow):
QApplication.instance().focusWidget().paste() QApplication.instance().focusWidget().paste()
except AttributeError: except AttributeError:
pass pass
#
# Help actions
#
def about_apol(self):
QMessageBox.about(self, "About Apol", "Version {0}<br>"
"Apol is a graphical SELinux policy analysis tool and part of "
"<a href=\"https://github.com/TresysTechnology/setools/wiki\">"
"SETools</a>.<p>"
"Copyright (C) 2015-2016, Tresys Technology.".format(__version__))