Add About dialog

This commit is contained in:
Rebecca Breu 2021-05-14 16:51:19 +02:00
parent a6ad6b47fe
commit 34f25d3fb6
5 changed files with 20 additions and 1 deletions

View file

@ -203,6 +203,11 @@ actions = [
'shortcuts': ['F1', 'Ctrl+H'],
'callback': 'on_action_help',
},
{
'id': 'about',
'text': '&About',
'callback': 'on_action_about',
},
{
'id': 'debuglog',
'text': 'Show &Debug Log',

View file

@ -89,6 +89,7 @@ menu_structure = [
'menu': '&Help',
'items': [
'help',
'about',
'debuglog',
],
},

View file

@ -29,7 +29,7 @@ logger = logging.getLogger(__name__)
parser = argparse.ArgumentParser(
description=f'{constants.APPNAME} referance image viewer')
description=f'{constants.APPNAME_FULL} {constants.VERSION}')
parser.add_argument(
'filename',
nargs='?',

View file

@ -14,4 +14,7 @@
# along with BeeRef. If not, see <https://www.gnu.org/licenses/>.
APPNAME = 'BeeRef'
APPNAME_FULL = f'{APPNAME} Reference Image Viewer'
VERSION = '0.1'
WEBSITE = 'https://github.com/rbreu/beeref'
COPYRIGHT = 'Copyright © 2021 Rebecca Breu'

View file

@ -334,6 +334,16 @@ class BeeGraphicsView(QtWidgets.QGraphicsView, ActionsMixin):
def on_action_help(self):
gui.HelpDialog(self)
def on_action_about(self):
QtWidgets.QMessageBox.about(
self,
f'About {constants.APPNAME}',
(f'<h2>{constants.APPNAME} {constants.VERSION}</h2>'
f'<p>{constants.APPNAME_FULL}</p>'
f'<p>{constants.COPYRIGHT}</p>'
f'<p><a href="{constants.WEBSITE}">'
f'Visit the {constants.APPNAME} website</a></p>'))
def on_action_debuglog(self):
gui.DebugLogDialog(self)