Skip to content

Commit

Permalink
about-window: Use new_from_appdata constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
oscfdezdz committed Aug 15, 2023
1 parent d6b535e commit b4041e9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 27 deletions.
1 change: 1 addition & 0 deletions data/com.mattjakeman.ExtensionManager.metainfo.xml.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<launchable type="desktop-id">@app_id@.desktop</launchable>
<url type="homepage">https://github.com/mjakeman/extension-manager</url>
<url type="bugtracker">https://github.com/mjakeman/extension-manager/issues</url>
<url type="help">https://github.com/mjakeman/extension-manager/discussions</url>
<keywords>
<keyword>Extensions</keyword>
<keyword>Shell</keyword>
Expand Down
2 changes: 1 addition & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ appstream_file_in = configure_file(

appstream_file = i18n.merge_file(
input: appstream_file_in,
output: '@0@.appdata.xml'.format(app_id),
output: '@0@.metainfo.xml'.format(app_id),
po_dir: '../po',
install: true,
install_dir: join_paths(get_option('datadir'), 'metainfo')
Expand Down
19 changes: 1 addition & 18 deletions src/exm-application.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,38 +161,21 @@ exm_application_show_about (GSimpleAction *action,
ExmApplication *self = EXM_APPLICATION (user_data);
GtkWindow *window = NULL;
const gchar *authors[] = {"Matthew Jakeman", NULL};
const gchar *program_name = IS_DEVEL
? _("Extension Manager (Development)")
: _("Extension Manager");

gchar *release_notes;
gsize length;

GtkWidget *about_window;

g_return_if_fail (EXM_IS_APPLICATION (self));

window = gtk_application_get_active_window (GTK_APPLICATION (self));

release_notes = exm_utils_read_resource ("/com/mattjakeman/ExtensionManager/release-notes.txt", &length);

about_window = adw_about_window_new ();
about_window = adw_about_window_new_from_appdata ("/com/mattjakeman/ExtensionManager/com.mattjakeman.ExtensionManager.metainfo.xml", APP_VERSION);
gtk_window_set_modal (GTK_WINDOW (about_window), TRUE);
gtk_window_set_transient_for (GTK_WINDOW (about_window), window);

adw_about_window_set_application_name (ADW_ABOUT_WINDOW (about_window), program_name);
adw_about_window_set_application_icon (ADW_ABOUT_WINDOW (about_window), APP_ID);
adw_about_window_set_developer_name (ADW_ABOUT_WINDOW (about_window), "Matthew Jakeman");
adw_about_window_set_version (ADW_ABOUT_WINDOW (about_window), APP_VERSION);
adw_about_window_set_comments (ADW_ABOUT_WINDOW (about_window), _("Browse, install, and manage GNOME Shell Extensions."));
adw_about_window_set_website (ADW_ABOUT_WINDOW (about_window), "https://github.com/mjakeman/extension-manager");
adw_about_window_set_support_url (ADW_ABOUT_WINDOW (about_window), "https://github.com/mjakeman/extension-manager/discussions");
adw_about_window_set_issue_url (ADW_ABOUT_WINDOW (about_window), "https://github.com/mjakeman/extension-manager/issues");
adw_about_window_set_release_notes (ADW_ABOUT_WINDOW (about_window), release_notes);
adw_about_window_set_developers (ADW_ABOUT_WINDOW (about_window), authors);
adw_about_window_set_translator_credits (ADW_ABOUT_WINDOW (about_window), _("translator-credits"));
adw_about_window_set_copyright (ADW_ABOUT_WINDOW (about_window), "© 2022 Matthew Jakeman");
adw_about_window_set_license_type (ADW_ABOUT_WINDOW (about_window), GTK_LICENSE_GPL_3_0);

// Dependency Attribution
adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about_window),
Expand Down
2 changes: 1 addition & 1 deletion src/exm.gresource.xml → src/exm.gresource.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<file>exm-upgrade-assistant.ui</file>
<file>exm-error-dialog.ui</file>
<file alias="suggestions.txt">res/suggestions.txt</file>
<file alias="release-notes.txt">res/release-notes.txt</file>
<file preprocess="xml-stripblanks" alias="com.mattjakeman.ExtensionManager.metainfo.xml">../data/@appstream_file@</file>
<file>style.css</file>
</gresource>

Expand Down
13 changes: 11 additions & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,18 @@ exm_sources += gnome.mkenums_simple('exm-enums',
sources: 'exm-types.h'
)

gresourceconf = configuration_data()
gresourceconf.set('appstream_file', '@0@.metainfo.xml'.format(app_id))

gresource_file = configure_file(
input: 'exm.gresource.xml.in',
output: 'exm.gresource.xml',
configuration: gresourceconf,
)

exm_sources += gnome.compile_resources('exm-resources',
'exm.gresource.xml',
dependencies: blueprints,
gresource_file,
dependencies: [blueprints, appstream_file],
c_name: 'exm'
)

Expand Down
5 changes: 0 additions & 5 deletions src/res/release-notes.txt

This file was deleted.

0 comments on commit b4041e9

Please sign in to comment.