Skip to content
Snippets Groups Projects
Commit 017b2988 authored by Marko Mecina's avatar Marko Mecina
Browse files

add TST About dialog

parent 6c17f83b
No related branches found
No related tags found
No related merge requests found
...@@ -14,11 +14,11 @@ output-file-path = ${paths:tst}/logs_test_runs/output_files/ ...@@ -14,11 +14,11 @@ output-file-path = ${paths:tst}/logs_test_runs/output_files/
[tst-preferences] [tst-preferences]
show-json-view = True show-json-view = True
main-window-height = 1016 main-window-height = 1090
main-window-width = 1848 main-window-width = 1920
paned-position = 919 paned-position = 953
paned-position-codeblockreuse = 520 paned-position-codeblockreuse = 520
[tst-history] [tst-history]
last-folder = /home/sebastian/CCS/Tst/test_specs last-folder = /home/marko/space/smile/OBSW/Documentation/testspec/tst
...@@ -6,7 +6,7 @@ import time ...@@ -6,7 +6,7 @@ import time
import gi import gi
gi.require_version('Gtk', '3.0') gi.require_version('Gtk', '3.0')
gi.require_version('GtkSource', '3.0') gi.require_version('GtkSource', '3.0')
from gi.repository import Gtk, Gdk, Gio, GtkSource, GLib from gi.repository import Gtk, Gdk, Gio, GtkSource, GLib, GdkPixbuf
import confignator import confignator
import sys import sys
sys.path.append(confignator.get_option('paths', 'ccs')) sys.path.append(confignator.get_option('paths', 'ccs'))
...@@ -31,9 +31,6 @@ import spec_to_json ...@@ -31,9 +31,6 @@ import spec_to_json
# creating lists for type and subtype to get rid of duplicate entries, for TC List # creating lists for type and subtype to get rid of duplicate entries, for TC List
path_icon = os.path.join(os.path.dirname(__file__), 'style/tst.svg') path_icon = os.path.join(os.path.dirname(__file__), 'style/tst.svg')
menu_xml = os.path.join(os.path.dirname(__file__), 'app_menu.xml') menu_xml = os.path.join(os.path.dirname(__file__), 'app_menu.xml')
css_file = os.path.join(os.path.dirname(__file__), 'style/style.css') css_file = os.path.join(os.path.dirname(__file__), 'style/style.css')
...@@ -49,6 +46,9 @@ file_hdlr = toolbox.create_file_handler(file=log_file) ...@@ -49,6 +46,9 @@ file_hdlr = toolbox.create_file_handler(file=log_file)
logger.addHandler(hdlr=file_hdlr) logger.addHandler(hdlr=file_hdlr)
VERSION = '0.9'
class TstApp(Gtk.Application): class TstApp(Gtk.Application):
def __init__(self, application_id, flags, logger=logger): def __init__(self, application_id, flags, logger=logger):
...@@ -228,6 +228,10 @@ class TstAppWindow(Gtk.ApplicationWindow): ...@@ -228,6 +228,10 @@ class TstAppWindow(Gtk.ApplicationWindow):
action.connect('activate', self.on_apply_css) action.connect('activate', self.on_apply_css)
self.add_action(action) self.add_action(action)
action = Gio.SimpleAction.new('about_us', None)
action.connect('activate', self.on_about)
self.add_action(action)
self.create_make_menu() self.create_make_menu()
self.set_icon_from_file(path_icon) self.set_icon_from_file(path_icon)
...@@ -280,8 +284,21 @@ class TstAppWindow(Gtk.ApplicationWindow): ...@@ -280,8 +284,21 @@ class TstAppWindow(Gtk.ApplicationWindow):
self.toolbar.insert(self.btn_generate_products, 3) self.toolbar.insert(self.btn_generate_products, 3)
self.toolbar.insert(self.btn_start_ccs_editor, 4) self.toolbar.insert(self.btn_start_ccs_editor, 4)
self.toolbar.insert(self.btn_open_progress_view, 5) self.toolbar.insert(self.btn_open_progress_view, 5)
# logo
sepa = Gtk.SeparatorToolItem()
sepa.set_expand(True)
self.toolbar.insert(sepa, 6)
self.unilogo = Gtk.ToolButton()
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(
confignator.get_option('paths', 'ccs') + '/pixmap/Icon_Space_blau_en.png', 32, 32)
icon = Gtk.Image.new_from_pixbuf(pixbuf)
self.unilogo.set_icon_widget(icon)
#self.unilogo.set_tooltip_text('New test specification')
self.unilogo.connect('clicked', self.on_about)
self.toolbar.insert(self.unilogo, 7)
self.box.pack_start(self.toolbar, False, True, 0) self.box.pack_start(self.toolbar, False, True, 0)
self.info_bar = None self.info_bar = None
# packing the widgets # packing the widgets
...@@ -1021,6 +1038,20 @@ class TstAppWindow(Gtk.ApplicationWindow): ...@@ -1021,6 +1038,20 @@ class TstAppWindow(Gtk.ApplicationWindow):
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION) Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
Gtk.StyleContext.reset_widgets(Gdk.Screen.get_default()) Gtk.StyleContext.reset_widgets(Gdk.Screen.get_default())
def on_about(self, *args):
about_dialog = Gtk.AboutDialog(transient_for=self, modal=True)
about_dialog.set_authors(['Stefan Winkler', 'Dominik Möslinger', 'Sebastian Miksch', 'Marko Mecina'])
about_dialog.set_website('https://space.univie.ac.at/en')
about_dialog.set_website_label('space.univie.ac.at')
about_dialog.set_version(VERSION)
pixbuf = GdkPixbuf.Pixbuf.new_from_file(style_path + '/tst.png')
about_dialog.set_logo(pixbuf)
about_dialog.set_program_name('Test Specification Tool')
about_dialog.set_copyright('UVIE 11/2021')
about_dialog.set_license_type(Gtk.License.GPL_2_0)
about_dialog.present()
return
class ViewModelAsJson(Gtk.Box): class ViewModelAsJson(Gtk.Box):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment