extensions-app: Create about dialog from metainfo
Using the existing metainfo to populate the about window means that we stop duplicating information, which is generally a good idea. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3158>
This commit is contained in:
parent
dfff65bf05
commit
fa81335fe8
@ -1,10 +1,18 @@
|
||||
subdir('icons')
|
||||
subdir('metainfo')
|
||||
|
||||
gnome.compile_resources(
|
||||
app_id + '.data',
|
||||
configure_file(
|
||||
input: base_id + '.data.gresource.xml.in',
|
||||
output: app_id + '.data.gresource.xml',
|
||||
configuration: {'profile': '/'.join(profile.split('.')) },
|
||||
configuration: {
|
||||
'app_id': app_id,
|
||||
'profile': '/'.join(profile.split('.')),
|
||||
},
|
||||
),
|
||||
dependencies: [metainfo],
|
||||
source_dir: ['.', meson.current_build_dir()],
|
||||
gresource_bundle: true,
|
||||
install: true,
|
||||
install_dir: pkgdatadir
|
||||
@ -46,7 +54,4 @@ configure_file(
|
||||
install_dir: servicedir,
|
||||
)
|
||||
|
||||
subdir('icons')
|
||||
subdir('metainfo')
|
||||
|
||||
install_data(base_id + '.gschema.xml', install_dir: schemadir)
|
||||
|
@ -1,18 +1,17 @@
|
||||
metainfo = app_id + '.metainfo.xml'
|
||||
i18n.merge_file(
|
||||
metainfo = i18n.merge_file(
|
||||
input: configure_file(
|
||||
input: base_id + '.metainfo.xml.in',
|
||||
output: app_id + '.metainfo.xml.in',
|
||||
configuration: {'app_id': app_id},
|
||||
),
|
||||
output: metainfo,
|
||||
output: '@BASENAME@',
|
||||
po_dir: po_dir,
|
||||
install: true,
|
||||
install_dir: metainfodir
|
||||
)
|
||||
|
||||
if (appstream_util.found())
|
||||
test('Validating via appstream_util ' + metainfo,
|
||||
test('Validating metainfo via appstream_util',
|
||||
appstream_util,
|
||||
args: ['validate', '--nonet', metainfo],
|
||||
workdir: meson.current_build_dir()
|
||||
@ -21,7 +20,7 @@ endif
|
||||
|
||||
# Validate Appdata
|
||||
if (appstreamcli.found())
|
||||
test('Validating ' + metainfo,
|
||||
test('Validating metainfo',
|
||||
appstreamcli,
|
||||
args: ['validate', '--no-net', metainfo],
|
||||
workdir: meson.current_build_dir()
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
<gresource prefix="/org/gnome/Extensions">
|
||||
<file>dbus-interfaces/org.gnome.Shell.Extensions.xml</file>
|
||||
<file preprocess="xml-stripblanks" alias="metainfo.xml">metainfo/@app_id@.metainfo.xml</file>
|
||||
|
||||
<file>ui/extension-row.ui</file>
|
||||
<file>ui/extensions-window.ui</file>
|
||||
|
@ -2,7 +2,6 @@ import Adw from 'gi://Adw?version=1';
|
||||
import GLib from 'gi://GLib';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Gtk from 'gi://Gtk?version=4.0';
|
||||
import Shew from 'gi://Shew';
|
||||
|
||||
const Package = imports.package;
|
||||
@ -141,7 +140,11 @@ export const ExtensionsWindow = GObject.registerClass({
|
||||
}
|
||||
|
||||
_showAbout() {
|
||||
const aboutDialog = new Adw.AboutDialog({
|
||||
const [version] = Package.version.split(' ');
|
||||
const aboutDialog = Adw.AboutDialog.new_from_appdata(
|
||||
'/org/gnome/Extensions/metainfo.xml', version);
|
||||
|
||||
aboutDialog.set({
|
||||
developers: [
|
||||
'Florian Müllner <fmuellner@gnome.org>',
|
||||
'Jasper St. Pierre <jstpierre@mecheye.net>',
|
||||
@ -153,13 +156,7 @@ export const ExtensionsWindow = GObject.registerClass({
|
||||
'Tobias Bernard <tbernard@gnome.org>',
|
||||
],
|
||||
translator_credits: _('translator-credits'),
|
||||
application_name: _('Extensions'),
|
||||
license_type: Gtk.License.GPL_2_0,
|
||||
application_icon: Package.name,
|
||||
version: Package.version,
|
||||
developer_name: _('The GNOME Project'),
|
||||
website: 'https://apps.gnome.org/app/org.gnome.Extensions/',
|
||||
issue_url: 'https://gitlab.gnome.org/GNOME/gnome-shell/issues/new',
|
||||
});
|
||||
aboutDialog.present(this);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user