about window: show data from appdata file

This commit is contained in:
ranfdev
2023-11-09 19:08:57 +01:00
parent 98811de34a
commit 6581eb55ab
5 changed files with 36 additions and 40 deletions

View File

@ -27,32 +27,6 @@ if desktop_file_validate.found()
)
endif
# Appdata
appdata_conf = configuration_data()
appdata_conf.set('app-id', application_id)
appdata_conf.set('gettext-package', gettext_package)
appdata_file = i18n.merge_file(
input: configure_file(
input: '@0@.metainfo.xml.in.in'.format(base_id),
output: '@BASENAME@',
configuration: appdata_conf
),
output: '@0@.metainfo.xml'.format(application_id),
po_dir: podir,
install: true,
install_dir: datadir / 'metainfo'
)
# Validate Appdata
if appstream_util.found()
test(
'validate-appdata', appstream_util,
args: [
'validate', '--nonet', appdata_file.full_path()
],
depends: appdata_file,
)
endif
# GSchema
gschema_conf = configuration_data()
gschema_conf.set('app-id', application_id)

View File

@ -22,6 +22,8 @@
</screenshots>
<url type="homepage">https://github.com/ranfdev/Notify</url>
<url type="bugtracker">https://github.com/ranfdev/Notify/issues</url>
<url type="donation">https://github.com/sponsors/ranfdev</url>
<content_rating type="oars-1.0" />
<releases>
<release version="0.1.2" date="2023-11-07">

View File

@ -10,6 +10,32 @@ blueprints = custom_target('blueprints',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)
# Appdata
appdata_conf = configuration_data()
appdata_conf.set('app-id', application_id)
appdata_conf.set('gettext-package', gettext_package)
appdata_file = i18n.merge_file(
input: configure_file(
input: '@0@.metainfo.xml.in.in'.format(base_id),
output: '@BASENAME@',
configuration: appdata_conf
),
output: 'metainfo.xml',
po_dir: podir,
install: true,
install_dir: datadir / 'metainfo'
)
# Validate Appdata
if appstream_util.found()
test(
'validate-appdata', appstream_util,
args: [
'validate', '--nonet', appdata_file.full_path()
],
depends: appdata_file,
)
endif
resources = gnome.compile_resources(
'resources',
'resources.gresource.xml',
@ -17,5 +43,7 @@ resources = gnome.compile_resources(
source_dir: meson.current_build_dir(),
install: true,
install_dir: pkgdatadir,
dependencies: blueprints,
dependencies: [blueprints, appdata_file],
)

View File

@ -6,7 +6,7 @@
<file compressed="true" preprocess="xml-stripblanks">ui/window.ui</file>
<file compressed="true" preprocess="xml-stripblanks">ui/subscription_info_dialog.ui</file>
<file compressed="true">style.css</file>
<file compressed="true">metainfo.xml</file>
</gresource>
<gresource prefix="/com/ranfdev/Notify/icons/16x16/status/">
<file preprocess="xml-stripblanks" alias="dice3-symbolic.svg">../icons/dice3-symbolic.svg</file>

View File

@ -8,7 +8,6 @@ use adw::subclass::prelude::*;
use capnp_rpc::{rpc_twoparty_capnp, twoparty, RpcSystem};
use futures::stream::Stream;
use futures::AsyncReadExt;
use gettextrs::gettext;
use gio::SocketClient;
use gio::UnixSocketAddress;
use gtk::prelude::*;
@ -207,17 +206,10 @@ impl NotifyApplication {
}
fn show_about_dialog(&self) {
let dialog = adw::AboutWindow::builder()
.application_icon(APP_ID)
.application_name("Notify")
.license_type(gtk::License::Gpl30)
.version(VERSION)
.transient_for(&self.main_window())
.translator_credits(gettext("translator-credits"))
.modal(true)
.developers(vec!["ranfdev"])
.artists(vec!["ranfdev"])
.build();
let dialog = adw::AboutWindow::from_appdata("/com/ranfdev/Notify/metainfo.xml", None);
if let Some(w) = self.imp().window.borrow().upgrade() {
dialog.set_transient_for(Some(&w));
}
dialog.present();
}