Commit 319decf1 authored by Lubosz Sarnecki's avatar Lubosz Sarnecki

settings: Add about dialog.

Add version to config file.
parent a325b75b
pkgdatadir = '@pkgdatadir@'
version = '@version@'
......@@ -26,6 +26,14 @@ endif
config = configuration_data()
config.set('pkgdatadir', pkgdatadir)
GIT_TAG = ''
git = find_program('git', required : false)
if git.found()
GIT_TAG = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
endif
config.set('version', '@0@.@1@'.format(meson.project_version(), GIT_TAG))
configure_file(
input: 'config.py.in',
output: 'config.py',
......
......@@ -198,8 +198,34 @@ class XrdSettings(Gtk.Application):
self.window.connect("destroy", Gtk.main_quit)
self.reset_button.connect("clicked", self.reset)
def on_about(self, action, param):
from xrdesktop.config import version
about_dialog = Gtk.AboutDialog(transient_for=self.window, modal=True,
logo_icon_name="org.xrdesktop.settings",
license_type="mit-x11",
program_name="xrdesktop",
copyright="Copyright 2019 - 2020 Collabora Ltd.",
website="https://gitlab.freedesktop.org/xrdesktop",
website_label="Freedesktop Gitlab",
authors=["Lubosz Sarnecki", "Christoph Haag"],
version=version)
about_dialog.present()
def on_help(self, action, param):
wiki_url = "https://gitlab.freedesktop.org/xrdesktop/xrdesktop/-/wikis/home"
Gtk.show_uri_on_window(self.window, wiki_url, Gdk.CURRENT_TIME)
def do_startup(self):
Gtk.Application.do_startup(self)
action = Gio.SimpleAction.new("about", None)
action.connect("activate", self.on_about)
self.add_action(action)
action = Gio.SimpleAction.new("help", None)
action.connect("activate", self.on_help)
self.add_action(action)
self.window.set_application(self)
......
......@@ -45,12 +45,12 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkModelButton" id="help_button">
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">False</property>
<property name="action_name">help</property>
<property name="action_name">app.help</property>
<property name="text" translatable="yes">Help</property>
</object>
<packing>
......@@ -60,12 +60,12 @@
</packing>
</child>
<child>
<object class="GtkModelButton" id="about_button">
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="hexpand">False</property>
<property name="action_name">about</property>
<property name="action_name">app.about</property>
<property name="text" translatable="yes">About xrdesktop</property>
</object>
<packing>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment