Create about window from appdata

This commit is contained in:
kramo
2023-07-21 10:13:14 +02:00
parent 62ebcba590
commit 8bb2368b3d
2 changed files with 14 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gresources> <gresources>
<gresource prefix="@PREFIX@"> <gresource prefix="@PREFIX@">
<file preprocess="xml-stripblanks">@APP_ID@.metainfo.xml</file>
<file preprocess="xml-stripblanks">gtk/window.ui</file> <file preprocess="xml-stripblanks">gtk/window.ui</file>
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file> <file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file preprocess="xml-stripblanks">gtk/game.ui</file> <file preprocess="xml-stripblanks">gtk/game.ui</file>

View File

@@ -172,30 +172,26 @@ class CartridgesApplication(Adw.Application):
debug_str += log_file.read() debug_str += log_file.read()
log_file.close() log_file.close()
about = Adw.AboutWindow( about = Adw.AboutWindow.new_from_appdata(
transient_for=self.win, shared.PREFIX + "/" + shared.APP_ID + ".metainfo.xml", shared.VERSION
application_name=_("Cartridges"), )
application_icon=shared.APP_ID, about.set_transient_for(self.win)
developer_name="kramo", about.set_developers(
version=shared.VERSION, (
developers=[
"kramo https://kramo.hu", "kramo https://kramo.hu",
"Geoffrey Coulaud https://geoffrey-coulaud.fr", "Geoffrey Coulaud https://geoffrey-coulaud.fr",
"Arcitec https://github.com/Arcitec", "Arcitec https://github.com/Arcitec",
"Domenico https://github.com/Domefemia", "Domenico https://github.com/Domefemia",
"Paweł Lidwin https://github.com/imLinguin", "Paweł Lidwin https://github.com/imLinguin",
"Rafael Mardojai CM https://mardojai.com", "Rafael Mardojai CM https://mardojai.com",
], )
designers=("kramo https://kramo.hu",),
copyright="© 2022-2023 kramo",
license_type=Gtk.License.GPL_3_0,
issue_url="https://github.com/kra-mo/cartridges/issues/new",
website="https://github.com/kra-mo/cartridges",
# Translators: Replace this with your name for it to show up in the about window
translator_credits=_("translator_credits"),
debug_info=debug_str,
debug_info_filename="cartridges.log",
) )
about.set_designers(("kramo https://kramo.hu",))
about.set_copyright("© 2022-2023 kramo")
# Translators: Replace this with your name for it to show up in the about window
about.set_translator_credits = (_("translator_credits"),)
about.set_debug_info(debug_str)
about.set_debug_info_filename("cartridges.log")
about.add_legal_section( about.add_legal_section(
"Steam Branding", "Steam Branding",
"© 2023 Valve Corporation", "© 2023 Valve Corporation",