From a67e572e17b4c81793e6b4f37cedcb3a1e2a4efe Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 18 Feb 2019 17:17:41 +0100 Subject: Read authors (updated) from atril.about gresource --- shell/Makefile.am | 1 + shell/atril.about | 2 ++ shell/atril.gresource.xml | 1 + shell/ev-window.c | 49 +++++++++++++++++++++++++++-------------------- 4 files changed, 32 insertions(+), 21 deletions(-) create mode 100644 shell/atril.about (limited to 'shell') diff --git a/shell/Makefile.am b/shell/Makefile.am index 829137b3..881cd860 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -152,6 +152,7 @@ atrild_LDADD= \ endif EXTRA_DIST = \ + atril.about \ atril.css \ atril-ui.xml \ atril-toolbar.xml \ diff --git a/shell/atril.about b/shell/atril.about new file mode 100644 index 00000000..f2a1380f --- /dev/null +++ b/shell/atril.about @@ -0,0 +1,2 @@ +[About] +Authors=Adam Erdman ;Alejandro Piñeiro ;Alexander Ovchinnikov ;Alexander van der Meij ;Alexei Sorokin ;Andrey Gursky ;Antia Puentes ;Avishkar Gupta ;Balló György ;Baurzhan Muftakhidinov ;Brent Hull ;Bryan Clark ;Carlos Garcia Campos ;Christian Persch ;Clement Lefebvre ;Colomban Wendling ;Cormac Walsh ;Cosimo Cecchi ;Daniel Glöckner ;Eli Schwartz ;Gabriel Cormier-Affleck ;Geert Braekmans ;Germán Poo-Caamaño ;Giovanni Campagna ;Giselle Machado ;Hib Eris ;Jason Crain ;Joanmarie Diggs ;Jonathan Blandford ;JosephMcc ;José Aliste ;Justin Willmert ;Lars Mueller ;Lubos Koudelka ;Marcel Dijkstra ;Marco Pesenti Gritti ;Marcus Comstedt ;Marek Kasik ;Martin Kretzschmar ;Martin Wimpress ;Matthew Petroff ;Matvey Soloviev ;Michał Bień ;Mickael Albertus ;Nelson Benitez Leon ;Nickolay V. Shmyrev ;Owen W. Taylor ;Oz N Tiram ;Pablo Barciela ;Perberos ;Peter Moser ;Piotr Drąg ;Robert Buj ;Sander Sweers ;Steev Klimaszewski ;Stefano Karapetsas ;Steve Zesch ;Tobias Mueller ;Vlad Orlov ;William Jon McCann ;Wolfgang Ulbrich ;Wouter Bolsterlee ;Wu Xiaotian ;Xiao-Long Chen ;ZenWalker ; diff --git a/shell/atril.gresource.xml b/shell/atril.gresource.xml index 952c7de1..0a241ead 100644 --- a/shell/atril.gresource.xml +++ b/shell/atril.gresource.xml @@ -20,6 +20,7 @@ atril-ui.xml atril-toolbar.xml atril.css + atril.about diff --git a/shell/ev-window.c b/shell/ev-window.c index 95678310..828cc9e9 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -5298,25 +5298,12 @@ build_comments_string (EvDocument *document) return comments; } +#define ABOUT_GROUP "About" +#define EMAILIFY(string) (g_strdelimit ((string), "%", '@')) + static void ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window) { - const char *authors[] = { - "Martin Kretzschmar ", - "Jonathan Blandford ", - "Marco Pesenti Gritti ", - "Nickolay V. Shmyrev ", - "Bryan Clark ", - "Carlos Garcia Campos ", - "Wouter Bolsterlee ", - "Christian Persch ", - "Perberos ", - "Stefano Karapetsas ", - "Steve Zesch ", - "Avishkar Gupta ", - NULL - }; - const char *documenters[] = { "MATE Documentation Team", "GNOME Documentation Team", @@ -5337,15 +5324,34 @@ ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window) "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n") }; - char *license_trans; - char *comments; + char *license_trans, *comments; + GKeyFile *key_file; + GBytes *bytes; + const guint8 *data; + gsize data_len; + GError *error = NULL; + char **authors; + gsize n_authors = 0, i; + + bytes = g_resources_lookup_data ("/org/mate/atril/shell/atril.about", G_RESOURCE_LOOKUP_FLAGS_NONE, &error); + g_assert_no_error (error); + + data = g_bytes_get_data (bytes, &data_len); + key_file = g_key_file_new (); + g_key_file_load_from_data (key_file, (const char *) data, data_len, 0, &error); + g_assert_no_error (error); + + authors = g_key_file_get_string_list (key_file, ABOUT_GROUP, "Authors", &n_authors, NULL); + + g_key_file_free (key_file); + g_bytes_unref (bytes); + + for (i = 0; i < n_authors; ++i) + authors[i] = EMAILIFY (authors[i]); #ifdef ENABLE_NLS const char **p; - for (p = authors; *p; ++p) - *p = _(*p); - for (p = documenters; *p; ++p) *p = _(*p); #endif @@ -5371,6 +5377,7 @@ ev_window_cmd_help_about (GtkAction *action, EvWindow *ev_window) "wrap-license", TRUE, NULL); + g_strfreev (authors); g_free (comments); g_free (license_trans); } -- cgit v1.2.1